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

RADIUS master protocol handler. More...

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

Go to the source code of this file.

Functions

static int auth_type_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
static int auth_type_parse (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 Parse auth_type. More...
 
static int8_t client_cmp (void const *one, void const *two)
 
static int mod_bootstrap (module_inst_ctx_t const *mctx)
 Bootstrap the application. More...
 
static int mod_decode (UNUSED void const *instance, request_t *request, uint8_t *const data, size_t data_len)
 Decode the packet. 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_load (void)
 
static int mod_open (void *instance, fr_schedule_t *sc, UNUSED CONF_SECTION *conf)
 Open listen sockets/connect to external event source. More...
 
static void mod_unload (void)
 
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_attr_t const * attr_additional_data
 
static fr_dict_attr_t const * attr_bfd_packet
 
static fr_dict_attr_t const * attr_my_discriminator
 
static fr_dict_attr_t const * attr_packet_type
 
static fr_dict_attr_t const * attr_your_discriminator
 
static fr_dict_t const * dict_bfd
 
static const conf_parser_t peer_config []
 
fr_app_t proto_bfd
 
static conf_parser_t const proto_bfd_config []
 How to parse a BFD listen section. More...
 
fr_dict_autoload_t proto_bfd_dict []
 
fr_dict_attr_autoload_t proto_bfd_dict_attr []
 

Detailed Description

RADIUS master protocol handler.

Id
4c394e4251781396e7de9c865f7a2f1ac933915e

Definition in file proto_bfd.c.

Function Documentation

◆ auth_type_parse() [1/2]

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

◆ auth_type_parse() [2/2]

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

Parse auth_type.

Parameters
[in]ctxto allocate data in (instance of proto_bfd).
[out]outWhere to write the auth_type value
[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 160 of file proto_bfd.c.

+ Here is the call graph for this function:

◆ client_cmp()

static int8_t client_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 89 of file proto_bfd.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

Bootstrap the application.

Bootstrap I/O and type submodules.

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

Definition at line 409 of file proto_bfd.c.

+ Here is the call graph for this function:

◆ mod_decode()

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

Decode the packet.

Definition at line 180 of file proto_bfd.c.

+ Here is the call graph for this function:

◆ 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 268 of file proto_bfd.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 371 of file proto_bfd.c.

◆ mod_load()

static int mod_load ( void  )
static

Definition at line 544 of file proto_bfd.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 349 of file proto_bfd.c.

+ Here is the call graph for this function:

◆ mod_unload()

static void mod_unload ( void  )
static

Definition at line 553 of file proto_bfd.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_bfd).
[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 108 of file proto_bfd.c.

+ Here is the call graph for this function:

Variable Documentation

◆ attr_additional_data

fr_dict_attr_t const* attr_additional_data
static

Definition at line 72 of file proto_bfd.c.

◆ attr_bfd_packet

fr_dict_attr_t const* attr_bfd_packet
static

Definition at line 69 of file proto_bfd.c.

◆ attr_my_discriminator

fr_dict_attr_t const* attr_my_discriminator
static

Definition at line 70 of file proto_bfd.c.

◆ attr_packet_type

fr_dict_attr_t const* attr_packet_type
static

Definition at line 68 of file proto_bfd.c.

◆ attr_your_discriminator

fr_dict_attr_t const* attr_your_discriminator
static

Definition at line 71 of file proto_bfd.c.

◆ dict_bfd

fr_dict_t const* dict_bfd
static

Definition at line 60 of file proto_bfd.c.

◆ peer_config

const conf_parser_t peer_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("min_transmit_interval", bfd_session_t, desired_min_tx_interval ) },
{ FR_CONF_OFFSET("min_receive_interval", bfd_session_t, required_min_rx_interval ) },
{ FR_CONF_OFFSET("max_timeouts", bfd_session_t, detect_multi ) },
{ FR_CONF_OFFSET("demand", bfd_session_t, demand_mode ) },
{ FR_CONF_OFFSET_TYPE_FLAGS("auth_type", FR_TYPE_VOID, 0, bfd_session_t, auth_type ),
.func = auth_type_parse },
{ FR_CONF_OFFSET("port", bfd_session_t, port ) },
}
#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
#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 auth_type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)

Definition at line 46 of file proto_bfd.c.

◆ proto_bfd

fr_app_t proto_bfd
Initial value:
= {
.common = {
.name = "bfd",
.config = proto_bfd_config,
.inst_size = sizeof(proto_bfd_t),
.onload = mod_load,
.unload = mod_unload,
.bootstrap = mod_bootstrap,
},
.dict = &dict_bfd,
.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 int mod_load(void)
Definition: proto_bfd.c:544
static ssize_t mod_encode(UNUSED void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
Definition: proto_bfd.c:268
static conf_parser_t const proto_bfd_config[]
How to parse a BFD listen section.
Definition: proto_bfd.c:39
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Bootstrap the application.
Definition: proto_bfd.c:409
static void mod_unload(void)
Definition: proto_bfd.c:553
static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *const data, size_t data_len)
Decode the packet.
Definition: proto_bfd.c:180
static fr_dict_t const * dict_bfd
Definition: proto_bfd.c:60
static int mod_instantiate(module_inst_ctx_t const *mctx)
Instantiate the application.
Definition: proto_bfd.c:371
static int mod_open(void *instance, fr_schedule_t *sc, UNUSED CONF_SECTION *conf)
Open listen sockets/connect to external event source.
Definition: proto_bfd.c:349
An instance of a proto_radius listen section.
Definition: proto_bfd.h:33
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1312

Definition at line 558 of file proto_bfd.c.

◆ proto_bfd_config

conf_parser_t const proto_bfd_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET_TYPE_FLAGS("transport", FR_TYPE_VOID, 0, proto_bfd_t, io.submodule),
.func = transport_parse },
}
static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)

How to parse a BFD listen section.

Definition at line 39 of file proto_bfd.c.

◆ proto_bfd_dict

fr_dict_autoload_t proto_bfd_dict
Initial value:
= {
{ .out = &dict_bfd, .proto = "bfd" },
{ NULL }
}

Definition at line 63 of file proto_bfd.c.

◆ proto_bfd_dict_attr

fr_dict_attr_autoload_t proto_bfd_dict_attr
Initial value:
= {
{ .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_bfd},
{ .out = &attr_bfd_packet, .name = "Packet", .type = FR_TYPE_STRUCT, .dict = &dict_bfd},
{ .out = &attr_my_discriminator, .name = "Packet.my-discriminator", .type = FR_TYPE_UINT32, .dict = &dict_bfd},
{ .out = &attr_your_discriminator, .name = "Packet.your-discriminator", .type = FR_TYPE_UINT32, .dict = &dict_bfd},
{ .out = &attr_additional_data, .name = "Additional-Data", .type = FR_TYPE_GROUP, .dict = &dict_bfd},
{ NULL }
}
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
@ FR_TYPE_STRUCT
like TLV, but without T or L, and fixed-width children
Definition: merged_model.c:119
@ FR_TYPE_GROUP
A grouping of other attributes.
Definition: merged_model.c:124
static fr_dict_attr_t const * attr_packet_type
Definition: proto_bfd.c:68
static fr_dict_attr_t const * attr_bfd_packet
Definition: proto_bfd.c:69
static fr_dict_attr_t const * attr_my_discriminator
Definition: proto_bfd.c:70
static fr_dict_attr_t const * attr_additional_data
Definition: proto_bfd.c:72
static fr_dict_attr_t const * attr_your_discriminator
Definition: proto_bfd.c:71

Definition at line 75 of file proto_bfd.c.