23 #include <freeradius-devel/util/pair.h>
24 #include <freeradius-devel/util/print.h>
25 #include <freeradius-devel/util/proto.h>
33 buff = talloc_vasprintf(NULL,
fmt, ap);
49 msg = talloc_vasprintf(NULL,
fmt, ap);
64 msg = talloc_vasprintf(NULL,
fmt, ap);
75 int i = da_stack->depth;
78 for (i--; i >= 0; i--) {
80 "stk: %s [%i] %s: %s, vendor: 0x%x (%u), attr: 0x%x (%u)",
81 (i == (
int)
depth) ?
">" :
" ", i,
83 da_stack->da[i]->name,
85 da_stack->da[i]->attr, da_stack->da[i]->attr);
107 if ((c->
da->dict ==
dict) && (!c->
da->flags.internal))
break;
132 memcpy(&
stack->da[0], &cached[1],
sizeof(
stack->da[0]) * da->depth);
141 da_o =
stack->da + (da->depth - 1);
143 while (da_o >=
stack->da) {
149 stack->depth = da->depth;
170 da_o =
stack->da + (da->depth - 1);
172 while (da_o >= da_q) {
177 stack->depth = da->depth;
static int const char * fmt
fr_dcursor_eval_t void const * uctx
fr_dcursor_iter_t void * current
static fr_dict_attr_t const ** fr_dict_attr_da_stack(fr_dict_attr_t const *da)
Return the cached da stack (if any) associated with an attribute.
static uint32_t fr_dict_vendor_num_by_da(fr_dict_attr_t const *da)
Return the vendor number for an attribute.
static void * fr_dlist_next(fr_dlist_head_t const *list_head, void const *ptr)
Get the next item in a list.
Head of a doubly linked list.
void fr_log_hex(fr_log_t const *log, fr_log_type_t type, char const *file, int line, uint8_t const *data, size_t data_len, char const *line_prefix_fmt,...)
Print out hex block.
void fr_log_hex_marker(fr_log_t const *log, fr_log_type_t type, char const *file, int line, uint8_t const *data, size_t data_len, ssize_t marker_idx, char const *marker, char const *line_prefix_fmt,...)
Print out hex block.
void fr_log(fr_log_t const *log, fr_log_type_t type, char const *file, int line, char const *fmt,...)
Send a server log message to its destination.
@ L_DBG
Only displayed when debugging is enabled.
static char * stack[MAX_STACK]
static uint8_t depth(fr_minmax_heap_index_t i)
void fr_proto_da_stack_build(fr_da_stack_t *stack, fr_dict_attr_t const *da)
Build a complete DA stack from the da back to the root.
void fr_proto_print(char const *file, int line, char const *fmt,...)
void fr_proto_da_stack_print(char const *file, int line, char const *func, fr_da_stack_t *da_stack, unsigned int depth)
void * fr_proto_next_encodable(fr_dlist_head_t *list, void *current, void *uctx)
Implements the default iterator to encode pairs belonging to a specific dictionary that are not inter...
void fr_proto_print_hex_data(char const *file, int line, uint8_t const *data, size_t data_len, char const *fmt,...)
void fr_proto_da_stack_build_partial(fr_da_stack_t *stack, fr_dict_attr_t const *parent, fr_dict_attr_t const *da)
Complete the DA stack for a child attribute.
void fr_proto_print_hex_marker(char const *file, int line, uint8_t const *data, size_t data_len, ssize_t slen, char const *fmt,...)
static char buff[sizeof("18446744073709551615")+3]
Stores an attribute, a value and various bits of other data.
fr_dict_attr_t const *_CONST da
Dictionary attribute defines the attribute number, vendor and type of the pair.
Structure for holding the stack of dictionary attributes being encoded.
static char const * fr_type_to_str(fr_type_t type)
Return a static string containing the type name.
#define fr_box_strvalue_buffer(_val)
int format(printf, 5, 0))