2014-12-01 22:15:16 +01:00
|
|
|
#ifndef _FASTNETMON_TYPES_H
|
|
|
|
#define _FASTNETMON_TYPES_H
|
|
|
|
|
|
|
|
// simplified packet struct for lightweight save into memory
|
2014-12-02 10:30:20 +01:00
|
|
|
class simple_packet {
|
|
|
|
public:
|
2015-01-23 17:37:23 +01:00
|
|
|
simple_packet() : sample_ratio(1), src_ip(0), dst_ip(0), source_port(0), destination_port(0), protocol(0), length(0), flags(0), number_of_packets(1) {
|
2014-12-02 10:30:20 +01:00
|
|
|
ts.tv_usec = 0;
|
|
|
|
ts.tv_sec = 0;
|
|
|
|
}
|
|
|
|
uint32_t sample_ratio;
|
2014-12-01 22:15:16 +01:00
|
|
|
uint32_t src_ip;
|
|
|
|
uint32_t dst_ip;
|
|
|
|
uint16_t source_port;
|
|
|
|
uint16_t destination_port;
|
|
|
|
unsigned int protocol;
|
|
|
|
unsigned int length;
|
2015-01-23 17:37:23 +01:00
|
|
|
unsigned int number_of_packets; /* for netflow */
|
2014-12-01 22:15:16 +01:00
|
|
|
uint8_t flags; /* tcp flags */
|
|
|
|
struct timeval ts;
|
|
|
|
};
|
|
|
|
|
2014-12-02 13:43:34 +01:00
|
|
|
typedef void (*process_packet_pointer)(simple_packet&);
|
|
|
|
|
2014-12-01 22:15:16 +01:00
|
|
|
#endif
|