16 #ifndef included_features_h 17 #define included_features_h 22 typedef struct _vnet_feature_arc_registration
25 struct _vnet_feature_arc_registration *next;
32 u16 feature_arc_index;
36 typedef struct _vnet_feature_registration
39 struct _vnet_feature_registration *next;
46 u32 feature_index_u32;
89 #define VNET_FEATURE_ARC_INIT(x,...) \ 90 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x;\ 91 static void __vnet_add_feature_arc_registration_##x (void) \ 92 __attribute__((__constructor__)) ; \ 93 static void __vnet_add_feature_arc_registration_##x (void) \ 95 vnet_feature_main_t * fm = &feature_main; \ 96 vnet_feat_arc_##x.next = fm->next_arc; \ 97 fm->next_arc = & vnet_feat_arc_##x; \ 99 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x 101 #define VNET_FEATURE_INIT(x,...) \ 102 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x; \ 103 static void __vnet_add_feature_registration_##x (void) \ 104 __attribute__((__constructor__)) ; \ 105 static void __vnet_add_feature_registration_##x (void) \ 107 vnet_feature_main_t * fm = &feature_main; \ 108 vnet_feat_##x.next = fm->next_feature; \ 109 fm->next_feature = & vnet_feat_##x; \ 111 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x 115 u32 sw_if_index,
int is_add);
121 u32 sw_if_index,
int enable_disable,
122 void *feature_config,
123 u32 n_feature_config_bytes);
159 u32 sw_if_index,
u32 * next0,
161 u16 buffer_advanced0)
177 vnet_buffer (b0)->device_input_feat.saved_next_index = *next0;
178 vnet_buffer (b0)->device_input_feat.buffer_advance = buffer_advanced0;
188 #define ORDER_CONSTRAINTS (char*[]) 189 #define VNET_FEATURES(...) (char*[]) { __VA_ARGS__, 0} 194 int num_feature_start_nodes,
196 first_reg,
char ***feature_nodes);
vnet_config_main_t config_main
struct vnet_feature_config_main_t_ vnet_feature_config_main_t
static char * feature_start_nodes[]
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
void vnet_config_update_feature_count(vnet_feature_main_t *fm, u16 arc, u32 sw_if_index, int is_add)
char *** feature_nodes
Save partial order results for show command.
vnet_feature_registration_t * next_feature
feature path configuration lists
u32 * config_index_by_sw_if_index
#define static_always_inline
static_always_inline void vnet_feature_device_input_redirect_x1(vlib_node_runtime_t *node, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0, u16 buffer_advanced0)
vlib_main_t * vlib_main
convenience
vnet_feature_main_t feature_main
u32 vnet_feature_index_from_node_name(u16 type, const char *s)
clib_error_t * vnet_feature_arc_init(vlib_main_t *vm, vnet_config_main_t *vcm, char **feature_start_nodes, int num_feature_start_nodes, vnet_feature_registration_t *first_reg, char ***feature_nodes)
Initialize a feature graph arc.
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
static_always_inline void vnet_feature_redirect(u16 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
static_always_inline u32 vnet_feature_get_config_index(u16 arc, u32 sw_if_index)
uword ** next_feature_by_name
void vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
uword ** arc_index_by_name
i16 ** feature_count_by_sw_if_index
feature reference counts by interface
vnet_feature_registration_t ** next_feature_by_arc
#define vec_elt(v, i)
Get vector value at index i.
void vnet_interface_features_show(vlib_main_t *vm, u32 sw_if_index)
Display the set of driver features configured on a specific interface Called by "show interface" hand...
static_always_inline int vnet_have_features(u32 arc, u32 sw_if_index)
struct _vnet_feature_arc_registration vnet_feature_arc_registration_t
feature registration object
vnet_feature_arc_registration_t * next_arc
feature arc configuration list
uword ** sw_if_index_has_features
bitmap of interfaces which have driver rx features configured
vnet_feature_config_main_t * feature_config_mains
feature config main objects
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object