30 #ifndef TINS_OFFLINE_PACKET_FILTER_H 31 #define TINS_OFFLINE_PACKET_FILTER_H 35 #include <tins/macros.h> 39 #include <tins/data_link_type.h> 82 class TINS_API OfflinePacketFilter {
92 OfflinePacketFilter(
const std::string& filter,
93 const DataLinkType<T>& lt,
94 unsigned int snap_len = 65535)
95 : string_filter_(filter) {
96 init(filter, lt.get_type(), snap_len);
108 OfflinePacketFilter(
const OfflinePacketFilter& other);
117 OfflinePacketFilter& operator=(
const OfflinePacketFilter& other);
122 ~OfflinePacketFilter();
135 bool matches_filter(
const uint8_t* buffer, uint32_t total_sz)
const;
150 bool matches_filter(PDU& pdu)
const;
152 void init(
const std::string& pcap_filter,
int link_type,
153 unsigned int snap_len);
157 mutable bpf_program filter_;
158 std::string string_filter_;
163 #endif // TINS_HAVE_PCAP 165 #endif // TINS_OFFLINE_PACKET_FILTER_H The Tins namespace.
Definition: address_range.h:38