16 #ifndef included_ip_table_h 17 #define included_ip_table_h 26 #define VNET_IP_TABLE_FUNC_N_PRIO ((vnet_ip_table_function_priority_t)VNET_IP_TABLE_FUNC_PRIORITY_HIGH+1) 28 #ifndef CLIB_MARCH_VARIANT 29 #define _VNET_IP_TABLE_FUNCTION_DECL_PRIO(f,tag,p) \ 31 static void __vnet_ip_table_function_init_##tag##_##f (void) \ 32 __attribute__((__constructor__)) ; \ 34 static void __vnet_ip_table_function_init_##tag##_##f (void) \ 36 vnet_main_t * vnm = vnet_get_main(); \ 37 static _vnet_ip_table_function_list_elt_t init_function; \ 38 init_function.next_ip_table_function = vnm->tag##_functions[p]; \ 39 vnm->tag##_functions[p] = &init_function; \ 40 init_function.fp = (void *) &f; \ 42 static void __vnet_ip_table_function_deinit_##tag##_##f (void) \ 43 __attribute__((__destructor__)) ; \ 45 static void __vnet_ip_table_function_deinit_##tag##_##f (void) \ 47 vnet_main_t * vnm = vnet_get_main(); \ 48 _vnet_ip_table_function_list_elt_t *next; \ 49 if (vnm->tag##_functions[p]->fp == f) \ 51 vnm->tag##_functions[p] = \ 52 vnm->tag##_functions[p]->next_ip_table_function; \ 55 next = vnm->tag##_functions[p]; \ 56 while (next->next_ip_table_function) \ 58 if (next->next_ip_table_function->fp == f) \ 60 next->next_ip_table_function = \ 61 next->next_ip_table_function->next_ip_table_function; \ 64 next = next->next_ip_table_function; \ 70 #define _VNET_IP_TABLE_FUNCTION_DECL_PRIO(f,tag,p) \ 71 static __clib_unused void * __clib_unused_##f = f; 74 #define _VNET_IP_TABLE_FUNCTION_DECL(f,tag) \ 75 _VNET_IP_TABLE_FUNCTION_DECL_PRIO(f,tag,VNET_ITF_FUNC_PRIORITY_LOW) 77 #define VNET_IP_TABLE_ADD_DEL_FUNCTION(f) \ 78 _VNET_IP_TABLE_FUNCTION_DECL(f,ip_table_add_del) vnet_ip_table_function_priority_t_
enum vnet_ip_table_function_priority_t_ vnet_ip_table_function_priority_t