diff mbox series

[API-NEXT,v1,1/2] api: packet: separate checksum check flags

Message ID 1511992805-23399-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/2] api: packet: separate checksum check flags | expand

Commit Message

Github ODP bot Nov. 29, 2017, 10 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Separate union controlling different checksum checks. It will be used by
IPsec API.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 314 (lumag:ipsec-chksum)
 ** https://github.com/Linaro/odp/pull/314
 ** Patch: https://github.com/Linaro/odp/pull/314.patch
 ** Base sha: 4cb02e1caccb9179575e95448fd46979e17d0905
 ** Merge commit sha: 9750daf1153b3a13935f26f866bb2a23548e6e16
 **/
 include/odp/api/spec/packet.h | 46 ++++++++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index b897c9d3c..e04f85f7f 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -1178,6 +1178,31 @@  int odp_packet_move_data(odp_packet_t pkt, uint32_t dst_offset,
  *
  */
 
+/**
+ * Flags to control payload checksum checking
+ */
+typedef union odp_packet_parse_chksum_t {
+	/** Individual check bits. */
+	struct {
+		/** Check IPv4 header checksum */
+		uint32_t ipv4_chksum   : 1;
+
+		/** Check UDP checksum */
+		uint32_t udp_chksum    : 1;
+
+		/** Check TCP checksum */
+		uint32_t tcp_chksum    : 1;
+
+		/** Check SCTP checksum */
+		uint32_t sctp_chksum   : 1;
+
+	} check;
+
+	/** All check bits. This can be used to set/clear all flags. */
+	uint32_t all_check;
+
+} odp_packet_parse_chksum_t;
+
 /**
  * Packet parse parameters
  */
@@ -1194,26 +1219,7 @@  typedef struct odp_packet_parse_param_t {
 	 *  layer. Checksum checking status can be queried for each packet with
 	 *  odp_packet_l3_chksum_status() and odp_packet_l4_chksum_status().
 	 */
-	union {
-		/** Individual check bits. */
-		struct {
-			/** Check IPv4 header checksum */
-			uint32_t ipv4_chksum   : 1;
-
-			/** Check UDP checksum */
-			uint32_t udp_chksum    : 1;
-
-			/** Check TCP checksum */
-			uint32_t tcp_chksum    : 1;
-
-			/** Check SCTP checksum */
-			uint32_t sctp_chksum   : 1;
-
-		} check;
-
-		/** All check bits. This can be used to set/clear all flags. */
-		uint32_t all_check;
-	};
+	odp_packet_parse_chksum_t chksum;
 
 } odp_packet_parse_param_t;