25 RCSID(
"$Id: 68d0e4bdda18d332034a04ac6ec03659b5517992 $")
27 #include <freeradius-devel/server/state.h>
28 #include <freeradius-devel/server/pair.h>
41 packet_type_vp->vp_uint32 = request->reply->code;
88 if (!packet_type_vp) {
90 REDEBUG(
"No such value '%d' of attribute 'Packet-Type' for server %s",
97 if (!type_enum)
goto bad_packet_type;
102 request->packet->code = packet_type_vp->vp_uint32;
112 packet_type_vp->vp_uint32 = request->packet->code;
116 request->packet->code = packet_type_vp->vp_uint32;
166 REDEBUG(
"No Packet-Type attribute available");
202 .server_cs = server_cs,
256 .debug_braces =
true,
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
@ UNLANG_ACTION_PUSHED_CHILD
unlang_t pushed a new child onto the stack, execute it instead of continuing.
@ UNLANG_ACTION_FAIL
Encountered an unexpected error.
@ UNLANG_ACTION_CALCULATE_RESULT
Calculate a new section rlm_rcode_t value.
static unlang_action_t unlang_call_resume(UNUSED rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
static unlang_action_t unlang_call_children(rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
void unlang_call_init(void)
CONF_SECTION * unlang_call_current(request_t *request)
Return the last virtual server that was called.
unlang_action_t unlang_call_push(request_t *request, CONF_SECTION *server_cs, bool top_frame)
Push a call frame onto the stack.
static unlang_action_t unlang_call_frame_init(rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
static unlang_call_t * unlang_group_to_call(unlang_group_t *g)
Cast a group structure to the call keyword extension.
CONF_SECTION * server_cs
Config section of the virtual server being executed.
static unlang_t * unlang_call_to_generic(unlang_call_t *call)
Cast a call keyword extension to a unlang_t structure.
fr_dict_attr_t const * attr_packet_type
Attribute used to specify packet type and sections run in the server_cs.
unlang_group_t group
Generic field common to all group type unlang_t nodes.
Entry point into a proto_ module.
A section grouping multiple CONF_PAIR.
char const * cf_section_name2(CONF_SECTION const *cs)
Return the second identifier of a CONF_SECTION.
#define CF_TO_ITEM(_cf)
Auto cast from the input type to CONF_ITEM (which is the base type)
static fr_dict_attr_t const * attr_packet_type
fr_dict_attr_t const * fr_dict_attr_by_name(fr_dict_attr_err_t *err, fr_dict_attr_t const *parent, char const *attr))
Locate a fr_dict_attr_t by its name.
fr_dict_enum_value_t * fr_dict_enum_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value)
Lookup the structure representing an enum value in a fr_dict_attr_t.
fr_dict_attr_t const * fr_dict_root(fr_dict_t const *dict)
Return the root attribute of a dictionary.
Value of an enumerated attribute.
int unlang_interpret_push(request_t *request, unlang_t const *instruction, rlm_rcode_t default_rcode, bool do_next_sibling, bool top_frame)
Push a new frame onto the stack.
unlang_action_t unlang_interpret_push_children(rlm_rcode_t *p_result, request_t *request, rlm_rcode_t default_rcode, bool do_next_sibling)
Push the children of the current frame onto a new frame onto the stack.
void unlang_register(int type, unlang_op_t *op)
Register an operation with the interpreter.
static char * stack[MAX_STACK]
static uint8_t depth(fr_minmax_heap_index_t i)
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.
#define pair_update_request(_attr, _da)
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_NOT_SET
Error resolving rcode (should not be returned by modules).
@ RLM_MODULE_NOOP
Module succeeded without doing anything.
@ RLM_MODULE_HANDLED
The module handled the request, so stop.
#define pair_update_reply(_attr, _da)
Return or allocate a fr_pair_t in the reply list.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
Stores an attribute, a value and various bits of other data.
fr_dict_attr_t const *_CONST da
Dictionary attribute defines the attribute number, vendor and type of the pair.
#define UNLANG_NEXT_SIBLING
static unlang_group_t * unlang_generic_to_group(unlang_t const *p)
static int stack_depth_current(request_t *request)
@ UNLANG_TYPE_CALL
call another virtual server
static void frame_repeat(unlang_stack_frame_t *frame, unlang_process_t process)
Mark the current stack frame up for repeat, and set a new process function.
unlang_t const * instruction
The unlang node we're evaluating.
rlm_rcode_t result
The result from executing the instruction.
unlang_type_t type
The specialisation of this node.
unlang_t * children
Children beneath this group.
Generic representation of a grouping.
Our interpreter stack, as distinct from the C stack.
An unlang stack associated with a request.
#define fr_box_uint32(_val)
unlang_action_t virtual_server_push(request_t *request, CONF_SECTION *server_cs, bool top_frame)
Set the request processing function.
fr_dict_t const * virtual_server_dict_by_cs(CONF_SECTION const *server_cs)
Return the namespace for the virtual server specified by a config section.