The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Typedefs | Functions
encode.h File Reference

Protocol encoder support functions. More...

#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/util/dbuff.h>
#include <freeradius-devel/util/proto.h>
+ Include dependency graph for encode.h:

Go to the source code of this file.

Macros

#define PROTO_ENCODE_FUNC(_name)
 

Typedefs

typedef ssize_t(* fr_encode_dbuff_t) (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, void *encode_ctx)
 Typedefs for simplifying the use and declaration of protocol encoders. More...
 

Functions

ssize_t fr_pair_array_to_network (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, int depth, fr_dcursor_t *cursor, void *encode_ctx, fr_encode_dbuff_t encode_value))
 Encode an array of values from the network. More...
 
ssize_t fr_pair_cursor_to_network (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, void *encode_ctx, fr_encode_dbuff_t encode_pair))
 
ssize_t fr_pair_ref_to_network (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor)
 Encode a foreign reference to the network. More...
 

Detailed Description

Protocol encoder support functions.

Definition in file encode.h.

Macro Definition Documentation

◆ PROTO_ENCODE_FUNC

#define PROTO_ENCODE_FUNC (   _name)
Value:
static ssize_t _name(fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, \
fr_dcursor_t *cursor, void *encode_ctx);
long int ssize_t
Definition: merged_model.c:24
static uint8_t depth(fr_minmax_heap_index_t i)
Definition: minmax_heap.c:83
static fr_internal_encode_ctx_t encode_ctx
Structure for holding the stack of dictionary attributes being encoded.
Definition: proto.h:54

Definition at line 40 of file encode.h.

Typedef Documentation

◆ fr_encode_dbuff_t

typedef ssize_t(* fr_encode_dbuff_t) (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, void *encode_ctx)

Typedefs for simplifying the use and declaration of protocol encoders.

Definition at line 37 of file encode.h.

Function Documentation

◆ fr_pair_array_to_network()

ssize_t fr_pair_array_to_network ( fr_dbuff_t dbuff,
fr_da_stack_t da_stack,
int  depth,
fr_dcursor_t cursor,
void *  encode_ctx,
fr_encode_dbuff_t  encode_value 
)

Encode an array of values from the network.

Parameters
[out]dbuffbuffer to write the TLV to.
[in]da_stackDescribing nesting of options.
[in]depthin the da_stack.
[in,out]cursorCurrent attribute we're encoding.
[in]encode_ctxContaining DHCPv4 dictionary.
[in]encode_valueFunction to perform encoding of a single value.
Returns
  • >0 length of data encoded.
  • 0 if we ran out of space.
  • < 0 on error.

Definition at line 42 of file encode.c.

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

◆ fr_pair_cursor_to_network()

ssize_t fr_pair_cursor_to_network ( fr_dbuff_t dbuff,
fr_da_stack_t da_stack,
unsigned int  depth,
fr_dcursor_t cursor,
void *  encode_ctx,
fr_encode_dbuff_t  encode_pair 
)

Definition at line 71 of file encode.c.

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

◆ fr_pair_ref_to_network()

ssize_t fr_pair_ref_to_network ( fr_dbuff_t dbuff,
fr_da_stack_t da_stack,
unsigned int  depth,
fr_dcursor_t cursor 
)

Encode a foreign reference to the network.

Parameters
[out]dbuffbuffer to write the TLV to.
[in]da_stackDescribing nesting of options.
[in]depthin the da_stack.
[in,out]cursorCurrent attribute we're encoding.
Returns
  • >0 length of data encoded.
  • 0 if we ran out of space.
  • < 0 on error.

Definition at line 123 of file encode.c.

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