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 WritePppHeader (void)
void WritePacket (Ptr< const Packet > packet)

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.


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