30 #ifndef TINS_PACKET_WRITER_H 31 #define TINS_PACKET_WRITER_H 34 #include <tins/macros.h> 35 #include <tins/cxxstd.h> 36 #include <tins/utils/pdu_utils.h> 40 #include <tins/data_link_type.h> 80 class TINS_API PacketWriter {
90 RADIOTAP = DLT_IEEE802_11_RADIO,
91 DOT11 = DLT_IEEE802_11,
119 PacketWriter(
const std::string& file_name,
const DataLinkType<T>& lt) {
120 init(file_name, lt.get_type());
133 PacketWriter(
const std::string& file_name, LinkType lt);
144 PacketWriter(PacketWriter &&rhs) TINS_NOEXCEPT {
145 *
this = std::move(rhs);
156 PacketWriter& operator=(PacketWriter &&rhs) TINS_NOEXCEPT {
159 std::swap(handle_, rhs.handle_);
160 std::swap(dumper_, rhs.dumper_);
176 void write(PDU& pdu);
186 void write(Packet& packet);
207 template<
typename ForwardIterator>
208 void write(ForwardIterator start, ForwardIterator end) {
209 while (start != end) {
215 PacketWriter(
const PacketWriter&);
216 PacketWriter& operator=(
const PacketWriter&);
218 void init(
const std::string& file_name,
int link_type);
219 void write(PDU& pdu,
const struct timeval& tv);
222 pcap_dumper_t* dumper_;
227 #endif // TINS_HAVE_PCAP 229 #endif // TINS_PACKET_WRITER_H PDU & dereference_until_pdu(PDU &pdu)
Definition: pdu_utils.h:61
The Tins namespace.
Definition: address_range.h:38