The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions
internal.h File Reference
#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/util/talloc.h>
+ Include dependency graph for internal.h:

Go to the source code of this file.

Data Structures

struct  fr_internal_encode_ctx_t
 

Macros

#define FR_INTERNAL_FLAG_EXTENDED   0x01
 
#define FR_INTERNAL_FLAG_INTERNAL   0x40
 
#define FR_INTERNAL_FLAG_TAINTED   0x02
 
#define FR_INTERNAL_FLAG_UNKNOWN   0x80
 
#define FR_INTERNAL_MASK_LEN   0x1c
 
#define FR_INTERNAL_MASK_TYPE   0xe0
 

Functions

ssize_t fr_internal_decode_list_dbuff (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, fr_dbuff_t *dbuff, void *decode_ctx)
 Retrieve all pairs from the dbuff. More...
 
ssize_t fr_internal_decode_pair (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)
 Create a single fr_pair_t and all its nesting. More...
 
ssize_t fr_internal_decode_pair_dbuff (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, fr_dbuff_t *dbuff, void *decode_ctx)
 
ssize_t fr_internal_encode_list (fr_dbuff_t *dbuff, fr_pair_list_t const *list, void *encode_ctx)
 Encode a list of pairs using the internal encoder. More...
 
ssize_t fr_internal_encode_pair (fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *encode_ctx)
 Encode a data structure into an internal attribute. More...
 

Data Structure Documentation

◆ fr_internal_encode_ctx_t

struct fr_internal_encode_ctx_t

Definition at line 35 of file internal.h.

Data Fields
bool allow_name_only Allow name only pairs.

This should be set to true when encoding data that's being passed between threads in the same process. It should be set to false when encoding data that's stored in an external database or in the cache module.

Macro Definition Documentation

◆ FR_INTERNAL_FLAG_EXTENDED

#define FR_INTERNAL_FLAG_EXTENDED   0x01

Definition at line 26 of file internal.h.

◆ FR_INTERNAL_FLAG_INTERNAL

#define FR_INTERNAL_FLAG_INTERNAL   0x40

Definition at line 33 of file internal.h.

◆ FR_INTERNAL_FLAG_TAINTED

#define FR_INTERNAL_FLAG_TAINTED   0x02

Definition at line 27 of file internal.h.

◆ FR_INTERNAL_FLAG_UNKNOWN

#define FR_INTERNAL_FLAG_UNKNOWN   0x80

Definition at line 32 of file internal.h.

◆ FR_INTERNAL_MASK_LEN

#define FR_INTERNAL_MASK_LEN   0x1c

Definition at line 25 of file internal.h.

◆ FR_INTERNAL_MASK_TYPE

#define FR_INTERNAL_MASK_TYPE   0xe0

Definition at line 24 of file internal.h.

Function Documentation

◆ fr_internal_decode_list_dbuff()

ssize_t fr_internal_decode_list_dbuff ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
fr_dict_attr_t const *  parent,
fr_dbuff_t dbuff,
void *  decode_ctx 
)

Retrieve all pairs from the dbuff.

Parameters
ctxto create new pairs in
outlist to append pairs to
parentattribute within which which to decode
dbuffto parse
decode_ctxto pass to decoder function
Returns
  • bytes of dbuff consumed
  • < 0 on error

Definition at line 310 of file decode.c.

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

◆ fr_internal_decode_pair()

ssize_t fr_internal_decode_pair ( 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 
)

Create a single fr_pair_t and all its nesting.

Definition at line 273 of file decode.c.

+ Here is the call graph for this function:

◆ fr_internal_decode_pair_dbuff()

ssize_t fr_internal_decode_pair_dbuff ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
fr_dict_attr_t const *  parent,
fr_dbuff_t dbuff,
void *  decode_ctx 
)

Definition at line 279 of file decode.c.

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

◆ fr_internal_encode_list()

ssize_t fr_internal_encode_list ( fr_dbuff_t dbuff,
fr_pair_list_t const *  list,
void *  encode_ctx 
)

Encode a list of pairs using the internal encoder.

Parameters
[out]dbuffWhere to write encoded data.
[in]listList of attributes to encode.
[in]encode_ctxAdditional data to be used by the encoder.
Returns
  • length of encoded data on success
  • < 0 on failure

Definition at line 303 of file encode.c.

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

◆ fr_internal_encode_pair()

ssize_t fr_internal_encode_pair ( fr_dbuff_t dbuff,
fr_dcursor_t cursor,
void *  encode_ctx 
)

Encode a data structure into an internal attribute.

Parameters
[in,out]dbuffWhere to write encoded data and how much one can write.
[in]cursorSpecifying attribute to encode.
[in]encode_ctxAdditional data such as the shared secret to use.
Returns
  • >0 The number of bytes written to out.
  • 0 Nothing to encode (or attribute skipped).
  • <0 an error occurred.

Definition at line 281 of file encode.c.

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