diff mbox series

[API-NEXT,v2,1/2] api: packet add L2 packet type to complement L3 and L4 types

Message ID 1518595209-773-2-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v2,1/2] api: packet add L2 packet type to complement L3 and L4 types | expand

Commit Message

Github ODP bot Feb. 14, 2018, 8 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


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

---
/** Email created from pull request 476 (lumag:l2-type)
 ** https://github.com/Linaro/odp/pull/476
 ** Patch: https://github.com/Linaro/odp/pull/476.patch
 ** Base sha: af7be638ef9ac98bdb1f2e4917f152889eb1850f
 ** Merge commit sha: 07d4eead898ce4cf6c7a574495f3622b7aa9d27d
 **/
 include/odp/api/abi-default/packet.h |  5 +++++
 include/odp/api/spec/packet.h        | 24 ++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h
index b83288d4c..f9efdc7c0 100644
--- a/include/odp/api/abi-default/packet.h
+++ b/include/odp/api/abi-default/packet.h
@@ -30,6 +30,11 @@  typedef _odp_abi_packet_seg_t *odp_packet_seg_t;
 #define ODP_PACKET_SEG_INVALID    ((odp_packet_seg_t)0xffffffff)
 #define ODP_PACKET_OFFSET_INVALID 0xffff
 
+typedef uint8_t odp_proto_l2_type_t;
+
+#define ODP_PROTO_L2_TYPE_NONE   0
+#define ODP_PROTO_L2_TYPE_ETH    1
+
 typedef uint8_t odp_proto_l3_type_t;
 
 #define ODP_PROTO_L3_TYPE_NONE   0
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 4be515c7b..423b492da 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -71,6 +71,19 @@  extern "C" {
   * Packet is red
   */
 
+/**
+ * @typedef odp_proto_l2_type_t
+ * Layer 2 protocol type
+ */
+
+/**
+ * @def ODP_PROTO_L2_TYPE_NONE
+ * Layer 2 protocol type not defined
+ *
+ * @def ODP_PROTO_L2_TYPE_ETH
+ * Layer 2 protocol is Ethernet
+ */
+
 /**
  * @typedef odp_proto_l3_type_t
  * Layer 3 protocol type
@@ -1615,6 +1628,17 @@  uint32_t odp_packet_l4_offset(odp_packet_t pkt);
  */
 int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset);
 
+/**
+ * Layer 2 protocol type
+ *
+ * Returns layer 2 protocol type. Initial type value is ODP_PROTO_L3_TYPE_NONE.
+ *
+ * @param      pkt      Packet handle
+ *
+ * @return Layer 2 protocol type
+ */
+odp_proto_l2_type_t odp_packet_l2_type(odp_packet_t pkt);
+
 /**
  * Layer 3 protocol type
  *