The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
struct.c File Reference

Functions to encode / decode structures on the wire. More...

#include <freeradius-devel/util/struct.h>
#include <freeradius-devel/util/encode.h>
#include <freeradius-devel/io/pair.h>
+ Include dependency graph for struct.c:

Go to the source code of this file.

Functions

ssize_t fr_struct_from_network (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx, fr_pair_decode_value_t decode_value, fr_pair_decode_value_t decode_tlv)
 Convert a STRUCT to one or more VPs. More...
 
ssize_t fr_struct_to_network (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *parent_cursor, void *encode_ctx, fr_encode_dbuff_t encode_value, fr_encode_dbuff_t encode_pair)
 
static int8_t pair_sort_increasing (void const *a, void const *b)
 
static int put_bits_dbuff (fr_dbuff_t *dbuff, uint8_t *p, int start_bit, uint8_t num_bits, uint64_t data)
 Put bits into an output dbuff. More...
 
static void * struct_next_encodable (fr_dlist_head_t *list, void *current, void *uctx)
 

Detailed Description

Functions to encode / decode structures on the wire.

Definition in file struct.c.

Function Documentation

◆ fr_struct_from_network()

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

Convert a STRUCT to one or more VPs.

Definition at line 33 of file struct.c.

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

◆ fr_struct_to_network()

ssize_t fr_struct_to_network ( fr_dbuff_t dbuff,
fr_da_stack_t da_stack,
unsigned int  depth,
fr_dcursor_t parent_cursor,
void *  encode_ctx,
fr_encode_dbuff_t  encode_value,
fr_encode_dbuff_t  encode_pair 
)

Definition at line 470 of file struct.c.

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

◆ pair_sort_increasing()

static int8_t pair_sort_increasing ( void const *  a,
void const *  b 
)
static

Definition at line 440 of file struct.c.

+ Here is the caller graph for this function:

◆ put_bits_dbuff()

static int put_bits_dbuff ( fr_dbuff_t dbuff,
uint8_t p,
int  start_bit,
uint8_t  num_bits,
uint64_t  data 
)
static

Put bits into an output dbuff.

Parameters
dbuffwhere the bytes go
pwhere leftover bits go
start_bitstart bit in the dbuff where the data goes, 0..7
num_bitsnumber of bits to write to the output, 0..55
datadata to write, all in the lower "num_bits" of the uint64_t variable
Returns
>= 0 the next value to pass in for start_bit < 0 no space or invalid start_bit or num_bits parameter

Definition at line 414 of file struct.c.

+ Here is the caller graph for this function:

◆ struct_next_encodable()

static void* struct_next_encodable ( fr_dlist_head_t list,
void *  current,
void *  uctx 
)
static

Definition at line 455 of file struct.c.

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