24 RCSID(
"$Id: 7726cc5ca69687a52d4766188008f39f9679184d $")
26 #include <freeradius-devel/io/application.h>
27 #include <freeradius-devel/server/modpriv.h>
28 #include <freeradius-devel/util/debug.h>
29 #include <freeradius-devel/util/dlist.h>
120 cf_log_err(ci,
"Unknown TACACS+ packet type '%s'", type_str);
124 code = type_enum->
value->vb_uint32;
126 memcpy(
out, &code,
sizeof(code));
140 if (action == FR_SIGNAL_DUP)
return;
146 mctx->
rctx), request, action);
161 REDEBUG(
"Invalid packet code %d", request->packet->code);
165 if (!
inst->allowed[request->packet->code]) {
166 REDEBUG(
"Packet code %s is disallowed by the configuration",
178 ua =
inst->io->enqueue(&rcode, &rctx,
inst->io_submodule->data,
212 num_types = talloc_array_length(
inst->types);
218 for (i = 0; i < num_types; i++) {
221 code =
inst->types[i];
224 inst->allowed[code] =
true;
234 PERROR(
"Failed initialising protocol library");
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
@ UNLANG_ACTION_YIELD
Temporarily pause execution until an event occurs.
#define CONF_PARSER_TERMINATOR
#define FR_INTEGER_BOUND_CHECK(_name, _var, _op, _bound)
#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
#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
#define FR_CONF_OFFSET_SUBSECTION(_name, _flags, _struct, _field, _subcs)
conf_parser_t which populates a sub-struct using a CONF_SECTION
#define FR_TIME_DELTA_BOUND_CHECK(_name, _var, _op, _bound)
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
@ CONF_FLAG_MULTI
CONF_PAIR can have multiple copies.
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
#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
Defines a CONF_PAIR to C data type mapping.
Common header for all CONF_* types.
A section grouping multiple CONF_PAIR.
CONF_PAIR * cf_item_to_pair(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_PAIR.
char const * cf_pair_value(CONF_PAIR const *pair)
Return the value of a CONF_PAIR.
CONF_SECTION * cf_item_to_section(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_SECTION.
char const * cf_section_name1(CONF_SECTION const *cs)
Return the second identifier of a CONF_SECTION.
#define cf_log_err(_cf, _fmt,...)
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
fr_value_box_t const * value
Enum value (what name maps to).
fr_dict_enum_value_t * fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len)
Specifies an attribute which must be present for the module to function.
Specifies a dictionary which must be loaded/loadable for the module to function.
Value of an enumerated attribute.
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
void * env_data
Per call environment data.
module_instance_t const * mi
Instance of the module being instantiated.
void * rctx
Resume ctx that a module previously set.
#define MODULE_CTX(_mi, _thread, _env_data, _rctx)
Wrapper to create a module_ctx_t as a compound literal.
module_instance_t * mi
Instance of the module being instantiated.
Temporary structure to hold arguments for module calls.
Temporary structure to hold arguments for instantiation calls.
int module_rlm_submodule_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Generic conf_parser_t func for loading drivers.
module_t common
Common fields presented by all modules.
static const conf_parser_t config[]
char const * fr_tacacs_packet_names[FR_TACACS_CODE_MAX]
void fr_tacacs_global_free(void)
int fr_tacacs_global_init(void)
#define RETURN_MODULE_RCODE(_rcode)
rlm_rcode_t
Return codes indicating the result of the module call.
static int instantiate(module_inst_ctx_t const *mctx)
static int mod_load(void)
static fr_dict_attr_t const * attr_packet_type
fr_dict_attr_autoload_t rlm_tacacs_dict_attr[]
static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Send packets outbound.
static conf_parser_t retry_config[]
static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
static fr_dict_t const * dict_tacacs
fr_dict_autoload_t rlm_tacacs_dict[]
static void mod_unload(void)
static void mod_tacacs_signal(module_ctx_t const *mctx, request_t *request, fr_signal_t action)
static int mod_instantiate(module_inst_ctx_t const *mctx)
static conf_parser_t const module_config[]
struct rlm_tacacs_s rlm_tacacs_t
unlang_module_signal_t signal
Send a signal to an IO module.
Public structure describing an I/O path for an outgoing socket.
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
char const * name
Instance name e.g. user_database.
static module_thread_instance_t * module_thread(module_instance_t const *mi)
Retrieve module/thread specific instance for a module.
void * data
Module's instance data.
void * data
Thread specific instance data.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
unlang_action_t unlang_module_yield(request_t *request, module_method_t resume, unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx)
Yield a request back to the interpreter from within a module.
eap_aka_sim_process_conf_t * inst
#define FR_TACACS_PACKET_CODE_VALID(_code)
#define FR_MAX_ATTRIBUTES
#define talloc_get_type_abort_const
static fr_time_delta_t fr_time_delta_from_sec(int64_t sec)
conf_parser_t const trunk_config[]
Config parser definitions to populate a trunk_conf_t.
static size_t char ** out