FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
init.h File Reference
+ Include dependency graph for init.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vlib_config_function_runtime_t
 

Macros

#define VLIB_INIT_FUNCTION_SYMBOL(x)   _VLIB_INIT_FUNCTION_SYMBOL(x, init)
 
#define VLIB_MAIN_LOOP_ENTER_FUNCTION_SYMBOL(x)   _VLIB_INIT_FUNCTION_SYMBOL(x, main_loop_enter)
 
#define VLIB_MAIN_LOOP_EXIT_FUNCTION_SYMBOL(x)   _VLIB_INIT_FUNCTION_SYMBOL(x, main_loop_exit)
 
#define VLIB_CONFIG_FUNCTION_SYMBOL(x)   _VLIB_INIT_FUNCTION_SYMBOL(x, config)
 
#define VLIB_DECLARE_INIT_FUNCTION(x, tag)
 
#define VLIB_INIT_FUNCTION(x)   VLIB_DECLARE_INIT_FUNCTION(x,init)
 
#define VLIB_WORKER_INIT_FUNCTION(x)   VLIB_DECLARE_INIT_FUNCTION(x,worker_init)
 
#define VLIB_MAIN_LOOP_ENTER_FUNCTION(x)   VLIB_DECLARE_INIT_FUNCTION(x,main_loop_enter)
 
#define VLIB_MAIN_LOOP_EXIT_FUNCTION(x)   VLIB_DECLARE_INIT_FUNCTION(x,main_loop_exit)
 
#define VLIB_CONFIG_FUNCTION(x, n, ...)
 
#define VLIB_EARLY_CONFIG_FUNCTION(x, n, ...)
 
#define vlib_call_init_function(vm, x)
 
#define vlib_mark_init_function_complete(vm, x)
 
#define vlib_call_post_graph_init_function(vm, x)
 
#define vlib_call_config_function(vm, x)
 
#define foreach_vlib_module_reference
 

Typedefs

typedef clib_error_t *( vlib_init_function_t) (struct vlib_main_t *vm)
 
typedef clib_error_t *( vlib_config_function_t) (struct vlib_main_t *vm, unformat_input_t *input)
 
typedef struct vlib_config_function_runtime_t vlib_config_function_runtime_t
 

Functions

clib_error_tvlib_call_all_init_functions (struct vlib_main_t *vm)
 
clib_error_tvlib_call_all_config_functions (struct vlib_main_t *vm, unformat_input_t *input, int is_early)
 
clib_error_tvlib_call_all_main_loop_enter_functions (struct vlib_main_t *vm)
 
clib_error_tvlib_call_all_main_loop_exit_functions (struct vlib_main_t *vm)
 
clib_error_tvlib_call_init_exit_functions (struct vlib_main_t *vm, _vlib_init_function_list_elt_t *head, int call_once)
 

Macro Definition Documentation

#define foreach_vlib_module_reference
Value:
_ (node_cli) \
_ (trace_cli)

Definition at line 224 of file init.h.

#define vlib_call_config_function (   vm,
 
)
Value:
({ \
clib_error_t * _error = 0; \
\
if (! hash_get (vm->init_functions_called, _r->function)) \
{ \
hash_set1 (vm->init_functions_called, _r->function); \
_error = _r->function (vm, &_r->input); \
} \
_error; \
})
#define VLIB_CONFIG_FUNCTION_SYMBOL(x)
Definition: init.h:91
#define hash_get(h, key)
Definition: hash.h:248
#define hash_set1(h, key)
Definition: hash.h:257
struct vlib_config_function_runtime_t vlib_config_function_runtime_t

Definition at line 196 of file init.h.

#define vlib_call_init_function (   vm,
 
)
Value:
({ \
clib_error_t * _error = 0; \
if (! hash_get (vm->init_functions_called, _f)) \
{ \
hash_set1 (vm->init_functions_called, _f); \
_error = _f (vm); \
} \
_error; \
})
#define hash_get(h, key)
Definition: hash.h:248
clib_error_t *( vlib_init_function_t)(struct vlib_main_t *vm)
Definition: init.h:51
#define hash_set1(h, key)
Definition: hash.h:257
#define VLIB_INIT_FUNCTION_SYMBOL(x)
Definition: init.h:85

Definition at line 162 of file init.h.

#define vlib_call_post_graph_init_function (   vm,
 
)
Value:
({ \
extern vlib_init_function_t * VLIB_POST_GRAPH_INIT_FUNCTION_SYMBOL (x); \
vlib_init_function_t * _f = VLIB_POST_GRAPH_INIT_FUNCTION_SYMBOL (x); \
clib_error_t * _error = 0; \
if (! hash_get (vm->init_functions_called, _f)) \
{ \
hash_set1 (vm->init_functions_called, _f); \
_error = _f (vm); \
} \
_error; \
})
#define hash_get(h, key)
Definition: hash.h:248
clib_error_t *( vlib_init_function_t)(struct vlib_main_t *vm)
Definition: init.h:51
#define hash_set1(h, key)
Definition: hash.h:257

Definition at line 183 of file init.h.

