The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Functions to send/receive dhcp packets. More...
#include <freeradius-devel/dhcpv4/dhcpv4.h>
#include <freeradius-devel/util/net.h>
#include <freeradius-devel/util/proto.h>
#include "attrs.h"
Go to the source code of this file.
Data Structures | |
struct | dhcp_option_t |
Macros | |
#define | DHCP_MAX_MESSAGE_TYPE (NUM_ELEMENTS(dhcp_message_types)) |
Functions | |
static bool | attr_valid (fr_dict_attr_t *da) |
static int | dict_flag_prefix (fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules) |
int8_t | fr_dhcpv4_attr_cmp (void const *a, void const *b) |
ssize_t | fr_dhcpv4_encode (uint8_t *buffer, size_t buflen, dhcp_packet_t *original, int code, uint32_t xid, fr_pair_list_t *vps) |
ssize_t | fr_dhcpv4_encode_dbuff (fr_dbuff_t *dbuff, dhcp_packet_t *original, int code, uint32_t xid, fr_pair_list_t *vps) |
void | fr_dhcpv4_global_free (void) |
int | fr_dhcpv4_global_init (void) |
Resolve/cache attributes in the DHCP dictionary. | |
bool | fr_dhcpv4_is_encodable (void const *item, UNUSED void const *uctx) |
Evaluation function for DCHPV4-encodability. | |
void * | fr_dhcpv4_next_encodable (fr_dlist_head_t *list, void *current, void *uctx) |
DHCPV4-specific iterator. | |
bool | fr_dhcpv4_ok (uint8_t const *data, ssize_t data_len, uint8_t *message_type, uint32_t *xid) |
Check received DHCP request is valid and build fr_packet_t structure if it is. | |
void | fr_dhcpv4_print_hex (FILE *fp, uint8_t const *packet, size_t packet_len) |
Print a raw DHCP packet as hex. | |
static void | print_hex_data (FILE *fp, uint8_t const *ptr, int attrlen, int depth) |
Functions to send/receive dhcp packets.
Definition in file base.c.
#define DHCP_MAX_MESSAGE_TYPE (NUM_ELEMENTS(dhcp_message_types)) |
|
static |
|
static |
int8_t fr_dhcpv4_attr_cmp | ( | void const * | a, |
void const * | b | ||
) |
ssize_t fr_dhcpv4_encode | ( | uint8_t * | buffer, |
size_t | buflen, | ||
dhcp_packet_t * | original, | ||
int | code, | ||
uint32_t | xid, | ||
fr_pair_list_t * | vps | ||
) |
ssize_t fr_dhcpv4_encode_dbuff | ( | fr_dbuff_t * | dbuff, |
dhcp_packet_t * | original, | ||
int | code, | ||
uint32_t | xid, | ||
fr_pair_list_t * | vps | ||
) |
void fr_dhcpv4_global_free | ( | void | ) |
int fr_dhcpv4_global_init | ( | void | ) |
void * fr_dhcpv4_next_encodable | ( | fr_dlist_head_t * | list, |
void * | current, | ||
void * | uctx | ||
) |
bool fr_dhcpv4_ok | ( | uint8_t const * | data, |
ssize_t | data_len, | ||
uint8_t * | message_type, | ||
uint32_t * | xid | ||
) |
Check received DHCP request is valid and build fr_packet_t structure if it is.
data | pointer to received packet. | |
data_len | length of received data, and then length of the actual DHCP data. | |
[out] | message_type | where the message type will be stored (if used) |
[out] | xid | where the xid will be stored (if used) |
Definition at line 240 of file base.c.
|
static |
fr_dict_attr_t const* attr_dhcp_boot_filename |
fr_dict_attr_t const* attr_dhcp_client_hardware_address |
fr_dict_attr_t const* attr_dhcp_client_ip_address |
fr_dict_attr_t const* attr_dhcp_dhcp_maximum_msg_size |
fr_dict_attr_t const* attr_dhcp_flags |
fr_dict_attr_t const* attr_dhcp_gateway_ip_address |
fr_dict_attr_t const* attr_dhcp_hardware_address_length |
fr_dict_attr_t const* attr_dhcp_hardware_type |
fr_dict_attr_t const* attr_dhcp_hop_count |
fr_dict_attr_t const* attr_dhcp_interface_mtu_size |
fr_dict_attr_t const* attr_dhcp_message_type |
fr_dict_attr_t const* attr_dhcp_network_subnet |
fr_dict_attr_t const* attr_dhcp_number_of_seconds |
fr_dict_attr_t const* attr_dhcp_opcode |
fr_dict_attr_t const* attr_dhcp_option_82 |
fr_dict_attr_t const* attr_dhcp_overload |
fr_dict_attr_t const* attr_dhcp_parameter_request_list |
fr_dict_attr_t const* attr_dhcp_relay_link_selection |
fr_dict_attr_t const* attr_dhcp_server_host_name |
fr_dict_attr_t const* attr_dhcp_server_ip_address |
fr_dict_attr_t const* attr_dhcp_subnet_selection_option |
fr_dict_attr_t const* attr_dhcp_transaction_id |
fr_dict_attr_t const* attr_dhcp_vendor_class_identifier |
fr_dict_attr_t const* attr_dhcp_your_ip_address |
fr_dict_attr_t const** dhcp_header_attrs[] |
size_t dhcp_header_attrs_len = NUM_ELEMENTS(dhcp_header_attrs) |
int dhcp_header_sizes[] |
char const* dhcp_message_types[] |
fr_dict_autoload_t dhcpv4_dict |
fr_dict_attr_autoload_t dhcpv4_dict_attr |
|
static |
uint8_t eth_bcast[ETH_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } |
fr_dict_protocol_t libfreeradius_dhcpv4_dict_protocol |