Export tuple.h / packet.h / session.h to the include directory

This commit is contained in:
luwenpeng
2024-04-10 11:40:26 +08:00
parent a5a133bf91
commit 24e109e34f
51 changed files with 1238 additions and 1067 deletions

View File

@@ -210,7 +210,6 @@ int packet_io_dumpfile_ingress(struct packet_io_dumpfile *handle, uint16_t threa
return nr_parsed;
}
// pkts from packet_io_dumpfile_ingress
void packet_io_dumpfile_egress(struct packet_io_dumpfile *handle, uint16_t thread_id, struct packet *pkts, int nr_pkts)
{
struct packet *pkt = NULL;
@@ -222,12 +221,14 @@ void packet_io_dumpfile_egress(struct packet_io_dumpfile *handle, uint16_t threa
ATOMIC_ADD(&handle->stat.tx_bytes, packet_get_len(pkt));
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_user_data(pkt);
assert(pcap_pkt != NULL);
free(pcap_pkt);
if (pcap_pkt)
{
free(pcap_pkt);
}
packet_free(pkt);
}
}
// pkts from packet_io_dumpfile_ingress
void packet_io_dumpfile_drop(struct packet_io_dumpfile *handle, uint16_t thread_id, struct packet *pkts, int nr_pkts)
{
struct packet *pkt = NULL;
@@ -239,12 +240,14 @@ void packet_io_dumpfile_drop(struct packet_io_dumpfile *handle, uint16_t thread_
ATOMIC_ADD(&handle->stat.drop_bytes, packet_get_len(pkt));
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_user_data(pkt);
assert(pcap_pkt != NULL);
free(pcap_pkt);
if (pcap_pkt)
{
free(pcap_pkt);
}
packet_free(pkt);
}
}
// pkts build by packet_new
void packet_io_dumpfile_inject(struct packet_io_dumpfile *handle, uint16_t thread_id, struct packet *pkts, int nr_pkts)
{
struct packet *pkt = NULL;
@@ -255,8 +258,11 @@ void packet_io_dumpfile_inject(struct packet_io_dumpfile *handle, uint16_t threa
ATOMIC_ADD(&handle->stat.inject_pkts, 1);
ATOMIC_ADD(&handle->stat.inject_bytes, packet_get_len(pkt));
assert(packet_get_user_data(pkt) == NULL);
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_user_data(pkt);
if (pcap_pkt)
{
free(pcap_pkt);
}
packet_free(pkt);
}
}