refactor: packet module (split to parse/build/layer/tunnel/utils)

This commit is contained in:
luwenpeng
2024-06-24 17:07:05 +08:00
parent d8963af5f8
commit 71422ebb36
36 changed files with 796 additions and 724 deletions

View File

@@ -3,14 +3,19 @@
#include <sys/queue.h>
#include <assert.h>
#include "packet_priv.h"
#include "log.h"
#include "packet_def.h"
#include "packet_utils.h"
#include "packet_parse.h"
#include "crc32_hash.h"
#include "checksum.h"
#include "ipv4_utils.h"
#include "ipv6_utils.h"
#include "ip_reassembly.h"
#define IP_REASSEMBLE_DEBUG(format, ...) LOG_DEBUG("ip_reassembly", format, ##__VA_ARGS__)
#define IP_REASSEMBLE_ERROR(format, ...) LOG_ERROR("ip_reassembly", format, ##__VA_ARGS__)
#define IPV4_KEYLEN 1
#define IPV6_KEYLEN 4
#define PRIME_VALUE 0xeaad8405

View File

@@ -5,12 +5,6 @@ extern "C"
{
#endif
#include "packet_priv.h"
#include "log.h"
#define IP_REASSEMBLE_DEBUG(format, ...) LOG_DEBUG("ip_reassembly", format, ##__VA_ARGS__)
#define IP_REASSEMBLE_ERROR(format, ...) LOG_ERROR("ip_reassembly", format, ##__VA_ARGS__)
struct ip_reassembly_options
{
uint8_t enable;

View File

@@ -12,8 +12,10 @@ extern "C"
#include "ipv4_utils.h"
#include "ipv6_utils.h"
#include "ip_reassembly.h"
#include "packet_priv.h"
#include "packet_def.h"
#include "packet_utils.h"
#include "packet_parse.h"
#include "packet_layer.h"
static inline void packet_set_ipv4_src_addr(struct packet *pkt, uint32_t saddr)
{