aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>2018-02-14 10:06:58 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-02-26 14:17:14 +0300
commit570fb3e6e0fdc1b73ce813d205a57ba001261e82 (patch)
treebe0089a0c1bb8d11e8e39e9252a0c16b889dacb9 /include
parent8da57fbe43755a3bbab795ff3a15f06376dec7e0 (diff)
api: packet add L2 packet type to complement L3 and L4 types
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/odp/api/abi-default/packet.h5
-rw-r--r--include/odp/api/spec/packet.h24
2 files changed, 29 insertions, 0 deletions
diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h
index d3a1753f8..97c0d0883 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..079a1ae1b 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -72,6 +72,19 @@ extern "C" {
*/
/**
+ * @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
*/
@@ -1616,6 +1629,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_L2_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
*
* Returns layer 3 protocol type. Initial type value is ODP_PROTO_L3_TYPE_NONE.