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

Load master protocol handler. More...

#include <freeradius-devel/io/application.h>
#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/io/schedule.h>
#include <freeradius-devel/radius/radius.h>
#include "proto_load.h"
+ Include dependency graph for proto_load.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_decode (void const *instance, request_t *request, uint8_t *const data, size_t data_len)
 Decode the packet, and set the request->process function. More...
 
static ssize_t mod_encode (UNUSED void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
 
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...
 
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)
 Wrapper around dl_instance which translates the packet-type into a submodule name. More...
 

Variables

fr_app_t proto_load
 
static conf_parser_t const proto_load_config []
 How to parse a Load listen section. More...
 

Detailed Description

Load master protocol handler.

Id
7577be3941a4cc14baaf1d18c481f7b65c2b6b57

Definition in file proto_load.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 264 of file proto_load.c.

+ Here is the call graph for this function:

◆ mod_decode()

static int mod_decode ( void const *  instance,
request_t request,
uint8_t *const  data,
size_t  data_len 
)
static

Decode the packet, and set the request->process function.

Definition at line 153 of file proto_load.c.

◆ mod_encode()

static ssize_t mod_encode ( UNUSED void const *  instance,
request_t request,
uint8_t buffer,
size_t  buffer_len 
)
static

Definition at line 180 of file proto_load.c.

◆ 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 230 of file proto_load.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 207 of file proto_load.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_load).
[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 119 of file proto_load.c.

+ Here is the call graph for this function:

◆ type_parse() [1/2]

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

◆ type_parse() [2/2]

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

Wrapper around dl_instance which translates the packet-type into a submodule name.

Parameters
[in]ctxto allocate data in (instance of proto_load).
[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 72 of file proto_load.c.

+ Here is the call graph for this function:

Variable Documentation

◆ proto_load

fr_app_t proto_load
Initial value:
= {
.common = {
.name = "load",
.config = proto_load_config,
.inst_size = sizeof(proto_load_t),
.bootstrap = mod_bootstrap,
},
.open = mod_open,
.decode = mod_decode,
.encode = mod_encode,
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:65
static ssize_t mod_encode(UNUSED void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
Definition: proto_load.c:180
static int mod_decode(void const *instance, request_t *request, uint8_t *const data, size_t data_len)
Decode the packet, and set the request->process function.
Definition: proto_load.c:153
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Bootstrap the application.
Definition: proto_load.c:264
static conf_parser_t const proto_load_config[]
How to parse a Load listen section.
Definition: proto_load.c:39
static int mod_instantiate(module_inst_ctx_t const *mctx)
Instantiate the application.
Definition: proto_load.c:230
static int mod_open(void *instance, fr_schedule_t *sc, UNUSED CONF_SECTION *conf)
Open listen sockets/connect to external event source.
Definition: proto_load.c:207
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1312

Definition at line 309 of file proto_load.c.

◆ proto_load_config

conf_parser_t const proto_load_config[]
static
Initial value:
= {
type), .func = type_parse },
{ FR_CONF_OFFSET_TYPE_FLAGS("transport", FR_TYPE_VOID, 0, proto_load_t, io.submodule),
.func = transport_parse, .dflt = "step" },
{ FR_CONF_OFFSET("max_entry_size", proto_load_t, max_packet_size) } ,
{ FR_CONF_OFFSET("max_packet_size", proto_load_t, max_packet_size) } ,
{ FR_CONF_OFFSET("num_messages", proto_load_t, num_messages) } ,
{ FR_CONF_OFFSET("priority", proto_load_t, priority) },
}
#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
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition: cf_parse.h:406
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
Definition: cf_parse.h:421
#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 int type_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, conf_parser_t const *rule)
fr_aka_sim_id_type_t type

How to parse a Load listen section.

Definition at line 39 of file proto_load.c.