The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions | Variables
rlm_date.c File Reference

Translates timestrings between formats. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <time.h>
+ Include dependency graph for rlm_date.c:

Go to the source code of this file.

Data Structures

struct  rlm_date_t
 

Functions

static xlat_action_t date_convert_string (TALLOC_CTX *ctx, fr_dcursor_t *out, request_t *request, const char *str, rlm_date_t const *inst)
 
static xlat_action_t date_encode_strftime (TALLOC_CTX *ctx, fr_dcursor_t *out, rlm_date_t const *inst, request_t *request, char const *fmt, time_t date)
 
static int mod_bootstrap (module_inst_ctx_t const *mctx)
 
static xlat_action_t xlat_date_convert (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Get or convert time and date. More...
 

Variables

static const conf_parser_t module_config []
 
module_rlm_t rlm_date
 
static xlat_arg_parser_t const xlat_date_convert_args []
 

Detailed Description

Translates timestrings between formats.

Author
Artur Malinowski (artur.nosp@m.@wow.nosp@m..com)

Definition in file rlm_date.c.


Data Structure Documentation

◆ rlm_date_t

struct rlm_date_t

Definition at line 32 of file rlm_date.c.

Data Fields
char const * fmt
bool utc

Function Documentation

◆ date_convert_string()

static xlat_action_t date_convert_string ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
request_t request,
const char *  str,
rlm_date_t const *  inst 
)
static

Definition at line 44 of file rlm_date.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ date_encode_strftime()

static xlat_action_t date_encode_strftime ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
rlm_date_t const *  inst,
request_t request,
char const *  fmt,
time_t  date 
)
static

Definition at line 109 of file rlm_date.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_bootstrap()

static int mod_bootstrap ( module_inst_ctx_t const *  mctx)
static

Definition at line 232 of file rlm_date.c.

+ Here is the call graph for this function:

Variable Documentation

◆ module_config

const conf_parser_t module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("format", rlm_date_t, fmt), .dflt = "%b %e %Y %H:%M:%S %Z" },
{ FR_CONF_OFFSET("utc", rlm_date_t, utc), .dflt = "no" },
}
static int const char * fmt
Definition: acutest.h:573
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:627
#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
Definition: cf_parse.h:268

Definition at line 37 of file rlm_date.c.

◆ rlm_date

module_rlm_t rlm_date
Initial value:
= {
.common = {
.name = "date",
.inst_size = sizeof(rlm_date_t),
.bootstrap = mod_bootstrap
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:63
static const conf_parser_t config[]
Definition: base.c:183
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Definition: rlm_date.c:232
static const conf_parser_t module_config[]
Definition: rlm_date.c:37

Definition at line 243 of file rlm_date.c.

◆ xlat_date_convert_args

xlat_arg_parser_t const xlat_date_convert_args[]
static
Initial value:
= {
{ .required = true, .single = true, .type = FR_TYPE_VOID },
}
@ FR_TYPE_VOID
User data.
Definition: merged_model.c:127
#define XLAT_ARG_PARSER_TERMINATOR
Definition: xlat.h:166

Definition at line 138 of file rlm_date.c.