The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
proto_vmps.c
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15 */
16
17/**
18 * $Id: 5c149899b2d5ae53ba24d4a415fd625653851032 $
19 * @file proto_vmps.c
20 * @brief VMPS master protocol handler.
21 *
22 * @copyright 2017 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
23 * @copyright 2016 Alan DeKok (aland@freeradius.org)
24 */
25#include <freeradius-devel/io/listen.h>
26#include <freeradius-devel/protocol/vmps/vmps.h>
27#include <freeradius-devel/server/module_rlm.h>
28#include <freeradius-devel/util/debug.h>
29
30#include "proto_vmps.h"
31
32extern fr_app_t proto_vmps;
33static int type_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule);
34static int transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule);
35
37 { FR_CONF_OFFSET("Join-Request", proto_vmps_t, priorities[FR_PACKET_TYPE_VALUE_JOIN_REQUEST]),
38 .func = cf_table_parse_int, .uctx = &(cf_table_parse_ctx_t){ .table = channel_packet_priority, .len = &channel_packet_priority_len }, .dflt = "low" },
39 { FR_CONF_OFFSET("Reconfirm-Request", proto_vmps_t, priorities[FR_PACKET_TYPE_VALUE_RECONFIRM_REQUEST]),
40 .func = cf_table_parse_int, .uctx = &(cf_table_parse_ctx_t){ .table = channel_packet_priority, .len = &channel_packet_priority_len }, .dflt = "low" },
41
43};
44
45static conf_parser_t const limit_config[] = {
46 { FR_CONF_OFFSET("idle_timeout", proto_vmps_t, io.idle_timeout), .dflt = "30.0" } ,
47 { FR_CONF_OFFSET("nak_lifetime", proto_vmps_t, io.nak_lifetime), .dflt = "30.0" } ,
48
49 { FR_CONF_OFFSET("max_connections", proto_vmps_t, io.max_connections), .dflt = "1024" } ,
50 { FR_CONF_OFFSET("max_clients", proto_vmps_t, io.max_clients), .dflt = "256" } ,
51 { FR_CONF_OFFSET("max_pending_packets", proto_vmps_t, io.max_pending_packets), .dflt = "256" } ,
52
53 /*
54 * For performance tweaking. NOT for normal humans.
55 */
56 { FR_CONF_OFFSET("max_packet_size", proto_vmps_t, max_packet_size) } ,
57 { FR_CONF_OFFSET("num_messages", proto_vmps_t, num_messages) } ,
58
60};
61
62/** How to parse a VMPS listen section
63 *
64 */
67 { FR_CONF_OFFSET_TYPE_FLAGS("transport", FR_TYPE_VOID, 0, proto_vmps_t, io.submodule), .func = transport_parse },
68
69 { FR_CONF_POINTER("limit", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) limit_config },
70 { FR_CONF_POINTER("priority", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) priority_config },
72};
73
74static fr_dict_t const *dict_vmps;
75
78 { .out = &dict_vmps, .proto = "vmps" },
79 { NULL }
80};
81
83
86 { .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_vmps},
87 { NULL }
88};
89
90/** Translates the packet-type into a submodule name
91 *
92 * @param[in] ctx to allocate data in (instance of proto_vmps).
93 * @param[out] out Where to write a module_instance_t containing the module handle and instance.
94 * @param[in] parent Base structure address.
95 * @param[in] ci #CONF_PAIR specifying the name of the type module.
96 * @param[in] rule unused.
97 * @return
98 * - 0 on success.
99 * - -1 on failure.
100 */
101static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent,
102 CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
103{
104 proto_vmps_t *inst = talloc_get_type_abort(parent, proto_vmps_t);
106 CONF_PAIR *cp;
107 char const *value;
108
109 cp = cf_item_to_pair(ci);
110 value = cf_pair_value(cp);
111
113 if (!dv || (dv->value->vb_uint32 >= FR_VMPS_CODE_MAX)) {
114 cf_log_err(ci, "Unknown VMPS packet type '%s'", value);
115 return -1;
116 }
117
118 inst->allowed[dv->value->vb_uint32] = true;
119 *((char const **) out) = value;
120
121 return 0;
122}
123
124static int transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
125{
126 proto_vmps_t *inst = talloc_get_type_abort(parent, proto_vmps_t);
128
129 if (unlikely(virtual_server_listen_transport_parse(ctx, out, parent, ci, rule) < 0)) {
130 return -1;
131 }
132
133 mi = talloc_get_type_abort(*(void **)out, module_instance_t);
134 inst->io.app_io = (fr_app_io_t const *)mi->exported;
135 inst->io.app_io_instance = mi->data;
136 inst->io.app_io_conf = mi->conf;
137
138 return 0;
139}
140
141/** Decode the packet
142 *
143 */
144static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *const data, size_t data_len)
145{
146 fr_io_track_t const *track = talloc_get_type_abort_const(request->async->packet_ctx, fr_io_track_t);
147 fr_io_address_t const *address = track->address;
148 fr_client_t const *client;
149 fr_packet_t *packet = request->packet;
150
152
153 RHEXDUMP3(data, data_len, "proto_vmps decode packet");
154
155 client = address->radclient;
156
157 /*
158 * Hacks for now until we have a lower-level decode routine.
159 */
160 request->packet->code = data[0];
161 request->packet->id = data[1];
162 request->reply->id = data[1];
163
164 request->packet->data = talloc_memdup(request->packet, data, data_len);
165 request->packet->data_len = data_len;
166
167 /*
168 * Note that we don't set a limit on max_attributes here.
169 * That MUST be set and checked in the underlying
170 * transport, via a call to fr_vmps_ok().
171 */
172 if (fr_vmps_decode(request->request_ctx, &request->request_pairs,
173 packet->data, packet->data_len, &packet->code) < 0) {
174 RPEDEBUG("Failed decoding packet");
175 return -1;
176 }
177
178 /*
179 * Set the rest of the fields.
180 */
181 request->client = UNCONST(fr_client_t *, client);
182
183 request->packet->socket = address->socket;
184 fr_socket_addr_swap(&request->reply->socket, &address->socket);
185
186 if (fr_packet_pairs_from_packet(request->request_ctx, &request->request_pairs, request->packet) < 0) {
187 RPEDEBUG("Failed decoding 'Net.*' packet");
188 return -1;
189 }
190
191 REQUEST_VERIFY(request);
192
193 return 0;
194}
195
196static ssize_t mod_encode(UNUSED void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
197{
198 fr_io_track_t *track = talloc_get_type_abort(request->async->packet_ctx, fr_io_track_t);
199 fr_io_address_t const *address = track->address;
200 ssize_t data_len;
201 fr_client_t const *client;
202 fr_dcursor_t cursor;
203
204 /*
205 * Process layer NAK, never respond, or "Do not respond".
206 */
207 if ((buffer_len == 1) ||
208 (request->reply->code == FR_VMPS_DO_NOT_RESPOND) ||
209 (request->reply->code >= FR_VMPS_CODE_MAX)) {
210 track->do_not_respond = true;
211 return 1;
212 }
213
214 client = address->radclient;
215 fr_assert(client);
216
217 /*
218 * Dynamic client stuff
219 */
220 if (client->dynamic && !client->active) {
221 fr_client_t *new_client;
222
223 fr_assert(buffer_len >= sizeof(client));
224
225 /*
226 * Allocate the client. If that fails, send back a NAK.
227 *
228 * @todo - deal with NUMA zones? Or just deal with this
229 * client being in different memory.
230 *
231 * Maybe we should create a CONF_SECTION from the client,
232 * and pass *that* back to mod_write(), which can then
233 * parse it to create the actual client....
234 */
235 new_client = client_afrom_request(NULL, request);
236 if (!new_client) {
237 PERROR("Failed creating new client");
238 buffer[0] = true;
239 return 1;
240 }
241
242 memcpy(buffer, &new_client, sizeof(new_client));
243 return sizeof(new_client);
244 }
245
246 /*
247 * Overwrite the src ip address on the outbound packet
248 * with the one specified by the client. This is useful
249 * to work around broken DSR implementations and other
250 * routing issues.
251 */
252 if (client->src_ipaddr.af != AF_UNSPEC) {
253 request->reply->socket.inet.src_ipaddr = client->src_ipaddr;
254 }
255
256 fr_pair_dcursor_iter_init(&cursor, &request->reply_pairs, fr_proto_next_encodable, dict_vmps);
257
258 data_len = fr_vmps_encode(&FR_DBUFF_TMP(buffer, buffer_len), request->packet->data,
259 request->reply->code, request->reply->id, &cursor);
260 if (data_len < 0) {
261 RPEDEBUG("Failed encoding VMPS reply");
262 return -1;
263 }
264
265 fr_packet_net_from_pairs(request->reply, &request->reply_pairs);
266
267 RHEXDUMP3(buffer, data_len, "proto_vmps encode packet");
268
269 return data_len;
270}
271
272static int mod_priority_set(void const *instance, uint8_t const *buffer, UNUSED size_t buflen)
273{
275
276 /*
277 * Disallowed packet
278 */
279 if (!inst->priorities[buffer[1]]) return 0;
280
281 /*
282 * @todo - if we cared, we could also return -1 for "this
283 * is a bad packet". But that's really only for
284 * mod_inject, as we assume that app_io->read() always
285 * returns good packets.
286 */
287
288 /*
289 * Return the configured priority.
290 */
291 return inst->priorities[buffer[1]];
292}
293
294/** Open listen sockets/connect to external event source
295 *
296 * @param[in] instance Ctx data for this application.
297 * @param[in] sc to add our file descriptor to.
298 * @param[in] conf Listen section parsed to give us instance.
299 * @return
300 * - 0 on success.
301 * - -1 on failure.
302 */
303static int mod_open(void *instance, fr_schedule_t *sc, UNUSED CONF_SECTION *conf)
304{
305 proto_vmps_t *inst = talloc_get_type_abort(instance, proto_vmps_t);
306
307 inst->io.app = &proto_vmps;
308 inst->io.app_instance = instance;
309
310 return fr_master_io_listen(&inst->io, sc,
311 inst->max_packet_size, inst->num_messages);
312}
313
314/** Instantiate the application
315 *
316 * Instantiate I/O and type submodules.
317 *
318 * @return
319 * - 0 on success.
320 * - -1 on failure.
321 */
322static int mod_instantiate(module_inst_ctx_t const *mctx)
323{
324 proto_vmps_t *inst = talloc_get_type_abort(mctx->mi->data, proto_vmps_t);
325 CONF_SECTION *conf = mctx->mi->conf;
326
327 /*
328 * Ensure that the server CONF_SECTION is always set.
329 */
330 inst->io.server_cs = cf_item_to_section(cf_parent(conf));
331
332 fr_assert(dict_vmps != NULL);
334
335 /*
336 * No IO module, it's an empty listener.
337 */
338 if (!inst->io.submodule) return 0;
339
340 /*
341 * These timers are usually protocol specific.
342 */
343 FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, fr_time_delta_from_sec(1));
344 FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, fr_time_delta_from_sec(600));
345
346 FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, fr_time_delta_from_sec(1));
347 FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, fr_time_delta_from_sec(600));
348
349 /*
350 * Tell the master handler about the main protocol instance.
351 */
352 inst->io.app = &proto_vmps;
353 inst->io.app_instance = inst;
354
355 /*
356 * We will need this for dynamic clients and connected sockets.
357 */
358 inst->io.mi = mctx->mi;
359
360 /*
361 * These configuration items are not printed by default,
362 * because normal people shouldn't be touching them.
363 */
364 if (!inst->max_packet_size && inst->io.app_io) inst->max_packet_size = inst->io.app_io->default_message_size;
365
366 if (!inst->num_messages) inst->num_messages = 256;
367
368 FR_INTEGER_BOUND_CHECK("num_messages", inst->num_messages, >=, 32);
369 FR_INTEGER_BOUND_CHECK("num_messages", inst->num_messages, <=, 65535);
370
371 FR_INTEGER_BOUND_CHECK("max_packet_size", inst->max_packet_size, >=, 1024);
372 FR_INTEGER_BOUND_CHECK("max_packet_size", inst->max_packet_size, <=, 65535);
373
374 /*
375 * Instantiate the transport module before calling the
376 * common instantiation function.
377 */
378 if (module_instantiate(inst->io.submodule) < 0) return -1;
379
380 /*
381 * Instantiate the master io submodule
382 */
384}
385
386static int mod_load(void)
387{
388 if (fr_vmps_global_init() < 0) {
389 PERROR("Failed initializing the VMPS dictionaries");
390 return -1;
391 }
392
393 return 0;
394}
395
396static void mod_unload(void)
397{
399}
400
402 .common = {
403 .magic = MODULE_MAGIC_INIT,
404 .name = "vmps",
406 .inst_size = sizeof(proto_vmps_t),
407
408 .onload = mod_load,
409 .unload = mod_unload,
411 },
412 .dict = &dict_vmps,
413 .open = mod_open,
414 .decode = mod_decode,
415 .encode = mod_encode,
416 .priority = mod_priority_set
417};
static int const char char buffer[256]
Definition acutest.h:576
module_t common
Common fields to all loadable modules.
Definition app_io.h:34
Public structure describing an I/O path for a protocol.
Definition app_io.h:33
module_t common
Common fields provided by all modules.
Definition application.h:72
Describes a new application (protocol)
Definition application.h:71
#define UNCONST(_type, _ptr)
Remove const qualification from a pointer.
Definition build.h:167
#define unlikely(_x)
Definition build.h:383
#define UNUSED
Definition build.h:317
int cf_table_parse_int(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Generic function for parsing conf pair values as int.
Definition cf_parse.c:1592
#define CONF_PARSER_TERMINATOR
Definition cf_parse.h:658
cf_parse_t func
Override default parsing behaviour for the specified type with a custom parsing function.
Definition cf_parse.h:612
#define FR_INTEGER_BOUND_CHECK(_name, _var, _op, _bound)
Definition cf_parse.h:518
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition cf_parse.h:284
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
Definition cf_parse.h:339
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition cf_parse.h:272
#define FR_TIME_DELTA_BOUND_CHECK(_name, _var, _op, _bound)
Definition cf_parse.h:529
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
Definition cf_parse.h:449
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition cf_parse.h:428
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition cf_parse.h:241
Defines a CONF_PAIR to C data type mapping.
Definition cf_parse.h:595
Common header for all CONF_* types.
Definition cf_priv.h:49
Configuration AVP similar to a fr_pair_t.
Definition cf_priv.h:70
A section grouping multiple CONF_PAIR.
Definition cf_priv.h:101
CONF_SECTION * cf_item_to_section(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_SECTION.
Definition cf_util.c:683
CONF_PAIR * cf_item_to_pair(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_PAIR.
Definition cf_util.c:663
char const * cf_pair_value(CONF_PAIR const *pair)
Return the value of a CONF_PAIR.
Definition cf_util.c:1593
#define cf_log_err(_cf, _fmt,...)
Definition cf_util.h:289
#define cf_parent(_cf)
Definition cf_util.h:101
size_t channel_packet_priority_len
Definition channel.c:170
fr_table_num_sorted_t const channel_packet_priority[]
Definition channel.c:164
#define FR_DBUFF_TMP(_start, _len_or_end)
Creates a compound literal to pass into functions which accept a dbuff.
Definition dbuff.h:514
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
Definition dict.h:272
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
Definition dict.h:285
fr_value_box_t const * value
Enum value (what name maps to).
Definition dict.h:235
fr_dict_enum_value_t * fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len)
Definition dict_util.c:3397
Specifies an attribute which must be present for the module to function.
Definition dict.h:271
Specifies a dictionary which must be loaded/loadable for the module to function.
Definition dict.h:284
Value of an enumerated attribute.
Definition dict.h:231
Test enumeration values.
Definition dict_test.h:92
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition dl_module.h:63
int af
Address family.
Definition inet.h:64
fr_socket_t socket
src/dst ip and port.
Definition base.h:336
fr_client_t const * radclient
old-style client definition
Definition base.h:338
bool active
for dynamic clients
Definition client.h:119
fr_ipaddr_t src_ipaddr
IPv4/IPv6 address to send responses from (family must match ipaddr).
Definition client.h:84
bool dynamic
Whether the client was dynamically defined.
Definition client.h:118
Describes a host allowed to send packets to the server.
Definition client.h:80
#define PERROR(_fmt,...)
Definition log.h:228
#define RPEDEBUG(fmt,...)
Definition log.h:376
#define RHEXDUMP3(_data, _len, _fmt,...)
Definition log.h:705
int fr_packet_pairs_from_packet(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_packet_t const *packet)
Allocate a "Net." struct with src/dst host and port.
Definition packet.c:89
void fr_packet_net_from_pairs(fr_packet_t *packet, fr_pair_list_t const *list)
Convert pairs to information in a packet.
Definition packet.c:139
fr_app_io_t fr_master_app_io
Definition master.c:3277
int fr_master_io_listen(fr_io_instance_t *inst, fr_schedule_t *sc, size_t default_message_size, size_t num_messages)
Definition master.c:3068
fr_io_address_t const * address
of this packet.. shared between multiple packets
Definition master.h:54
bool do_not_respond
don't respond
Definition master.h:50
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_VOID
User data.
long int ssize_t
unsigned char uint8_t
#define MODULE_INST_CTX(_mi)
Wrapper to create a module_inst_ctx_t as a compound literal.
Definition module_ctx.h:158
module_instance_t * mi
Instance of the module being instantiated.
Definition module_ctx.h:51
Temporary structure to hold arguments for instantiation calls.
Definition module_ctx.h:50
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...
Definition proto.c:100
static int mod_load(void)
Definition proto_vmps.c:386
static fr_dict_attr_t const * attr_packet_type
Definition proto_vmps.c:82
static ssize_t mod_encode(UNUSED void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
Definition proto_vmps.c:196
static conf_parser_t const limit_config[]
Definition proto_vmps.c:45
static int type_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
static void mod_unload(void)
Definition proto_vmps.c:396
fr_app_t proto_vmps
Definition proto_vmps.c:401
fr_dict_autoload_t proto_vmps_dict[]
Definition proto_vmps.c:77
static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *const data, size_t data_len)
Decode the packet.
Definition proto_vmps.c:144
fr_dict_attr_autoload_t proto_vmps_dict_attr[]
Definition proto_vmps.c:85
static conf_parser_t const proto_vmps_config[]
How to parse a VMPS listen section.
Definition proto_vmps.c:65
static const conf_parser_t priority_config[]
Definition proto_vmps.c:36
static int transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Definition proto_vmps.c:124
static int mod_instantiate(module_inst_ctx_t const *mctx)
Instantiate the application.
Definition proto_vmps.c:322
static int mod_open(void *instance, fr_schedule_t *sc, UNUSED CONF_SECTION *conf)
Open listen sockets/connect to external event source.
Definition proto_vmps.c:303
static int mod_priority_set(void const *instance, uint8_t const *buffer, UNUSED size_t buflen)
Definition proto_vmps.c:272
static fr_dict_t const * dict_vmps
Definition proto_vmps.c:74
An instance of a proto_vmps listen section.
Definition proto_vmps.h:32
int fr_vmps_global_init(void)
Definition base.c:55
void fr_vmps_global_free(void)
Definition base.c:79
#define fr_assert(_expr)
Definition rad_assert.h:38
static rs_t * conf
Definition radsniff.c:53
#define REQUEST_VERIFY(_x)
Definition request.h:305
static int instantiate(module_inst_ctx_t const *mctx)
Definition rlm_rest.c:1313
The scheduler.
Definition schedule.c:125
CONF_SECTION * conf
Module's instance configuration.
Definition module.h:330
void * data
Module's instance data.
Definition module.h:272
module_instantiate_t instantiate
Callback to allow the module to register any per-instance resources like sockets and file handles.
Definition module.h:219
conf_parser_t const * config
How to convert a CONF_SECTION to a module instance.
Definition module.h:198
module_t * exported
Public module structure.
Definition module.h:277
Module instance data.
Definition module.h:266
static const uchar sc[16]
Definition smbdes.c:115
fr_client_t * client_afrom_request(TALLOC_CTX *ctx, request_t *request)
Create a new client, consuming all attributes in the control list of the request.
Definition client.c:923
int module_instantiate(module_instance_t *instance)
Manually complete module setup by calling its instantiate function.
Definition module.c:1189
eap_aka_sim_process_conf_t * inst
#define talloc_get_type_abort_const
Definition talloc.h:282
static fr_time_delta_t fr_time_delta_from_sec(int64_t sec)
Definition time.h:590
unsigned int code
Packet code (type).
Definition packet.h:61
uint8_t * data
Packet data (body).
Definition packet.h:63
size_t data_len
Length of packet data.
Definition packet.h:64
#define fr_pair_dcursor_iter_init(_cursor, _list, _iter, _uctx)
Initialises a special dcursor with callbacks that will maintain the attr sublists correctly.
Definition pair.h:569
static fr_slen_t parent
Definition pair.h:845
static void fr_socket_addr_swap(fr_socket_t *dst, fr_socket_t const *src)
Swap src/dst information of a fr_socket_t.
Definition socket.h:121
static fr_slen_t data
Definition value.h:1274
static size_t char ** out
Definition value.h:1012
int virtual_server_listen_transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Generic conf_parser_t func for loading drivers.
int fr_vmps_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, unsigned int *code)
Definition vmps.c:154
ssize_t fr_vmps_encode(fr_dbuff_t *dbuff, uint8_t const *original, int code, uint32_t seq_no, fr_dcursor_t *cursor)
Definition vmps.c:267
@ FR_VMPS_DO_NOT_RESPOND
Definition vmps.h:55
@ FR_VMPS_CODE_MAX
Definition vmps.h:54