Add packet_build.cpp support imitate_tcp_packet() / imitate_udp_packet()

This commit is contained in:
luwenpeng
2024-04-24 11:40:00 +08:00
parent ffead24e45
commit d8963af5f8
16 changed files with 444 additions and 441 deletions

View File

@@ -203,7 +203,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_get_hash(&pkt, LDBC_METHOD_HASH_INT_IP_AND_EXT_IP, 0);
uint64_t hash = packet_get_hash(&pkt, LDBC_METHOD_HASH_INT_IP_AND_EXT_IP, PACKET_DIRECTION_OUTGOING);
// push packet to queue
struct lock_free_queue *queue = handle->queue[hash % handle->nr_threads];