The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
base.c File Reference

Base, utility functions for the unlang library. More...

#include "unlang_priv.h"
+ Include dependency graph for base.c:

Go to the source code of this file.

Functions

void unlang_global_free (void)
 
int unlang_global_init (void)
 
void unlang_register (int type, unlang_op_t *op)
 Register an operation with the interpreter. More...
 
bool unlang_section (CONF_SECTION *cs)
 Return whether a section has unlang data associated with it. More...
 

Variables

static uint32_t instance_count
 
static TALLOC_CTX * unlang_ctx = NULL
 
unlang_op_t unlang_ops [UNLANG_TYPE_MAX]
 Different operations the interpreter can execute. More...
 

Detailed Description

Base, utility functions for the unlang library.

Id
e5555ed76b7f2453e656103f55b0541963f530ca

Definition in file base.c.

Function Documentation

◆ unlang_global_free()

void unlang_global_free ( void  )

Definition at line 134 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_global_init()

int unlang_global_init ( void  )

Definition at line 74 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_register()

void unlang_register ( int  type,
unlang_op_t op 
)

Register an operation with the interpreter.

The main purpose of this registration API is to avoid intermixing the xlat, condition, map APIs with the interpreter, i.e. the callbacks needed for that functionality can be in their own source files, and we don't need to include supporting types and function declarations in the interpreter.

Later, this could potentially be used to register custom operations for modules.

The reason why there's a function instead of accessing the unlang_op array directly, is because 'type' really needs to go away, as needing to add ops to the unlang_type_t enum breaks the pluggable module model. If there's no explicit/consistent type values we need to enumerate the operations ourselves.

Parameters
[in]typeOperation identifier. Used to map compiled unlang code to operations.
[in]opunlang_op to register.

Definition at line 65 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_section()

bool unlang_section ( CONF_SECTION cs)

Return whether a section has unlang data associated with it.

Parameters
[in]csto check.
Returns
  • true if it has data.
  • false if it doesn't have data.

Definition at line 42 of file base.c.

Variable Documentation

◆ instance_count

uint32_t instance_count
static

Definition at line 29 of file base.c.

◆ unlang_ctx

TALLOC_CTX* unlang_ctx = NULL
static

Definition at line 72 of file base.c.

◆ unlang_ops

Different operations the interpreter can execute.

Definition at line 33 of file base.c.