refactor: move packet_ldbc_hash to packet.cpp

This commit is contained in:
luwenpeng
2024-08-16 17:07:52 +08:00
parent 60a4666427
commit 839e848473
8 changed files with 144 additions and 169 deletions

View File

@@ -14,7 +14,6 @@
#include "utils.h"
#include "dumpfile_io.h"
#include "packet_private.h"
#include "packet_ldbc.h"
#include "packet_parser.h"
#include "packet_dump.h"
#include "lock_free_queue.h"
@@ -130,7 +129,7 @@ static void pcap_packet_handler(u_char *user, const struct pcap_pkthdr *h, const
struct packet pkt;
memset(&pkt, 0, sizeof(struct packet));
packet_parse(&pkt, pcap_pkt->data, pcap_pkt->len);
uint64_t hash = packet_ldbc_hash(&pkt, LDBC_HASH_OUTERMOST_INT_EXT_IP, PACKET_DIRECTION_OUTGOING);
uint64_t hash = packet_ldbc_hash(&pkt, PKT_LDBC_METH_OUTERMOST_INT_EXT_IP, PACKET_DIRECTION_OUTGOING);
// push packet to queue
struct lock_free_queue *queue = handle->queue[hash % handle->nr_threads];