IP directed broadcast
[vpp.git] / src / vnet / interface.h
index b582dba..d869b0c 100644 (file)
@@ -578,6 +578,7 @@ typedef enum
   /* A sub-interface. */
   VNET_SW_INTERFACE_TYPE_SUB,
   VNET_SW_INTERFACE_TYPE_P2P,
+  VNET_SW_INTERFACE_TYPE_PIPE,
 } vnet_sw_interface_type_t;
 
 typedef struct
@@ -647,32 +648,40 @@ typedef enum
 
 extern vnet_mtu_t vnet_link_to_mtu (vnet_link_t link);
 
-/* Software-interface.  This corresponds to a Ethernet VLAN, ATM vc, a
-   tunnel, etc.  Configuration (e.g. IP address) gets attached to
-   software interface. */
-typedef struct
+typedef enum vnet_sw_interface_flags_t_
 {
-  vnet_sw_interface_type_t type:16;
-
-  u16 flags;
   /* Interface is "up" meaning adminstratively up.
      Up in the sense of link state being up is maintained by hardware interface. */
-#define VNET_SW_INTERFACE_FLAG_ADMIN_UP (1 << 0)
+  VNET_SW_INTERFACE_FLAG_ADMIN_UP = (1 << 0),
 
   /* Interface is disabled for forwarding: punt all traffic to slow-path. */
-#define VNET_SW_INTERFACE_FLAG_PUNT (1 << 1)
+  VNET_SW_INTERFACE_FLAG_PUNT = (1 << 1),
 
-#define VNET_SW_INTERFACE_FLAG_PROXY_ARP (1 << 2)
+  VNET_SW_INTERFACE_FLAG_PROXY_ARP = (1 << 2),
 
-#define VNET_SW_INTERFACE_FLAG_UNNUMBERED (1 << 3)
+  VNET_SW_INTERFACE_FLAG_UNNUMBERED = (1 << 3),
 
-#define VNET_SW_INTERFACE_FLAG_BOND_SLAVE (1 << 4)
+  VNET_SW_INTERFACE_FLAG_BOND_SLAVE = (1 << 4),
 
   /* Interface does not appear in CLI/API */
-#define VNET_SW_INTERFACE_FLAG_HIDDEN (1 << 5)
+  VNET_SW_INTERFACE_FLAG_HIDDEN = (1 << 5),
 
   /* Interface in ERROR state */
-#define VNET_SW_INTERFACE_FLAG_ERROR (1 << 6)
+  VNET_SW_INTERFACE_FLAG_ERROR = (1 << 6),
+
+  /* Interface has IP configured directed broadcast */
+  VNET_SW_INTERFACE_FLAG_DIRECTED_BCAST = (1 << 7),
+
+} __attribute__ ((packed)) vnet_sw_interface_flags_t;
+
+/* Software-interface.  This corresponds to a Ethernet VLAN, ATM vc, a
+   tunnel, etc.  Configuration (e.g. IP address) gets attached to
+   software interface. */
+typedef struct
+{
+  vnet_sw_interface_type_t type:16;
+
+  vnet_sw_interface_flags_t flags;
 
   /* Index for this interface. */
   u32 sw_if_index;
@@ -737,6 +746,26 @@ typedef enum
        _x <= VNET_INTERFACE_COUNTER_TX_BROADCAST;               \
        _x++)
 
+#define foreach_simple_interface_counter_name  \
+  _(DROP, drops, if)                           \
+  _(PUNT, punt, if)                            \
+  _(IP4, ip4, if)                              \
+  _(IP6, ip6, if)                              \
+  _(RX_NO_BUF, rx-no-buf, if)                  \
+  _(RX_MISS, rx-miss, if)                      \
+  _(RX_ERROR, rx-error, if)                    \
+  _(TX_ERROR, tx-error, if)
+
+#define foreach_combined_interface_counter_name        \
+  _(RX, rx, if)                                        \
+  _(RX_UNICAST, rx-unicast, if)                        \
+  _(RX_MULTICAST, rx-multicast, if)            \
+  _(RX_BROADCAST, rx-broadcast, if)            \
+  _(TX, tx, if)                                        \
+  _(TX_UNICAST, tx-unicast-miss, if)           \
+  _(TX_MULTICAST, tx-multicast, if)            \
+  _(TX_BROADCAST, tx-broadcast, if)
+
 typedef enum
 {
   COLLECT_SIMPLE_STATS = 0,