Instruction (GNU Radius Reference Manual)

Next: , Up: Proposed Solution [Contents][Index]


A.3.1 Request-processing Instruction

Request-processing program consists of instructions. There are seven basic instruction types:

grad_instr_conditional_t

This instruction marks a branch point within the program.

grad_instr_call_t

Represents a call of a subprogram

grad_instr_action_t

Invokes a Rewrite function

grad_instr_proxy_t

Proxies a request to the remote server

grad_instr_forward_t

Forwards a request to the remote server

grad_instr_reply_t

Replies back to the requesting NAS.

Consequently, an instruction is defined as a union of the above node types:

Instruction: grad_instr_t
enum grad_instr_type
{
 grad_instr_conditional,
 grad_instr_call,
 grad_instr_return,
 grad_instr_action,
 grad_instr_reply,
 grad_instr_proxy,
 grad_instr_forward
};
typedef struct grad_instr grad_instr_t;
struct grad_instr
{
 enum grad_instr_type type;
 grad_instr_t *next;
 union
 {
 grad_instr_conditional_t cond;
 grad_instr_call_t call;
 grad_instr_action_t action;
 grad_instr_reply_t reply;
 grad_instr_proxy_t proxy;
 grad_instr_forward_t forward;
 } v;
};

Type member contains type of the instruction. The evaluator uses type to determine which part of union v, holds instruction-specific data.

Next points to the next instruction. The evaluator will go to this instruction unless the present one changes the control flow.

Finally, v contains instruction-specific data. These will be discussed in the following subsections.

AltStyle によって変換されたページ (->オリジナル) /