feature: add GTP utils, support overwrite message length of GTP header

This commit is contained in:
luwenpeng
2024-07-09 11:17:03 +08:00
parent b435ec2ea1
commit c87ad330e0
28 changed files with 1676 additions and 648 deletions

View File

@@ -1635,9 +1635,9 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP6_TCP_TLS)
EXPECT_TRUE(outer_udp_record->hdr_len == 8);
EXPECT_TRUE(outer_udp_record->pld_len == 1380);
// LAYER_PROTO_GTP
const struct raw_layer *outer_gtp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_GTP);
const struct raw_layer *inner_gtp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_GTP);
// 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);
EXPECT_TRUE(outer_gtp_record != nullptr);
EXPECT_TRUE(inner_gtp_record != nullptr);
@@ -1892,9 +1892,9 @@ TEST(PACKET_PARSE, ETH_IP6_UDP_GTP_IP4_TCP_TLS)
EXPECT_TRUE(outer_udp_record->hdr_len == 8);
EXPECT_TRUE(outer_udp_record->pld_len == 1408);
// LAYER_PROTO_GTP
const struct raw_layer *outer_gtp_record = packet_get_outermost_raw_layer(&handler, LAYER_PROTO_GTP);
const struct raw_layer *inner_gtp_record = packet_get_innermost_raw_layer(&handler, LAYER_PROTO_GTP);
// 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);
EXPECT_TRUE(outer_gtp_record != nullptr);
EXPECT_TRUE(inner_gtp_record != nullptr);