24 #include <freeradius-devel/server/protocol.h>
25 #include <freeradius-devel/util/debug.h>
26 #include <freeradius-devel/arp/arp.h>
61 #define PROCESS_PACKET_TYPE fr_arp_packet_code_t
62 #define PROCESS_CODE_MAX FR_ARP_CODE_MAX
63 #define PROCESS_CODE_DO_NOT_RESPOND FR_ARP_DO_NOT_RESPOND
64 #define PROCESS_PACKET_CODE_VALID FR_ARP_PACKET_CODE_VALID
65 #define PROCESS_INST process_arp_t
66 #include <freeradius-devel/server/process.h>
83 .resume = resume_recv_generic,
84 .section_offset = PROCESS_CONF_OFFSET(request),
100 .resume = resume_send_generic,
101 .section_offset = PROCESS_CONF_OFFSET(reply),
117 .recv = recv_generic,
118 .resume = resume_recv_generic,
119 .section_offset = PROCESS_CONF_OFFSET(reverse_request),
134 .send = send_generic,
135 .resume = resume_send_generic,
136 .section_offset = PROCESS_CONF_OFFSET(reverse_reply),
154 .send = send_generic,
155 .resume = resume_send_generic,
156 .section_offset = PROCESS_CONF_OFFSET(do_not_respond),
169 received ?
"Received" :
"Sending",
172 if (received || request->parent) {
181 fr_process_state_t
const *state;
188 request->component =
"arp";
189 request->module = NULL;
192 UPDATE_STATE(packet);
195 REDEBUG(
"Invalid packet type (%u)", request->packet->code);
201 return state->recv(p_result, mctx, request);
210 .offset = PROCESS_CONF_OFFSET(request),
216 .offset = PROCESS_CONF_OFFSET(reply),
222 .offset = PROCESS_CONF_OFFSET(recv_reply),
226 .name2 =
"Reverse-Request",
228 .offset = PROCESS_CONF_OFFSET(reverse_request),
233 .name2 =
"Reverse-Reply",
235 .offset = PROCESS_CONF_OFFSET(reverse_reply),
239 .name2 =
"Do-Not-Respond",
241 .offset = PROCESS_CONF_OFFSET(do_not_respond),
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
A section grouping multiple CONF_PAIR.
@ MOD_POST_AUTH
7 methods index for postauth section.
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.
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.
void *_CONST data
Module instance's parsed configuration.
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
void log_request_proto_pair_list(fr_log_lvl_t lvl, request_t *request, fr_pair_t const *parent, fr_pair_list_t const *vps, char const *prefix)
Print a list of protocol fr_pair_ts.
void log_request(fr_log_type_t type, fr_log_lvl_t lvl, request_t *request, char const *file, int line, char const *fmt,...)
Marshal variadic log arguments into a va_list and pass to normal logging functions.
void log_request_pair_list(fr_log_lvl_t lvl, request_t *request, fr_pair_t const *parent, fr_pair_list_t const *vps, char const *prefix)
Print a fr_pair_list_t.
@ L_DBG_LVL_1
Highest priority debug messages (-x).
@ L_DBG
Only displayed when debugging is enabled.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
dl_module_inst_t const * inst
Dynamic loader API handle for the module.
Temporary structure to hold arguments for module calls.
static fr_dict_attr_t const * attr_packet_type
static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
process_arp_sections_t sections
CONF_SECTION * reverse_reply
static void arp_packet_debug(request_t *request, fr_packet_t const *packet, fr_pair_list_t const *list, bool received)
fr_dict_autoload_t process_arp_dict[]
fr_dict_attr_autoload_t process_arp_dict_attr[]
static const virtual_server_compile_t compile_list[]
static fr_process_state_t const process_state[]
CONF_SECTION * recv_reply
static fr_dict_t const * dict_arp
CONF_SECTION * reverse_request
fr_process_module_t process_arp
#define PROCESS_PACKET_CODE_VALID
CONF_SECTION * do_not_respond
#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.
char const * fr_arp_packet_codes[FR_ARP_CODE_MAX]
rlm_rcode_t
Return codes indicating the result of the module call.
@ RLM_MODULE_INVALID
The module considers the request invalid.
@ RLM_MODULE_OK
The module is OK, continue.
@ RLM_MODULE_FAIL
Module failed, don't reply.
@ RLM_MODULE_DISALLOW
Reject the request (user is locked out).
@ RLM_MODULE_REJECT
Immediately reject the request.
@ RLM_MODULE_NOTFOUND
User not found.
@ RLM_MODULE_UPDATED
OK (pairs modified).
@ RLM_MODULE_NOOP
Module succeeded without doing anything.
#define talloc_get_type_abort_const
unsigned int code
Packet code (type).
#define COMPILE_TERMINATOR
char const * name
Name of the processing section, such as "recv" or "send".
Processing sections which are allowed in this virtual server.