#include <freeradius-devel/server/base.h>
#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/unlang/base.h>
#include <freeradius-devel/util/debug.h>
#include "proto_cron.h"
Go to the source code of this file.
|
static int | mod_instantiate (void *instance, CONF_SECTION *conf) |
| Instantiate the application. More...
|
|
static int | mod_open (void *instance, fr_schedule_t *sc, UNUSED CONF_SECTION *conf) |
| Open listen sockets/connect to external event source. More...
|
|
static int | parse_field (CONF_ITEM *ci, char const **start, char const *name, unsigned int min, unsigned int max) |
|
static int | time_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
|
static int | time_parse (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule) |
| Checks the syntax of a cron job. More...
|
|
static int | type_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
|
static int | type_parse (UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule) |
| Translates the packet-type into a submodule name. More...
|
|
◆ mod_instantiate()
static int mod_instantiate |
( |
void * |
instance, |
|
|
CONF_SECTION * |
conf |
|
) |
| |
|
static |
Instantiate the application.
Instantiate I/O and type submodules.
- Parameters
-
[in] | instance | Ctx data for this application. |
[in] | conf | Listen section parsed to give us instance. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 395 of file cron.c.
◆ mod_open()
Open listen sockets/connect to external event source.
- Parameters
-
[in] | instance | Ctx data for this application. |
[in] | sc | to add our file descriptor to. |
[in] | conf | Listen section parsed to give us instance. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 334 of file cron.c.
◆ parse_field()
static int parse_field |
( |
CONF_ITEM * |
ci, |
|
|
char const ** |
start, |
|
|
char const * |
name, |
|
|
unsigned int |
min, |
|
|
unsigned int |
max |
|
) |
| |
|
static |
◆ time_parse() [1/2]
◆ time_parse() [2/2]
Checks the syntax of a cron job.
- Parameters
-
[in] | ctx | to allocate data in (instance of proto_cron). |
[out] | out | Where to write a module_instance_t containing the module handle and instance. |
[in] | parent | Base structure address. |
[in] | ci | CONF_PAIR specifying the name of the type module. |
[in] | rule | unused. |
- Returns
- 0 on success.
- -1 on failure.
https://github.com/staticlibs/ccronexpr/blob/master/ccronexpr.c
Definition at line 279 of file cron.c.
◆ type_parse() [1/2]
◆ type_parse() [2/2]
Translates the packet-type into a submodule name.
- Parameters
-
[in] | ctx | to allocate data in (instance of proto_cron). |
[out] | out | Where to write a module_instance_t containing the module handle and instance. |
[in] | parent | Base structure address. |
[in] | ci | CONF_PAIR specifying the name of the type module. |
[in] | rule | unused. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 81 of file cron.c.
◆ dict_cron
◆ limit_config
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
#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 at line 34 of file cron.c.
◆ proto_cron
Initial value:= {
.magic = RLM_MODULE_INIT,
.name = "cron",
}
static int mod_instantiate(void *instance, CONF_SECTION *conf)
Instantiate the application.
static conf_parser_t const proto_cron_config[]
How to parse a CRON listen section.
static int mod_open(void *instance, fr_schedule_t *sc, UNUSED CONF_SECTION *conf)
Open listen sockets/connect to external event source.
static int instantiate(module_inst_ctx_t const *mctx)
Definition at line 436 of file cron.c.
◆ proto_cron_config
Initial value:= {
}
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
#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
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
@ CONF_FLAG_FILE_INPUT
File matching value must exist, and must be readable.
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
#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
static conf_parser_t const limit_config[]
static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
static int time_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
fr_aka_sim_id_type_t type
How to parse a CRON listen section.
Definition at line 47 of file cron.c.
◆ proto_cron_dict
Initial value:= {
{ .out = &
dict_cron, .proto =
"freeradius" },
{ NULL }
}
static fr_dict_t const * dict_cron
Definition at line 65 of file cron.c.
◆ time_names
Initial value:= {
{
L(
"annually"),
"0 0 1 1 *" },
{
L(
"daily"),
"0 0 * * *" },
{
L(
"hourly"),
"0 * * * *" },
{
L(
"midnight"),
"0 0 * * *" },
{
L(
"monthly"),
"0 0 1 * *" },
{
L(
"weekly"),
"0 0 * * 0" },
{
L(
"yearly"),
"0 0 1 1 *" },
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition at line 252 of file cron.c.
◆ time_names_len