@@ -1437,6 +1437,23 @@ void odp_packet_l3_chksum_insert(odp_packet_t pkt, int l3);
void odp_packet_l4_chksum_insert(odp_packet_t pkt, int l4);
/**
+ * Ones' complement sum of IP payload data
+ *
+ * Returns 16-bit ones' complement sum calculated over IP payload data in the
+ * packet (includes L4 headers, excludes Ethernet CRC). In case of odd number of
+ * bytes, calculation uses a zero byte as padding at the end. The sum may be
+ * used as part of e.g. UDP/TCP checksum checking, especially with IP
+ * fragments.
+ *
+ * Use odp_packet_has_ones_comp() to check if the sum has been set.
+ *
+ * @param pkt Packet handle
+ *
+ * @return Ones' complement sum of IP payload data
+ */
+uint16_t odp_packet_ones_comp(odp_packet_t pkt);
+
+/**
* Packet flow hash value
*
* Returns the hash generated from the packet header. Use
@@ -277,6 +277,15 @@ int odp_packet_has_sctp(odp_packet_t pkt);
int odp_packet_has_icmp(odp_packet_t pkt);
/**
+ * Check for ones' complement sum
+ *
+ * @param pkt Packet handle
+ * @retval non-zero if packet contains ones' complement sum
+ * @retval 0 if packet does not contain ones' complement sum
+ */
+int odp_packet_has_ones_comp(odp_packet_t pkt);
+
+/**
* Check for packet flow hash
*
* @param pkt Packet handle