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

@@ -3,7 +3,7 @@
#include "tuple.h"
#include "times.h"
#include "ipv4_utils.h"
#include "ip4_utils.h"
#include "packet_def.h"
#include "packet_parse.h"
#include "packet_layer.h"
@@ -441,7 +441,7 @@ TEST(TCP_INIT_TO_OPENING, BY_SYN_RETRANSMISSION)
packet_parse(&pkt, (const char *)syn_retransmission, sizeof(tcp_pkt1_c2s_syn));
const struct raw_layer *ipv4_layer = packet_get_innermost_raw_layer(&pkt, LAYER_PROTO_IPV4);
struct ip *hdr = (struct ip *)ipv4_layer->hdr_ptr;
ipv4_hdr_set_ipid(hdr, 0x1234);
ip4_hdr_set_ipid(hdr, 0x1234);
printf("<= Packet Parse: done\n\n");
// lookup session
@@ -540,7 +540,7 @@ TEST(TCP_INIT_TO_OPENING, BY_SYNACK_RETRANSMISSION)
const struct raw_layer *ipv4_layer = packet_get_innermost_raw_layer(&pkt, LAYER_PROTO_IPV4);
EXPECT_TRUE(ipv4_layer);
struct ip *hdr = (struct ip *)ipv4_layer->hdr_ptr;
ipv4_hdr_set_ipid(hdr, 0x1234);
ip4_hdr_set_ipid(hdr, 0x1234);
printf("<= Packet Parse: done\n\n");
// lookup session