All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
rlm_perl.c File Reference

Translates requests between the server an a perl interpreter. More...

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <freeradius-devel/rad_assert.h>
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>
#include <dlfcn.h>
#include <semaphore.h>
+ Include dependency graph for rlm_perl.c:

Go to the source code of this file.

Data Structures

struct  rlm_perl_t
 

Macros

#define RLM_PERL_CONF(_x)
 
#define RLM_PERL_FUNC(_x)
 

Typedefs

typedef struct rlm_perl_t rlm_perl_t
 

Functions

EXTERN_C void boot_DynaLoader (pTHX_ CV *cv)
 
static rlm_rcode_t CC_HINT (nonnull)
 
static int do_perl (void *instance, REQUEST *request, char const *function_name)
 
static int get_hv_content (TALLOC_CTX *ctx, REQUEST *request, HV *my_hv, VALUE_PAIR **vps, const char *hash_name, const char *list_name)
 
static int mod_bootstrap (CONF_SECTION *conf, void *instance)
 
static int mod_detach (void *instance)
 
static int mod_instantiate (CONF_SECTION *conf, void *instance)
 
static int pairadd_sv (TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR **vps, char *key, SV *sv, FR_TOKEN op, const char *hash_name, const char *list_name)
 
static void perl_parse_config (CONF_SECTION *cs, int lvl, HV *rad_hv)
 
static void perl_store_vps (UNUSED TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR **vps, HV *rad_hv, const char *hash_name, const char *list_name)
 
static void perl_vp_to_svpvn_element (REQUEST *request, AV *av, VALUE_PAIR const *vp, int *i, const char *hash_name, const char *list_name)
 
