The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Functions to encode DHCP options. More...
#include <freeradius-devel/io/pair.h>
#include <freeradius-devel/protocol/dhcpv6/freeradius.internal.h>
#include <freeradius-devel/protocol/dhcpv6/rfc3315.h>
#include <freeradius-devel/protocol/dhcpv6/rfc5007.h>
#include <freeradius-devel/util/proto.h>
#include <freeradius-devel/util/rand.h>
#include "dhcpv6.h"
#include "attrs.h"
Go to the source code of this file.
Functions | |
static bool | attr_valid (fr_dict_attr_t *da) |
static void | dhcpv6_print_hex (FILE *fp, uint8_t const *packet, size_t packet_len, int depth) |
static bool | duid_match (uint8_t const *option, fr_dhcpv6_decode_ctx_t const *packet_ctx) |
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. | |
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. | |
void | fr_dhcpv6_global_free (void) |
int | fr_dhcpv6_global_init (void) |
void * | fr_dhcpv6_next_encodable (fr_dlist_head_t *list, void *current, void *uctx) |
DHCPV6-specific iterator. | |
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. | |
static ssize_t | fr_dhcpv6_ok_internal (uint8_t const *packet, uint8_t const *end, size_t max_attributes, int depth) |
uint8_t const * | fr_dhcpv6_option_find (uint8_t const *start, uint8_t const *end, unsigned int option) |
static ssize_t | fr_dhcpv6_options_ok (uint8_t const *packet, uint8_t const *end, size_t max_attributes, bool allow_relay, int depth) |
void | fr_dhcpv6_print_hex (FILE *fp, uint8_t const *packet, size_t packet_len) |
Print a raw DHCP packet as hex. | |
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. | |
static void | print_hex_data (FILE *fp, uint8_t const *ptr, int attrlen, int depth) |
static bool | verify_from_client (uint8_t const *packet, size_t packet_len, fr_dhcpv6_decode_ctx_t const *packet_ctx) |
Verify a packet from a client to a server. | |
static bool | verify_to_client (uint8_t const *packet, size_t packet_len, fr_dhcpv6_decode_ctx_t const *packet_ctx) |
Verify a reply packet from a server to a client. | |
Variables | |
fr_dict_attr_t const * | attr_hop_count |
fr_dict_attr_t const * | attr_option_request |
fr_dict_attr_t const * | attr_packet_type |
fr_dict_attr_t const * | attr_relay_link_address |
fr_dict_attr_t const * | attr_relay_message |
fr_dict_attr_t const * | attr_relay_peer_address |
fr_dict_attr_t const * | attr_transaction_id |
static fr_dict_flag_parser_t const | dhcpv6_flags [] |
fr_dict_t const * | dict_dhcpv6 |
char const * | fr_dhcpv6_packet_names [FR_DHCPV6_CODE_MAX] |
static uint32_t | instance_count = 0 |
fr_dict_autoload_t | libfreeradius_dhcpv6_dict [] |
fr_dict_attr_autoload_t | libfreeradius_dhcpv6_dict_attr [] |
fr_dict_protocol_t | libfreeradius_dhcpv6_dict_protocol |
static char const | tabs [] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" |
Functions to encode DHCP options.
Definition in file base.c.
|
static |
|
static |
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_encode | ( | fr_dbuff_t * | dbuff, |
uint8_t const * | original, | ||
size_t | length, | ||
int | msg_type, | ||
fr_pair_list_t * | vps | ||
) |
void fr_dhcpv6_global_free | ( | void | ) |
int fr_dhcpv6_global_init | ( | void | ) |
void * fr_dhcpv6_next_encodable | ( | fr_dlist_head_t * | list, |
void * | current, | ||
void * | uctx | ||
) |
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.
|
static |
|
static |
|
static |
fr_dict_attr_t const* attr_hop_count |
fr_dict_attr_t const* attr_option_request |
fr_dict_attr_t const* attr_packet_type |
fr_dict_attr_t const* attr_relay_link_address |
fr_dict_attr_t const* attr_relay_message |
fr_dict_attr_t const* attr_relay_peer_address |
fr_dict_attr_t const* attr_transaction_id |
|
static |
char const* fr_dhcpv6_packet_names[FR_DHCPV6_CODE_MAX] |
fr_dict_autoload_t libfreeradius_dhcpv6_dict |
fr_dict_attr_autoload_t libfreeradius_dhcpv6_dict_attr |
fr_dict_protocol_t libfreeradius_dhcpv6_dict_protocol |