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, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm)


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

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::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,
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.
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 file:

Generated on Fri Apr 9 15:01:08 2010 for NS-3 by  doxygen 1.5.8