Changeset View
Changeset View
Standalone View
Standalone View
plugins/process/network/helper/Capture.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 37 | public: | |||
---|---|---|---|---|---|
47 | void handlePacket(const struct pcap_pkthdr *header, const uint8_t *data); | 47 | void handlePacket(const struct pcap_pkthdr *header, const uint8_t *data); | ||
48 | 48 | | |||
49 | private: | 49 | private: | ||
50 | void loop(); | 50 | void loop(); | ||
51 | bool checkError(int result); | 51 | bool checkError(int result); | ||
52 | 52 | | |||
53 | std::string m_interface; | 53 | std::string m_interface; | ||
54 | std::string m_error; | 54 | std::string m_error; | ||
55 | std::atomic_bool m_active; | | |||
56 | std::thread m_thread; | 55 | std::thread m_thread; | ||
57 | std::mutex m_mutex; | 56 | std::mutex m_mutex; | ||
58 | std::condition_variable m_condition; | 57 | std::condition_variable m_condition; | ||
59 | std::deque<Packet> m_queue; | 58 | std::deque<Packet> m_queue; | ||
60 | 59 | | |||
61 | int m_packetCount = 0; | 60 | int m_packetCount = 0; | ||
61 | int m_droppedPackets = 0; | ||||
62 | 62 | | |||
63 | pcap *m_pcap; | 63 | pcap *m_pcap = nullptr; | ||
64 | }; | 64 | }; | ||
65 | 65 | | |||
66 | #endif // CAPTURE_H | 66 | #endif // CAPTURE_H |