The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
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: a01fe09aaecb05203bd48590e57640091130900d $
20  *
21  * @file unlang/subrequest_priv.h
22  *
23  * @copyright 2019 The FreeRADIUS server project
24  */
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include <freeradius-devel/server/tmpl.h>
30 #include <freeradius-devel/util/dict.h>
31 #include "unlang_priv.h"
32 
33 typedef 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 /** Parameters for initialising the subrequest (parent's frame state)
49  *
50  */
51 typedef struct {
52  rlm_rcode_t *p_result; //!< Where to store the result.
53  request_t *child; //!< Pre-allocated child request.
54  bool free_child; //!< Whether we should free the child after
55  ///< it completes.
56  bool detachable; //!< Whether the request can be detached.
57  unlang_subrequest_session_t session; //!< Session configuration.
59 
60 /** Cast a group structure to the subrequest keyword extension
61  *
62  */
64 {
65  return talloc_get_type_abort(g, unlang_subrequest_t);
66 }
67 
68 /** Cast a subrequest keyword extension to a group structure
69  *
70  */
72 {
73  return (unlang_group_t *)subrequest;
74 }
75 
77 
78 #ifdef __cplusplus
79 }
80 #endif
Value of an enumerated attribute.
Definition: dict.h:209
rlm_rcode_t
Return codes indicating the result of the module call.
Definition: rcode.h:40
bool free_child
Whether we should free the child after it completes.
static unlang_group_t * unlang_subrequest_to_group(unlang_subrequest_t *subrequest)
Cast a subrequest keyword extension to a group structure.
tmpl_t * vpt
Value to expand to find the value to place into the packet-type attribute.
unlang_subrequest_session_t session
Session configuration.
fr_dict_attr_t const * attr_packet_type
Packet-type attribute in the subrequest protocol.
request_t * child
Pre-allocated child request.
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.
static unlang_subrequest_t * unlang_group_to_subrequest(unlang_group_t *g)
Cast a group structure to the subrequest keyword extension.
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.
rlm_rcode_t * p_result
Where to store the result.
bool detachable
Whether the request can be detached.
Parameters for initialising the subrequest (parent's frame state)
Private interpreter structures and functions.
Generic representation of a grouping.
Definition: unlang_priv.h:155