The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
rlm_tacacs.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 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 #include <freeradius-devel/io/atomic_queue.h>
18 #include <freeradius-devel/server/base.h>
19 #include <freeradius-devel/server/map.h>
20 #include <freeradius-devel/server/module_rlm.h>
21 #include <freeradius-devel/server/trunk.h>
22 #include <freeradius-devel/util/dlist.h>
23 #include <freeradius-devel/util/retry.h>
24 #include <freeradius-devel/unlang/module.h>
25 #include <freeradius-devel/tacacs/tacacs.h>
26 
27 /*
28  * $Id: e28373dc86c856dc81aed32060ad53335fc13c47 $
29  *
30  * @file rlm_tacacs.h
31  * @brief Structures for the TACACS+ client packets
32  *
33  * @copyright 2023 Network RADIUS SAS (legal@networkradius.com)
34  */
35 
36 typedef struct rlm_tacacs_s rlm_tacacs_t;
37 typedef struct rlm_tacacs_io_s rlm_tacacs_io_t;
38 
39 #define FR_TACACS_PACKET_TYPE_MAX (10)
40 
41 /*
42  * Define a structure for our module configuration.
43  */
44 struct rlm_tacacs_s {
45  char const *name;
47  rlm_tacacs_io_t const *io; //!< Public symbol exported by the submodule.
48 
52 
53  uint32_t max_attributes; //!< Maximum number of attributes to decode in response.
54 
55  uint32_t *types; //!< array of allowed packet types
56 
57  fr_retry_config_t retry; //!< retries shared by all packet types
58 
60 
61  trunk_conf_t trunk_conf; //!< trunk configuration
62 };
63 
64 /** Enqueue a request_t to an IO submodule
65  *
66  */
67 typedef unlang_action_t (*rlm_tacacs_io_enqueue_t)(rlm_rcode_t *p_result, void **rctx, void *instance, void *thread, request_t *request);
68 
69 /** Public structure describing an I/O path for an outgoing socket.
70  *
71  * This structure is exported by client I/O modules e.g. rlm_tacacs_udp.
72  */
74  module_t common; //!< Common fields to all loadable modules.
75  rlm_tacacs_io_enqueue_t enqueue; //!< Enqueue a request_t with an IO submodule.
76  unlang_module_signal_t signal; //!< Send a signal to an IO module.
77  module_method_t resume; //!< Resume a request, and get rcode.
78 };
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Definition: action.h:35
unsigned int uint32_t
Definition: merged_model.c:33
rlm_rcode_t
Return codes indicating the result of the module call.
Definition: rcode.h:40
module_t common
Common fields to all loadable modules.
Definition: rlm_tacacs.h:74
fr_retry_config_t retry
retries shared by all packet types
Definition: rlm_tacacs.h:57
char const * name
Definition: rlm_tacacs.h:45
rlm_tacacs_io_enqueue_t enqueue
Enqueue a request_t with an IO submodule.
Definition: rlm_tacacs.h:75
uint32_t * types
array of allowed packet types
Definition: rlm_tacacs.h:55
fr_time_delta_t revive_interval
Definition: rlm_tacacs.h:51
unlang_action_t(* rlm_tacacs_io_enqueue_t)(rlm_rcode_t *p_result, void **rctx, void *instance, void *thread, request_t *request)
Enqueue a request_t to an IO submodule.
Definition: rlm_tacacs.h:67
trunk_conf_t trunk_conf
trunk configuration
Definition: rlm_tacacs.h:61
bool allowed[FR_TACACS_CODE_MAX]
Definition: rlm_tacacs.h:59
unlang_module_signal_t signal
Send a signal to an IO module.
Definition: rlm_tacacs.h:76
module_instance_t * io_submodule
Definition: rlm_tacacs.h:46
fr_time_delta_t zombie_period
Definition: rlm_tacacs.h:50
rlm_tacacs_io_t const * io
Public symbol exported by the submodule.
Definition: rlm_tacacs.h:47
uint32_t max_attributes
Maximum number of attributes to decode in response.
Definition: rlm_tacacs.h:53
fr_time_delta_t response_window
Definition: rlm_tacacs.h:49
module_method_t resume
Resume a request, and get rcode.
Definition: rlm_tacacs.h:77
Public structure describing an I/O path for an outgoing socket.
Definition: rlm_tacacs.h:73
unlang_action_t(* module_method_t)(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Module section callback.
Definition: module.h:68
Module instance data.
Definition: module.h:265
Struct exported by a rlm_* module.
Definition: module.h:195
@ FR_TACACS_CODE_MAX
Definition: tacacs.h:317
A time delta, a difference in time measured in nanoseconds.
Definition: time.h:80
Common configuration parameters for a trunk.
Definition: trunk.h:224
void(* unlang_module_signal_t)(module_ctx_t const *mctx, request_t *request, fr_signal_t action)
A callback when the request gets a fr_signal_t.
Definition: module.h:80