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

Pair serialisation API. More...

#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/util/talloc.h>
#include <freeradius-devel/util/proto.h>
#include <freeradius-devel/util/pair_legacy.h>
+ Include dependency graph for pair_print.c:

Go to the source code of this file.

Functions

void _fr_pair_list_log (fr_log_t const *log, int lvl, fr_pair_t *parent, fr_pair_list_t const *list, char const *file, int line)
 Print a list of attributes and enumv. More...
 
void fr_pair_debug (fr_pair_t const *pair)
 Dumps a pair to the default logging destination - Useful for calling from debuggers. More...
 
void fr_pair_list_debug (fr_pair_list_t const *list)
 Dumps a list to the default logging destination - Useful for calling from debuggers. More...
 
static void fr_pair_list_log_sbuff (fr_log_t const *log, int lvl, fr_pair_t *parent, fr_pair_list_t const *list, char const *file, int line, fr_sbuff_t *sbuff)
 
ssize_t fr_pair_list_print (fr_sbuff_t *out, fr_dict_attr_t const *parent, fr_pair_list_t const *list)
 Print a pair list. More...
 
ssize_t fr_pair_print (fr_sbuff_t *out, fr_dict_attr_t const *parent, fr_pair_t const *vp)
 Print one attribute and value to a string. More...
 
ssize_t fr_pair_print_secure (fr_sbuff_t *out, fr_dict_attr_t const *parent, fr_pair_t const *vp)
 Print one attribute and value to a string with escape rules. More...
 
ssize_t fr_pair_print_value_quoted (fr_sbuff_t *out, fr_pair_t const *vp, fr_token_t quote)
 Print the value of an attribute to a string. More...
 

Detailed Description

Pair serialisation API.

Definition in file pair_print.c.

Function Documentation

◆ _fr_pair_list_log()

void _fr_pair_list_log ( fr_log_t const *  log,
int  lvl,
fr_pair_t parent,
fr_pair_list_t const *  list,
char const *  file,
int  line 
)

Print a list of attributes and enumv.

Parameters
[in]logto output to.
[in]lvldepth in structural attribute.
[in]parentparent attribute
[in]listto print.
[in]filewhere the message originated
[in]linewhere the message originated

Definition at line 305 of file pair_print.c.

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

◆ fr_pair_debug()

void fr_pair_debug ( fr_pair_t const *  pair)

Dumps a pair to the default logging destination - Useful for calling from debuggers.

Definition at line 327 of file pair_print.c.

+ Here is the call graph for this function:

◆ fr_pair_list_debug()

void fr_pair_list_debug ( fr_pair_list_t const *  list)

Dumps a list to the default logging destination - Useful for calling from debuggers.

Definition at line 318 of file pair_print.c.

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

◆ fr_pair_list_log_sbuff()

static void fr_pair_list_log_sbuff ( fr_log_t const *  log,
int  lvl,
fr_pair_t parent,
fr_pair_list_t const *  list,
char const *  file,
int  line,
fr_sbuff_t sbuff 
)
static

Definition at line 260 of file pair_print.c.

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

◆ fr_pair_list_print()

ssize_t fr_pair_list_print ( fr_sbuff_t out,
fr_dict_attr_t const *  parent,
fr_pair_list_t const *  list 
)

Print a pair list.

Parameters
[in]outWhere to write the string.
[in]parentparent da to start from
[in]listpair list
Returns
  • Length of data written to out.
  • value >= outlen on truncation.

Definition at line 233 of file pair_print.c.

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

◆ fr_pair_print()

ssize_t fr_pair_print ( fr_sbuff_t out,
fr_dict_attr_t const *  parent,
fr_pair_t const *  vp 
)

Print one attribute and value to a string.

Print a fr_pair_t in the format:

        <attribute_name> <op> <value>

to a string.

Parameters
[in]outWhere to write the string.
[in]parentIf not NULL, only print OID components from this parent to the VP.
[in]vpto print.
Returns
  • Length of data written to out.
  • value >= outlen on truncation.

Definition at line 104 of file pair_print.c.

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

◆ fr_pair_print_secure()

ssize_t fr_pair_print_secure ( fr_sbuff_t out,
fr_dict_attr_t const *  parent,
fr_pair_t const *  vp 
)

Print one attribute and value to a string with escape rules.

Similar to fr_pair_print(), but secrets are omitted. This function duplicates parts of the functionality of fr_pair_print(). fr_pair_print_value_quoted(), and fr_value_box_print_quoted(), but for the special case of secure strings.

Note that only secrets of type "string" and "octets" are omitted. Other "secret" data types are still printed as-is.

"octets" are still printed as "<<< secret >>>". Which won't parse correctly, but that's fine. Because omitted data is not meant to be parsed into real data.

Parameters
[in]outWhere to write the string.
[in]parentIf not NULL, only print OID components from this parent to the VP.
[in]vpto print.
Returns
  • < 0 on error
  • Length of data written to out.
  • value >= outlen on truncation.

Definition at line 166 of file pair_print.c.

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

◆ fr_pair_print_value_quoted()

ssize_t fr_pair_print_value_quoted ( fr_sbuff_t out,
fr_pair_t const *  vp,
fr_token_t  quote 
)

Print the value of an attribute to a string.

Parameters
[in]outWhere to write the string.
[in]vpto print.
[in]quoteChar to add before and after printed value, if 0 no char will be added, if < 0 raw string will be added.
Returns
  • >= 0 length of data written to out.
  • <0 the number of bytes we would have needed to write the complete string to out.

Definition at line 40 of file pair_print.c.

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