diff mbox series

[API-NEXT,v1,8/15] linux-gen: packet: support L4 type No Next Header

Message ID 1519232408-28445-9-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v1,1/15] api: don't create special case for the tunnel-dummy packets | expand

Commit Message

Github ODP bot Feb. 21, 2018, 5 p.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 494 (lumag:ipsec-tfc-imp)
 ** https://github.com/Linaro/odp/pull/494
 ** Patch: https://github.com/Linaro/odp/pull/494.patch
 ** Base sha: ea2afab619ae74108a03798bc358fdfcd29fdd88
 ** Merge commit sha: 7bc900650676584bfb99c8a92c3d8812b458f172
 **/
 platform/linux-generic/include/odp/api/plat/packet_inline_types.h | 1 +
 platform/linux-generic/include/protocols/ip.h                     | 1 +
 platform/linux-generic/odp_packet.c                               | 6 ++++++
 3 files changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
index 2e8efecb6..4b88d3517 100644
--- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
+++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
@@ -90,6 +90,7 @@  typedef union {
 		uint64_t tcp:1;       /* TCP */
 		uint64_t sctp:1;      /* SCTP */
 		uint64_t icmp:1;      /* ICMP */
+		uint64_t no_next_hdr:1; /* No Next Header */
 
 		uint64_t color:2;     /* Packet color for traffic mgmt */
 		uint64_t nodrop:1;    /* Drop eligibility status */
diff --git a/platform/linux-generic/include/protocols/ip.h b/platform/linux-generic/include/protocols/ip.h
index f02980693..19aef3dcc 100644
--- a/platform/linux-generic/include/protocols/ip.h
+++ b/platform/linux-generic/include/protocols/ip.h
@@ -167,6 +167,7 @@  typedef struct ODP_PACKED {
 #define _ODP_IPPROTO_AH      0x33 /**< Authentication Header (51) */
 #define _ODP_IPPROTO_ESP     0x32 /**< Encapsulating Security Payload (50) */
 #define _ODP_IPPROTO_ICMPV6  0x3A /**< Internet Control Message Protocol (58) */
+#define _ODP_IPPROTO_NO_NEXT 0x3B /**< No Next Header (59) */
 #define _ODP_IPPROTO_DEST    0x3C /**< IPv6 Destination header (60) */
 #define _ODP_IPPROTO_SCTP    0x84 /**< Stream Control Transmission protocol
 				       (132) */
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 187580085..7caeb9889 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -2229,6 +2229,10 @@  int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr,
 		prs->input_flags.sctp = 1;
 		break;
 
+	case _ODP_IPPROTO_NO_NEXT:
+		prs->input_flags.no_next_hdr = 1;
+		break;
+
 	default:
 		prs->input_flags.l4 = 0;
 		break;
@@ -2550,6 +2554,8 @@  odp_proto_l4_type_t odp_packet_l4_type(odp_packet_t pkt)
 	else if (pkt_hdr->p.input_flags.icmp &&
 		 pkt_hdr->p.input_flags.ipv6)
 		return ODP_PROTO_L4_TYPE_ICMPV6;
+	else if (pkt_hdr->p.input_flags.no_next_hdr)
+		return ODP_PROTO_L4_TYPE_NO_NEXT;
 
 	return ODP_PROTO_L4_TYPE_NONE;
 }