Applications can access the computed hash (if any) through these functions,
and query the length the platform supports to store.

Signed-off-by: Zoltan Kiss <[email protected]>
---
 include/odp/api/packet.h    | 16 ++++++++++++++++
 include/odp/api/packet_io.h | 14 ++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
index 3a454b5..66fa2a9 100644
--- a/include/odp/api/packet.h
+++ b/include/odp/api/packet.h
@@ -615,6 +615,22 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t 
offset);
 int odp_packet_is_segmented(odp_packet_t pkt);
 
 /**
+ * Hash pointer
+ *
+ * Returns pointer to the hash of the packet. Optionally returns the length of
+ * the hash as well.
+ *
+ * @param      pkt      Packet handle
+ * @param[out] len      Length of hash area (output).
+ *                      Ignored when NULL.
+ *
+ * @return  Hash pointer
+ *
+ * @see odp_pktio_hash_len()
+ */
+void *odp_packet_hash_ptr(odp_packet_t pkt, uint32_t *len);
+
+/**
  * Number of segments
  *
  * Returns number of segments in the packet. A packet has always at least one
diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index e00d011..a065567 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -321,6 +321,20 @@ int odp_pktio_skip_set(odp_pktio_t pktio, uint32_t offset);
 int odp_pktio_headroom_set(odp_pktio_t pktio, uint32_t headroom);
 
 /**
+ * Hash length
+ *
+ * Returns length of hash space for this packet IO.
+ *
+ * @param      pkt      Packet handle
+ *                      Ignored when NULL.
+ *
+ * @return  Hash length
+ *
+ * @see odp_packet_hash_ptr()
+ */
+uint32_t odp_pktio_hash_len(odp_pktio_t pktio);
+
+/**
  * Get printable value for an odp_pktio_t
  *
  * @param pktio   odp_pktio_t handle to be printed
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to