ethdev: allow action with any config object type
[dpdk.git] / lib / librte_ethdev / rte_flow.h
index 5f52359..bc41023 100644 (file)
@@ -628,7 +628,7 @@ static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
  * Note: IPv4 options are handled by dedicated pattern items.
  */
 struct rte_flow_item_ipv4 {
-       struct ipv4_hdr hdr; /**< IPv4 header definition. */
+       struct rte_ipv4_hdr hdr; /**< IPv4 header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */
@@ -650,7 +650,7 @@ static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
  * RTE_FLOW_ITEM_TYPE_IPV6_EXT.
  */
 struct rte_flow_item_ipv6 {
-       struct ipv6_hdr hdr; /**< IPv6 header definition. */
+       struct rte_ipv6_hdr hdr; /**< IPv6 header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */
@@ -692,7 +692,7 @@ static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {
  * Matches a UDP header.
  */
 struct rte_flow_item_udp {
-       struct udp_hdr hdr; /**< UDP header definition. */
+       struct rte_udp_hdr hdr; /**< UDP header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
@@ -711,7 +711,7 @@ static const struct rte_flow_item_udp rte_flow_item_udp_mask = {
  * Matches a TCP header.
  */
 struct rte_flow_item_tcp {
-       struct tcp_hdr hdr; /**< TCP header definition. */
+       struct rte_tcp_hdr hdr; /**< TCP header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
@@ -730,7 +730,7 @@ static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
  * Matches a SCTP header.
  */
 struct rte_flow_item_sctp {
-       struct sctp_hdr hdr; /**< SCTP header definition. */
+       struct rte_sctp_hdr hdr; /**< SCTP header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
@@ -1244,9 +1244,10 @@ struct rte_flow_item {
 /**
  * Action types.
  *
- * Each possible action is represented by a type. Some have associated
- * configuration structures. Several actions combined in a list can be
- * assigned to a flow rule and are performed in order.
+ * Each possible action is represented by a type.
+ * An action can have an associated configuration object.
+ * Several actions combined in a list can be assigned
+ * to a flow rule and are performed in order.
  *
  * They fall in three categories:
  *
@@ -1650,6 +1651,62 @@ enum rte_flow_action_type {
         * See struct rte_flow_action_set_mac.
         */
        RTE_FLOW_ACTION_TYPE_SET_MAC_DST,
+
+       /**
+        * Increase sequence number in the outermost TCP header.
+        *
+        * Action configuration specifies the value to increase
+        * TCP sequence number as a big-endian 32 bit integer.
+        *
+        * @p conf type:
+        * @code rte_be32_t * @endcode
+        *
+        * Using this action on non-matching traffic will result in
+        * undefined behavior.
+        */
+       RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ,
+
+       /**
+        * Decrease sequence number in the outermost TCP header.
+        *
+        * Action configuration specifies the value to decrease
+        * TCP sequence number as a big-endian 32 bit integer.
+        *
+        * @p conf type:
+        * @code rte_be32_t * @endcode
+        *
+        * Using this action on non-matching traffic will result in
+        * undefined behavior.
+        */
+       RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ,
+
+       /**
+        * Increase acknowledgment number in the outermost TCP header.
+        *
+        * Action configuration specifies the value to increase
+        * TCP acknowledgment number as a big-endian 32 bit integer.
+        *
+        * @p conf type:
+        * @code rte_be32_t * @endcode
+
+        * Using this action on non-matching traffic will result in
+        * undefined behavior.
+        */
+       RTE_FLOW_ACTION_TYPE_INC_TCP_ACK,
+
+       /**
+        * Decrease acknowledgment number in the outermost TCP header.
+        *
+        * Action configuration specifies the value to decrease
+        * TCP acknowledgment number as a big-endian 32 bit integer.
+        *
+        * @p conf type:
+        * @code rte_be32_t * @endcode
+        *
+        * Using this action on non-matching traffic will result in
+        * undefined behavior.
+        */
+       RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK,
 };
 
 /**
@@ -2136,11 +2193,11 @@ struct rte_flow_action_set_mac {
  *
  * A list of actions is terminated by a END action.
  *
- * For simple actions without a configuration structure, conf remains NULL.
+ * For simple actions without a configuration object, conf remains NULL.
  */
 struct rte_flow_action {
        enum rte_flow_action_type type; /**< Action type. */
-       const void *conf; /**< Pointer to action configuration structure. */
+       const void *conf; /**< Pointer to action configuration object. */
 };
 
 /**