20 #include "ns3/uinteger.h"
21 #include "ns3/buffer.h"
22 #include "ns3/header.h"
37 .AddConstructor<PcapFileWrapper> ()
38 .AddAttribute (
"CaptureSize",
39 "Maximum length of captured packets (cf. pcap snaplen)",
102 if (snapLen != std::numeric_limits<uint32_t>::max ())
104 m_file.
Init (dataLinkType, snapLen, tzCorrection);
117 uint64_t
s = current / 1000000;
118 uint64_t us = current % 1000000;
128 uint64_t
s = current / 1000000;
129 uint64_t us = current % 1000000;
139 uint64_t
s = current / 1000000;
140 uint64_t us = current % 1000000;
keep track of time values and allow control of global simulation resolution
#define NS_LOG_FUNCTION(parameters)
uint16_t GetVersionMinor(void)
void Write(Time t, Ptr< const Packet > p)
Write the next packet to file.
void Init(uint32_t dataLinkType, uint32_t snapLen=std::numeric_limits< uint32_t >::max(), int32_t tzCorrection=PcapFile::ZONE_DEFAULT)
Initialize the pcap file associated with this wrapper.
uint16_t GetVersionMajor(void)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
NS_LOG_COMPONENT_DEFINE("PcapFileWrapper")
uint32_t GetDataLinkType(void)
int64_t GetMicroSeconds(void) const
Hold an unsigned integer type.
static TypeId GetTypeId(void)
int32_t GetTimeZoneOffset(void)
void Clear(void)
Clear all state bits of the underlying iostream.
void Open(std::string const &filename, std::ios::openmode mode)
Create a new pcap file or open an existing pcap file.
void Clear(void)
Clear all state bits of the underlying iostream.
static const uint32_t SNAPLEN_DEFAULT
Default value for maximum octets to save per packet.
uint16_t GetVersionMinor(void)
void Init(uint32_t dataLinkType, uint32_t snapLen=SNAPLEN_DEFAULT, int32_t timeZoneCorrection=ZONE_DEFAULT, bool swapMode=false)
Initialize the pcap file associated with this object.
uint32_t GetSigFigs(void)
void Close(void)
Close the underlying file.
uint16_t GetVersionMajor(void)
uint32_t GetSigFigs(void)
void Open(std::string const &filename, std::ios::openmode mode)
Create a new pcap file or open an existing pcap file.
uint32_t GetDataLinkType(void)
a base class which provides memory management and object aggregation
void Close(void)
Close the underlying pcap file.
void Write(uint32_t tsSec, uint32_t tsUsec, uint8_t const *const data, uint32_t totalLen)
Write next packet to file.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
uint32_t GetSnapLen(void)
uint32_t GetSnapLen(void)
int32_t GetTimeZoneOffset(void)