The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Typedefs | Functions
module_ctx.h File Reference

Temporary argument structures for module calls. More...

#include <freeradius-devel/util/event.h>
+ Include dependency graph for module_ctx.h:

Go to the source code of this file.

Data Structures

struct  module_ctx_t
 Temporary structure to hold arguments for module calls. More...
 
struct  module_detach_ctx_t
 Temporary structure to hold arguments for detach calls. More...
 
struct  module_inst_ctx_t
 Temporary structure to hold arguments for instantiation calls. More...
 
struct  module_thread_inst_ctx_t
 Temporary structure to hold arguments for thread_instantiation calls. More...
 

Macros

#define MODULE_CTX(_mi, _thread, _env_data, _rctx)   &(module_ctx_t){ .mi = _mi, .thread = _thread, .env_data = _env_data, .rctx = _rctx }
 Wrapper to create a module_ctx_t as a compound literal. More...
 
#define MODULE_CTX_FROM_INST(_mctx)   &(module_ctx_t){ .mi = (_mctx)->mi }
 Wrapper to create a module_ctx_t as a compound literal from a module_inst_ctx_t. More...
 
#define MODULE_CTX_FROM_THREAD_INST(_mctx)   &(module_ctx_t){ .mi = (_mctx)->mi, .thread = (_mctx)->thread, .env_data = (_mctx)->env_data }
 Wrapper to create a module_ctx_t as a compound literal from a module_inst_ctx_t. More...
 
#define MODULE_DETACH_CTX(_mi)   &(module_detach_ctx_t){ .mi = _mi }
 Wrapper to create a module_detach_ctx_t as a compound literal. More...
 
#define MODULE_INST_CTX(_mi)   &(module_inst_ctx_t){ .mi = _mi }
 Wrapper to create a module_inst_ctx_t as a compound literal. More...
 
#define MODULE_THREAD_INST_CTX(_mi, _thread, _el)   &(module_thread_inst_ctx_t){ .mi = _mi, .thread = _thread, .el = _el }
 Wrapper to create a module_thread_inst_ctx_t as a compound literal. More...
 
#define MODULE_THREAD_INST_CTX_FROM_INST_CTX(_mctx)   &(module_ctx_t){ .mi = (_mctx)->mi }
 Wrapper to create a module_inst_ctx_t as a comound listeral from a module_thread_ctx_t. More...
 

Typedefs

typedef struct module_instance_s module_instance_t
 

Functions

static module_ctx_tmodule_ctx_dup (TALLOC_CTX *ctx, module_ctx_t const *mctx)
 Duplicate a stack based module_ctx_t on the heap. More...
 
static module_ctx_tmodule_ctx_from_inst (TALLOC_CTX *ctx, module_inst_ctx_t const *mctx)
 Allocate a module calling ctx on the heap based on an instance ctx. More...
 
static module_ctx_tmodule_ctx_from_thread_inst (TALLOC_CTX *ctx, module_thread_inst_ctx_t const *mctx)
 Allocate a module calling ctx on the heap based on an instance ctx. More...
 

Detailed Description

Temporary argument structures for module calls.

Id
1db004302cc4620d69a8ece0a5fdbb22f1ca6a86

These get used in various places where we may not want to include the full module.h.

Definition in file module_ctx.h.


Data Structure Documentation

◆ module_ctx_t

struct module_ctx_t

Temporary structure to hold arguments for module calls.

Definition at line 41 of file module_ctx.h.

+ Collaboration diagram for module_ctx_t:
Data Fields
void * env_data Per call environment data.
module_instance_t const * mi Instance of the module being instantiated.
void * rctx Resume ctx that a module previously set.
void * thread Thread specific instance data.

◆ module_detach_ctx_t

struct module_detach_ctx_t

Temporary structure to hold arguments for detach calls.

Definition at line 56 of file module_ctx.h.

+ Collaboration diagram for module_detach_ctx_t:
Data Fields
module_instance_t * mi Module instance to detach.

◆ module_inst_ctx_t

struct module_inst_ctx_t

Temporary structure to hold arguments for instantiation calls.

Definition at line 50 of file module_ctx.h.

+ Collaboration diagram for module_inst_ctx_t:
Data Fields
module_instance_t * mi Instance of the module being instantiated.

◆ module_thread_inst_ctx_t

struct module_thread_inst_ctx_t

Temporary structure to hold arguments for thread_instantiation calls.

Definition at line 63 of file module_ctx.h.

+ Collaboration diagram for module_thread_inst_ctx_t:
Data Fields
fr_event_list_t * el Event list to register any IO handlers and timers against.
module_instance_t const * mi Instance of the module being instantiated.

Must come first to allow cast between module_inst_ctx.

void * thread Thread instance data.

Macro Definition Documentation

◆ MODULE_CTX

