The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
call_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: 2b88c95ae323f1bfb8659dfc27188f6e3d48ca45 $
20  *
21  * @file unlang/call_priv.h
22  *
23  * @copyright 2020 The FreeRADIUS server project
24  * @copyright 2021 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
25  */
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include "unlang_priv.h"
31 #include <freeradius-devel/unlang/unlang_priv.h>
32 
33 /** Entry point into a proto_ module.
34  *
35  */
36 typedef struct {
37  unlang_group_t group; //!< Generic field common to all group type
38  ///< #unlang_t nodes.
39  CONF_SECTION *server_cs; //!< Config section of the virtual server being
40  ///< executed.
41  fr_dict_attr_t const *attr_packet_type; //!< Attribute used to specify packet type and
42  ///< sections run in the server_cs.
44 
45 /** Cast a group structure to the call keyword extension
46  *
47  */
49 {
50  return talloc_get_type_abort(g, unlang_call_t);
51 }
52 
53 /** Cast a call keyword extension to a group structure
54  *
55  */
57 {
58  return (unlang_group_t *)call;
59 }
60 
61 /** Cast a call keyword extension to a unlang_t structure
62  *
63  */
65 {
66  return (unlang_t *)call;
67 }
68 
69 #ifdef __cplusplus
70 }
71 #endif
static unlang_call_t * unlang_group_to_call(unlang_group_t *g)
Cast a group structure to the call keyword extension.
Definition: call_priv.h:48
CONF_SECTION * server_cs
Config section of the virtual server being executed.
Definition: call_priv.h:39
static unlang_t * unlang_call_to_generic(unlang_call_t *call)
Cast a call keyword extension to a unlang_t structure.
Definition: call_priv.h:64
fr_dict_attr_t const * attr_packet_type
Attribute used to specify packet type and sections run in the server_cs.
Definition: call_priv.h:41
unlang_group_t group
Generic field common to all group type unlang_t nodes.
Definition: call_priv.h:37
static unlang_group_t * unlang_call_to_group(unlang_call_t *call)
Cast a call keyword extension to a group structure.
Definition: call_priv.h:56
Entry point into a proto_ module.
Definition: call_priv.h:36
A section grouping multiple CONF_PAIR.
Definition: cf_priv.h:101
Private interpreter structures and functions.
Generic representation of a grouping.
Definition: unlang_priv.h:145
A node in a graph of unlang_op_t (s) that we execute.
Definition: unlang_priv.h:112