gbp: add anonymous l3-out external interfaces
[vpp.git] / src / vnet / l2 / l2_output.h
index 6da3e30..1cc1e73 100644 (file)
@@ -28,8 +28,6 @@
 typedef struct
 {
 
-  u32 feature_bitmap;
-
   /*
    * vlan tag rewrite for ingress and egress
    * ingress vtr is located here because the same config data is used for
@@ -40,9 +38,7 @@ typedef struct
   ptr_config_t input_pbb_vtr;
   ptr_config_t output_pbb_vtr;
 
-  /* some of these flags may get integrated into the feature bitmap */
-  u8 fwd_enable;
-  u8 flood_enable;
+  u32 feature_bitmap;
 
   /* split horizon group */
   u8 shg;
@@ -75,14 +71,19 @@ typedef struct
   vnet_main_t *vnet_main;
 } l2output_main_t;
 
-l2output_main_t l2output_main;
+extern l2output_main_t l2output_main;
+
+extern vlib_node_registration_t l2output_node;
 
 /* L2 output features */
 
-/* Mappings from feature ID to graph node name */
+/* Mappings from feature ID to graph node name in reverse order */
 #define foreach_l2output_feat \
  _(OUTPUT,            "interface-output")           \
- _(SPAN,              "feature-bitmap-drop")        \
+ _(SPAN,              "span-l2-output")             \
+ _(GBP_POLICY_LPM,    "gbp-policy-lpm")            \
+ _(GBP_POLICY_PORT,   "gbp-policy-port")            \
+ _(GBP_POLICY_MAC,    "gbp-policy-mac")             \
  _(CFM,               "feature-bitmap-drop")        \
  _(QOS,               "feature-bitmap-drop")        \
  _(ACL,               "l2-output-acl")              \
@@ -92,6 +93,7 @@ l2output_main_t l2output_main;
  _(STP_BLOCKED,       "feature-bitmap-drop")        \
  _(LINESTATUS_DOWN,   "feature-bitmap-drop")        \
  _(OUTPUT_CLASSIFY,   "l2-output-classify")        \
+ _(OUTPUT_FEAT_ARC,   "l2-output-feat-arc")        \
  _(XCRW,             "l2-xcrw")
 
 /* Feature bitmap positions */
@@ -103,9 +105,12 @@ typedef enum
     L2OUTPUT_N_FEAT,
 } l2output_feat_t;
 
+STATIC_ASSERT (L2OUTPUT_N_FEAT <= 32, "too many l2 output features");
+
 /* Feature bit masks */
 typedef enum
 {
+  L2OUTPUT_FEAT_NONE = 0,
 #define _(sym,str) L2OUTPUT_FEAT_##sym = (1<<L2OUTPUT_FEAT_##sym##_BIT),
   foreach_l2output_feat
 #undef _
@@ -137,6 +142,8 @@ typedef enum
 /* Return an array of strings containing graph node names of each feature */
 char **l2output_get_feat_names (void);
 
+/* arg0 - u32 feature_bitmap, arg1 - u32 verbose */
+u8 *format_l2_output_features (u8 * s, va_list * args);
 
 /**
  * The next set of functions is for use by output feature graph nodes.
@@ -155,7 +162,8 @@ l2_output_config_t *l2output_intf_config (u32 sw_if_index);
 
 /** Enable (or disable) the feature in the bitmap for the given interface */
 void l2output_intf_bitmap_enable (u32 sw_if_index,
-                                 u32 feature_bitmap, u32 enable);
+                                 l2output_feat_masks_t feature_bitmap,
+                                 u32 enable);
 
 #endif