1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Add PacketWriter::write overload that takes a Packet.

This commit is contained in:
Matias Fontanini
2015-05-26 21:33:13 -07:00
parent 9c25f635eb
commit 0f3441ccf6
3 changed files with 33 additions and 5 deletions

View File

@@ -37,8 +37,11 @@
#include "utils.h"
#include "cxxstd.h"
struct timeval;
namespace Tins {
class PDU;
class Packet;
/**
* \class PacketWriter
@@ -167,8 +170,19 @@ public:
/**
* \brief Writes a PDU to this file.
* \param pdu The PDU to be written.
*/
void write(PDU &pdu);
/**
* \brief Writes a Packet to this file.
*
* The timestamp used on the entry for this packet will be the Timestamp
* object associated with this packet.
*
* \param packet The packet to be written.
*/
void write(Packet &packet);
/**
* \brief Writes a PDU to this file.
@@ -200,6 +214,7 @@ private:
PacketWriter& operator=(const PacketWriter&);
void init(const std::string& file_name, int link_type);
void write(PDU& pdu, const struct timeval& tv);
pcap_t *handle;
pcap_dumper_t *dumper;

View File

@@ -35,6 +35,7 @@
#include <cstring>
#include <algorithm>
#include <string>
#include <limits>
#include <stdint.h>
#include "exceptions.h"
#include "endianness.h"