refactor: packet dump utils

This commit is contained in:
luwenpeng
2024-08-13 10:24:26 +08:00
parent ff8630e436
commit 03468d55be
13 changed files with 200 additions and 186 deletions

View File

@@ -4,6 +4,7 @@
#include "packet_def.h"
#include "packet_ldbc.h"
#include "packet_parse.h"
#include "packet_dump.h"
/******************************************************************************
* [Protocols in frame: eth:ethertype:ip:ipv6:tcp]
@@ -76,7 +77,7 @@ TEST(PACKET_LDBC, HASH_VALUE)
const char *payload = packet_parse(&handler, (const char *)data, sizeof(data));
EXPECT_TRUE(payload != nullptr);
EXPECT_TRUE((char *)payload - (char *)&data == 106);
packet_print(&handler);
packet_dump_stdio(&handler);
// buffer: "2001:da8:200:900e:200:5efe:d24d:58a3 0 2600:140e:6::1702:1058 0"
// buffer: "210.77.88.163 0 59.66.4.50 0"