Add support for parsing PW Ethernet and Enhanced MPLS parsing

This commit is contained in:
luwenpeng
2024-06-02 00:07:33 +08:00
parent f3b92a8a15
commit 18fe1e2e41
13 changed files with 615 additions and 250 deletions

View File

@@ -2628,8 +2628,8 @@ TEST(PACKET, ETH_MPLS_MPLS_PWETHCW_ETH_ARP)
EXPECT_TRUE(inner_mpls_record != nullptr);
EXPECT_TRUE(inner_mpls_record->hdr_offset == 18);
EXPECT_TRUE(inner_mpls_record->hdr_len == 4 + 4); // MPLS + PWETH
EXPECT_TRUE(inner_mpls_record->pld_len == 64);
EXPECT_TRUE(inner_mpls_record->hdr_len == 4);
EXPECT_TRUE(inner_mpls_record->pld_len == 68);
// LAYER_TYPE_L2_TUN
const struct packet_layer *inner_l2_tun_record = packet_get_innermost_layer(&handler, LAYER_TYPE_L2_TUN);
@@ -2637,6 +2637,14 @@ TEST(PACKET, ETH_MPLS_MPLS_PWETHCW_ETH_ARP)
EXPECT_TRUE(inner_l2_tun_record != nullptr);
EXPECT_TRUE(inner_l2_tun_record == inner_mpls_record);
// LAYER_TYPE_PWETHCW
const struct packet_layer *inner_pweth_record = packet_get_innermost_layer(&handler, LAYER_TYPE_PWETH);
EXPECT_TRUE(inner_pweth_record != nullptr);
EXPECT_TRUE(inner_pweth_record->hdr_offset == 22);
EXPECT_TRUE(inner_pweth_record->hdr_len == 4);
EXPECT_TRUE(inner_pweth_record->pld_len == 64);
// LAYER_TYPE_ETHER
const struct packet_layer *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_TYPE_ETHER);