X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vnet%2Fvnet%2Ffeature%2Ffeature.h;h=96d573b69f63115de06e78d782bc907914f95adc;hb=7490a752814187ed03c0deca4d836b0dca09fb4b;hp=b026cdf1c8f54467e1e05996f11b21c94a0b96a0;hpb=8b3191e6d715760deefe550b59c7d92be4b5cda9;p=vpp.git diff --git a/vnet/vnet/feature/feature.h b/vnet/vnet/feature/feature.h index b026cdf1c8f..96d573b69f6 100644 --- a/vnet/vnet/feature/feature.h +++ b/vnet/vnet/feature/feature.h @@ -34,6 +34,10 @@ typedef struct _vnet_feature_arc_registration u8 *arc_index_ptr; } vnet_feature_arc_registration_t; +/* Enable feature callback. */ +typedef clib_error_t *(vnet_feature_enable_disable_function_t) + (u32 sw_if_index, int enable_disable); + /** feature registration object */ typedef struct _vnet_feature_registration { @@ -50,6 +54,9 @@ typedef struct _vnet_feature_registration char **runs_before; /** Constraints of the form "this feature runs after Y" */ char **runs_after; + + /** Function to enable/disable feature **/ + vnet_feature_enable_disable_function_t *enable_disable_cb; } vnet_feature_registration_t; typedef struct vnet_feature_config_main_t_ @@ -121,6 +128,9 @@ vnet_config_update_feature_count (vnet_feature_main_t * fm, u8 arc, u32 vnet_get_feature_index (u8 arc, const char *s); u8 vnet_get_feature_arc_index (const char *s); +vnet_feature_registration_t *vnet_get_feature_reg (const char *arc_name, + const char *node_name); + int vnet_feature_enable_disable_with_index (u8 arc_index, u32 feature_index, @@ -145,6 +155,13 @@ vnet_get_feature_arc_config_main (u8 arc_index) return &fm->feature_config_mains[arc_index]; } +static_always_inline vnet_feature_config_main_t * +vnet_feature_get_config_main (u16 arc) +{ + vnet_feature_main_t *fm = &feature_main; + return &fm->feature_config_mains[arc]; +} + static_always_inline int vnet_have_features (u8 arc, u32 sw_if_index) {