* going to return.
*/
typedef struct {
- char const *xlat_name;
+ char const *name;
char const *rcode_str; //!< The base value.
+ module_instance_t *mi;
rlm_rcode_t rcode; //!< The integer constant representing rcode_str.
uint32_t simulcount;
fr_value_box_list_t *in)
{
rlm_always_t const *inst = talloc_get_type_abort_const(*((void const * const *)xlat_inst),rlm_always_t);
- module_instance_t *mi;
+ module_instance_t *mi = inst->mi;
char const *status;
char const *p;
fr_value_box_t *vb;
fr_value_box_t *in_head = fr_dlist_head(in);
- mi = module_by_name(NULL, inst->xlat_name);
- if (!mi) {
- RERROR("Can't find the module that registered this xlat: %s", inst->xlat_name);
- return XLAT_ACTION_FAIL;
- }
-
/*
* Expand to the existing status
*/
rlm_always_t *inst = instance;
xlat_t *xlat;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) {
- inst->xlat_name = cf_section_name1(conf);
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
+
+ inst->mi = module_by_name(NULL, inst->name);
+ if (!inst->mi) {
+ cf_log_err(conf, "Can't find the module instance data for this module: %s", inst->name);
+ return -1;
}
- xlat = xlat_register(inst, inst->xlat_name, always_xlat, false);
+
+ xlat = xlat_register(inst, inst->name, always_xlat, false);
xlat_func_args(xlat, always_xlat_args);
xlat_async_instantiate_set(xlat, always_xlat_instantiate, rlm_always_t *, NULL, inst);
*
*/
typedef struct {
- char const *xlat_name; //!< Name of xlat we registered.
+ char const *name; //!< Name of xlat we registered.
cipher_type_t type; //!< Type of encryption to use.
/** Supported cipher types
{
rlm_cipher_t *inst = talloc_get_type_abort(instance, rlm_cipher_t);
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
switch (inst->type) {
case RLM_CIPHER_TYPE_RSA:
/*
* Register decrypt xlat
*/
- xlat_name = talloc_asprintf(inst, "%s_decrypt", inst->xlat_name);
+ xlat_name = talloc_asprintf(inst, "%s_decrypt", inst->name);
xlat = xlat_register(inst, xlat_name, cipher_rsa_decrypt_xlat, false);
xlat_func_mono(xlat, &cipher_rsa_decrypt_xlat_arg);
xlat_async_instantiate_set(xlat, cipher_xlat_instantiate,
/*
* Verify sign xlat
*/
- xlat_name = talloc_asprintf(inst, "%s_verify", inst->xlat_name);
+ xlat_name = talloc_asprintf(inst, "%s_verify", inst->name);
xlat = xlat_register(inst, xlat_name, cipher_rsa_verify_xlat, false);
xlat_func_args(xlat, cipher_rsa_verify_xlat_arg);
xlat_async_instantiate_set(xlat, cipher_xlat_instantiate,
/*
* Register encrypt xlat
*/
- xlat_name = talloc_asprintf(inst, "%s_encrypt", inst->xlat_name);
+ xlat_name = talloc_asprintf(inst, "%s_encrypt", inst->name);
xlat = xlat_register(inst, xlat_name, cipher_rsa_encrypt_xlat, false);
xlat_func_mono(xlat, &cipher_rsa_encrypt_xlat_arg);
xlat_async_instantiate_set(xlat, cipher_xlat_instantiate,
/*
* Register sign xlat
*/
- xlat_name = talloc_asprintf(inst, "%s_sign", inst->xlat_name);
+ xlat_name = talloc_asprintf(inst, "%s_sign", inst->name);
xlat = xlat_register(inst, xlat_name, cipher_rsa_sign_xlat, false);
xlat_func_mono(xlat, &cipher_rsa_sign_xlat_arg);
xlat_async_instantiate_set(xlat, cipher_xlat_instantiate,
inst);
talloc_free(xlat_name);
- xlat_name = talloc_asprintf(inst, "%s_certificate", inst->xlat_name);
+ xlat_name = talloc_asprintf(inst, "%s_certificate", inst->name);
xlat = xlat_register(inst, xlat_name, cipher_certificate_xlat, false);
xlat_func_args(xlat, cipher_certificate_xlat_args);
xlat_async_instantiate_set(xlat, cipher_xlat_instantiate,
#include <time.h>
typedef struct {
- char const *xlat_name;
+ char const *name;
char const *fmt;
bool utc;
} rlm_date_t;
rlm_date_t *inst = instance;
xlat_t *xlat;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) {
- inst->xlat_name = cf_section_name1(conf);
- }
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(inst, inst->xlat_name, xlat_date_convert, false);
+ xlat = xlat_register(inst, inst->name, xlat_date_convert, false);
xlat_func_args(xlat,xlat_date_convert_args);
xlat_async_instantiate_set(xlat, mod_xlat_instantiate, rlm_date_t *, NULL, inst);
#include <freeradius-devel/util/time.h>
typedef struct {
- char const *xlat_name; //!< Name of our xlat function.
+ char const *name; //!< Name of our xlat function.
tmpl_t *delay; //!< How long we delay for.
bool relative; //!< Whether the delay is relative to the start of request processing.
bool force_reschedule; //!< Whether we should force rescheduling of the request.
rlm_delay_t *inst = instance;
xlat_t *xlat;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(inst, inst->xlat_name, xlat_delay, true);
+ xlat = xlat_register(inst, inst->name, xlat_delay, true);
xlat_func_args(xlat, xlat_delay_args);
xlat_async_instantiate_set(xlat, mod_xlat_instantiate, rlm_delay_t *, NULL, inst);
return 0;
*/
typedef struct {
char const *name;
- char const *xlat_name;
fr_udp_queue_config_t config; //!< UDP queue config
{
rlm_dhcpv4_t *inst = talloc_get_type_abort(instance, rlm_dhcpv4_t);
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
- inst->name = inst->xlat_name;
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
/*
* Ensure that we have a destination address.
* Define a structure for our module configuration.
*/
typedef struct {
- char const *xlat_name;
+ char const *name;
char const *allowed_chars;
} rlm_escape_t;
char *unescape;
xlat_t *xlat;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) {
- inst->xlat_name = cf_section_name1(conf);
- }
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- MEM(unescape = talloc_asprintf(NULL, "un%s", inst->xlat_name));
- xlat = xlat_register(NULL, inst->xlat_name, escape_xlat, false);
+ MEM(unescape = talloc_asprintf(NULL, "un%s", inst->name));
+ xlat = xlat_register(NULL, inst->name, escape_xlat, false);
xlat_func_mono(xlat, &escape_xlat_arg);
xlat_async_instantiate_set(xlat, mod_xlat_instantiate, rlm_escape_t *, NULL, inst);
* Define a structure for our module configuration.
*/
typedef struct {
- char const *xlat_name;
+ char const *name;
} rlm_expr_t;
/** Calculate powers
rlm_expr_t *inst = instance;
xlat_t *xlat;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) {
- inst->xlat_name = cf_section_name1(conf);
- }
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(inst, inst->xlat_name, expr_xlat, false);
+ xlat = xlat_register(inst, inst->name, expr_xlat, false);
xlat_func_mono(xlat, &expr_xlat_arg);
return 0;
*/
typedef struct {
char const *name;
- char const *xlat_name;
char const *interface;
fr_time_delta_t timeout;
fr_ipaddr_t src_ipaddr;
rlm_icmp_t *inst = instance;
xlat_t *xlat;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
- inst->name = inst->xlat_name;
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(inst, inst->xlat_name, xlat_icmp, true);
+ xlat = xlat_register(inst, inst->name, xlat_icmp, true);
xlat_func_args(xlat, xlat_icmp_args);
xlat_async_instantiate_set(xlat, mod_xlat_instantiate, rlm_icmp_t *, NULL, inst);
xlat_async_thread_instantiate_set(xlat, mod_xlat_thread_instantiate, xlat_icmp_thread_inst_t, NULL, inst);
* Structure for module configuration
*/
typedef struct {
- char const *xlat_name;
+ char const *name;
bool use_std3_ascii_rules;
bool allow_unassigned;
} rlm_idn_t;
static int mod_bootstrap(void *instance, CONF_SECTION *conf)
{
rlm_idn_t *inst = instance;
- char const *xlat_name;
xlat_t *xlat;
- xlat_name = cf_section_name2(conf);
- if (!xlat_name) {
- xlat_name = cf_section_name1(conf);
- }
-
- inst->xlat_name = xlat_name;
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(inst, inst->xlat_name, xlat_idna, false);
+ xlat = xlat_register(inst, inst->name, xlat_idna, false);
xlat_func_mono(xlat, &xlat_idna_arg);
xlat_async_instantiate_set(xlat, mod_xlat_instantiate, rlm_idn_t *, NULL, inst);
RCSID("$Id$")
#define LOG_PREFIX "rlm_lua (%s) - "
-#define LOG_PREFIX_ARGS inst->xlat_name
+#define LOG_PREFIX_ARGS inst->name
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
//!< basis, or use a single mutex protected interpreter.
bool jit; //!< Whether the linked interpreter is Lua 5.1 or LuaJIT.
- const char *xlat_name; //!< Name of this instance.
+ const char *name; //!< Name of this instance.
const char *module; //!< Full path to lua script to load and execute.
const char *func_instantiate; //!< Name of function to run on instantiation.
RCSID("$Id$")
#define LOG_PREFIX "rlm_lua (%s) - "
-#define LOG_PREFIX_ARGS inst->xlat_name
+#define LOG_PREFIX_ARGS inst->name
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
rlm_lua_t *inst = instance;
rlm_rcode_t rcode;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
/*
* Get an instance global interpreter to use with various things...
RCSID("$Id$")
#define LOG_PREFIX "rlm_lua (%s) - "
-#define LOG_PREFIX_ARGS inst->xlat_name
+#define LOG_PREFIX_ARGS inst->name
#include <freeradius-devel/server/base.h>
* be used as the instance handle.
*/
typedef struct {
+ char const *name;
+
/* Name of the perl module */
char const *module;
char const *func_preacct;
char const *func_detach;
char const *func_post_auth;
- char const *xlat_name;
char const *perl_flags;
PerlInterpreter *perl;
bool perl_parsed;
{
rlm_perl_t *inst = instance;
xlat_t *xlat;
- char const *xlat_name;
- xlat_name = cf_section_name2(conf);
- if (!xlat_name) xlat_name = cf_section_name1(conf);
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(NULL, xlat_name, perl_xlat, false);
+ xlat = xlat_register(NULL, inst->name, perl_xlat, false);
xlat_func_args(xlat, perl_xlat_args);
xlat_async_instantiate_set(xlat, mod_xlat_instantiate, rlm_perl_xlat_t, NULL, inst);
RCSID("$Id$")
#define LOG_PREFIX "rlm_rest (%s) - "
-#define LOG_PREFIX_ARGS inst->xlat_name
+#define LOG_PREFIX_ARGS inst->name
#include <ctype.h>
#include <string.h>
* Structure for module configuration
*/
typedef struct {
- char const *xlat_name; //!< Instance name.
+ char const *name; //!< Instance name.
char const *connect_proxy; //!< Send request via this proxy.
* thread safe.
*/
my_conf = cf_section_dup(NULL, NULL, conf, cf_section_name1(conf), cf_section_name2(conf), true);
- t->pool = fr_pool_init(NULL, my_conf, instance, rest_mod_conn_create, NULL, inst->xlat_name);
+ t->pool = fr_pool_init(NULL, my_conf, instance, rest_mod_conn_create, NULL, inst->name);
talloc_free(my_conf);
if (!t->pool) {
rlm_rest_t *inst = instance;
xlat_t *xlat;
- inst->xlat_name = cf_section_name2(conf);
- if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(inst, inst->xlat_name, rest_xlat, true);
+ xlat = xlat_register(inst, inst->name, rest_xlat, true);
xlat_func_args(xlat, rest_xlat_args);
xlat_async_thread_instantiate_set(xlat, mod_xlat_thread_instantiate, rest_xlat_thread_inst_t, NULL, inst);
#include <freeradius-devel/soh/base.h>
typedef struct {
- char const *xlat_name;
+ char const *name;
bool dhcp;
} rlm_soh_t;
static int mod_bootstrap(void *instance, CONF_SECTION *conf)
{
- char const *name;
rlm_soh_t *inst = instance;
xlat_t *xlat;
- name = cf_section_name2(conf);
- if (!name) name = cf_section_name1(conf);
- inst->xlat_name = name;
- if (!inst->xlat_name) return -1;
+ inst->name = cf_section_name2(conf);
+ if (!inst->name) inst->name = cf_section_name1(conf);
- xlat = xlat_register(inst, inst->xlat_name, soh_xlat, false);
+ xlat = xlat_register(inst, inst->name, soh_xlat, false);
xlat_func_args(xlat, soh_xlat_args);
return 0;