diff mbox

[3/3] linux-gen: packet: identify sctp packets

Message ID 1473777012-21850-3-git-send-email-matias.elo@nokia.com
State Accepted
Commit 5fff93ce094807c460ab7a1bf9b7af429143a19d
Headers show

Commit Message

Elo, Matias (Nokia - FI/Espoo) Sept. 13, 2016, 2:30 p.m. UTC
Signed-off-by: Matias Elo <matias.elo@nokia.com>

---
 platform/linux-generic/include/protocols/ip.h | 2 ++
 platform/linux-generic/odp_packet.c           | 4 ++++
 2 files changed, 6 insertions(+)

-- 
2.7.4
diff mbox

Patch

diff --git a/platform/linux-generic/include/protocols/ip.h b/platform/linux-generic/include/protocols/ip.h
index d5277fb..6c089e3 100644
--- a/platform/linux-generic/include/protocols/ip.h
+++ b/platform/linux-generic/include/protocols/ip.h
@@ -154,6 +154,8 @@  typedef struct ODP_PACKED {
 #define _ODP_IPPROTO_FRAG    0x2C /**< IPv6 Fragment (44) */
 #define _ODP_IPPROTO_AH      0x33 /**< Authentication Header (51) */
 #define _ODP_IPPROTO_ESP     0x32 /**< Encapsulating Security Payload (50) */
+#define _ODP_IPPROTO_SCTP    0x84 /**< Stream Control Transmission protocol
+				       (132) */
 #define _ODP_IPPROTO_INVALID 0xFF /**< Reserved invalid by IANA */
 
 /**@}*/
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index df6fd1e..714794a 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -1328,6 +1328,10 @@  int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr,
 			prs->input_flags.ipsec_esp = 1;
 			break;
 
+		case _ODP_IPPROTO_SCTP:
+			prs->input_flags.sctp = 1;
+			break;
+
 		default:
 			prs->input_flags.l4 = 0;
 			prs->l4_offset = ODP_PACKET_OFFSET_INVALID;