#define MODULE_CTX (   _mi,
  _thread,
  _env_data,
  _rctx 
)    &(module_ctx_t){ .mi = _mi, .thread = _thread, .env_data = _env_data, .rctx = _rctx }

Wrapper to create a module_ctx_t as a compound literal.

This is used so that the compiler will flag any uses of (module_ctx_t) which don't set the required fields. Additional arguments should be added to this macro whenever the module_ctx_t fields are altered.

Parameters
[in]_miof the module being called.
[in]_threadinstance of the module being called.
[in]_env_dataCall environment data.
[in]_rctxResume ctx (if any).

Definition at line 128 of file module_ctx.h.

◆ MODULE_CTX_FROM_INST

#define MODULE_CTX_FROM_INST (   _mctx)    &(module_ctx_t){ .mi = (_mctx)->mi }

Wrapper to create a module_ctx_t as a compound literal from a module_inst_ctx_t.

This is used so that the compiler will flag any uses of (module_ctx_t) which don't set the required fields. Additional arguments should be added to this macro whenever the module_ctx_t fields are altered.

Parameters
[in]_mctxto copy fields from.

Definition at line 138 of file module_ctx.h.

◆ MODULE_CTX_FROM_THREAD_INST

#define MODULE_CTX_FROM_THREAD_INST (   _mctx)    &(module_ctx_t){ .mi = (_mctx)->mi, .thread = (_mctx)->thread, .env_data = (_mctx)->env_data }

Wrapper to create a module_ctx_t as a compound literal from a module_inst_ctx_t.

This is used so that the compiler will flag any uses of (module_ctx_t) which don't set the required fields. Additional arguments should be added to this macro whenever the module_ctx_t fields are altered.

Parameters
[in]_mctxto copy fields from.

Definition at line 148 of file module_ctx.h.

◆ MODULE_DETACH_CTX

#define MODULE_DETACH_CTX (   _mi)    &(module_detach_ctx_t){ .mi = _mi }

Wrapper to create a module_detach_ctx_t as a compound literal.

Parameters
[in]_miof the module being called..

Definition at line 164 of file module_ctx.h.

◆ MODULE_INST_CTX

#define MODULE_INST_CTX (   _mi)    &(module_inst_ctx_t){ .mi = _mi }

Wrapper to create a module_inst_ctx_t as a compound literal.

This is used so that the compiler will flag any uses of (module_inst_ctx_t) which don't set the required fields. Additional arguments should be added to this macro whenever the module_inst_ctx_t fields are altered.

Parameters
[in]_miof the module being called..

Definition at line 158 of file module_ctx.h.

◆ MODULE_THREAD_INST_CTX

#define MODULE_THREAD_INST_CTX (   _mi,
  _thread,
  _el 
)    &(module_thread_inst_ctx_t){ .mi = _mi, .thread = _thread, .el = _el }

Wrapper to create a module_thread_inst_ctx_t as a compound literal.

This is used so that the compiler will flag any uses of (module_thread_inst_ctx_t) which don't set the required fields. Additional arguments should be added to this macro whenever the module_thread_inst_ctx_t fields are altered.

Parameters
[in]_miof the module being called.
[in]_threadinstance of the module being called.
[in]_elThread specific event list.

Definition at line 176 of file module_ctx.h.

◆ MODULE_THREAD_INST_CTX_FROM_INST_CTX

#define MODULE_THREAD_INST_CTX_FROM_INST_CTX (   _mctx)    &(module_ctx_t){ .mi = (_mctx)->mi }

Wrapper to create a module_inst_ctx_t as a comound listeral from a module_thread_ctx_t.

Extract the module_instance_t from a module_thread_inst_ctx_t.

Parameters
[in]_mctxto extract module_thread_inst_ctx_t from.

Definition at line 184 of file module_ctx.h.

Typedef Documentation

◆ module_instance_t

Definition at line 1 of file module_ctx.h.

Function Documentation

◆ module_ctx_dup()

static module_ctx_t* module_ctx_dup ( TALLOC_CTX *  ctx,
module_ctx_t const *  mctx 
)
static

Duplicate a stack based module_ctx_t on the heap.

Definition at line 105 of file module_ctx.h.

◆ module_ctx_from_inst()

static module_ctx_t* module_ctx_from_inst ( TALLOC_CTX *  ctx,
module_inst_ctx_t const *  mctx 
)
static

Allocate a module calling ctx on the heap based on an instance ctx.

Definition at line 76 of file module_ctx.h.

+ Here is the caller graph for this function:

◆ module_ctx_from_thread_inst()

static module_ctx_t* module_ctx_from_thread_inst ( TALLOC_CTX *  ctx,
module_thread_inst_ctx_t const *  mctx 
)
static

Allocate a module calling ctx on the heap based on an instance ctx.

Definition at line 90 of file module_ctx.h.