*/
ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_cursor_t *cursor,
fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len,
- fr_dict_attr_t const **child_p,
- fr_decode_value_t decode_value, void *decoder_ctx)
+ fr_dict_attr_t const **child_p, void *decoder_ctx,
+ fr_decode_value_t decode_value, fr_decode_value_t decode_tlv)
{
unsigned int child_num;
uint8_t const *p = data, *end = data + data_len;
fr_assert(child->type == FR_TYPE_STRUCT);
slen = fr_struct_from_network(ctx, &child_cursor, child, p, end - p, child_p,
- decode_value, decoder_ctx);
+ decoder_ctx, decode_value, decode_tlv);
if (slen <= 0) goto unknown_child;
p += slen;
}
ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_cursor_t *cursor,
fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len,
- fr_dict_attr_t const **child,
- fr_decode_value_t decode_value, void *decoder_ctx) CC_HINT(nonnull(2,3,4));
+ fr_dict_attr_t const **child, void *decoder_ctx,
+ fr_decode_value_t decode_value, fr_decode_value_t decode_tlv) CC_HINT(nonnull(2,3,4));
typedef ssize_t (*fr_encode_dbuff_t)(fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth,
fr_cursor_t *cursor, void *encoder_ctx);
*/
fr_pair_list_init(list);
fr_cursor_init(&cursor, list);
- return fr_struct_from_network(ctx, &cursor, attr_arp_packet, packet, FR_ARP_PACKET_SIZE, &child, NULL, NULL);
+ return fr_struct_from_network(ctx, &cursor, attr_arp_packet, packet, FR_ARP_PACKET_SIZE, &child,
+ NULL, NULL, NULL);
}
int fr_arp_init(void)
case FR_TYPE_STRUCT:
slen = fr_struct_from_network(ctx, cursor, parent, data, data_len, &tlv,
- decode_value_trampoline, decoder_ctx);
+ decoder_ctx, decode_value_trampoline, NULL);
if (slen < 0) return slen;
if (tlv) {
* into a contiguous memory buffer.
*/
ret = fr_struct_from_network(ctx, cursor, parent, p, attr_len, &child,
- decode_value, decoder_ctx);
+ decoder_ctx, decode_value, NULL);
if (ret < 0) goto raw;
/*
/*
* Call the struct encoder to do the actual work.
*/
- if (fr_struct_from_network(ctx, cursor, attr_tacacs_packet, buffer, buffer_len, &tlv, NULL, NULL) < 0) {
+ if (fr_struct_from_network(ctx, cursor, attr_tacacs_packet, buffer, buffer_len, &tlv, NULL, NULL, NULL) < 0) {
fr_strerror_printf("Problems to decode %s using fr_struct_from_network()", attr_tacacs_packet->name);
return -1;
}