The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
Loading...
Searching...
No Matches
Macros | Functions | Variables
decode.c File Reference

Functions to decode DHCP options. More...

#include <stdint.h>
#include <stddef.h>
#include <freeradius-devel/io/test_point.h>
#include <freeradius-devel/util/dns.h>
#include <freeradius-devel/util/proto.h>
#include <freeradius-devel/util/struct.h>
#include "dhcpv6.h"
#include "attrs.h"
+ Include dependency graph for decode.c:

Go to the source code of this file.

Macros

#define DHCPV6_ORO_FORBIDDEN
 

Functions

static ssize_t decode_option (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx)
 
static ssize_t decode_pair (TALLOC_CTX *ctx, fr_pair_list_t *out, NDEBUG_UNUSED fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx)
 
static int decode_test_ctx (void **out, TALLOC_CTX *ctx, UNUSED fr_dict_t const *dict, UNUSED fr_dict_attr_t const *root_da)
 
static ssize_t decode_tlv_trampoline (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx)
 
static ssize_t decode_value (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx)
 
static ssize_t decode_value_trampoline (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx)
 Handle arrays of DNS labels for fr_struct_from_network()
 
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.
 
static ssize_t fr_dhcpv6_decode_proto (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, UNUSED void *proto_ctx)
 

Variables

fr_test_point_pair_decode_t dhcpv6_tp_decode_pair
 
fr_test_point_proto_decode_t dhcpv6_tp_decode_proto
 

Detailed Description

Functions to decode DHCP options.

Id
85e1cdf59923173579798d0f0ce5826c3386c2d8
Author
Arran Cudbard-Bell (a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg)

Definition in file decode.c.

Macro Definition Documentation

◆ DHCPV6_ORO_FORBIDDEN

#define DHCPV6_ORO_FORBIDDEN
Value:
((1ULL << 1) | /* OPTION_CLIENTID */ \
(1ULL << 2) | /* OPTION_SERVERID */ \
(1ULL << 3) | /* OPTION_IA_NA */ \
(1ULL << 4) | /* OPTION_IA_TA */ \
(1ULL << 5) | /* OPTION_IAADDR */ \
(1ULL << 6) | /* OPTION_ORO */ \
(1ULL << 7) | /* OPTION_PREFERENCE */ \
(1ULL << 8) | /* OPTION_ELAPSED_TIME */ \
(1ULL << 9) | /* OPTION_RELAY_MSG */ \
(1ULL << 11) | /* OPTION_AUTH */ \
(1ULL << 12) | /* OPTION_UNICAST */ \
(1ULL << 13) | /* OPTION_STATUS_CODE */ \
(1ULL << 14) | /* OPTION_RAPID_COMMIT */ \
(1ULL << 15) | /* OPTION_USER_CLASS */ \
(1ULL << 16) | /* OPTION_VENDOR_CLASS */ \
(1ULL << 18) | /* OPTION_INTERFACE_ID */ \
(1ULL << 19) | /* OPTION_RECONF_MSG */ \
(1ULL << 20) | /* OPTION_RECONF_ACCEPT */ \
(1ULL << 25) | /* OPTION_IA_PD */ \
(1ULL << 26)) /* OPTION_IAPREFIX */

Definition at line 44 of file decode.c.

Function Documentation

◆ decode_option()

static ssize_t decode_option ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
fr_dict_attr_t const *  parent,
uint8_t const *  data,
size_t const  data_len,
void *  decode_ctx 
)
static

Definition at line 281 of file decode.c.

+ Here is the call graph for this function:

◆ decode_pair()

static ssize_t decode_pair ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
NDEBUG_UNUSED fr_dict_attr_t const *  parent,
uint8_t const *  data,
size_t  data_len,
void *  decode_ctx 
)
static

Definition at line 563 of file decode.c.

+ Here is the call graph for this function:

◆ decode_test_ctx()

static int decode_test_ctx ( void **  out,
TALLOC_CTX *  ctx,
UNUSED fr_dict_t const *  dict,
UNUSED fr_dict_attr_t const *  root_da 
)
static

Definition at line 537 of file decode.c.

◆ decode_tlv_trampoline()

static ssize_t decode_tlv_trampoline ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
fr_dict_attr_t const *  parent,
uint8_t const *  data,
size_t const  data_len,
void *  decode_ctx 
)
static

Definition at line 70 of file decode.c.

+ Here is the call graph for this function:

◆ decode_value()

static ssize_t decode_value ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
fr_dict_attr_t const *  parent,
uint8_t const *  data,
size_t const  data_len,
void *  decode_ctx 
)
static

Definition at line 96 of file decode.c.

+ Here is the call graph for this function:

◆ decode_value_trampoline()

static ssize_t decode_value_trampoline ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
fr_dict_attr_t const *  parent,
uint8_t const *  data,
size_t const  data_len,
void *  decode_ctx 
)
static

Handle arrays of DNS labels for fr_struct_from_network()

Definition at line 84 of file decode.c.

+ Here is the call graph for this function:

◆ fr_dhcpv6_decode_foreign()

ssize_t fr_dhcpv6_decode_foreign ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
uint8_t const *  data,
size_t  data_len 
)

Definition at line 498 of file decode.c.

+ Here is the call graph for this function:

◆ fr_dhcpv6_decode_option()

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 483 of file decode.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_dhcpv6_decode_proto()

static ssize_t fr_dhcpv6_decode_proto ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
uint8_t const *  data,
size_t  data_len,
UNUSED void *  proto_ctx 
)
static

Definition at line 552 of file decode.c.

+ Here is the call graph for this function:

Variable Documentation

◆ dhcpv6_tp_decode_pair

fr_test_point_pair_decode_t dhcpv6_tp_decode_pair
Initial value:
= {
.test_ctx = decode_test_ctx,
.func = decode_pair,
}
static int decode_test_ctx(void **out, TALLOC_CTX *ctx, UNUSED fr_dict_t const *dict, UNUSED fr_dict_attr_t const *root_da)
Definition decode.c:102
static ssize_t decode_pair(TALLOC_CTX *ctx, fr_pair_list_t *out, NDEBUG_UNUSED fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx)
Definition decode.c:563

Definition at line 575 of file decode.c.

◆ dhcpv6_tp_decode_proto

fr_test_point_proto_decode_t dhcpv6_tp_decode_proto
Initial value:
= {
.test_ctx = decode_test_ctx,
}
static ssize_t fr_dhcpv6_decode_proto(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, UNUSED void *proto_ctx)
Definition decode.c:552

Definition at line 581 of file decode.c.