Public Member Functions | Static Public Member Functions

ns3::PcapWriter Class Reference
[Common]

Pcap output for Packet logger. More...

#include <pcap-writer.h>

Inheritance diagram for ns3::PcapWriter:
Inheritance graph
[legend]
Collaboration diagram for ns3::PcapWriter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void Open (std::string const &name)
void WriteEthernetHeader (void)
void WriteIpHeader (void)
void WriteWifiHeader (void)
void WriteWifiRadiotapHeader (void)
void WriteWifiPrismHeader (void)
void WritePppHeader (void)
void WritePacket (Ptr< const Packet > packet)
void WriteWifiMonitorPacket (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm)
void SetCaptureSize (uint32_t size)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::PcapWriter.

Detailed Description

Pcap output for Packet logger.

Log Packets to a file in pcap format which can be read by pcap readers.


Member Function Documentation

static TypeId ns3::PcapWriter::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::PcapWriter.

Attributes defined for this type:

  • CaptureSize: Number of bytes to capture at the start of each packet written in the pcap file. Zero means capture all bytes.

No TraceSources defined for this type.

Reimplemented from ns3::Object.

void ns3::PcapWriter::Open ( std::string const &  name  ) 
Parameters:
name the name of the file to store packet log into. This method creates the file if it does not exist. If it exists, the file is emptied.
void ns3::PcapWriter::SetCaptureSize ( uint32_t  size  ) 

Set the maximum number of bytes to be captured for each packet.

Parameters:
size the maximum number of bytes to be captured. If zero (default), the whole packet will be captured.
void ns3::PcapWriter::WriteEthernetHeader ( void   ) 

Write a pcap header in the output file which specifies that the content of the file will be Packets with Ethernet/LLC/SNAP encapsulation. This method should be invoked before ns3::PcapWriter::writePacket and after ns3::PcapWriter::open.

void ns3::PcapWriter::WriteIpHeader ( void   ) 

Write a pcap header in the output file which specifies that the content of the file will be IPv4 Packets. This method should be invoked before ns3::PcapWriter::WritePacket and after ns3::PcapWriter::Open.

void ns3::PcapWriter::WritePacket ( Ptr< const Packet packet  ) 
Parameters:
packet packet to write to output file
void ns3::PcapWriter::WritePppHeader ( void   ) 

Write a pcap header in the output file which specifies that the content of the file will be ppp Packets. This method should be invoked before ns3::PcapWriter::WritePacket and after ns3::PcapWriter::Open.

void ns3::PcapWriter::WriteWifiHeader ( void   ) 

Write a pcap header in the output file which specifies that the content of the file will be 802.11 Packets. This method should be invoked before ns3::PcapWriter::WritePacket and after ns3::PcapWriter::Open.

void ns3::PcapWriter::WriteWifiMonitorPacket ( Ptr< const Packet packet,
uint16_t  channelFreqMhz,
uint16_t  channelNumber,
uint32_t  rate,
bool  isShortPreamble,
bool  isTx,
double  signalDbm,
double  noiseDbm 
)

Write a Packet, possibly adding wifi PHY layer information to it

Parameters:
packet the packet being received
channelFreqMhz the frequency in MHz at which the packet is received. Note that in real devices this is normally the frequency to which the receiver is tuned, and this can be different than the frequency at which the packet was originally transmitted. This is because it is possible to have the receiver tuned on a given channel and still to be able to receive packets on a nearby channel.
channelNumber the channel number, as defined by the IEEE 802.11 standard.
rate the PHY data rate in units of 500kbps (i.e., the same units used both for the radiotap and for the prism header)
isShortPreamble true if short preamble is used, false otherwise
isTx true if packet is being transmitted, false when packet is being received
signalDbm signal power in dBm
noiseDbm noise power in dBm
void ns3::PcapWriter::WriteWifiPrismHeader ( void   ) 

Write a pcap header in the output file which specifies that the content of the file will be 802.11 Packets preceded by a prism header providing PHY layer info. This method should be invoked before ns3::PcapWriter::WritePacket and after ns3::PcapWriter::Open.

void ns3::PcapWriter::WriteWifiRadiotapHeader ( void   ) 

Write a pcap header in the output file which specifies that the content of the file will be 802.11 Packets preceded by a radiotap header providing PHY layer info. This method should be invoked before ns3::PcapWriter::WritePacket and after ns3::PcapWriter::Open.


The documentation for this class was generated from the following files: