24#include <freeradius-devel/util/debug.h>
25#include <freeradius-devel/bfd/bfd.h>
51 CONF_SECTION *recv_ ## _x; \
52 CONF_SECTION *send_ ## _x
67#define PROCESS_PACKET_TYPE fr_bfd_packet_code_t
68#define PROCESS_CODE_MAX FR_BFD_CODE_MAX
69#define PROCESS_PACKET_CODE_VALID FR_BFD_PACKET_CODE_VALID
70#define PROCESS_INST process_bfd_t
72#define PROCESS_SEND_RECV (1)
74#include <freeradius-devel/server/process.h>
95 REDEBUG(
"Invalid BFD packet type %u",
vp->vp_uint32);
98 state =
vp->vp_uint32;
104 REDEBUG(
"Invalid BFD state %u",
vp->vp_uint8);
107 state =
vp->vp_uint8;
112 request->reply->code = state;
114 request->reply->timestamp =
fr_time();
127 .recv = recv_generic,
128 .resume = resume_recv_bfd,
135 .recv = recv_generic,
136 .resume = resume_recv_bfd,
143 .recv = recv_generic,
144 .resume = resume_recv_bfd,
151 .recv = recv_generic,
152 .resume = resume_recv_bfd,
163 .send = send_generic,
164 .resume = resume_send_generic,
170 .send = send_generic,
171 .resume = resume_send_generic,
177 .send = send_generic,
178 .resume = resume_send_generic,
184 .send = send_generic,
185 .resume = resume_send_generic,
192 fr_process_state_t
const *state;
200 request->component =
"bfd";
201 request->module = NULL;
214 return state->send(p_result, mctx, request);
219 UPDATE_STATE(packet);
222 REDEBUG(
"Invalid packet type (%u)", request->packet->code);
226 return state->recv(p_result, mctx, request);
232#define SEND_RECV(_x, _y) \
234 .section = SECTION_NAME("recv", _x), \
235 .actions = &mod_actions_postauth, \
236 .offset = PROCESS_CONF_OFFSET(recv_ ## _y), \
239 .section = SECTION_NAME("send", _x), \
240 .actions = &mod_actions_postauth, \
241 .offset = PROCESS_CONF_OFFSET(send_ ## _y), \
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
@ UNLANG_ACTION_CALCULATE_RESULT
Calculate a new section rlm_rcode_t value.
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
#define DICT_AUTOLOAD_TERMINATOR
Specifies an attribute which must be present for the module to function.
Specifies a dictionary which must be loaded/loadable for the module to function.
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
fr_dict_attr_t const * attr_packet_type
@ BFD_WRAPPER_SEND_PACKET
@ BFD_WRAPPER_RECV_PACKET
@ FR_TYPE_UINT8
8 Bit unsigned integer.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_STRUCT
like TLV, but without T or L, and fixed-width children
module_instance_t const * mi
Instance of the module being instantiated.
Temporary structure to hold arguments for module calls.
fr_pair_t * fr_pair_find_by_da_nested(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find a pair with a matching fr_dict_attr_t, by walking the nested fr_dict_attr_t tree.
fr_pair_t * fr_pair_find_by_da(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find the first pair with a matching da.
static unlang_action_t mod_process(unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request)
static const virtual_server_compile_t compile_list[]
fr_dict_autoload_t process_bfd_dict[]
static fr_dict_attr_t const * attr_bfd_packet
process_bfd_sections_t sections
fr_process_module_t process_bfd
static fr_dict_attr_t const * attr_bfd_state
static fr_process_state_t const process_state_reply[]
fr_dict_attr_autoload_t process_bfd_dict_attr[]
RESUME_FLAG(recv_bfd, UNUSED,)
static fr_dict_t const * dict_bfd
#define SEND_RECV(_x, _y)
#define PROCESS_PACKET_CODE_VALID
static fr_process_state_t const process_state_packet[]
#define PROCESS_TRACE
Trace each state function as it's entered.
module_t common
Common fields for all loadable modules.
Common public symbol definition for all process modules.
#define RETURN_UNLANG_FAIL
rlm_rcode_t
Return codes indicating the result of the module call.
@ RLM_MODULE_FAIL
Module failed, don't reply.
@ RLM_MODULE_NOOP
Module succeeded without doing anything.
@ RLM_MODULE_NUMCODES
How many valid return codes there are.
void * data
Module's instance data.
#define MODULE_RCTX(_ctype)
#define MODULE_INST(_ctype)
init
Enter the EAP-IDENTITY state.
Stores an attribute, a value and various bits of other data.
#define talloc_get_type_abort_const
#define COMPILE_TERMINATOR
Processing sections which are allowed in this virtual server.