#define VLIB_CONFIG_FUNCTION (   x,
  n,
  ... 
)
Value:
static void __vlib_add_config_function_##x (void) \
__attribute__((__constructor__)) ; \
static void __vlib_add_config_function_##x (void) \
{ \
VLIB_CONFIG_FUNCTION_SYMBOL(x).next_registration \
= vm->config_function_registrations; \
vm->config_function_registrations \
} \
= { \
.name = n, \
.function = x, \
.is_early = 0, \
}
#define VLIB_CONFIG_FUNCTION_SYMBOL(x)
Definition: init.h:91
struct vlib_main_t vlib_main_t
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23

Definition at line 119 of file init.h.

#define VLIB_CONFIG_FUNCTION_SYMBOL (   x)    _VLIB_INIT_FUNCTION_SYMBOL(x, config)

Definition at line 91 of file init.h.

#define VLIB_DECLARE_INIT_FUNCTION (   x,
  tag 
)
Value:
vlib_init_function_t * _VLIB_INIT_FUNCTION_SYMBOL (x, tag) = x; \
static void __vlib_add_##tag##_function_##x (void) \
__attribute__((__constructor__)) ; \
static void __vlib_add_##tag##_function_##x (void) \
{ \
static _vlib_init_function_list_elt_t _vlib_init_function; \
_vlib_init_function.next_init_function \
= vm->tag##_function_registrations; \
vm->tag##_function_registrations = &_vlib_init_function; \
_vlib_init_function.f = &x; \
}
struct vlib_main_t vlib_main_t
clib_error_t *( vlib_init_function_t)(struct vlib_main_t *vm)
Definition: init.h:51
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23

Definition at line 97 of file init.h.

#define VLIB_EARLY_CONFIG_FUNCTION (   x,
  n,
  ... 
)
Value:
static void __vlib_add_config_function_##x (void) \
__attribute__((__constructor__)) ; \
static void __vlib_add_config_function_##x (void) \
{ \
VLIB_CONFIG_FUNCTION_SYMBOL(x).next_registration \
= vm->config_function_registrations; \
vm->config_function_registrations \
} \
= { \
.name = n, \
.function = x, \
.is_early = 1, \
}
#define VLIB_CONFIG_FUNCTION_SYMBOL(x)
Definition: init.h:91
struct vlib_main_t vlib_main_t
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23

Definition at line 140 of file init.h.

#define VLIB_INIT_FUNCTION (   x)    VLIB_DECLARE_INIT_FUNCTION(x,init)

Definition at line 111 of file init.h.

#define VLIB_INIT_FUNCTION_SYMBOL (   x)    _VLIB_INIT_FUNCTION_SYMBOL(x, init)

Definition at line 85 of file init.h.

#define VLIB_MAIN_LOOP_ENTER_FUNCTION (   x)    VLIB_DECLARE_INIT_FUNCTION(x,main_loop_enter)

Definition at line 114 of file init.h.

#define VLIB_MAIN_LOOP_ENTER_FUNCTION_SYMBOL (   x)    _VLIB_INIT_FUNCTION_SYMBOL(x, main_loop_enter)

Definition at line 87 of file init.h.

#define VLIB_MAIN_LOOP_EXIT_FUNCTION (   x)    VLIB_DECLARE_INIT_FUNCTION(x,main_loop_exit)

Definition at line 116 of file init.h.

#define VLIB_MAIN_LOOP_EXIT_FUNCTION_SYMBOL (   x)    _VLIB_INIT_FUNCTION_SYMBOL(x, main_loop_exit)

Definition at line 89 of file init.h.

#define vlib_mark_init_function_complete (   vm,
 
)
Value:
({ \
hash_set1 (vm->init_functions_called, _f); \
})
clib_error_t *( vlib_init_function_t)(struct vlib_main_t *vm)
Definition: init.h:51
#define hash_set1(h, key)
Definition: hash.h:257
#define VLIB_INIT_FUNCTION_SYMBOL(x)
Definition: init.h:85

Definition at line 176 of file init.h.

#define VLIB_WORKER_INIT_FUNCTION (   x)    VLIB_DECLARE_INIT_FUNCTION(x,worker_init)

Definition at line 112 of file init.h.

Typedef Documentation

typedef clib_error_t*( vlib_config_function_t) (struct vlib_main_t *vm, unformat_input_t *input)

Definition at line 61 of file init.h.

typedef clib_error_t*( vlib_init_function_t) (struct vlib_main_t *vm)

Definition at line 51 of file init.h.

Function Documentation

clib_error_t* vlib_call_all_config_functions ( struct vlib_main_t vm,
unformat_input_t input,
int  is_early 
)

Definition at line 94 of file init.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_call_all_init_functions ( struct vlib_main_t vm)

Definition at line 67 of file init.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_call_all_main_loop_enter_functions ( struct vlib_main_t vm)

Definition at line 80 of file init.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_call_all_main_loop_exit_functions ( struct vlib_main_t vm)

Definition at line 87 of file init.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_call_init_exit_functions ( struct vlib_main_t vm,
_vlib_init_function_list_elt_t *  head,
int  call_once 
)

Definition at line 43 of file init.c.

+ Here is the caller graph for this function: