RADIUS master protocol handler.
More...
#include <freeradius-devel/radius/radius.h>
#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <freeradius-devel/server/module_rlm.h>
#include "proto_radius.h"
Go to the source code of this file.
|
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 int | mod_priority_set (void const *instance, uint8_t const *buffer, UNUSED size_t buflen) |
|
static void | mod_unload (void) |
|
static xlat_action_t | packet_vector_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
| Get the authentication vector. 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...
|
|
RADIUS master protocol handler.
- Id
- 11f39a3f5f82c6bf83acf60e96ec0ca4693f9396
- Copyright
- 2017 Arran Cudbard-Bell (a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg)
-
2016 Alan DeKok (aland.nosp@m.@fre.nosp@m.eradi.nosp@m.us.o.nosp@m.rg)
Definition in file proto_radius.c.
◆ mod_bootstrap()
Bootstrap the application.
Bootstrap I/O and type submodules.
- Returns
- 0 on success.
- -1 on failure.
Definition at line 527 of file proto_radius.c.
◆ mod_decode()
◆ mod_encode()
◆ mod_instantiate()
Instantiate the application.
Instantiate I/O and type submodules.
- Returns
- 0 on success.
- -1 on failure.
Definition at line 489 of file proto_radius.c.
◆ mod_load()
static int mod_load |
( |
void |
| ) |
|
|
static |
◆ 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 467 of file proto_radius.c.
◆ mod_priority_set()
static int mod_priority_set |
( |
void const * |
instance, |
|
|
uint8_t const * |
buffer, |
|
|
UNUSED size_t |
buflen |
|
) |
| |
|
static |
◆ mod_unload()
static void mod_unload |
( |
void |
| ) |
|
|
static |
◆ packet_vector_xlat()
Get the authentication vector.
Note that we don't allow people to get the reply vector, because it doesn't exist until the reply is sent.
Definition at line 586 of file proto_radius.c.
◆ transport_parse() [1/2]
◆ transport_parse() [2/2]
Wrapper around dl_instance.
- Parameters
-
[in] | ctx | to allocate data in (instance of proto_radius). |
[out] | out | Where to write a dl_module_inst_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 156 of file proto_radius.c.
◆ type_parse() [1/2]
◆ type_parse() [2/2]
Wrapper around dl_instance which translates the packet-type into a submodule name.
If we found a Packet-Type = Access-Request CONF_PAIR for example, here's we'd load the proto_radius_auth module.
- Parameters
-
[in] | ctx | to allocate data in (instance of proto_radius). |
[out] | out | Where to write a dl_module_inst_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 123 of file proto_radius.c.
◆ attr_packet_type
◆ attr_state
◆ attr_user_name
◆ dict_radius
◆ 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
An instance of a proto_radius listen section.
Definition at line 36 of file proto_radius.c.
◆ priority_config
Initial value:= {
}
int cf_table_parse_int(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Generic function for parsing conf pair values as int.
size_t channel_packet_priority_len
fr_table_num_sorted_t const channel_packet_priority[]
@ FR_RADIUS_CODE_ACCESS_REQUEST
RFC2865 - Access-Request.
@ FR_RADIUS_CODE_DISCONNECT_REQUEST
RFC3575/RFC5176 - Disconnect-Request.
@ FR_RADIUS_CODE_STATUS_SERVER
RFC2865/RFC5997 - Status Server (request)
@ FR_RADIUS_CODE_COA_REQUEST
RFC3575/RFC5176 - CoA-Request.
@ FR_RADIUS_CODE_ACCOUNTING_REQUEST
RFC2866 - Accounting-Request.
Definition at line 54 of file proto_radius.c.
◆ proto_radius
Initial value:= {
.common = {
.name = "radius",
},
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static int mod_load(void)
static ssize_t mod_encode(UNUSED void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
static fr_dict_t const * dict_radius
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Bootstrap the application.
static void mod_unload(void)
static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *const data, size_t data_len)
Decode the packet.
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 mod_priority_set(void const *instance, uint8_t const *buffer, UNUSED size_t buflen)
static conf_parser_t const proto_radius_config[]
How to parse a RADIUS listen section.
static int instantiate(module_inst_ctx_t const *mctx)
Definition at line 626 of file proto_radius.c.
◆ proto_radius_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_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 const conf_parser_t priority_config[]
static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
How to parse a RADIUS listen section.
Definition at line 72 of file proto_radius.c.
◆ proto_radius_dict
◆ proto_radius_dict_attr
Initial value:= {
{ NULL }
}
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_OCTETS
Raw octets.
static fr_dict_attr_t const * attr_packet_type
static fr_dict_attr_t const * attr_state
static fr_dict_attr_t const * attr_user_name
Definition at line 102 of file proto_radius.c.