/src/freeradius-server/src/freeradius-devel/util/ext.h
Line | Count | Source |
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 | | /** 'compositing' using talloc structures |
19 | | * |
20 | | * These allow multiple variable length memory areas to be appended to |
21 | | * talloced structures. Extensions can either contain a header in which |
22 | | * case the exact length is recorded, or they can be of a fixed size. |
23 | | * |
24 | | * The structure being extended must be padded to a multiple of FR_EXT_ALIGNMENT. |
25 | | * i.e. CC_HINT(aligned(FR_EXT_ALIGNMENT)). |
26 | | * |
27 | | * It is strongly recommended that extended structures are allocated in a |
28 | | * talloc_pool() to avoid the overhead of multiple reallocs. |
29 | | * |
30 | | * @file src/lib/util/ext.h |
31 | | * |
32 | | * @copyright 2020 The FreeRADIUS server project |
33 | | * @copyright 2020 Arran Cudbard-Bell <a.cudbardb@freeradius.org> |
34 | | */ |
35 | | RCSIDH(ext_h, "$Id: 8f485ee92039de1ea8fb6df5deaf0d960e8544e1 $") |
36 | | |
37 | | #include <freeradius-devel/util/table.h> |
38 | | #include <limits.h> |
39 | | |
40 | | #ifdef __cplusplus |
41 | | extern "C" { |
42 | | #endif |
43 | | |
44 | | /** The alignment of object extension structures |
45 | | * |
46 | | */ |
47 | | #ifdef __WORD_SIZE |
48 | | # if __WORD_SIZE < 4 |
49 | | # define FR_EXT_ALIGNMENT sizeof(uint32_t) |
50 | | # else |
51 | | # define FR_EXT_ALIGNMENT __WORD_SIZE /* From limits.h */ |
52 | | # endif |
53 | | #else |
54 | 11.6M | # define FR_EXT_ALIGNMENT sizeof(uint64_t) |
55 | | #endif |
56 | | |
57 | | typedef struct fr_ext_s fr_ext_t; |
58 | | |
59 | | /** Function for pre-allocating extension memory for extensions before they're copied |
60 | | * |
61 | | * @param[in] def Extension definitions. |
62 | | * @param[in,out] dst_chunk_p to add extensions to. |
63 | | * @param[in] ext that's being copied. |
64 | | * @param[in] src_ext_ptr Pointer for the src extension. |
65 | | * @param[in] src_ext_len Length of the src extension. |
66 | | * @return |
67 | | * - NULL on error. |
68 | | * - Pointer to the new extension on success. |
69 | | */ |
70 | | typedef void *(* fr_ext_alloc_t)(fr_ext_t const *def, TALLOC_CTX **dst_chunk_p, |
71 | | int ext, void *src_ext_ptr, size_t src_ext_len); |
72 | | |
73 | | /** Function for re-populating extensions after they're copied |
74 | | * |
75 | | * @param[in] ext that's being copied. |
76 | | * @param[in] dst_chunk Talloc chunk we're copying to. |
77 | | * @param[in] dst_ext_ptr Pointer to the dst extension to populate. |
78 | | * @param[in] dst_ext_len The length of the dst extension. |
79 | | * @param[in] src_chunk Talloc chunk we're copying from. |
80 | | * @param[in] src_ext_ptr Pointer for the src extension. |
81 | | * @param[in] src_ext_len Length of the src extension. |
82 | | * @return |
83 | | * - NULL on error. |
84 | | * - Pointer to the new extension on success. |
85 | | */ |
86 | | typedef int (* fr_ext_copy_t)(int ext, |
87 | | TALLOC_CTX *dst_chunk, |
88 | | void *dst_ext_ptr, size_t dst_ext_len, |
89 | | TALLOC_CTX const *src_chunk, |
90 | | void *src_ext_ptr, size_t src_ext_len); |
91 | | |
92 | | /** Function for re-establishing internal consistency on realloc |
93 | | * |
94 | | * In some cases the chunk may cache a pointer to an extension. |
95 | | * On realloc this pointer may be invalidated. This provides a |
96 | | * callback to fixup consistency issues after a realloc. |
97 | | * |
98 | | * @param[in] ext that's being copied. |
99 | | * @param[in] chunk Talloc chunk. |
100 | | * @param[in] ext_ptr Pointer to the extension to fixup. |
101 | | * @param[in] ext_len The length of the extension to fixup. |
102 | | * @return |
103 | | * - NULL on error. |
104 | | * - Pointer to the new extension on success. |
105 | | */ |
106 | | typedef int (* fr_ext_fixup_t)(int ext, TALLOC_CTX *chunk, |
107 | | void *ext_ptr, size_t ext_len); |
108 | | |
109 | | /** Additional information for a given extension |
110 | | */ |
111 | | typedef struct { |
112 | | size_t min; //!< Minimum size of extension. |
113 | | bool has_hdr; //!< Additional metadata should be allocated before |
114 | | ///< the extension data to record the exact length |
115 | | ///< of the extension. |
116 | | bool can_copy; //!< Copying this extension between structs is allowed. |
117 | | |
118 | | fr_ext_alloc_t alloc; //!< Override the normal alloc operation with a callback. |
119 | | fr_ext_copy_t copy; //!< Override the normal copy operation with a callback. |
120 | | fr_ext_fixup_t fixup; //!< Callback for fixing up internal consistency issues. |
121 | | } fr_ext_info_t; |
122 | | |
123 | | /** Structure to define a set of extensions |
124 | | * |
125 | | */ |
126 | | struct fr_ext_s { |
127 | | size_t offset_of_exts; //!< Where in the extended struct the extensions array starts. |
128 | | fr_table_num_ordered_t const *name_table; //!< String identifiers for the extensions. |
129 | | size_t *name_table_len; //!< How many extensions there are in the table. |
130 | | int max; //!< The highest extension value. |
131 | | fr_ext_info_t const *info; //!< Additional information about each extension. |
132 | | }; |
133 | | |
134 | | /** Optional extension header struct |
135 | | * |
136 | | */ |
137 | | typedef struct { |
138 | | size_t len; //!< Length of extension data. |
139 | | uint8_t data[]; //!< Extension data |
140 | | } CC_HINT(aligned(FR_EXT_ALIGNMENT)) fr_ext_hdr_t; |
141 | | |
142 | | static inline CC_HINT(always_inline) uint8_t *fr_ext_offsets(fr_ext_t const *def, TALLOC_CTX const *chunk) |
143 | 25.1M | { |
144 | 25.1M | return (uint8_t *)(((uintptr_t)chunk) + def->offset_of_exts); |
145 | 25.1M | } Unexecuted instantiation: fuzzer_dhcpv6.c:fr_ext_offsets Unexecuted instantiation: fuzzer_util.c:fr_ext_offsets Unexecuted instantiation: fuzzer_dhcpv4.c:fr_ext_offsets Unexecuted instantiation: fuzzer_cbor.c:fr_ext_offsets Unexecuted instantiation: fuzzer_der.c:fr_ext_offsets Unexecuted instantiation: fuzzer_dns.c:fr_ext_offsets Unexecuted instantiation: fuzzer_tacacs.c:fr_ext_offsets Unexecuted instantiation: fuzzer_bfd.c:fr_ext_offsets Unexecuted instantiation: fuzzer_radius.c:fr_ext_offsets Unexecuted instantiation: fuzzer_tftp.c:fr_ext_offsets Unexecuted instantiation: fuzzer_vmps.c:fr_ext_offsets Unexecuted instantiation: base32.c:fr_ext_offsets Unexecuted instantiation: base64.c:fr_ext_offsets Unexecuted instantiation: calc.c:fr_ext_offsets Unexecuted instantiation: cbor.c:fr_ext_offsets Unexecuted instantiation: decode.c:fr_ext_offsets Unexecuted instantiation: dict_ext.c:fr_ext_offsets Unexecuted instantiation: dict_fixup.c:fr_ext_offsets Unexecuted instantiation: dict_print.c:fr_ext_offsets Unexecuted instantiation: dict_test.c:fr_ext_offsets Unexecuted instantiation: dict_tokenize.c:fr_ext_offsets Unexecuted instantiation: dict_unknown.c:fr_ext_offsets Unexecuted instantiation: dict_util.c:fr_ext_offsets Unexecuted instantiation: dict_validate.c:fr_ext_offsets Unexecuted instantiation: dl.c:fr_ext_offsets Unexecuted instantiation: dns.c:fr_ext_offsets Unexecuted instantiation: edit.c:fr_ext_offsets Unexecuted instantiation: encode.c:fr_ext_offsets Unexecuted instantiation: timer.c:fr_ext_offsets Line | Count | Source | 143 | 25.1M | { | 144 | 25.1M | return (uint8_t *)(((uintptr_t)chunk) + def->offset_of_exts); | 145 | 25.1M | } |
Unexecuted instantiation: file.c:fr_ext_offsets Unexecuted instantiation: inet.c:fr_ext_offsets Unexecuted instantiation: log.c:fr_ext_offsets Unexecuted instantiation: packet.c:fr_ext_offsets Unexecuted instantiation: pair.c:fr_ext_offsets Unexecuted instantiation: pair_inline.c:fr_ext_offsets Unexecuted instantiation: pair_legacy.c:fr_ext_offsets Unexecuted instantiation: pair_print.c:fr_ext_offsets Unexecuted instantiation: pair_tokenize.c:fr_ext_offsets Unexecuted instantiation: print.c:fr_ext_offsets Unexecuted instantiation: proto.c:fr_ext_offsets Unexecuted instantiation: regex.c:fr_ext_offsets Unexecuted instantiation: socket.c:fr_ext_offsets Unexecuted instantiation: stats.c:fr_ext_offsets Unexecuted instantiation: struct.c:fr_ext_offsets Unexecuted instantiation: trie.c:fr_ext_offsets Unexecuted instantiation: types.c:fr_ext_offsets Unexecuted instantiation: uri.c:fr_ext_offsets Unexecuted instantiation: value.c:fr_ext_offsets Unexecuted instantiation: fuzzer.c:fr_ext_offsets Unexecuted instantiation: base.c:fr_ext_offsets Unexecuted instantiation: raw.c:fr_ext_offsets Unexecuted instantiation: udp.c:fr_ext_offsets Unexecuted instantiation: json.c:fr_ext_offsets Unexecuted instantiation: jpath.c:fr_ext_offsets Unexecuted instantiation: cache.c:fr_ext_offsets Unexecuted instantiation: cert.c:fr_ext_offsets Unexecuted instantiation: conf.c:fr_ext_offsets Unexecuted instantiation: ctx.c:fr_ext_offsets Unexecuted instantiation: engine.c:fr_ext_offsets Unexecuted instantiation: pairs.c:fr_ext_offsets Unexecuted instantiation: session.c:fr_ext_offsets Unexecuted instantiation: strerror.c:fr_ext_offsets Unexecuted instantiation: utils.c:fr_ext_offsets Unexecuted instantiation: verify.c:fr_ext_offsets Unexecuted instantiation: version.c:fr_ext_offsets Unexecuted instantiation: virtual_server.c:fr_ext_offsets Unexecuted instantiation: list.c:fr_ext_offsets Unexecuted instantiation: tcp.c:fr_ext_offsets Unexecuted instantiation: abinary.c:fr_ext_offsets Unexecuted instantiation: auth.c:fr_ext_offsets Unexecuted instantiation: cf_file.c:fr_ext_offsets Unexecuted instantiation: cf_parse.c:fr_ext_offsets Unexecuted instantiation: cf_util.c:fr_ext_offsets Unexecuted instantiation: client.c:fr_ext_offsets Unexecuted instantiation: command.c:fr_ext_offsets Unexecuted instantiation: connection.c:fr_ext_offsets Unexecuted instantiation: dependency.c:fr_ext_offsets Unexecuted instantiation: dl_module.c:fr_ext_offsets Unexecuted instantiation: exec.c:fr_ext_offsets Unexecuted instantiation: exec_legacy.c:fr_ext_offsets Unexecuted instantiation: exfile.c:fr_ext_offsets Unexecuted instantiation: global_lib.c:fr_ext_offsets Unexecuted instantiation: main_config.c:fr_ext_offsets Unexecuted instantiation: main_loop.c:fr_ext_offsets Unexecuted instantiation: map.c:fr_ext_offsets Unexecuted instantiation: map_proc.c:fr_ext_offsets Unexecuted instantiation: module.c:fr_ext_offsets Unexecuted instantiation: module_method.c:fr_ext_offsets Unexecuted instantiation: module_rlm.c:fr_ext_offsets Unexecuted instantiation: paircmp.c:fr_ext_offsets Unexecuted instantiation: pairmove.c:fr_ext_offsets Unexecuted instantiation: password.c:fr_ext_offsets Unexecuted instantiation: pool.c:fr_ext_offsets Unexecuted instantiation: request.c:fr_ext_offsets Unexecuted instantiation: request_data.c:fr_ext_offsets Unexecuted instantiation: snmp.c:fr_ext_offsets Unexecuted instantiation: state.c:fr_ext_offsets Unexecuted instantiation: tmpl_dcursor.c:fr_ext_offsets Unexecuted instantiation: tmpl_eval.c:fr_ext_offsets Unexecuted instantiation: tmpl_tokenize.c:fr_ext_offsets Unexecuted instantiation: trigger.c:fr_ext_offsets Unexecuted instantiation: trunk.c:fr_ext_offsets Unexecuted instantiation: users_file.c:fr_ext_offsets Unexecuted instantiation: util.c:fr_ext_offsets Unexecuted instantiation: virtual_servers.c:fr_ext_offsets Unexecuted instantiation: call.c:fr_ext_offsets Unexecuted instantiation: call_env.c:fr_ext_offsets Unexecuted instantiation: caller.c:fr_ext_offsets Unexecuted instantiation: catch.c:fr_ext_offsets Unexecuted instantiation: child_request.c:fr_ext_offsets Unexecuted instantiation: compile.c:fr_ext_offsets Unexecuted instantiation: condition.c:fr_ext_offsets Unexecuted instantiation: detach.c:fr_ext_offsets Unexecuted instantiation: finally.c:fr_ext_offsets Unexecuted instantiation: foreach.c:fr_ext_offsets Unexecuted instantiation: function.c:fr_ext_offsets Unexecuted instantiation: group.c:fr_ext_offsets Unexecuted instantiation: interpret.c:fr_ext_offsets Unexecuted instantiation: interpret_synchronous.c:fr_ext_offsets Unexecuted instantiation: io.c:fr_ext_offsets Unexecuted instantiation: limit.c:fr_ext_offsets Unexecuted instantiation: load_balance.c:fr_ext_offsets Unexecuted instantiation: map_builtin.c:fr_ext_offsets Unexecuted instantiation: parallel.c:fr_ext_offsets Unexecuted instantiation: return.c:fr_ext_offsets Unexecuted instantiation: subrequest.c:fr_ext_offsets Unexecuted instantiation: switch.c:fr_ext_offsets Unexecuted instantiation: timeout.c:fr_ext_offsets Unexecuted instantiation: tmpl.c:fr_ext_offsets Unexecuted instantiation: try.c:fr_ext_offsets Unexecuted instantiation: transaction.c:fr_ext_offsets Unexecuted instantiation: xlat.c:fr_ext_offsets Unexecuted instantiation: xlat_alloc.c:fr_ext_offsets Unexecuted instantiation: xlat_builtin.c:fr_ext_offsets Unexecuted instantiation: xlat_eval.c:fr_ext_offsets Unexecuted instantiation: xlat_expr.c:fr_ext_offsets Unexecuted instantiation: xlat_func.c:fr_ext_offsets Unexecuted instantiation: xlat_inst.c:fr_ext_offsets Unexecuted instantiation: xlat_pair.c:fr_ext_offsets Unexecuted instantiation: xlat_purify.c:fr_ext_offsets Unexecuted instantiation: xlat_redundant.c:fr_ext_offsets Unexecuted instantiation: xlat_tokenize.c:fr_ext_offsets Unexecuted instantiation: app_io.c:fr_ext_offsets Unexecuted instantiation: channel.c:fr_ext_offsets Unexecuted instantiation: coord.c:fr_ext_offsets Unexecuted instantiation: coord_pair.c:fr_ext_offsets Unexecuted instantiation: master.c:fr_ext_offsets Unexecuted instantiation: network.c:fr_ext_offsets Unexecuted instantiation: schedule.c:fr_ext_offsets Unexecuted instantiation: thread.c:fr_ext_offsets Unexecuted instantiation: worker.c:fr_ext_offsets Unexecuted instantiation: vmps.c:fr_ext_offsets |
146 | | |
147 | | /** Return a pointer to an extension in a chunk |
148 | | * |
149 | | */ |
150 | | static inline CC_HINT(always_inline) void *fr_ext_ptr(TALLOC_CTX const *chunk, size_t offset, bool has_hdr) |
151 | 11.6M | { |
152 | 11.6M | uintptr_t out; |
153 | | |
154 | 11.6M | out = (uintptr_t)chunk; /* chunk start */ |
155 | 11.6M | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ |
156 | 11.6M | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ |
157 | | |
158 | 11.6M | return (void *)out; |
159 | 11.6M | } Unexecuted instantiation: fuzzer_dhcpv6.c:fr_ext_ptr Unexecuted instantiation: fuzzer_util.c:fr_ext_ptr Unexecuted instantiation: fuzzer_dhcpv4.c:fr_ext_ptr Unexecuted instantiation: fuzzer_cbor.c:fr_ext_ptr Unexecuted instantiation: fuzzer_der.c:fr_ext_ptr Unexecuted instantiation: fuzzer_dns.c:fr_ext_ptr Unexecuted instantiation: fuzzer_tacacs.c:fr_ext_ptr Unexecuted instantiation: fuzzer_bfd.c:fr_ext_ptr Unexecuted instantiation: fuzzer_radius.c:fr_ext_ptr Unexecuted instantiation: fuzzer_tftp.c:fr_ext_ptr Unexecuted instantiation: fuzzer_vmps.c:fr_ext_ptr Unexecuted instantiation: base32.c:fr_ext_ptr Unexecuted instantiation: base64.c:fr_ext_ptr Unexecuted instantiation: calc.c:fr_ext_ptr Line | Count | Source | 151 | 2.85k | { | 152 | 2.85k | uintptr_t out; | 153 | | | 154 | 2.85k | out = (uintptr_t)chunk; /* chunk start */ | 155 | 2.85k | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 2.85k | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 2.85k | return (void *)out; | 159 | 2.85k | } |
Line | Count | Source | 151 | 50 | { | 152 | 50 | uintptr_t out; | 153 | | | 154 | 50 | out = (uintptr_t)chunk; /* chunk start */ | 155 | 50 | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 50 | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 50 | return (void *)out; | 159 | 50 | } |
Line | Count | Source | 151 | 100 | { | 152 | 100 | uintptr_t out; | 153 | | | 154 | 100 | out = (uintptr_t)chunk; /* chunk start */ | 155 | 100 | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 100 | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 100 | return (void *)out; | 159 | 100 | } |
Unexecuted instantiation: dict_print.c:fr_ext_ptr Unexecuted instantiation: dict_test.c:fr_ext_ptr dict_tokenize.c:fr_ext_ptr Line | Count | Source | 151 | 826 | { | 152 | 826 | uintptr_t out; | 153 | | | 154 | 826 | out = (uintptr_t)chunk; /* chunk start */ | 155 | 826 | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 826 | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 826 | return (void *)out; | 159 | 826 | } |
dict_unknown.c:fr_ext_ptr Line | Count | Source | 151 | 241k | { | 152 | 241k | uintptr_t out; | 153 | | | 154 | 241k | out = (uintptr_t)chunk; /* chunk start */ | 155 | 241k | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 241k | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 241k | return (void *)out; | 159 | 241k | } |
Line | Count | Source | 151 | 10.0M | { | 152 | 10.0M | uintptr_t out; | 153 | | | 154 | 10.0M | out = (uintptr_t)chunk; /* chunk start */ | 155 | 10.0M | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 10.0M | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 10.0M | return (void *)out; | 159 | 10.0M | } |
dict_validate.c:fr_ext_ptr Line | Count | Source | 151 | 20 | { | 152 | 20 | uintptr_t out; | 153 | | | 154 | 20 | out = (uintptr_t)chunk; /* chunk start */ | 155 | 20 | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 20 | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 20 | return (void *)out; | 159 | 20 | } |
Unexecuted instantiation: dl.c:fr_ext_ptr Unexecuted instantiation: dns.c:fr_ext_ptr Unexecuted instantiation: edit.c:fr_ext_ptr Unexecuted instantiation: encode.c:fr_ext_ptr Unexecuted instantiation: timer.c:fr_ext_ptr Line | Count | Source | 151 | 1.00M | { | 152 | 1.00M | uintptr_t out; | 153 | | | 154 | 1.00M | out = (uintptr_t)chunk; /* chunk start */ | 155 | 1.00M | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 1.00M | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 1.00M | return (void *)out; | 159 | 1.00M | } |
Unexecuted instantiation: file.c:fr_ext_ptr Unexecuted instantiation: inet.c:fr_ext_ptr Unexecuted instantiation: log.c:fr_ext_ptr Unexecuted instantiation: packet.c:fr_ext_ptr Unexecuted instantiation: pair.c:fr_ext_ptr Unexecuted instantiation: pair_inline.c:fr_ext_ptr Unexecuted instantiation: pair_legacy.c:fr_ext_ptr Unexecuted instantiation: pair_print.c:fr_ext_ptr Unexecuted instantiation: pair_tokenize.c:fr_ext_ptr Unexecuted instantiation: print.c:fr_ext_ptr Unexecuted instantiation: proto.c:fr_ext_ptr Unexecuted instantiation: regex.c:fr_ext_ptr Unexecuted instantiation: socket.c:fr_ext_ptr Unexecuted instantiation: stats.c:fr_ext_ptr Line | Count | Source | 151 | 5.74k | { | 152 | 5.74k | uintptr_t out; | 153 | | | 154 | 5.74k | out = (uintptr_t)chunk; /* chunk start */ | 155 | 5.74k | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 5.74k | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 5.74k | return (void *)out; | 159 | 5.74k | } |
Unexecuted instantiation: trie.c:fr_ext_ptr Unexecuted instantiation: types.c:fr_ext_ptr Unexecuted instantiation: uri.c:fr_ext_ptr Unexecuted instantiation: value.c:fr_ext_ptr Unexecuted instantiation: fuzzer.c:fr_ext_ptr Line | Count | Source | 151 | 21.8k | { | 152 | 21.8k | uintptr_t out; | 153 | | | 154 | 21.8k | out = (uintptr_t)chunk; /* chunk start */ | 155 | 21.8k | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 21.8k | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 21.8k | return (void *)out; | 159 | 21.8k | } |
Line | Count | Source | 151 | 317k | { | 152 | 317k | uintptr_t out; | 153 | | | 154 | 317k | out = (uintptr_t)chunk; /* chunk start */ | 155 | 317k | out += offset * FR_EXT_ALIGNMENT; /* offset described by the extension */ | 156 | 317k | out += sizeof(fr_ext_hdr_t) * (has_hdr == true); /* data field offset by length header */ | 157 | | | 158 | 317k | return (void *)out; | 159 | 317k | } |
Unexecuted instantiation: raw.c:fr_ext_ptr Unexecuted instantiation: udp.c:fr_ext_ptr Unexecuted instantiation: encode.c:fr_ext_ptr Unexecuted instantiation: json.c:fr_ext_ptr Unexecuted instantiation: jpath.c:fr_ext_ptr Unexecuted instantiation: cache.c:fr_ext_ptr Unexecuted instantiation: cert.c:fr_ext_ptr Unexecuted instantiation: conf.c:fr_ext_ptr Unexecuted instantiation: ctx.c:fr_ext_ptr Unexecuted instantiation: engine.c:fr_ext_ptr Unexecuted instantiation: pairs.c:fr_ext_ptr Unexecuted instantiation: session.c:fr_ext_ptr Unexecuted instantiation: strerror.c:fr_ext_ptr Unexecuted instantiation: utils.c:fr_ext_ptr Unexecuted instantiation: verify.c:fr_ext_ptr Unexecuted instantiation: version.c:fr_ext_ptr Unexecuted instantiation: virtual_server.c:fr_ext_ptr Unexecuted instantiation: list.c:fr_ext_ptr Unexecuted instantiation: tcp.c:fr_ext_ptr Unexecuted instantiation: abinary.c:fr_ext_ptr Unexecuted instantiation: auth.c:fr_ext_ptr Unexecuted instantiation: cf_file.c:fr_ext_ptr Unexecuted instantiation: cf_parse.c:fr_ext_ptr Unexecuted instantiation: cf_util.c:fr_ext_ptr Unexecuted instantiation: client.c:fr_ext_ptr Unexecuted instantiation: command.c:fr_ext_ptr Unexecuted instantiation: connection.c:fr_ext_ptr Unexecuted instantiation: dependency.c:fr_ext_ptr Unexecuted instantiation: dl_module.c:fr_ext_ptr Unexecuted instantiation: exec.c:fr_ext_ptr Unexecuted instantiation: exec_legacy.c:fr_ext_ptr Unexecuted instantiation: exfile.c:fr_ext_ptr Unexecuted instantiation: global_lib.c:fr_ext_ptr Unexecuted instantiation: main_config.c:fr_ext_ptr Unexecuted instantiation: main_loop.c:fr_ext_ptr Unexecuted instantiation: map.c:fr_ext_ptr Unexecuted instantiation: map_proc.c:fr_ext_ptr Unexecuted instantiation: module.c:fr_ext_ptr Unexecuted instantiation: module_method.c:fr_ext_ptr Unexecuted instantiation: module_rlm.c:fr_ext_ptr Unexecuted instantiation: paircmp.c:fr_ext_ptr Unexecuted instantiation: pairmove.c:fr_ext_ptr Unexecuted instantiation: password.c:fr_ext_ptr Unexecuted instantiation: pool.c:fr_ext_ptr Unexecuted instantiation: request.c:fr_ext_ptr Unexecuted instantiation: request_data.c:fr_ext_ptr Unexecuted instantiation: snmp.c:fr_ext_ptr Unexecuted instantiation: state.c:fr_ext_ptr Unexecuted instantiation: tmpl_dcursor.c:fr_ext_ptr Unexecuted instantiation: tmpl_eval.c:fr_ext_ptr Unexecuted instantiation: tmpl_tokenize.c:fr_ext_ptr Unexecuted instantiation: trigger.c:fr_ext_ptr Unexecuted instantiation: trunk.c:fr_ext_ptr Unexecuted instantiation: users_file.c:fr_ext_ptr Unexecuted instantiation: util.c:fr_ext_ptr Unexecuted instantiation: virtual_servers.c:fr_ext_ptr Unexecuted instantiation: call.c:fr_ext_ptr Unexecuted instantiation: call_env.c:fr_ext_ptr Unexecuted instantiation: caller.c:fr_ext_ptr Unexecuted instantiation: catch.c:fr_ext_ptr Unexecuted instantiation: child_request.c:fr_ext_ptr Unexecuted instantiation: compile.c:fr_ext_ptr Unexecuted instantiation: condition.c:fr_ext_ptr Unexecuted instantiation: detach.c:fr_ext_ptr Unexecuted instantiation: finally.c:fr_ext_ptr Unexecuted instantiation: foreach.c:fr_ext_ptr Unexecuted instantiation: function.c:fr_ext_ptr Unexecuted instantiation: group.c:fr_ext_ptr Unexecuted instantiation: interpret.c:fr_ext_ptr Unexecuted instantiation: interpret_synchronous.c:fr_ext_ptr Unexecuted instantiation: io.c:fr_ext_ptr Unexecuted instantiation: limit.c:fr_ext_ptr Unexecuted instantiation: load_balance.c:fr_ext_ptr Unexecuted instantiation: map.c:fr_ext_ptr Unexecuted instantiation: map_builtin.c:fr_ext_ptr Unexecuted instantiation: parallel.c:fr_ext_ptr Unexecuted instantiation: return.c:fr_ext_ptr Unexecuted instantiation: subrequest.c:fr_ext_ptr Unexecuted instantiation: switch.c:fr_ext_ptr Unexecuted instantiation: timeout.c:fr_ext_ptr Unexecuted instantiation: tmpl.c:fr_ext_ptr Unexecuted instantiation: try.c:fr_ext_ptr Unexecuted instantiation: transaction.c:fr_ext_ptr Unexecuted instantiation: xlat.c:fr_ext_ptr Unexecuted instantiation: xlat_alloc.c:fr_ext_ptr Unexecuted instantiation: xlat_builtin.c:fr_ext_ptr Unexecuted instantiation: xlat_eval.c:fr_ext_ptr Unexecuted instantiation: xlat_expr.c:fr_ext_ptr Unexecuted instantiation: xlat_func.c:fr_ext_ptr Unexecuted instantiation: xlat_inst.c:fr_ext_ptr Unexecuted instantiation: xlat_pair.c:fr_ext_ptr Unexecuted instantiation: xlat_purify.c:fr_ext_ptr Unexecuted instantiation: xlat_redundant.c:fr_ext_ptr Unexecuted instantiation: xlat_tokenize.c:fr_ext_ptr Unexecuted instantiation: app_io.c:fr_ext_ptr Unexecuted instantiation: channel.c:fr_ext_ptr Unexecuted instantiation: coord.c:fr_ext_ptr Unexecuted instantiation: coord_pair.c:fr_ext_ptr Unexecuted instantiation: master.c:fr_ext_ptr Unexecuted instantiation: network.c:fr_ext_ptr Unexecuted instantiation: schedule.c:fr_ext_ptr Unexecuted instantiation: thread.c:fr_ext_ptr Unexecuted instantiation: worker.c:fr_ext_ptr Unexecuted instantiation: vmps.c:fr_ext_ptr |
160 | | |
161 | | void *fr_ext_alloc_size(fr_ext_t const *def, TALLOC_CTX **chunk_p, int ext, size_t ext_len); |
162 | | |
163 | | size_t fr_ext_len(fr_ext_t const *def, TALLOC_CTX const *chunk_in, int ext); |
164 | | |
165 | | void *fr_ext_copy(fr_ext_t const *def, TALLOC_CTX **chunk_out, TALLOC_CTX const *chunk_in, int ext); |
166 | | |
167 | | int fr_ext_copy_all(fr_ext_t const *def, TALLOC_CTX **chunk_out, TALLOC_CTX const *chunk_in); |
168 | | |
169 | | void fr_ext_debug(fr_ext_t const *def, char const *name, TALLOC_CTX const *chunk); |
170 | | |
171 | | #ifdef __cplusplus |
172 | | } |
173 | | #endif |