From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B6E8A034D; Sat, 29 Jan 2022 07:25:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14A224068A; Sat, 29 Jan 2022 07:25:46 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 52EA74068A for ; Sat, 29 Jan 2022 07:25:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643437543; x=1674973543; h=from:to:cc:subject:date:message-id:in-reply-to: references:reply-to:mime-version: content-transfer-encoding; bh=OCc1wOkI/4YsTCcl7PkDvS4CY87/TnkkGeVTcUkcEE4=; b=nXz805X+nJgZTXNQHuoldJJZdN3cSsmrP4XAjKKmz5FcXR5fsbUoUe7P sH9Xg8tPGeqg6sHvcEicHUiNX+re9m0pftYFJGwiBb07HMcGNz8y9jCTl SY7XGWo2EMH1silCBpQ0/X4aqd5+zyhlzRQF74LN9SWGQ6Q7QxgrY+MHQ FdCZ/HDVXSwI/ng0zVM2qlO/2pEkXGz0NU4Hl8NYX/xUl0mphQ7541trf Hi9x35gzgDzsQh3OOP4vCZC63Z16F+1DOUeM+S9IdcwpmpMfW0x2Sj2/S mKME7JYRigOXWT1Pff9UcqBWNx0jWZ1d6O4224Om44Y+e76V/vlQhZ0qK A==; X-IronPort-AV: E=McAfee;i="6200,9189,10241"; a="244847716" X-IronPort-AV: E=Sophos;i="5.88,326,1635231600"; d="scan'208";a="244847716" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 22:25:42 -0800 X-IronPort-AV: E=Sophos;i="5.88,326,1635231600"; d="scan'208";a="496351939" Received: from intel-cd-odc-gavin.cd.intel.com ([10.240.178.183]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 22:25:38 -0800 From: Jie Wang To: dev@dpdk.org Cc: stevex.yang@intel.com, orika@nvidia.com, aman.deep.singh@intel.com, ferruh.yigit@intel.com, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, olivier.matz@6wind.com, Jie Wang Subject: [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message Date: Sat, 29 Jan 2022 14:24:31 +0800 Message-Id: <20220129062434.2455711-4-jie1x.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220129062434.2455711-1-jie1x.wang@intel.com> References: <20220129062434.2455711-1-jie1x.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: 20220126063016.2384393-1-jie1x.wang@intel.com Errors-To: dev-bounces@dpdk.org This patch adds L2TPv2 control message and 5 types of data message support for testpmd. The added L2TPv2 message types are listed below: 1. L2TPv2 control 2. L2TPv2 3. L2TPv2 + length option 4. L2TPv2 + sequence option 5. L2TPv2 + offset option 6. L2TPv2 + length option + sequence option Signed-off-by: Jie Wang --- app/test-pmd/cmdline_flow.c | 313 ++++++++++++++++++++++++++++++------ lib/net/rte_l2tpv2.h | 13 ++ 2 files changed, 275 insertions(+), 51 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index bbaf18d76e..4e2ed3d6a3 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -322,13 +322,30 @@ enum index { ITEM_FLEX_ITEM_HANDLE, ITEM_FLEX_PATTERN_HANDLE, ITEM_L2TPV2, - ITEM_L2TPV2_COMMON, - ITEM_L2TPV2_COMMON_TYPE, - ITEM_L2TPV2_COMMON_TYPE_DATA_L, - ITEM_L2TPV2_COMMON_TYPE_CTRL, + ITEM_L2TPV2_TYPE, + ITEM_L2TPV2_TYPE_DATA, + ITEM_L2TPV2_TYPE_DATA_L, + ITEM_L2TPV2_TYPE_DATA_S, + ITEM_L2TPV2_TYPE_DATA_O, + ITEM_L2TPV2_TYPE_DATA_L_S, + ITEM_L2TPV2_TYPE_CTRL, + ITEM_L2TPV2_MSG_DATA_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_SESSION_ID, ITEM_L2TPV2_MSG_DATA_L_LENGTH, ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID, ITEM_L2TPV2_MSG_DATA_L_SESSION_ID, + ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_S_SESSION_ID, + ITEM_L2TPV2_MSG_DATA_S_NS, + ITEM_L2TPV2_MSG_DATA_S_NR, + ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_O_SESSION_ID, + ITEM_L2TPV2_MSG_DATA_O_OFFSET, + ITEM_L2TPV2_MSG_DATA_L_S_LENGTH, + ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID, + ITEM_L2TPV2_MSG_DATA_L_S_NS, + ITEM_L2TPV2_MSG_DATA_L_S_NR, ITEM_L2TPV2_MSG_CTRL_LENGTH, ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID, ITEM_L2TPV2_MSG_CTRL_SESSION_ID, @@ -1449,19 +1466,70 @@ static const enum index item_flex[] = { }; static const enum index item_l2tpv2[] = { - ITEM_L2TPV2_COMMON, + ITEM_L2TPV2_TYPE, ITEM_NEXT, ZERO, }; -static const enum index item_l2tpv2_common[] = { - ITEM_L2TPV2_COMMON_TYPE, +static const enum index item_l2tpv2_type[] = { + ITEM_L2TPV2_TYPE_DATA, + ITEM_L2TPV2_TYPE_DATA_L, + ITEM_L2TPV2_TYPE_DATA_S, + ITEM_L2TPV2_TYPE_DATA_O, + ITEM_L2TPV2_TYPE_DATA_L_S, + ITEM_L2TPV2_TYPE_CTRL, ZERO, }; -static const enum index item_l2tpv2_common_type[] = { - ITEM_L2TPV2_COMMON_TYPE_DATA_L, - ITEM_L2TPV2_COMMON_TYPE_CTRL, +static const enum index item_l2tpv2_type_data[] = { + ITEM_L2TPV2_MSG_DATA_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_SESSION_ID, + ITEM_NEXT, + ZERO, +}; + +static const enum index item_l2tpv2_type_data_l[] = { + ITEM_L2TPV2_MSG_DATA_L_LENGTH, + ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_L_SESSION_ID, + ITEM_NEXT, + ZERO, +}; + +static const enum index item_l2tpv2_type_data_s[] = { + ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_S_SESSION_ID, + ITEM_L2TPV2_MSG_DATA_S_NS, + ITEM_L2TPV2_MSG_DATA_S_NR, + ITEM_NEXT, + ZERO, +}; + +static const enum index item_l2tpv2_type_data_o[] = { + ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_O_SESSION_ID, + ITEM_L2TPV2_MSG_DATA_O_OFFSET, + ITEM_NEXT, + ZERO, +}; + +static const enum index item_l2tpv2_type_data_l_s[] = { + ITEM_L2TPV2_MSG_DATA_L_S_LENGTH, + ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID, + ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID, + ITEM_L2TPV2_MSG_DATA_L_S_NS, + ITEM_L2TPV2_MSG_DATA_L_S_NR, + ITEM_NEXT, + ZERO, +}; + +static const enum index item_l2tpv2_type_ctrl[] = { + ITEM_L2TPV2_MSG_CTRL_LENGTH, + ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID, + ITEM_L2TPV2_MSG_CTRL_SESSION_ID, + ITEM_L2TPV2_MSG_CTRL_NS, + ITEM_L2TPV2_MSG_CTRL_NR, + ITEM_NEXT, ZERO, }; @@ -3843,31 +3911,46 @@ static const struct token token_list[] = { .next = NEXT(item_l2tpv2), .call = parse_vc, }, - [ITEM_L2TPV2_COMMON] = { - .name = "common", - .help = "L2TPv2 common header", - .next = NEXT(item_l2tpv2_common), - }, - [ITEM_L2TPV2_COMMON_TYPE] = { + [ITEM_L2TPV2_TYPE] = { .name = "type", - .help = "type of common header", - .next = NEXT(item_l2tpv2_common_type), + .help = "type of l2tpv2", + .next = NEXT(item_l2tpv2_type), .args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)), }, - [ITEM_L2TPV2_COMMON_TYPE_DATA_L] = { + [ITEM_L2TPV2_TYPE_DATA] = { + .name = "data", + .help = "Type #7: data message without any options", + .next = NEXT(item_l2tpv2_type_data), + .call = parse_vc_item_l2tpv2_type, + }, + [ITEM_L2TPV2_MSG_DATA_TUNNEL_ID] = { + .name = "tunnel_id", + .help = "tunnel identifier", + .next = NEXT(item_l2tpv2_type_data, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type7.tunnel_id)), + }, + [ITEM_L2TPV2_MSG_DATA_SESSION_ID] = { + .name = "session_id", + .help = "session identifier", + .next = NEXT(item_l2tpv2_type_data, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type7.session_id)), + }, + [ITEM_L2TPV2_TYPE_DATA_L] = { .name = "data_l", .help = "Type #6: data message with length option", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH, - ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID, - ITEM_L2TPV2_MSG_DATA_L_SESSION_ID, - ITEM_NEXT)), + .next = NEXT(item_l2tpv2_type_data_l), .call = parse_vc_item_l2tpv2_type, }, [ITEM_L2TPV2_MSG_DATA_L_LENGTH] = { .name = "length", .help = "message length", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_data_l, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, @@ -3876,8 +3959,7 @@ static const struct token token_list[] = { [ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = { .name = "tunnel_id", .help = "tunnel identifier", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_data_l, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, @@ -3886,29 +3968,150 @@ static const struct token token_list[] = { [ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = { .name = "session_id", .help = "session identifier", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_data_l, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, hdr.type6.session_id)), }, - [ITEM_L2TPV2_COMMON_TYPE_CTRL] = { + [ITEM_L2TPV2_TYPE_DATA_S] = { + .name = "data_s", + .help = "Type #5: data message with ns, nr option", + .next = NEXT(item_l2tpv2_type_data_s), + .call = parse_vc_item_l2tpv2_type, + }, + [ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID] = { + .name = "tunnel_id", + .help = "tunnel identifier", + .next = NEXT(item_l2tpv2_type_data_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type5.tunnel_id)), + }, + [ITEM_L2TPV2_MSG_DATA_S_SESSION_ID] = { + .name = "session_id", + .help = "session identifier", + .next = NEXT(item_l2tpv2_type_data_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type5.session_id)), + }, + [ITEM_L2TPV2_MSG_DATA_S_NS] = { + .name = "ns", + .help = "sequence number for message", + .next = NEXT(item_l2tpv2_type_data_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type5.ns)), + }, + [ITEM_L2TPV2_MSG_DATA_S_NR] = { + .name = "nr", + .help = "sequence number for next receive message", + .next = NEXT(item_l2tpv2_type_data_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type5.nr)), + }, + [ITEM_L2TPV2_TYPE_DATA_O] = { + .name = "data_o", + .help = "Type #4: data message with offset option", + .next = NEXT(item_l2tpv2_type_data_o), + .call = parse_vc_item_l2tpv2_type, + }, + [ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID] = { + .name = "tunnel_id", + .help = "tunnel identifier", + .next = NEXT(item_l2tpv2_type_data_o, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type4.tunnel_id)), + }, + [ITEM_L2TPV2_MSG_DATA_O_SESSION_ID] = { + .name = "session_id", + .help = "session identifier", + .next = NEXT(item_l2tpv2_type_data_o, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type5.session_id)), + }, + [ITEM_L2TPV2_MSG_DATA_O_OFFSET] = { + .name = "offset_size", + .help = "the size of offset padding", + .next = NEXT(item_l2tpv2_type_data_o, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type4.offset_size)), + }, + [ITEM_L2TPV2_TYPE_DATA_L_S] = { + .name = "data_l_s", + .help = "Type #3: data message contains length, ns, nr " + "options", + .next = NEXT(item_l2tpv2_type_data_l_s), + .call = parse_vc_item_l2tpv2_type, + }, + [ITEM_L2TPV2_MSG_DATA_L_S_LENGTH] = { + .name = "length", + .help = "message length", + .next = NEXT(item_l2tpv2_type_data_l_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type3.length)), + }, + [ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID] = { + .name = "tunnel_id", + .help = "tunnel identifier", + .next = NEXT(item_l2tpv2_type_data_l_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type3.tunnel_id)), + }, + [ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID] = { + .name = "session_id", + .help = "session identifier", + .next = NEXT(item_l2tpv2_type_data_l_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type3.session_id)), + }, + [ITEM_L2TPV2_MSG_DATA_L_S_NS] = { + .name = "ns", + .help = "sequence number for message", + .next = NEXT(item_l2tpv2_type_data_l_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type3.ns)), + }, + [ITEM_L2TPV2_MSG_DATA_L_S_NR] = { + .name = "nr", + .help = "sequence number for next receive message", + .next = NEXT(item_l2tpv2_type_data_l_s, + NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, + hdr.type3.nr)), + }, + [ITEM_L2TPV2_TYPE_CTRL] = { .name = "control", - .help = "Type #3: conrtol message contains length, ns, nr options", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH, - ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID, - ITEM_L2TPV2_MSG_CTRL_SESSION_ID, - ITEM_L2TPV2_MSG_CTRL_NS, - ITEM_L2TPV2_MSG_CTRL_NR, - ITEM_NEXT)), + .help = "Type #3: conrtol message contains length, ns, nr " + "options", + .next = NEXT(item_l2tpv2_type_ctrl), .call = parse_vc_item_l2tpv2_type, }, [ITEM_L2TPV2_MSG_CTRL_LENGTH] = { .name = "length", .help = "message length", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_ctrl, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, @@ -3917,8 +4120,7 @@ static const struct token token_list[] = { [ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = { .name = "tunnel_id", .help = "tunnel identifier", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_ctrl, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, @@ -3927,8 +4129,7 @@ static const struct token token_list[] = { [ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = { .name = "session_id", .help = "session identifier", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_ctrl, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, @@ -3937,8 +4138,7 @@ static const struct token token_list[] = { [ITEM_L2TPV2_MSG_CTRL_NS] = { .name = "ns", .help = "sequence number for message", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_ctrl, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, @@ -3947,8 +4147,7 @@ static const struct token token_list[] = { [ITEM_L2TPV2_MSG_CTRL_NR] = { .name = "nr", .help = "sequence number for next receive message", - .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS, - ITEM_L2TPV2_COMMON, ITEM_NEXT), + .next = NEXT(item_l2tpv2_type_ctrl, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, @@ -5889,11 +6088,23 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token, if (parse_default(ctx, token, str, len, NULL, 0) < 0) return -1; switch (ctx->curr) { - case ITEM_L2TPV2_COMMON_TYPE_DATA_L: - msg_type |= 0x4000; + case ITEM_L2TPV2_TYPE_DATA: + msg_type |= RTE_L2TPV2_MSG_TYPE_DATA; + break; + case ITEM_L2TPV2_TYPE_DATA_L: + msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L; + break; + case ITEM_L2TPV2_TYPE_DATA_S: + msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_S; + break; + case ITEM_L2TPV2_TYPE_DATA_O: + msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_O; + break; + case ITEM_L2TPV2_TYPE_DATA_L_S: + msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L_S; break; - case ITEM_L2TPV2_COMMON_TYPE_CTRL: - msg_type |= 0xC800; + case ITEM_L2TPV2_TYPE_CTRL: + msg_type |= RTE_L2TPV2_MSG_TYPE_CONTROL; break; default: return -1; diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h index 1f3ad3f03c..d41123a504 100644 --- a/lib/net/rte_l2tpv2.h +++ b/lib/net/rte_l2tpv2.h @@ -78,6 +78,19 @@ extern "C" { #endif +/* + * L2TPv2 Message Type + */ +#define RTE_L2TPV2_MSG_TYPE_CONTROL 0xC802 +#define RTE_L2TPV2_MSG_TYPE_DATA 0x0002 +#define RTE_L2TPV2_MSG_TYPE_DATA_L 0x4002 +#define RTE_L2TPV2_MSG_TYPE_DATA_S 0x0802 +#define RTE_L2TPV2_MSG_TYPE_DATA_O 0x0202 +#define RTE_L2TPV2_MSG_TYPE_DATA_L_S 0x4802 +#define RTE_L2TPV2_MSG_TYPE_DATA_L_O 0x4202 +#define RTE_L2TPV2_MSG_TYPE_DATA_S_O 0x0A02 +#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O 0x4A02 + /** * L2TPv2 Common Header */ -- 2.25.1