The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
struct.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /** Boxed value structures and functions to manipulate them
19  *
20  * @file src/lib/util/struct.h
21  *
22  * @copyright 2018 Alan DeKok (aland@freeradius.org)
23  */
24 RCSIDH(struct_h, "$Id: 6f06d4bd17fb07e22a05950ac7842ab68b409103 $")
25 
26 #include <freeradius-devel/util/dcursor.h>
27 #include <freeradius-devel/util/pair.h>
28 #include <freeradius-devel/util/value.h>
29 #include <freeradius-devel/util/proto.h>
30 #include <freeradius-devel/util/decode.h>
31 #include <freeradius-devel/util/encode.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
38  fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len,
39  void *decode_ctx,
41 
42 ssize_t fr_struct_to_network(fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth,
43  fr_dcursor_t *cursor, void *encode_ctx,
45 
46 #ifdef __cplusplus
47 }
48 #endif
#define RCSIDH(h, id)
Definition: build.h:482
ssize_t(* fr_pair_decode_value_t)(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx)
Decode a value from the network into an output fr_pair_list_t.
Definition: decode.h:45
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: encode.h:37
static ssize_t encode_value(fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, int depth, fr_dcursor_t *cursor, void *encode_ctx)
Encodes the data portion of an attribute.
Definition: encode.c:272
long int ssize_t
Definition: merged_model.c:24
unsigned char uint8_t
Definition: merged_model.c:30
static uint8_t depth(fr_minmax_heap_index_t i)
Definition: minmax_heap.c:83
static fr_internal_encode_ctx_t encode_ctx
static ssize_t encode_pair(fr_dbuff_t *dbuff, fr_dcursor_t *cursor, UNUSED void *encode_ctx)
Definition: base.c:39
#define decode_value
Definition: decode.c:410
ssize_t fr_struct_from_network(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, fr_pair_decode_value_t decode_value, fr_pair_decode_value_t decode_tlv))
Convert a STRUCT to one or more VPs.
Definition: struct.c:33
ssize_t fr_struct_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_value, fr_encode_dbuff_t encode_pair))
Definition: struct.c:470
static fr_slen_t parent
Definition: pair.h:851
Structure for holding the stack of dictionary attributes being encoded.
Definition: proto.h:54
static fr_slen_t data
Definition: value.h:1265
int nonnull(2, 5))
static size_t char ** out
Definition: value.h:997