X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffeature%2Ffeature.h;h=70a456ee7c1036b90da794b9d258cf284be5ca96;hb=72d2c4f3718ba5293e9e0fa8726406ee7d9f3940;hp=eb6c95ca2c2bae80fec69c6144e43b8d3302875f;hpb=f13a8787365300d757eca4624c8f8a6b7c49392b;p=vpp.git diff --git a/src/vnet/feature/feature.h b/src/vnet/feature/feature.h index eb6c95ca2c2..70a456ee7c1 100644 --- a/src/vnet/feature/feature.h +++ b/src/vnet/feature/feature.h @@ -109,6 +109,14 @@ static void __vnet_add_feature_arc_registration_##x (void) \ vnet_feat_arc_##x.next = fm->next_arc; \ fm->next_arc = & vnet_feat_arc_##x; \ } \ +static void __vnet_rm_feature_arc_registration_##x (void) \ + __attribute__((__destructor__)) ; \ +static void __vnet_rm_feature_arc_registration_##x (void) \ +{ \ + vnet_feature_main_t * fm = &feature_main; \ + vnet_feature_arc_registration_t *r = &vnet_feat_arc_##x; \ + VLIB_REMOVE_FROM_LINKED_LIST (fm->next_arc, r, next); \ +} \ __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x #define VNET_FEATURE_INIT(x,...) \ @@ -121,6 +129,14 @@ static void __vnet_add_feature_registration_##x (void) \ vnet_feat_##x.next = fm->next_feature; \ fm->next_feature = & vnet_feat_##x; \ } \ +static void __vnet_rm_feature_registration_##x (void) \ + __attribute__((__destructor__)) ; \ +static void __vnet_rm_feature_registration_##x (void) \ +{ \ + vnet_feature_main_t * fm = &feature_main; \ + vnet_feature_registration_t *r = &vnet_feat_##x; \ + VLIB_REMOVE_FROM_LINKED_LIST (fm->next_feature, r, next); \ +} \ __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x void