refactor: rename struct raw_layer to struct layer_private

This commit is contained in:
luwenpeng
2024-08-21 11:17:25 +08:00
parent ee612d73c9
commit 1aece166cd
20 changed files with 268 additions and 268 deletions

View File

@@ -93,8 +93,8 @@ TEST(PACKET_PARSE, ETH_VLAN_VLAN_IP4_IP4_UDP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -104,8 +104,8 @@ TEST(PACKET_PARSE, ETH_VLAN_VLAN_IP4_IP4_UDP)
EXPECT_TRUE(outer_eth_record->pld_len == 156);
// LAYER_PROTO_VLAN
const struct raw_layer *outer_vlan_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_VLAN);
const struct raw_layer *inner_vlan_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_VLAN);
const struct layer_private *outer_vlan_record = packet_get_outermost_layer(&handler, LAYER_PROTO_VLAN);
const struct layer_private *inner_vlan_record = packet_get_innermost_layer(&handler, LAYER_PROTO_VLAN);
EXPECT_TRUE(outer_vlan_record != nullptr);
EXPECT_TRUE(inner_vlan_record != nullptr);
@@ -117,8 +117,8 @@ TEST(PACKET_PARSE, ETH_VLAN_VLAN_IP4_IP4_UDP)
EXPECT_TRUE(inner_vlan_record->pld_len == 148);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -130,8 +130,8 @@ TEST(PACKET_PARSE, ETH_VLAN_VLAN_IP4_IP4_UDP)
EXPECT_TRUE(inner_ipv4_record->pld_len == 108);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record != nullptr);
@@ -297,8 +297,8 @@ TEST(PACKET_PARSE, ETH_IP6_IP4_TCP_SSH)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -308,8 +308,8 @@ TEST(PACKET_PARSE, ETH_IP6_IP4_TCP_SSH)
EXPECT_TRUE(outer_eth_record->pld_len == 712);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record != nullptr);
@@ -319,8 +319,8 @@ TEST(PACKET_PARSE, ETH_IP6_IP4_TCP_SSH)
EXPECT_TRUE(outer_ipv6_record->pld_len == 672);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -330,8 +330,8 @@ TEST(PACKET_PARSE, ETH_IP6_IP4_TCP_SSH)
EXPECT_TRUE(outer_ipv4_record->pld_len == 652);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -490,8 +490,8 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -501,8 +501,8 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
EXPECT_TRUE(outer_eth_record->pld_len == 258);
// LAYER_PROTO_VLAN
const struct raw_layer *outer_vlan_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_VLAN);
const struct raw_layer *inner_vlan_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_VLAN);
const struct layer_private *outer_vlan_record = packet_get_outermost_layer(&handler, LAYER_PROTO_VLAN);
const struct layer_private *inner_vlan_record = packet_get_innermost_layer(&handler, LAYER_PROTO_VLAN);
EXPECT_TRUE(outer_vlan_record != nullptr);
EXPECT_TRUE(inner_vlan_record != nullptr);
@@ -512,8 +512,8 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
EXPECT_TRUE(outer_vlan_record->pld_len == 254);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record != nullptr);
@@ -523,7 +523,7 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
EXPECT_TRUE(outer_ipv6_record->pld_len == 214);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(outer_ipv4_record->hdr_offset == 58);
@@ -531,8 +531,8 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
EXPECT_TRUE(outer_ipv4_record->pld_len == 194);
// LAYER_PROTO_GRE
const struct raw_layer *outer_gre_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_GRE);
const struct raw_layer *inner_ger_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_GRE);
const struct layer_private *outer_gre_record = packet_get_outermost_layer(&handler, LAYER_PROTO_GRE);
const struct layer_private *inner_ger_record = packet_get_innermost_layer(&handler, LAYER_PROTO_GRE);
EXPECT_TRUE(outer_gre_record != nullptr);
EXPECT_TRUE(inner_ger_record != nullptr);
@@ -542,8 +542,8 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
EXPECT_TRUE(outer_gre_record->pld_len == 178);
// LAYER_PROTO_PPP
const struct raw_layer *outer_ppp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_PPP);
const struct raw_layer *inner_ppp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_PPP);
const struct layer_private *outer_ppp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_PPP);
const struct layer_private *inner_ppp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_PPP);
EXPECT_TRUE(outer_ppp_record != nullptr);
EXPECT_TRUE(inner_ppp_record != nullptr);
@@ -553,7 +553,7 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
EXPECT_TRUE(outer_ppp_record->pld_len == 174);
// LAYER_PROTO_IPV4
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(inner_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record->hdr_offset == 98);
@@ -561,8 +561,8 @@ TEST(PACKET_PARSE, ETH_VLAN_IP6_IP4_GRE_PPP_IP4_UDP_DNS)
EXPECT_TRUE(inner_ipv4_record->pld_len == 154);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record != nullptr);
@@ -697,8 +697,8 @@ TEST(PACKET_PARSE, ETH_IP4_IP6_TCP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -708,8 +708,8 @@ TEST(PACKET_PARSE, ETH_IP4_IP6_TCP)
EXPECT_TRUE(outer_eth_record->pld_len == 92);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -719,8 +719,8 @@ TEST(PACKET_PARSE, ETH_IP4_IP6_TCP)
EXPECT_TRUE(outer_ipv4_record->pld_len == 72);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record != nullptr);
@@ -730,8 +730,8 @@ TEST(PACKET_PARSE, ETH_IP4_IP6_TCP)
EXPECT_TRUE(outer_ipv6_record->pld_len == 32);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -852,8 +852,8 @@ TEST(PACKET_PARSE, ETH_IP6_IP6_UDP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -863,7 +863,7 @@ TEST(PACKET_PARSE, ETH_IP6_IP6_UDP)
EXPECT_TRUE(outer_eth_record->pld_len == 92);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(outer_ipv6_record->hdr_offset == 14);
@@ -871,7 +871,7 @@ TEST(PACKET_PARSE, ETH_IP6_IP6_UDP)
EXPECT_TRUE(outer_ipv6_record->pld_len == 52);
// LAYER_PROTO_IPV6
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(inner_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record->hdr_offset == 54);
@@ -879,8 +879,8 @@ TEST(PACKET_PARSE, ETH_IP6_IP6_UDP)
EXPECT_TRUE(inner_ipv6_record->pld_len == 12);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record != nullptr);
@@ -1008,8 +1008,8 @@ TEST(PACKET_PARSE, ETH_MPLS_IP4_TCP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -1019,8 +1019,8 @@ TEST(PACKET_PARSE, ETH_MPLS_IP4_TCP)
EXPECT_TRUE(outer_eth_record->pld_len == 56);
// LAYER_PROTO_MPLS
const struct raw_layer *outer_mpls_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_MPLS);
const struct raw_layer *inner_mpls_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_MPLS);
const struct layer_private *outer_mpls_record = packet_get_outermost_layer(&handler, LAYER_PROTO_MPLS);
const struct layer_private *inner_mpls_record = packet_get_innermost_layer(&handler, LAYER_PROTO_MPLS);
EXPECT_TRUE(outer_mpls_record != nullptr);
EXPECT_TRUE(inner_mpls_record != nullptr);
@@ -1030,8 +1030,8 @@ TEST(PACKET_PARSE, ETH_MPLS_IP4_TCP)
EXPECT_TRUE(outer_mpls_record->pld_len == 52);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -1041,8 +1041,8 @@ TEST(PACKET_PARSE, ETH_MPLS_IP4_TCP)
EXPECT_TRUE(outer_ipv4_record->pld_len == 32);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -1175,8 +1175,8 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_IP4_TCP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -1186,7 +1186,7 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_IP4_TCP)
EXPECT_TRUE(outer_eth_record->pld_len == 52);
// LAYER_PROTO_MPLS
const struct raw_layer *outer_mpls_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_MPLS);
const struct layer_private *outer_mpls_record = packet_get_outermost_layer(&handler, LAYER_PROTO_MPLS);
EXPECT_TRUE(outer_mpls_record != nullptr);
EXPECT_TRUE(outer_mpls_record->hdr_offset == 14);
@@ -1194,7 +1194,7 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_IP4_TCP)
EXPECT_TRUE(outer_mpls_record->pld_len == 48);
// LAYER_PROTO_MPLS
const struct raw_layer *inner_mpls_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_MPLS);
const struct layer_private *inner_mpls_record = packet_get_innermost_layer(&handler, LAYER_PROTO_MPLS);
EXPECT_TRUE(inner_mpls_record != nullptr);
EXPECT_TRUE(inner_mpls_record->hdr_offset == 18);
@@ -1202,8 +1202,8 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_IP4_TCP)
EXPECT_TRUE(inner_mpls_record->pld_len == 44);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -1213,8 +1213,8 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_IP4_TCP)
EXPECT_TRUE(outer_ipv4_record->pld_len == 24);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -1352,8 +1352,8 @@ TEST(PACKET_PARSE, ETH_VLAN_PPPOE_IP4_TCP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -1363,8 +1363,8 @@ TEST(PACKET_PARSE, ETH_VLAN_PPPOE_IP4_TCP)
EXPECT_TRUE(outer_eth_record->pld_len == 64);
// LAYER_PROTO_VLAN
const struct raw_layer *outer_vlan_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_VLAN);
const struct raw_layer *inner_vlan_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_VLAN);
const struct layer_private *outer_vlan_record = packet_get_outermost_layer(&handler, LAYER_PROTO_VLAN);
const struct layer_private *inner_vlan_record = packet_get_innermost_layer(&handler, LAYER_PROTO_VLAN);
EXPECT_TRUE(outer_vlan_record != nullptr);
EXPECT_TRUE(inner_vlan_record != nullptr);
@@ -1374,8 +1374,8 @@ TEST(PACKET_PARSE, ETH_VLAN_PPPOE_IP4_TCP)
EXPECT_TRUE(outer_vlan_record->pld_len == 60);
// LAYER_PROTO_PPPOE
const struct raw_layer *outer_pppoe_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_PPPOE);
const struct raw_layer *inner_pppoe_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_PPPOE);
const struct layer_private *outer_pppoe_record = packet_get_outermost_layer(&handler, LAYER_PROTO_PPPOE);
const struct layer_private *inner_pppoe_record = packet_get_innermost_layer(&handler, LAYER_PROTO_PPPOE);
EXPECT_TRUE(outer_pppoe_record != nullptr);
EXPECT_TRUE(inner_pppoe_record != nullptr);
@@ -1385,8 +1385,8 @@ TEST(PACKET_PARSE, ETH_VLAN_PPPOE_IP4_TCP)
EXPECT_TRUE(outer_pppoe_record->pld_len == 54);
// LAYER_PROTO_PPP
const struct raw_layer *outer_ppp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_PPP);
const struct raw_layer *inner_ppp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_PPP);
const struct layer_private *outer_ppp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_PPP);
const struct layer_private *inner_ppp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_PPP);
EXPECT_TRUE(outer_ppp_record != nullptr);
EXPECT_TRUE(inner_ppp_record != nullptr);
@@ -1396,8 +1396,8 @@ TEST(PACKET_PARSE, ETH_VLAN_PPPOE_IP4_TCP)
EXPECT_TRUE(outer_ppp_record->pld_len == 52);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -1408,8 +1408,8 @@ TEST(PACKET_PARSE, ETH_VLAN_PPPOE_IP4_TCP)
EXPECT_TRUE(outer_ipv4_record->pld_len == 32);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -1605,8 +1605,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP6_TCP_TLS)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -1616,7 +1616,7 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP6_TCP_TLS)
EXPECT_TRUE(outer_eth_record->pld_len == 1428);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(outer_ipv6_record->hdr_offset == 14);
@@ -1624,8 +1624,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP6_TCP_TLS)
EXPECT_TRUE(outer_ipv6_record->pld_len == 1388);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record != nullptr);
@@ -1635,8 +1635,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP6_TCP_TLS)
EXPECT_TRUE(outer_udp_record->pld_len == 1380);
// LAYER_PROTO_GTP_U
const struct raw_layer *outer_gtp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_GTP_U);
const struct raw_layer *inner_gtp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_GTP_U);
const struct layer_private *outer_gtp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_GTP_U);
const struct layer_private *inner_gtp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_GTP_U);
EXPECT_TRUE(outer_gtp_record != nullptr);
EXPECT_TRUE(inner_gtp_record != nullptr);
@@ -1646,7 +1646,7 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP6_TCP_TLS)
EXPECT_TRUE(outer_gtp_record->pld_len == 1372);
// LAYER_PROTO_IPV6
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(inner_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record->hdr_offset == 70);
@@ -1654,8 +1654,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP6_TCP_TLS)
EXPECT_TRUE(inner_ipv6_record->pld_len == 1332);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -1859,8 +1859,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_TCP_TLS)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -1870,8 +1870,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_TCP_TLS)
EXPECT_TRUE(outer_eth_record->pld_len == 1456);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record != nullptr);
@@ -1881,8 +1881,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_TCP_TLS)
EXPECT_TRUE(outer_ipv6_record->pld_len == 1416);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record != nullptr);
@@ -1892,8 +1892,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_TCP_TLS)
EXPECT_TRUE(outer_udp_record->pld_len == 1408);
// LAYER_PROTO_GTP_U
const struct raw_layer *outer_gtp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_GTP_U);
const struct raw_layer *inner_gtp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_GTP_U);
const struct layer_private *outer_gtp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_GTP_U);
const struct layer_private *inner_gtp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_GTP_U);
EXPECT_TRUE(outer_gtp_record != nullptr);
EXPECT_TRUE(inner_gtp_record != nullptr);
@@ -1903,8 +1903,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_TCP_TLS)
EXPECT_TRUE(outer_gtp_record->pld_len == 1400);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -1914,8 +1914,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_TCP_TLS)
EXPECT_TRUE(outer_ipv4_record->pld_len == 1380);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -2061,7 +2061,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_VXLAN_ETH_IP4_UDP_DNS)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(outer_eth_record->hdr_offset == 0);
@@ -2069,7 +2069,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_VXLAN_ETH_IP4_UDP_DNS)
EXPECT_TRUE(outer_eth_record->pld_len == 110);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(outer_ipv4_record->hdr_offset == 14);
@@ -2077,7 +2077,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_VXLAN_ETH_IP4_UDP_DNS)
EXPECT_TRUE(outer_ipv4_record->pld_len == 90);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(outer_udp_record->hdr_offset == 34);
@@ -2085,8 +2085,8 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_VXLAN_ETH_IP4_UDP_DNS)
EXPECT_TRUE(outer_udp_record->pld_len == 82);
// LAYER_PROTO_VXLAN
const struct raw_layer *outer_g_vlan_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_VXLAN);
const struct raw_layer *inner_g_vlan_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_VXLAN);
const struct layer_private *outer_g_vlan_record = packet_get_outermost_layer(&handler, LAYER_PROTO_VXLAN);
const struct layer_private *inner_g_vlan_record = packet_get_innermost_layer(&handler, LAYER_PROTO_VXLAN);
EXPECT_TRUE(outer_g_vlan_record != nullptr);
EXPECT_TRUE(inner_g_vlan_record != nullptr);
@@ -2097,7 +2097,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_VXLAN_ETH_IP4_UDP_DNS)
EXPECT_TRUE(outer_g_vlan_record->pld_len == 74);
// LAYER_PROTO_ETHER
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(inner_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record->hdr_offset == 50);
@@ -2105,7 +2105,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_VXLAN_ETH_IP4_UDP_DNS)
EXPECT_TRUE(inner_eth_record->pld_len == 60);
// LAYER_PROTO_IPV4
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(inner_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record->hdr_offset == 64);
@@ -2113,7 +2113,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_VXLAN_ETH_IP4_UDP_DNS)
EXPECT_TRUE(inner_ipv4_record->pld_len == 40);
// LAYER_PROTO_UDP
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(inner_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record->hdr_offset == 84);
@@ -2218,7 +2218,7 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_PWETHCW_ETH_ARP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(outer_eth_record->hdr_offset == 0);
@@ -2226,7 +2226,7 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_PWETHCW_ETH_ARP)
EXPECT_TRUE(outer_eth_record->pld_len == 76);
// LAYER_PROTO_MPLS
const struct raw_layer *outer_mpls_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_MPLS);
const struct layer_private *outer_mpls_record = packet_get_outermost_layer(&handler, LAYER_PROTO_MPLS);
EXPECT_TRUE(outer_mpls_record != nullptr);
EXPECT_TRUE(outer_mpls_record->hdr_offset == 14);
@@ -2234,7 +2234,7 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_PWETHCW_ETH_ARP)
EXPECT_TRUE(outer_mpls_record->pld_len == 72);
// LAYER_PROTO_MPLS
const struct raw_layer *inner_mpls_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_MPLS);
const struct layer_private *inner_mpls_record = packet_get_innermost_layer(&handler, LAYER_PROTO_MPLS);
EXPECT_TRUE(inner_mpls_record != nullptr);
EXPECT_TRUE(inner_mpls_record->hdr_offset == 18);
@@ -2242,7 +2242,7 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_PWETHCW_ETH_ARP)
EXPECT_TRUE(inner_mpls_record->pld_len == 68);
// LAYER_PROTO_PWETHCW
const struct raw_layer *inner_pweth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_PWETH);
const struct layer_private *inner_pweth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_PWETH);
EXPECT_TRUE(inner_pweth_record != nullptr);
EXPECT_TRUE(inner_pweth_record->hdr_offset == 22);
@@ -2250,7 +2250,7 @@ TEST(PACKET_PARSE, ETH_MPLS_MPLS_PWETHCW_ETH_ARP)
EXPECT_TRUE(inner_pweth_record->pld_len == 64);
// LAYER_PROTO_ETHER
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(inner_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record->hdr_offset == 26);
@@ -2355,8 +2355,8 @@ TEST(PACKET_PARSE, ETH_IP4_ICMP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -2366,8 +2366,8 @@ TEST(PACKET_PARSE, ETH_IP4_ICMP)
EXPECT_TRUE(outer_eth_record->pld_len == 84);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -2377,8 +2377,8 @@ TEST(PACKET_PARSE, ETH_IP4_ICMP)
EXPECT_TRUE(outer_ipv4_record->pld_len == 64);
// LAYER_PROTO_ICMP
const struct raw_layer *outer_icmp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ICMP);
const struct raw_layer *inner_icmp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ICMP);
const struct layer_private *outer_icmp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ICMP);
const struct layer_private *inner_icmp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ICMP);
EXPECT_TRUE(outer_icmp_record != nullptr);
EXPECT_TRUE(inner_icmp_record != nullptr);
@@ -2461,8 +2461,8 @@ TEST(PACKET_PARSE, ETH_IP6_ICMP6)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -2472,8 +2472,8 @@ TEST(PACKET_PARSE, ETH_IP6_ICMP6)
EXPECT_TRUE(outer_eth_record->pld_len == 100);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record != nullptr);
@@ -2483,8 +2483,8 @@ TEST(PACKET_PARSE, ETH_IP6_ICMP6)
EXPECT_TRUE(outer_ipv6_record->pld_len == 60);
// LAYER_PROTO_ICMP6
const struct raw_layer *outer_icmp6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ICMP6);
const struct raw_layer *inner_icmp6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ICMP6);
const struct layer_private *outer_icmp6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ICMP6);
const struct layer_private *inner_icmp6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ICMP6);
EXPECT_TRUE(outer_icmp6_record != nullptr);
EXPECT_TRUE(inner_icmp6_record != nullptr);
@@ -2626,7 +2626,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_L2TPV2_PPP_IP4_UDP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(outer_eth_record->hdr_offset == 0);
@@ -2634,7 +2634,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_L2TPV2_PPP_IP4_UDP)
EXPECT_TRUE(outer_eth_record->pld_len == 136);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(outer_ipv4_record->hdr_offset == 14);
@@ -2642,7 +2642,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_L2TPV2_PPP_IP4_UDP)
EXPECT_TRUE(outer_ipv4_record->pld_len == 116);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(outer_udp_record->hdr_offset == 34);
@@ -2650,7 +2650,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_L2TPV2_PPP_IP4_UDP)
EXPECT_TRUE(outer_udp_record->pld_len == 108);
// LAYER_PROTO_L2TP
const struct raw_layer *outer_l2tpv2_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_L2TP);
const struct layer_private *outer_l2tpv2_record = packet_get_outermost_layer(&handler, LAYER_PROTO_L2TP);
EXPECT_TRUE(outer_l2tpv2_record != nullptr);
EXPECT_TRUE(outer_l2tpv2_record->hdr_offset == 42);
@@ -2658,7 +2658,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_L2TPV2_PPP_IP4_UDP)
EXPECT_TRUE(outer_l2tpv2_record->pld_len == 100);
// LAYER_PROTO_PPP
const struct raw_layer *outer_ppp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_PPP);
const struct layer_private *outer_ppp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_PPP);
EXPECT_TRUE(outer_ppp_record != nullptr);
EXPECT_TRUE(outer_ppp_record->hdr_offset == 50);
@@ -2666,7 +2666,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_L2TPV2_PPP_IP4_UDP)
EXPECT_TRUE(outer_ppp_record->pld_len == 96);
// LAYER_PROTO_IPV4
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(inner_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record->hdr_offset == 54);
@@ -2674,7 +2674,7 @@ TEST(PACKET_PARSE, ETH_IP4_UDP_L2TPV2_PPP_IP4_UDP)
EXPECT_TRUE(inner_ipv4_record->pld_len == 76);
// LAYER_PROTO_UDP
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(inner_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record->hdr_offset == 74);
@@ -2791,8 +2791,8 @@ TEST(PACKET_PARSE, ETH_IP4_TCP_PADDING)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -2802,8 +2802,8 @@ TEST(PACKET_PARSE, ETH_IP4_TCP_PADDING)
EXPECT_TRUE(outer_eth_record->pld_len == 46);
// LAYER_PROTO_IPV4
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(outer_ipv4_record != nullptr);
EXPECT_TRUE(inner_ipv4_record != nullptr);
@@ -2813,8 +2813,8 @@ TEST(PACKET_PARSE, ETH_IP4_TCP_PADDING)
EXPECT_TRUE(outer_ipv4_record->pld_len == 20);
// LAYER_PROTO_TCP
const struct raw_layer *outer_tcp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct raw_layer *inner_tcp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *outer_tcp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_TCP);
const struct layer_private *inner_tcp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_TCP);
EXPECT_TRUE(outer_tcp_record != nullptr);
EXPECT_TRUE(inner_tcp_record != nullptr);
@@ -2968,8 +2968,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_UDP)
******************************************************/
// LAYER_PROTO_ETHER
const struct raw_layer *outer_eth_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct raw_layer *inner_eth_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *outer_eth_record = packet_get_outermost_layer(&handler, LAYER_PROTO_ETHER);
const struct layer_private *inner_eth_record = packet_get_innermost_layer(&handler, LAYER_PROTO_ETHER);
EXPECT_TRUE(outer_eth_record != nullptr);
EXPECT_TRUE(inner_eth_record != nullptr);
@@ -2979,8 +2979,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_UDP)
EXPECT_TRUE(outer_eth_record->pld_len == 501);
// LAYER_PROTO_IPV6
const struct raw_layer *outer_ipv6_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct raw_layer *inner_ipv6_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *outer_ipv6_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV6);
const struct layer_private *inner_ipv6_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV6);
EXPECT_TRUE(outer_ipv6_record != nullptr);
EXPECT_TRUE(inner_ipv6_record != nullptr);
@@ -2990,7 +2990,7 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_UDP)
EXPECT_TRUE(outer_ipv6_record->pld_len == 461);
// LAYER_PROTO_UDP
const struct raw_layer *outer_udp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *outer_udp_record = packet_get_outermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(outer_udp_record != nullptr);
EXPECT_TRUE(outer_udp_record->hdr_offset == 54);
@@ -2998,8 +2998,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_UDP)
EXPECT_TRUE(outer_udp_record->pld_len == 453);
// LAYER_PROTO_GTP_U
const struct raw_layer *outer_gtpu_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_GTP_U);
const struct raw_layer *inner_gtpu_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_GTP_U);
const struct layer_private *outer_gtpu_record = packet_get_outermost_layer(&handler, LAYER_PROTO_GTP_U);
const struct layer_private *inner_gtpu_record = packet_get_innermost_layer(&handler, LAYER_PROTO_GTP_U);
EXPECT_TRUE(outer_gtpu_record != nullptr);
EXPECT_TRUE(inner_gtpu_record != nullptr);
@@ -3009,8 +3009,8 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_UDP)
EXPECT_TRUE(outer_gtpu_record->pld_len == 437);
// LAYER_PROTO_IPV4
const struct raw_layer *inner_ipv4_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct raw_layer *outer_ipv4_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *inner_ipv4_record = packet_get_innermost_layer(&handler, LAYER_PROTO_IPV4);
const struct layer_private *outer_ipv4_record = packet_get_outermost_layer(&handler, LAYER_PROTO_IPV4);
EXPECT_TRUE(inner_ipv4_record != nullptr);
EXPECT_TRUE(outer_ipv4_record != nullptr);
@@ -3020,7 +3020,7 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_UDP)
EXPECT_TRUE(inner_ipv4_record->pld_len == 417);
// LAYER_PROTO_UDP
const struct raw_layer *inner_udp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_UDP);
const struct layer_private *inner_udp_record = packet_get_innermost_layer(&handler, LAYER_PROTO_UDP);
EXPECT_TRUE(inner_udp_record != nullptr);
EXPECT_TRUE(inner_udp_record->hdr_offset == 98);