Add a packet count var for pcap file mode to the Packet structure to ease debugging.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent ce01927515
commit b90ebc1ce5

@ -319,6 +319,9 @@ typedef struct Packet_
/* IPS action to take */ /* IPS action to take */
uint8_t action; uint8_t action;
/** packet number in the pcap file, matches wireshark */
uint64_t pcap_cnt;
/* double linked list ptrs */ /* double linked list ptrs */
struct Packet_ *next; struct Packet_ *next;
struct Packet_ *prev; struct Packet_ *prev;

@ -51,6 +51,7 @@ typedef struct PcapFileGlobalVars_ {
void (*Decoder)(ThreadVars *, DecodeThreadVars *, Packet *, u_int8_t *, u_int16_t, PacketQueue *); void (*Decoder)(ThreadVars *, DecodeThreadVars *, Packet *, u_int8_t *, u_int16_t, PacketQueue *);
int datalink; int datalink;
struct bpf_program filter; struct bpf_program filter;
uint64_t cnt; /** packet counter */
} PcapFileGlobalVars; } PcapFileGlobalVars;
typedef struct PcapFileThreadVars_ typedef struct PcapFileThreadVars_
@ -150,6 +151,8 @@ TmEcode ReceivePcapFile(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq)
EngineStop(); EngineStop();
SCReturnInt(TM_ECODE_FAILED); SCReturnInt(TM_ECODE_FAILED);
} }
p->pcap_cnt = pcap_g.cnt;
pcap_g.cnt++;
SCReturnInt(TM_ECODE_OK); SCReturnInt(TM_ECODE_OK);
} }

Loading…
Cancel
Save