static ssize_t perl_xlat (char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 
static XS (XS_radiusd_radlog)
 
static void xs_init (pTHX)
 

Variables

static const CONF_PARSER module_config []
 
module_t rlm_perl
 

Detailed Description

Translates requests between the server an a perl interpreter.

Id:
5c0f89825deb3ba0fed1852efff8ec395894ef79

Definition in file rlm_perl.c.


Data Structure Documentation

struct rlm_perl_t

Definition at line 51 of file rlm_perl.c.

Data Fields
char const * func_accounting
char const * func_authenticate
char const * func_authorize
char const * func_checksimul
char const * func_detach
char const * func_post_auth
char const * func_post_proxy
char const * func_pre_proxy
char const * func_preacct
char const * func_recv_coa
char const * func_send_coa
char const * func_start_accounting
char const * func_stop_accounting
char const * func_xlat
char const * module
PerlInterpreter * perl
char const * perl_flags
bool perl_parsed
HV * rad_perlconf_hv holds "config" items (perl RAD_PERLCONF hash).
pthread_key_t * thread_key
char const * xlat_name

Macro Definition Documentation

#define RLM_PERL_CONF (   _x)
Value:
{ "func_" STRINGIFY(_x), PW_TYPE_STRING, \
offsetof(rlm_perl_t,func_##_x), NULL, STRINGIFY(_x), T_INVALID }
#define STRINGIFY(x)
Definition: build.h:34
String of printable characters.
Definition: radius.h:33

Definition at line 90 of file rlm_perl.c.

#define RLM_PERL_FUNC (   _x)
Value:
static rlm_rcode_t CC_HINT(nonnull) mod_##_x(void *instance, REQUEST *request) \
{ \
return do_perl(instance, request, \
((rlm_perl_t *)instance)->func_##_x); \
}
enum rlm_rcodes rlm_rcode_t
Return codes indicating the result of the module call.
static rlm_rcode_t CC_HINT(nonnull)
Definition: rlm_perl.c:976

Definition at line 949 of file rlm_perl.c.

Typedef Documentation

typedef struct rlm_perl_t rlm_perl_t

Function Documentation

EXTERN_C void boot_DynaLoader ( pTHX_ CV *  cv)

+ Here is the caller graph for this function:

static rlm_rcode_t CC_HINT ( nonnull  )
static

Definition at line 976 of file rlm_perl.c.

+ Here is the call graph for this function:

static int do_perl ( void *  instance,
REQUEST request,
char const *  function_name 
)
static

Definition at line 788 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int get_hv_content ( TALLOC_CTX *  ctx,
REQUEST request,
HV *  my_hv,
VALUE_PAIR **  vps,
const char *  hash_name,
const char *  list_name 
)
static

Definition at line 758 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int mod_bootstrap ( CONF_SECTION conf,
void *  instance 
)
static

Definition at line 459 of file rlm_perl.c.

+ Here is the call graph for this function:

static int mod_detach ( void *  instance)
static

Definition at line 1018 of file rlm_perl.c.

static int mod_instantiate ( CONF_SECTION conf,
void *  instance 
)
static

Definition at line 487 of file rlm_perl.c.

+ Here is the call graph for this function:

static int pairadd_sv ( TALLOC_CTX *  ctx,
REQUEST request,
VALUE_PAIR **  vps,
char *  key,
SV *  sv,
FR_TOKEN  op,
const char *  hash_name,
const char *  list_name 
)
static

Definition at line 718 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void perl_parse_config ( CONF_SECTION cs,
int  lvl,
HV *  rad_hv 
)
static

Definition at line 398 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void perl_store_vps ( UNUSED TALLOC_CTX *  ctx,
REQUEST request,
VALUE_PAIR **  vps,
HV *  rad_hv,
const char *  hash_name,
const char *  list_name 
)
static

Definition at line 624 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void perl_vp_to_svpvn_element ( REQUEST request,
AV *  av,
VALUE_PAIR const *  vp,
int *  i,
const char *  hash_name,
const char *  list_name 
)
static

Definition at line 582 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t perl_xlat ( char **  out,
size_t  outlen,
void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Definition at line 310 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static XS ( XS_radiusd_radlog  )
static

Definition at line 276 of file rlm_perl.c.

+ Here is the call graph for this function:

static void xs_init ( pTHX  )
static

Definition at line 297 of file rlm_perl.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const CONF_PARSER module_config[]
static
Initial value:
= {
RLM_PERL_CONF(authorize),
RLM_PERL_CONF(authenticate),
RLM_PERL_CONF(post_auth),
RLM_PERL_CONF(accounting),
RLM_PERL_CONF(preacct),
RLM_PERL_CONF(checksimul),
RLM_PERL_CONF(detach),
RLM_PERL_CONF(pre_proxy),
RLM_PERL_CONF(post_proxy),
RLM_PERL_CONF(recv_coa),
RLM_PERL_CONF(send_coa),
{ FR_CONF_OFFSET("perl_flags", PW_TYPE_STRING, rlm_perl_t, perl_flags) },
{ FR_CONF_OFFSET("func_start_accounting", PW_TYPE_STRING, rlm_perl_t, func_start_accounting) },
{ FR_CONF_OFFSET("func_stop_accounting", PW_TYPE_STRING, rlm_perl_t, func_stop_accounting) },
}
#define PW_TYPE_FILE_INPUT
File matching value must exist, and must be readable.
Definition: conffile.h:204
#define CONF_PARSER_TERMINATOR
Definition: conffile.h:289
#define RLM_PERL_CONF(_x)
Definition: rlm_perl.c:90
#define FR_CONF_OFFSET(_n, _t, _s, _f)
Definition: conffile.h:168
#define PW_TYPE_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition: conffile.h:200
String of printable characters.
Definition: radius.h:33

Definition at line 93 of file rlm_perl.c.

module_t rlm_perl
Initial value:
= {
.magic = RLM_MODULE_INIT,
.name = "perl",
.inst_size = sizeof(rlm_perl_t),
.config = module_config,
.bootstrap = mod_bootstrap,
.instantiate = mod_instantiate,
.detach = mod_detach,
.methods = {
[MOD_PREACCT] = mod_preacct,
[MOD_PRE_PROXY] = mod_pre_proxy,
[MOD_POST_PROXY] = mod_post_proxy,
[MOD_RECV_COA] = mod_recv_coa,
[MOD_SEND_COA] = mod_send_coa
},
}
5 methods index for preproxy section.
Definition: modules.h:46
static rlm_rcode_t mod_accounting(void *instance, REQUEST *request)
Write accounting data to Couchbase documents.
static rlm_rcode_t mod_post_auth(void *instance, REQUEST *request) CC_HINT(nonnull)
#define RLM_TYPE_THREAD_UNSAFE
Module is not threadsafe.
Definition: modules.h:76
7 methods index for postauth section.
Definition: modules.h:48
static rlm_rcode_t mod_authorize(void *instance, REQUEST *request)
Handle authorization requests using Couchbase document data.
#define RLM_MODULE_INIT
Definition: modules.h:86
struct rlm_perl_t rlm_perl_t
static rlm_rcode_t mod_authenticate(void *instance, REQUEST *request) CC_HINT(nonnull)
4 methods index for checksimul section.
Definition: modules.h:45
3 methods index for accounting section.
Definition: modules.h:44
static int mod_detach(void *instance)
Definition: rlm_perl.c:1018
static rlm_rcode_t mod_checksimul(void *instance, REQUEST *request)
Check if a given user is already logged in.
0 methods index for authenticate section.
Definition: modules.h:41
static int mod_bootstrap(CONF_SECTION *conf, void *instance)
Definition: rlm_perl.c:459
6 methods index for postproxy section.
Definition: modules.h:47
2 methods index for preacct section.
Definition: modules.h:43
8 methods index for recvcoa section.
Definition: modules.h:50
static const CONF_PARSER module_config[]
Definition: rlm_perl.c:93
9 methods index for sendcoa section.
Definition: modules.h:51
1 methods index for authorize section.
Definition: modules.h:42
static int mod_instantiate(CONF_SECTION *conf, void *instance)
Definition: rlm_perl.c:487

Definition at line 1070 of file rlm_perl.c.