update TCP utils

This commit is contained in:
luwenpeng
2024-02-21 11:49:20 +08:00
parent c37f9869a6
commit 03f428681e
7 changed files with 341 additions and 178 deletions

View File

@@ -11,6 +11,7 @@
#include "uthash.h"
#include "packet.h"
#include "udp_utils.h"
#include "tcp_utils.h"
#define likely(expr) __builtin_expect((expr), 1)
#define unlikely(expr) __builtin_expect((expr), 0)
@@ -977,7 +978,7 @@ static inline const char *parse_tcp(struct packet *handler, const char *data, ui
{
return data;
}
uint16_t hdr_len = ((struct tcphdr *)data)->th_off << 2;
uint16_t hdr_len = tcp_hdr_get_hdr_len((struct tcphdr *)data);
SET_LAYER(handler, layer, LAYER_TYPE_TCP, hdr_len, data, len);
return layer->pld_ptr;