The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
subrequest_priv.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, or (at your option)
6 * 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 Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 */
17
18/**
19 * $Id: 12944514c676c6c8eafa200eaa7abb0fb4b9fa3c $
20 *
21 * @file unlang/subrequest_priv.h
22 *
23 * @copyright 2019 The FreeRADIUS server project
24 */
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include <freeradius-devel/server/tmpl.h>
30#include <freeradius-devel/util/dict.h>
31#include "unlang_priv.h"
32
33typedef struct {
35 tmpl_t *vpt; //!< Value to expand to find the value to place
36 ///< into the packet-type attribute.
37
38 tmpl_t *src; //!< Pairs to copy into the subrequest request list.
39 tmpl_t *dst; //!< Where to copy pairs from the reply list in the
40 ///< subrequest to.
41
42 fr_dict_t const *dict; //!< Dictionary of the subrequest protocol.
43 fr_dict_attr_t const *attr_packet_type; //!< Packet-type attribute in the subrequest protocol.
44 fr_dict_enum_value_t const *type_enum; //!< Static enumeration value for attr_packet_type
45 ///< if the packet-type is static.
47
48/** Cast a group structure to the subrequest keyword extension
49 *
50 */
52{
53 return talloc_get_type_abort(g, unlang_subrequest_t);
54}
55
56/** Cast a subrequest keyword extension to a group structure
57 *
58 */
60{
61 return (unlang_group_t *)subrequest;
62}
63
66
68
69#ifdef __cplusplus
70}
71#endif
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Definition action.h:35
#define UNUSED
Definition build.h:317
Value of an enumerated attribute.
Definition dict.h:232
rlm_rcode_t
Return codes indicating the result of the module call.
Definition rcode.h:40
static unlang_group_t * unlang_subrequest_to_group(unlang_subrequest_t *subrequest)
Cast a subrequest keyword extension to a group structure.
static unlang_subrequest_t * unlang_group_to_subrequest(unlang_group_t *g)
Cast a group structure to the subrequest keyword extension.
tmpl_t * vpt
Value to expand to find the value to place into the packet-type attribute.
fr_dict_attr_t const * attr_packet_type
Packet-type attribute in the subrequest protocol.
unlang_group_t group
tmpl_t * src
Pairs to copy into the subrequest request list.
fr_dict_t const * dict
Dictionary of the subrequest protocol.
unlang_action_t unlang_subrequest_child_run(UNUSED rlm_rcode_t *p_result, UNUSED request_t *request, unlang_stack_frame_t *frame)
Function called by the unlang interpreter, or manually to start the child running.
Definition subrequest.c:351
int unlang_subrequest_detach_child(request_t *request)
tmpl_t * dst
Where to copy pairs from the reply list in the subrequest to.
fr_dict_enum_value_t const * type_enum
Static enumeration value for attr_packet_type.
Private interpreter structures and functions.
Generic representation of a grouping.
Our interpreter stack, as distinct from the C stack.