The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
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.

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)
 
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() More...
 
static ssize_t decode_vsa (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)
 
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...
 
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
c33c13905743cf91838d25153f9429fb7908e23b
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.

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

+ Here is the call graph for this function:
+ Here is the caller 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 500 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 
)
static

Definition at line 475 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 43 of file decode.c.

+ Here is the call graph for this function:
+ Here is the caller 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 69 of file decode.c.

+ Here is the call graph for this function:
+ Here is the caller 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 57 of file decode.c.

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

◆ decode_vsa()

static ssize_t decode_vsa ( 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 263 of file decode.c.

+ Here is the call graph for this function:
+ Here is the caller 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 436 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 421 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 489 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)
Definition: decode.c:475
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:500

Definition at line 512 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:489

Definition at line 518 of file decode.c.