[PACKET_IO] finish pcap live mode

This commit is contained in:
liuwentan
2022-08-05 18:32:54 +08:00
parent 9cf895fa07
commit 7442cb09d5
10 changed files with 317 additions and 67 deletions

View File

@@ -51,12 +51,13 @@ struct packet_io_config {
/* delete after the pcap file is read */
bool should_delete;
/* loop read pcap file in directory */
bool should_loop;
time_t delay;
time_t poll_interval;
/* snapshot length */
int snaplen;
/* promiscuous value */
int promisc;
};
struct lib_config {

View File

@@ -12,6 +12,14 @@
#include "../../sdk/include/packet.h"
#define PKT_QUEUE_MAX_NUM 256
#define SET_PKT_LEN(p, len) do { \
(p)->pkt_len = (len); \
} while(0)
#define GET_PKT_DIRECT_DATA(p) (uint8_t *)((p) + 1)
struct packet_queue {
struct packet *top;
struct packet *bot;