The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
proto_control.c File Reference

CONTROL master protocol handler. More...

#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/util/debug.h>
#include "proto_control.h"
+ Include dependency graph for proto_control.c:

Go to the source code of this file.

Functions

static int mod_bootstrap (module_inst_ctx_t const *mctx)
 Bootstrap the application. More...
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 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 transport_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
static int transport_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 Wrapper around dl_instance. More...
 

Variables

static fr_dict_t const * dict_control
 
static conf_parser_t const limit_config []
 
fr_app_t proto_control
 
static conf_parser_t const proto_control_config []
 How to parse a CONTROL listen section. More...
 
fr_dict_autoload_t proto_control_dict []
 

Detailed Description

CONTROL master protocol handler.

Id
42644eff2d460f5b67eb615c260158e51dfc4001

Definition in file proto_control.c.

Function Documentation

◆ mod_bootstrap()

static int mod_bootstrap ( module_inst_ctx_t const *  mctx)
static

Bootstrap the application.

Bootstrap I/O and type submodules.

Returns
  • 0 on success.
  • -1 on failure.

Definition at line 181 of file proto_control.c.

+ Here is the call graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Instantiate the application.

Instantiate I/O and type submodules.

Returns
  • 0 on success.
  • -1 on failure.

Definition at line 146 of file proto_control.c.

+ Here is the call graph for this function:

◆ mod_open()

static int mod_open ( void *  instance,
fr_schedule_t sc,
UNUSED CONF_SECTION conf 
)
static

Open listen sockets/connect to external event source.

Parameters
[in]instanceCtx data for this application.
[in]scto add our file descriptor to.
[in]confListen section parsed to give us instance.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 127 of file proto_control.c.

+ Here is the call graph for this function:

◆ transport_parse() [1/2]

static int transport_parse ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
conf_parser_t const *  rule 
)
static

◆ transport_parse() [2/2]

static int transport_parse ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule 
)
static

Wrapper around dl_instance.

Parameters
[in]ctxto allocate data in (instance of proto_control).
[out]outWhere to write a dl_module_inst_t containing the module handle and instance.
[in]parentBase structure address.
[in]ciCONF_PAIR specifying the name of the type module.
[in]ruleunused.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 79 of file proto_control.c.

+ Here is the call graph for this function:

Variable Documentation

◆ dict_control

fr_dict_t const* dict_control
static

Definition at line 60 of file proto_control.c.

◆ limit_config

conf_parser_t const limit_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("idle_timeout", proto_control_t, io.idle_timeout), .dflt = "30.0" } ,
{ FR_CONF_OFFSET("nak_lifetime", proto_control_t, io.nak_lifetime), .dflt = "30.0" } ,
{ FR_CONF_OFFSET("max_connections", proto_control_t, io.max_connections), .dflt = "1024" } ,
{ FR_CONF_OFFSET("max_clients", proto_control_t, io.max_clients), .dflt = "256" } ,
{ FR_CONF_OFFSET("max_pending_packets", proto_control_t, io.max_pending_packets), .dflt = "256" } ,
{ FR_CONF_OFFSET("max_packet_size", proto_control_t, max_packet_size) } ,
{ FR_CONF_OFFSET("num_messages", proto_control_t, num_messages) } ,
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:626
#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
An instance of a proto_control listen section.
Definition: proto_control.h:33

Definition at line 32 of file proto_control.c.

◆ proto_control

fr_app_t proto_control
Initial value:
= {
.common = {
.name = "control",
.inst_size = sizeof(proto_control_t),
.bootstrap = mod_bootstrap,
},
.open = mod_open,
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:65
static conf_parser_t const proto_control_config[]
How to parse a CONTROL listen section.
Definition: proto_control.c:52
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Bootstrap the application.
static int mod_instantiate(module_inst_ctx_t const *mctx)
Instantiate the application.
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: rlm_rest.c:1312

Definition at line 226 of file proto_control.c.

◆ proto_control_config

conf_parser_t const proto_control_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET_TYPE_FLAGS("transport", FR_TYPE_VOID, 0, proto_control_t, io.submodule),
.func = transport_parse },
{ FR_CONF_POINTER("limit", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) limit_config },
}
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
Definition: cf_parse.h:310
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition: cf_parse.h:400
#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
Definition: cf_parse.h:241
@ FR_TYPE_VOID
User data.
Definition: merged_model.c:127
static conf_parser_t const limit_config[]
Definition: proto_control.c:32
static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)

How to parse a CONTROL listen section.

Definition at line 52 of file proto_control.c.

◆ proto_control_dict

fr_dict_autoload_t proto_control_dict
Initial value:
= {
{ .out = &dict_control, .proto = "freeradius" },
{ NULL }
}
static fr_dict_t const * dict_control
Definition: proto_control.c:60

Definition at line 63 of file proto_control.c.