ip: Sub Address Family types. Feature enable for each SAFI
[vpp.git] / src / vnet / ip / ip_types.h
index f779fe7..fa1f0fe 100644 (file)
@@ -38,9 +38,43 @@ extern fib_protocol_t ip_address_family_to_fib_proto (ip_address_family_t af);
 extern ip_address_family_t ip_address_family_from_fib_proto (fib_protocol_t
                                                             fp);
 
+typedef enum ip_sub_address_family_t_
+{
+  SAFI_UNICAST,
+  SAFI_MULTICAST,
+} __clib_packed ip_sub_address_family_t;
+
+#define N_SAFI (SAFI_MULTICAST+1)
+
+extern uword unformat_ip_sub_address_family (unformat_input_t * input,
+                                            va_list * args);
+extern u8 *format_ip_sub_address_family (u8 * s, va_list * args);
+
+#define FOR_EACH_IP_ADDRESS_SUB_FAMILY(_safi) \
+  for (_safi = SAFI_UNICAST; _safi <= SAFI_MULTICAST; _safi++)
+
 #define u8_ptr_add(ptr, index) (((u8 *)ptr) + index)
 #define u16_net_add(u, val) clib_host_to_net_u16(clib_net_to_host_u16(u) + (val))
 
+/**
+ * Locations in the IP switch path where features can be applied
+ */
+#define foreach_ip_feature_location                 \
+  _(INPUT, "input")                                 \
+  _(OUTPUT, "output")                               \
+  _(LOCAL, "local")                                 \
+  _(PUNT, "punt")                                   \
+  _(DROP, "drop")                                   \
+
+typedef enum ip_feature_location_t_
+{
+#define _(a,b) IP_FEATURE_##a,
+  foreach_ip_feature_location
+#undef _
+} __clib_packed ip_feature_location_t;
+
+#define N_IP_FEATURE_LOCATIONS (IP_FEATURE_DROP+1)
+
 /* *INDENT-OFF* */
 typedef struct ip_address
 {