diff mbox series

[API-NEXT,v1,1/6] api: packet: add packet memset and memcmp-like functions

Message ID 1501506009-28910-2-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v1,1/6] api: packet: add packet memset and memcmp-like functions | expand

Commit Message

Github ODP bot July 31, 2017, 1 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Currently we have such functions in internal namespace for in-ODP use
only. Exporting them as a part of public API would allow using them from
tests and user applications.

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

---
/** Email created from pull request 94 (lumag:crypto-long-keys)
 ** https://github.com/Linaro/odp/pull/94
 ** Patch: https://github.com/Linaro/odp/pull/94.patch
 ** Base sha: c16f1363303cd5fc11324acbc4dfebe0a9680a41
 ** Merge commit sha: bab24526ba91a4499aff896c5e82d4ac3f03fea9
 **/
 include/odp/api/spec/packet.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 95f5349b..c3b2a76e 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -1135,6 +1135,39 @@  int odp_packet_copy_data(odp_packet_t pkt, uint32_t dst_offset,
 int odp_packet_move_data(odp_packet_t pkt, uint32_t dst_offset,
 			 uint32_t src_offset, uint32_t len);
 
+/**
+ * Set packet data to specific value
+ *
+ * Set 'len' bytes of packet data to value 'c' starting from 'offset'.  Maximum
+ * number of bytes to compare is packet data length minus the offset. Packet is
+ * not modified.
+ *
+ * @param pkt    Packet handle
+ * @param offset Byte offset into the packet
+ * @param c      Value to set
+ * @param len    Number of bytes to compare
+ */
+int odp_packet_set_data(odp_packet_t pkt, uint32_t offset,
+			uint8_t c, uint32_t len);
+
+/**
+ * Compare data with packet
+ *
+ * Compare 'len' bytes of data from the source address with the packet
+ * contentes starting from offset. Maximum number of bytes to compare is packet
+ * data length minus the offset. Packet is not modified.
+ *
+ * @param pkt    Packet handle
+ * @param offset Byte offset into the packet
+ * @param data   Data address
+ * @param len    Number of bytes to compare
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_packet_cmp_data(odp_packet_t pkt, uint32_t offset,
+			const void *data, uint32_t len);
+
 /*
  *
  * Meta-data