The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Implementation of the DHCPv6 protocol. More...
#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/protocol/dhcpv6/dictionary.h>
Go to the source code of this file.
Data Structures | |
struct | fr_dhcpv6_attr_flags_t |
struct | fr_dhcpv6_decode_ctx_t |
struct | fr_dhcpv6_encode_ctx_t |
struct | fr_dhcpv6_packet_t |
subtype values for DHCPv4 and DHCPv6 More... | |
Functions | |
static fr_dhcpv6_attr_flags_t const * | fr_dhcpv6_attr_flags (fr_dict_attr_t const *da) |
ssize_t | fr_dhcpv6_decode (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *packet, size_t packet_len) |
Decode a DHCPv6 packet. More... | |
ssize_t | fr_dhcpv6_decode_foreign (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len) |
ssize_t | fr_dhcpv6_decode_option (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, void *decode_ctx) |
Create a "normal" fr_pair_t from the given data. More... | |
ssize_t | fr_dhcpv6_encode (fr_dbuff_t *dbuff, uint8_t const *original, size_t length, int msg_type, fr_pair_list_t *vps) |
Encode a DHCPv6 packet. More... | |
ssize_t | fr_dhcpv6_encode_foreign (fr_dbuff_t *dbuff, fr_pair_list_t const *list) |
ssize_t | fr_dhcpv6_encode_option (fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *encode_ctx) |
Encode a DHCPv6 option and any sub-options. More... | |
static bool | fr_dhcpv6_flag_any_dns_label (fr_dict_attr_t const *da) |
void | fr_dhcpv6_global_free (void) |
int | fr_dhcpv6_global_init (void) |
bool | fr_dhcpv6_ok (uint8_t const *packet, size_t packet_len, uint32_t max_attributes) |
See if the data pointed to by PTR is a valid DHCPv6 packet. More... | |
uint8_t const * | fr_dhcpv6_option_find (uint8_t const *start, uint8_t const *end, unsigned int option) |
void | fr_dhcpv6_print_hex (FILE *fp, uint8_t const *packet, size_t packet_len) |
Print a raw DHCP packet as hex. More... | |
bool | fr_dhcpv6_verify (uint8_t const *packet, size_t packet_len, fr_dhcpv6_decode_ctx_t const *packet_ctx, bool from_server) |
Verify the packet under some various circumstances. More... | |
Variables | |
char const * | fr_dhcpv6_packet_names [FR_DHCPV6_CODE_MAX] |
Implementation of the DHCPv6 protocol.
Definition in file dhcpv6.h.
struct fr_dhcpv6_attr_flags_t |
struct fr_dhcpv6_decode_ctx_t |
struct fr_dhcpv6_encode_ctx_t |
Data Fields | ||
---|---|---|
uint8_t const * | original | original packet |
size_t | original_length | length of the original packet |
fr_dict_attr_t const * | root | Root attribute of the dictionary. |
struct fr_dhcpv6_packet_t |
#define DHCPV6_GET_OPTION_LEN | ( | _x | ) | fr_nbo_to_uint16((_x) + 2) |
#define DHCPV6_GET_OPTION_NUM | ( | _x | ) | fr_nbo_to_uint16(_x) |
#define DHCPV6_HDR_LEN (DHCPV6_MSG_TYPE_LEN + DHCPV6_TRANSACTION_ID_LEN) |
#define DHCPV6_RELAY_HDR_LEN (DHCPV6_MSG_TYPE_LEN + DHCPV6_HOP_COUNT_LEN + DHCPV6_LINK_ADDRESS_LEN + DHCPV6_PEER_ADDRESS_LEN) |
#define fr_dhcpv6_flag_dns_label | ( | _da | ) | (fr_dhcpv6_attr_flags(_da)->dns_label) |
#define fr_dhcpv6_flag_partial_dns_label | ( | _da | ) | (fr_dhcpv6_attr_flags(_da)->partial_dns_label) |
#define FR_DHCPV6_PACKET_CODE_VALID | ( | _code | ) | (((_code) > 0) && ((_code) < FR_DHCPV6_CODE_MAX)) |
#define IN6ADDR_ALL_DHCP_RELAY_AGENTS_AND_SERVERS "FF02::1:2" |
#define IN6ADDR_ALL_DHCP_RELAY_AGENTS_AND_SERVERS_INIT {{{ 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,1,2}}} |
#define IN6ADDR_ALL_DHCP_SERVERS_INIT {{{ 0xff,0x05,0,0,0,0,0,0,0,0,0,0,0,0,1,3}}} |
|
inlinestatic |
ssize_t fr_dhcpv6_decode | ( | TALLOC_CTX * | ctx, |
fr_pair_list_t * | out, | ||
uint8_t const * | packet, | ||
size_t | packet_len | ||
) |
ssize_t fr_dhcpv6_decode_foreign | ( | TALLOC_CTX * | ctx, |
fr_pair_list_t * | out, | ||
uint8_t const * | data, | ||
size_t | data_len | ||
) |
ssize_t fr_dhcpv6_decode_option | ( | TALLOC_CTX * | ctx, |
fr_pair_list_t * | out, | ||
uint8_t const * | data, | ||
size_t | data_len, | ||
void * | decode_ctx | ||
) |
Create a "normal" fr_pair_t from the given data.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | option-code | option-len | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Definition at line 421 of file decode.c.
ssize_t fr_dhcpv6_encode | ( | fr_dbuff_t * | dbuff, |
uint8_t const * | original, | ||
size_t | length, | ||
int | msg_type, | ||
fr_pair_list_t * | vps | ||
) |
ssize_t fr_dhcpv6_encode_foreign | ( | fr_dbuff_t * | dbuff, |
fr_pair_list_t const * | list | ||
) |
ssize_t fr_dhcpv6_encode_option | ( | fr_dbuff_t * | dbuff, |
fr_dcursor_t * | cursor, | ||
void * | encode_ctx | ||
) |
Encode a DHCPv6 option and any sub-options.
[out] | dbuff | Where to write encoded DHCP attributes. |
[in] | cursor | with current VP set to the option to be encoded. Will be advanced to the next option to encode. |
[in] | encode_ctx | containing parameters for the encoder. |
Definition at line 670 of file encode.c.
|
inlinestatic |
void fr_dhcpv6_global_free | ( | void | ) |
int fr_dhcpv6_global_init | ( | void | ) |
See if the data pointed to by PTR is a valid DHCPv6 packet.
[in] | packet | to check. |
[in] | packet_len | The size of the packet data. |
[in] | max_attributes | to allow in the packet. |
Definition at line 230 of file base.c.
bool fr_dhcpv6_verify | ( | uint8_t const * | packet, |
size_t | packet_len, | ||
fr_dhcpv6_decode_ctx_t const * | packet_ctx, | ||
bool | from_server | ||
) |
Verify the packet under some various circumstances.
[in] | packet | to check. |
[in] | packet_len | The size of the packet data. |
[in] | packet_ctx | The expected packet_ctx |
[in] | from_server | true for packets from a server, false for packets from a client. |
fr_dhcpv6_ok() SHOULD be called before calling this function.
Definition at line 547 of file base.c.
|
extern |