ethdev: add IGMP key field to flow API
[dpdk.git] / lib / librte_ethdev / rte_flow.h
index 391a44a..350566c 100644 (file)
@@ -470,6 +470,20 @@ enum rte_flow_item_type {
         * See struct rte_flow_item_pppoe_proto_id.
         */
        RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID,
+
+       /**
+        * Matches Network service header (NSH).
+        * See struct rte_flow_item_nsh.
+        *
+        */
+       RTE_FLOW_ITEM_TYPE_NSH,
+
+       /**
+        * Matches Internet Group Management Protocol (IGMP).
+        * See struct rte_flow_item_igmp.
+        *
+        */
+       RTE_FLOW_ITEM_TYPE_IGMP,
 };
 
 /**
@@ -1307,6 +1321,61 @@ struct rte_flow_item_mark {
        uint32_t id; /**< Integer value to match against. */
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_NSH
+ *
+ * Match network service header (NSH), RFC 8300
+ *
+ */
+struct rte_flow_item_nsh {
+       uint32_t version:2;
+       uint32_t oam_pkt:1;
+       uint32_t reserved:1;
+       uint32_t ttl:6;
+       uint32_t length:6;
+       uint32_t reserved1:4;
+       uint32_t mdtype:4;
+       uint32_t next_proto:8;
+       uint32_t spi:24;
+       uint32_t sindex:8;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_NSH. */
+#ifndef __cplusplus
+static const struct rte_flow_item_nsh rte_flow_item_nsh_mask = {
+       .mdtype = 0xf,
+       .next_proto = 0xff,
+       .spi = 0xffffff,
+       .sindex = 0xff,
+};
+#endif
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_IGMP
+ *
+ * Match Internet Group Management Protocol (IGMP), RFC 2236
+ *
+ */
+struct rte_flow_item_igmp {
+       uint32_t type:8;
+       uint32_t max_resp_time:8;
+       uint32_t checksum:16;
+       uint32_t group_addr;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_IGMP. */
+#ifndef __cplusplus
+static const struct rte_flow_item_igmp rte_flow_item_igmp_mask = {
+       .group_addr = 0xffffffff,
+};
+#endif
+
 /**
  * Matching pattern item definition.
  *