A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::Packet Class Reference

network packets More...

#include <packet.h>

+ Inheritance diagram for ns3::Packet:
+ Collaboration diagram for ns3::Packet:

Public Member Functions

 Packet ()
 Packet (const Packet &o)
 Packet (uint32_t size)
 Packet (uint8_t const *buffer, uint32_t size, bool magic)
 Packet (uint8_t const *buffer, uint32_t size)
void AddAtEnd (Ptr< const Packet > packet)
void AddByteTag (const Tag &tag) const
void AddHeader (const Header &header)
void AddPacketTag (const Tag &tag) const
void AddPaddingAtEnd (uint32_t size)
void AddTrailer (const Trailer &trailer)
PacketMetadata::ItemIterator BeginItem (void) const
Ptr< PacketCopy (void) const
uint32_t CopyData (uint8_t *buffer, uint32_t size) const
void CopyData (std::ostream *os, uint32_t size) const
Ptr< PacketCreateFragment (uint32_t start, uint32_t length) const
bool FindFirstMatchingByteTag (Tag &tag) const
ByteTagIterator GetByteTagIterator (void) const
Ptr< NixVectorGetNixVector (void) const
PacketTagIterator GetPacketTagIterator (void) const
uint32_t GetSerializedSize (void) const
uint32_t GetSize (void) const
uint64_t GetUid (void) const
Packetoperator= (const Packet &o)
uint8_t const * PeekData (void) const NS_DEPRECATED
uint32_t PeekHeader (Header &header) const
bool PeekPacketTag (Tag &tag) const
uint32_t PeekTrailer (Trailer &trailer)
void Print (std::ostream &os) const
void PrintByteTags (std::ostream &os) const
void PrintPacketTags (std::ostream &os) const
void RemoveAllByteTags (void)
void RemoveAllPacketTags (void)
void RemoveAtEnd (uint32_t size)
void RemoveAtStart (uint32_t size)
uint32_t RemoveHeader (Header &header)
bool RemovePacketTag (Tag &tag)
uint32_t RemoveTrailer (Trailer &trailer)
uint32_t Serialize (uint8_t *buffer, uint32_t maxSize) const
void SetNixVector (Ptr< NixVector >)
- Public Member Functions inherited from ns3::SimpleRefCount< Packet >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const

Static Public Member Functions

static void EnableChecking (void)
static void EnablePrinting (void)
- Static Public Member Functions inherited from ns3::SimpleRefCount< Packet >
static void Cleanup (void)

Private Member Functions

 Packet (const Buffer &buffer, const ByteTagList &byteTagList, const PacketTagList &packetTagList, const PacketMetadata &metadata)
uint32_t Deserialize (uint8_t const *buffer, uint32_t size)

Private Attributes

Buffer m_buffer
ByteTagList m_byteTagList
PacketMetadata m_metadata
Ptr< NixVectorm_nixVector
PacketTagList m_packetTagList

Static Private Attributes

static uint32_t m_globalUid = 0

Detailed Description

network packets

Each network packet contains a byte buffer, a set of byte tags, a set of packet tags, and metadata.

  • The byte buffer stores the serialized content of the headers and trailers added to a packet. The serialized representation of these headers is expected to match that of real network packets bit for bit (although nothing forces you to do this) which means that the content of a packet buffer is expected to be that of a real packet.
  • The metadata describes the type of the headers and trailers which were serialized in the byte buffer. The maintenance of metadata is optional and disabled by default. To enable it, you must call Packet::EnablePrinting and this will allow you to get non-empty output from Packet::Print. If you wish to only enable checking of metadata, and do not need any printing capability, you can call Packet::EnableChecking: its runtime cost is lower than Packet::EnablePrinting.
  • The set of tags contain simulation-specific information which cannot be stored in the packet byte buffer because the protocol headers or trailers have no standard-conformant field for this information. So-called 'byte' tags are used to tag a subset of the bytes in the packet byte buffer while 'packet' tags are used to tag the packet itself. The main difference between these two kinds of tags is what happens when packets are copied, fragmented, and reassembled: 'byte' tags follow bytes while 'packet' tags follow packets. Another important difference between these two kinds of tags is that byte tags cannot be removed and are expected to be written once, and read many times, while packet tags are expected to be written once, read many times, and removed exactly once. An example of a 'byte' tag is a FlowIdTag which contains a flow id and is set by the application generating traffic. An example of a 'packet' tag is a cross-layer qos class id set by an application and processed by a lower-level MAC layer.

Implementing a new type of Header or Trailer for a new protocol is pretty easy and is a matter of creating a subclass of the ns3::Header or of the ns3::Trailer base class, and implementing the methods described in their respective API documentation.

Implementing a new type of Tag requires roughly the same amount of work and this work is described in the ns3::Tag API documentation.

The performance aspects of the Packet API are discussed in Packet Performance

Definition at line 203 of file packet.h.

Constructor & Destructor Documentation

ns3::Packet::Packet ( )

Create an empty packet with a new uid (as returned by getUid).

Definition at line 128 of file packet.cc.

References m_globalUid.

Referenced by CreateFragment().

+ Here is the caller graph for this function:

ns3::Packet::Packet ( const Packet o)

Definition at line 144 of file packet.cc.

References ns3::NixVector::Copy(), and m_nixVector.

+ Here is the call graph for this function:

ns3::Packet::Packet ( uint32_t  size)

Create a packet with a zero-filled payload. The memory necessary for the payload is not allocated: it will be allocated at any later point if you attempt to fragment this packet or to access the zero-filled bytes. The packet is allocated with a new uid (as returned by getUid).

Parameters
sizethe size of the zero-filled payload

Definition at line 170 of file packet.cc.

References m_globalUid.

ns3::Packet::Packet ( uint8_t const *  buffer,
uint32_t  size,
bool  magic 
)

Create a new packet from the serialized buffer. This new packet is identical to the serialized packet contained in the buffer and is magically deserialized for you

Parameters
bufferthe serialized packet to be created
sizethe size of the packet for deserialization
magicallows packet deserialization; asserts when set to false

Definition at line 185 of file packet.cc.

References Deserialize(), and NS_ASSERT.

+ Here is the call graph for this function:

ns3::Packet::Packet ( uint8_t const *  buffer,
uint32_t  size 
)

Create a packet with payload filled with the content of this buffer. The input data is copied: the input buffer is untouched.

Parameters
bufferthe data to store in the packet.
sizethe size of the input buffer.

Definition at line 196 of file packet.cc.

References ns3::Buffer::AddAtStart(), ns3::Buffer::Begin(), m_buffer, m_globalUid, and ns3::Buffer::Iterator::Write().

+ Here is the call graph for this function:

ns3::Packet::Packet ( const Buffer buffer,
const ByteTagList byteTagList,
const PacketTagList packetTagList,
const PacketMetadata metadata 
)
private

Definition at line 215 of file packet.cc.

Member Function Documentation

void ns3::Packet::AddAtEnd ( Ptr< const Packet packet)
void ns3::Packet::AddByteTag ( const Tag tag) const
Parameters
tagthe new tag to add to this packet

Tag each byte included in this packet with the new tag.

Note that adding a tag is a const operation which is pretty un-intuitive. The rationale is that the content and behavior of a packet is not changed when a tag is added to a packet: any code which was not aware of the new tag is going to work just the same if the new tag is added. The real reason why adding a tag was made a const operation is to allow a trace sink which gets a packet to tag the packet, even if the packet is const (and most trace sources should use const packets because it would be totally evil to allow a trace sink to modify the content of a packet).

Definition at line 806 of file packet.cc.

References ns3::Buffer::GetCurrentEndOffset(), ns3::Buffer::GetCurrentStartOffset(), ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), ns3::Tag::GetSerializedSize(), list, m_buffer, m_byteTagList, NS_LOG_FUNCTION, and ns3::Tag::Serialize().

Referenced by ns3::AnimationInterface::CsmaPhyTxBeginTrace(), ns3::LteRlcUm::DoNotifyTxOpportunity(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::LteRlcSm::DoNotifyTxOpportunity(), ns3::PacketTest::DoRun(), ns3::LtePdcp::DoTransmitRrcPdu(), ns3::AnimationInterface::LteSpectrumPhyTxStart(), ns3::AnimationInterface::LteTxTrace(), ns3::DelayJitterEstimation::PrepareTx(), CollisionExperiment::SendA(), CollisionExperiment::SendB(), ns3::PyViz::TraceNetDevTxCommon(), ns3::AnimationInterface::UanPhyGenTxTrace(), ns3::AnimationInterface::WifiPhyTxBeginTrace(), and ns3::AnimationInterface::WimaxTxTrace().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Packet::AddHeader ( const Header header)

Add header to this packet. This method invokes the Header::GetSerializedSize and Header::Serialize methods to reserve space in the buffer and request the header to serialize itself in the packet buffer.

Parameters
headera reference to the header to add to this packet.

Definition at line 251 of file packet.cc.

References ns3::ByteTagList::AddAtStart(), ns3::Buffer::AddAtStart(), ns3::PacketMetadata::AddHeader(), ns3::Buffer::Begin(), ns3::Buffer::GetCurrentStartOffset(), ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), ns3::Header::GetSerializedSize(), m_buffer, m_byteTagList, m_metadata, NS_LOG_FUNCTION, and ns3::Header::Serialize().

Referenced by ns3::dsr::DsrRouting::AddAckReqHeader(), ns3::PointToPointNetDevice::AddHeader(), ns3::CsmaNetDevice::AddHeader(), ns3::MsduStandardAggregator::Aggregate(), ns3::UanMacRc::Associate(), ns3::UanMacRc::AssociateTimeout(), benchA(), benchB(), benchC(), benchD(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::BaseStationNetDevice::CreateDcd(), ns3::BaseStationNetDevice::CreateDlMap(), ns3::SsServiceFlowManager::CreateDsaAck(), ns3::MeshWifiBeacon::CreatePacket(), ns3::BaseStationNetDevice::CreateUcd(), ns3::BaseStationNetDevice::CreateUlMap(), ns3::WimaxMacQueue::Dequeue(), ns3::Ipv4L3Protocol::DoFragmentation(), ns3::LteRlcUm::DoNotifyTxOpportunity(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::BaseStationNetDevice::DoReceive(), ns3::flame::FlameHeaderTest::DoRun(), ns3::dot11s::MeshHeaderTest::DoRun(), ns3::MeshInformationElementVectorBist::DoRun(), ns3::EpsGtpuHeaderTestCase::DoRun(), DsaRequestTestCase::DoRun(), ns3::OlsrMidTestCase::DoRun(), Ns3WimaxCsParamTlvTestCase::DoRun(), ns3::DsdvHeaderTestCase::DoRun(), ns3::EpcTftClassifierTestCase::DoRun(), ns3::aodv::TypeHeaderTest::DoRun(), ns3::aodv::RreqHeaderTest::DoRun(), Ns3WimaxSfTlvTestCase::DoRun(), ns3::OlsrHelloTestCase::DoRun(), ns3::aodv::RrepHeaderTest::DoRun(), ns3::PacketTest::DoRun(), ns3::dot11s::PeerLinkFrameStartTest::DoRun(), ns3::aodv::RrepAckHeaderTest::DoRun(), ns3::OlsrTcTestCase::DoRun(), ns3::aodv::RerrHeaderTest::DoRun(), ns3::OlsrHnaTestCase::DoRun(), ns3::Ipv4RawSocketImplTest::DoSendData_IpHdr(), ns3::Ipv4HeaderTest::DoSendData_IpHdr_Dscp(), ns3::LtePdcp::DoTransmitRrcPdu(), ns3::UanMacRcGw::EndCycle(), ns3::UanMacAloha::Enqueue(), ns3::UanMacCw::Enqueue(), ns3::SubscriberStationNetDevice::Enqueue(), ns3::Icmpv6L4Protocol::ForgeEchoRequest(), ns3::Icmpv6L4Protocol::ForgeNA(), ns3::Icmpv6L4Protocol::ForgeNS(), ns3::Icmpv6L4Protocol::ForgeRS(), ns3::dsr::DsrRouting::ForwardErrPacket(), ns3::dsr::DsrRouting::ForwardPacket(), ns3::dot11s::HwmpProtocolMac::ForwardPerr(), ns3::Ipv4RawSocketImpl::ForwardUp(), ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::Ipv6ExtensionFragment::GetFragments(), ns3::Icmpv4L4Protocol::HandleEcho(), ns3::Ipv6ExtensionFragment::HandleFragmentsTimeout(), ns3::Ipv6L3Protocol::IpForward(), ns3::Ipv4L3ProtocolDropSinkWithContext(), ns3::Ipv4L3ProtocolDropSinkWithoutContext(), ns3::Ipv6L3ProtocolDropSinkWithContext(), ns3::Ipv6L3ProtocolDropSinkWithoutContext(), ns3::Ipv6L3Protocol::LocalDeliver(), main(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::PcapSniffRxEvent(), ns3::PcapSniffTxEvent(), ns3::PcapSniffTxRxEvent(), ns3::WimaxMacQueue::Peek(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrOptionRrep::Process(), ns3::Ipv6ExtensionRouting::Process(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::Ipv6Extension::ProcessOptions(), ns3::NscTcpL4Protocol::Receive(), ns3::TapBridge::ReceiveFromBridgedDevice(), ns3::aodv::RoutingProtocol::RecvError(), ns3::aodv::RoutingProtocol::RecvReply(), ns3::aodv::RoutingProtocol::RecvRequest(), ns3::flame::FlameProtocol::RequestRoute(), ns3::UanMacRc::RtsTimeout(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::BlockAckManager::ScheduleBlockAckReqIfNeeded(), ns3::UanMacRc::ScheduleData(), ns3::SsServiceFlowManager::ScheduleDsaReq(), ns3::BsServiceFlowManager::ScheduleDsaRsp(), ns3::BSLinkManager::ScheduleRngRspMessage(), ns3::V4Ping::Send(), ns3::UdpClient::Send(), ns3::LteRadioBearerTagUdpClient::Send(), ns3::UdpL4Protocol::Send(), ns3::WifiNetDevice::Send(), ns3::TcpL4Protocol::Send(), ns3::Radvd::Send(), ns3::Ipv4L3Protocol::Send(), ns3::WimaxNetDevice::Send(), ns3::dsr::DsrRouting::Send(), ns3::dsr::DsrRouting::SendAck(), ns3::MacLow::SendAckAfterData(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::RegularWifiMac::SendAddBaResponse(), ns3::ArpL3Protocol::SendArpReply(), ns3::ArpL3Protocol::SendArpRequest(), ns3::StaWifiMac::SendAssociationRequest(), ns3::ApWifiMac::SendAssocResp(), ns3::BandwidthManager::SendBandwidthRequest(), ns3::MacLow::SendBlockAckResponse(), ns3::MacLow::SendCtsAfterRts(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), ns3::EdcaTxopN::SendDelbaFrame(), ns3::Icmpv4L4Protocol::SendDestUnreach(), ns3::Icmpv6L4Protocol::SendEchoReply(), ns3::dsr::DsrRouting::SendErrorRequest(), ns3::WifiNetDevice::SendFrom(), ns3::AlohaNoackNetDevice::SendFrom(), ns3::EmuNetDevice::SendFrom(), ns3::WimaxNetDevice::SendFrom(), ns3::dsr::DsrRouting::SendGratuitousReply(), ns3::aodv::RoutingProtocol::SendHello(), ns3::Icmpv4L4Protocol::SendMessage(), ns3::Icmpv6L4Protocol::SendMessage(), ns3::Icmpv6L4Protocol::SendNA(), ns3::Icmpv6L4Protocol::SendNS(), ns3::ApWifiMac::SendOneBeacon(), ns3::UdpTraceClient::SendPacket(), ns3::TcpL4Protocol::SendPacket(), ns3::olsr::RoutingProtocol::SendPacket(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), ns3::dot11s::PeerManagementProtocolMac::SendPeerLinkManagementFrame(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), ns3::dot11s::HwmpProtocolMac::SendPrep(), ns3::dot11s::HwmpProtocolMac::SendPreq(), ns3::StaWifiMac::SendProbeRequest(), ns3::ApWifiMac::SendProbeResp(), ns3::olsr::RoutingProtocol::SendQueuedMessages(), ns3::SSLinkManager::SendRangingRequest(), ns3::Ipv4L3Protocol::SendRealOut(), ns3::Ipv6L3Protocol::SendRealOut(), ns3::Icmpv6L4Protocol::SendRedirection(), ns3::aodv::RoutingProtocol::SendReply(), ns3::aodv::RoutingProtocol::SendReplyAck(), ns3::aodv::RoutingProtocol::SendReplyByIntermediateNode(), ns3::aodv::RoutingProtocol::SendRequest(), ns3::aodv::RoutingProtocol::SendRerrWhenBreaksLinkToNextHop(), ns3::aodv::RoutingProtocol::SendRerrWhenNoRouteToForward(), ns3::Icmpv6L4Protocol::SendRS(), ns3::UanMacRc::SendRts(), ns3::MacLow::SendRtsForPacket(), ns3::Icmpv4L4Protocol::SendTimeExceededTtl(), ns3::Ipv6RawSocketImpl::SendTo(), ns3::EpcEnbApplication::SendToS1uSocket(), ns3::EpcSgwPgwApplication::SendToS1uSocket(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), ns3::dsr::DsrRouting::SendUnreachError(), ns3::UanMacRcGw::StartCycle(), ns3::PyViz::TraceIpv4Drop(), and ns3::dot11s::HwmpProtocolMac::UpdateOutcomingFrame().

+ Here is the call graph for this function:

void ns3::Packet::AddPacketTag ( const Tag tag) const
Parameters
tagthe tag to store in this packet

Add a tag to this packet. This method calls the Tag::GetSerializedSize and, then, Tag::Serialize.

Note that this method is const, that is, it does not modify the state of this packet, which is fairly un-intuitive.

Definition at line 839 of file packet.cc.

References ns3::PacketTagList::Add(), ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), ns3::Tag::GetSerializedSize(), m_packetTagList, and NS_LOG_FUNCTION.

Referenced by benchD(), ns3::LteRlcUm::DoNotifyTxOpportunity(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::LteEnbRrc::DoReceiveRrcPdu(), ns3::LteDownlinkSinrTestCase::DoRun(), ns3::LteUplinkSinrTestCase::DoRun(), ns3::PacketTest::DoRun(), ns3::UdpSocketImpl::DoSendTo(), ns3::LteRlcUm::DoTransmitPdcpPdu(), ns3::LteRlcAm::DoTransmitPdcpPdu(), ns3::LteUeMac::DoTransmitPdu(), ns3::LteEnbMac::DoTransmitPdu(), ns3::dot11s::HwmpProtocol::ForwardUnicast(), ns3::Ipv4RawSocketImpl::ForwardUp(), ns3::UdpSocketImpl::ForwardUp(), ns3::PacketSocket::ForwardUp(), ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::UdpSocketImpl::ForwardUp6(), main(), ns3::WifiRemoteStationManager::PrepareForQueue(), ns3::dot11s::HwmpProtocol::ProactivePathResolved(), ns3::dsr::DsrOptionRreq::Process(), ns3::dot11s::HwmpProtocol::ReactivePathResolved(), ns3::NscTcpSocketImpl::ReadPendingData(), ns3::flame::FlameProtocolMac::Receive(), ns3::MeshWifiInterfaceMac::Receive(), ns3::dot11s::HwmpProtocolMac::ReceiveData(), ns3::TcpSocketBase::Recv(), ns3::dot11s::HwmpProtocol::RequestRoute(), ns3::flame::FlameProtocol::RequestRoute(), ns3::aodv::RoutingProtocol::RouteOutput(), ns3::dsdv::RoutingProtocol::RouteOutput(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::LteRadioBearerTagUdpClient::Send(), ns3::Radvd::Send(), ns3::MacLow::SendAckAfterData(), ns3::MacLow::SendCtsAfterRts(), ns3::dsr::DsrRouting::SendErrorRequest(), ns3::dsr::DsrRouting::SendInitialRequest(), ns3::Icmpv6L4Protocol::SendMessage(), ns3::Ipv4FlowProbe::SendOutgoingLogger(), ns3::EpcEnbApplication::SendToLteSocket(), and ns3::LteSpectrumPhy::StartTx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Packet::AddPaddingAtEnd ( uint32_t  size)
Parameters
sizenumber of padding bytes to add.

Definition at line 331 of file packet.cc.

References ns3::ByteTagList::AddAtEnd(), ns3::Buffer::AddAtEnd(), ns3::PacketMetadata::AddPaddingAtEnd(), ns3::Buffer::GetCurrentEndOffset(), m_buffer, m_byteTagList, m_metadata, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::Packet::AddTrailer ( const Trailer trailer)

Add trailer to this packet. This method invokes the Trailer::GetSerializedSize and Trailer::Serialize methods to reserve space in the buffer and request the trailer to serialize itself in the packet buffer.

Parameters
trailera reference to the trailer to add to this packet.

Definition at line 282 of file packet.cc.

References ns3::ByteTagList::AddAtEnd(), ns3::Buffer::AddAtEnd(), ns3::PacketMetadata::AddTrailer(), ns3::Buffer::End(), ns3::Buffer::GetCurrentEndOffset(), ns3::Buffer::GetCurrentStartOffset(), ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), ns3::Trailer::GetSerializedSize(), m_buffer, m_byteTagList, m_metadata, NS_LOG_FUNCTION, and ns3::Trailer::Serialize().

Referenced by ns3::CsmaNetDevice::AddHeader(), ns3::PacketTest::DoRun(), ns3::MacLow::SendAckAfterData(), ns3::MacLow::SendBlockAckResponse(), ns3::MacLow::SendCtsAfterRts(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), and ns3::MacLow::SendRtsForPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PacketMetadata::ItemIterator ns3::Packet::BeginItem ( void  ) const
Returns
an iterator which points to the first 'item' stored in this buffer. Note that this iterator will point to an empty array of items if you don't call EnablePrinting or EnableChecking before.
See Also
EnablePrinting EnableChecking

Definition at line 544 of file packet.cc.

References ns3::PacketMetadata::BeginItem(), m_buffer, and m_metadata.

Referenced by ns3::PacketMetadataTest::CheckHistory(), and ns3::PyViz::FilterPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr< Packet > ns3::Packet::Copy ( void  ) const
Returns
a COW copy of the packet.

The returns packet will behave like an independent copy of the original packet, even though they both share the same datasets internally.

Definition at line 120 of file packet.cc.

References ns3::PacketTagIterator::Packet.

Referenced by ns3::dsr::DsrRouting::AddAckReqHeader(), ns3::MsduStandardAggregator::Aggregate(), benchA(), benchD(), ns3::dsr::DsrRouting::CancelPacketTimerNextHop(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::IpcsClassifier::Classify(), ns3::EpcTftClassifier::Classify(), ns3::PacketBurst::Copy(), ns3::WimaxMacQueue::Dequeue(), ns3::Ipv4L3Protocol::DoFragmentation(), ns3::LteRlcUm::DoNotifyTxOpportunity(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::BaseStationNetDevice::DoReceive(), ns3::PacketTest::DoRun(), ns3::MeshPointDevice::DoSend(), ns3::UdpSocketImpl::DoSendTo(), ns3::LteSpectrumPhy::EndTx(), ns3::dsr::DsrRouting::FindSamePackets(), ns3::Icmpv6L4Protocol::ForgeEchoRequest(), ns3::BridgeNetDevice::ForwardBroadcast(), ns3::MeshWifiInterfaceMac::ForwardDown(), ns3::dsr::DsrRouting::ForwardPacket(), ns3::BridgeNetDevice::ForwardUnicast(), ns3::Ipv4RawSocketImpl::ForwardUp(), ns3::PacketSocket::ForwardUp(), ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::EmuNetDevice::ForwardUp(), ns3::Ipv6ExtensionFragment::GetFragments(), ns3::Ipv6ExtensionFragment::Fragments::GetPacket(), ns3::Ipv6ExtensionFragment::Fragments::GetPartialPacket(), ns3::EdcaTxopN::GotAck(), ns3::HalfDuplexIdealPhySignalParameters::HalfDuplexIdealPhySignalParameters(), ns3::Icmpv6L4Protocol::HandleDestinationUnreachable(), ns3::Icmpv6L4Protocol::HandlePacketTooBig(), ns3::Icmpv6L4Protocol::HandleParameterError(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::Ipv4FragmentationTest::HandleReadClient(), ns3::Ipv6FragmentationTest::HandleReadClient(), ns3::Ipv4FragmentationTest::HandleReadServer(), ns3::Ipv6FragmentationTest::HandleReadServer(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleTimeExceeded(), ns3::Ipv4L3Protocol::IpForward(), ns3::Ipv6L3Protocol::IpForward(), ns3::Ipv4L3Protocol::IpMulticastForward(), ns3::Ipv6L3Protocol::IpMulticastForward(), ns3::Ipv4L3ProtocolDropSinkWithContext(), ns3::Ipv4L3ProtocolDropSinkWithoutContext(), Ns3TcpStateTestCase::Ipv4L3Tx(), Ns3TcpLossTestCase::Ipv4L3Tx(), Ns3TcpInteroperabilityTestCase::Ipv4L3Tx(), ns3::Ipv6L3ProtocolDropSinkWithContext(), ns3::Ipv6L3ProtocolDropSinkWithoutContext(), ns3::Ipv4L3Protocol::LocalDeliver(), ns3::Ipv6L3Protocol::LocalDeliver(), main(), ns3::dsr::DsrRouting::NetworkScheduleTimerExpire(), ns3::AlohaNoackNetDevice::NotifyReceptionEndOk(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::dsr::DsrRouting::PassiveScheduleTimerExpire(), ns3::PcapSniffRxEvent(), ns3::PcapSniffTxEvent(), ns3::PcapSniffTxRxEvent(), ns3::WimaxMacQueue::Peek(), ns3::Ipv6OptionPad1::Process(), ns3::Ipv6OptionPadn::Process(), ns3::Ipv6ExtensionHopByHop::Process(), ns3::Ipv6OptionJumbogram::Process(), ns3::Ipv6ExtensionDestination::Process(), ns3::dsr::DsrOptionPad1::Process(), ns3::Ipv6OptionRouterAlert::Process(), ns3::Ipv6ExtensionFragment::Process(), ns3::dsr::DsrOptionPadn::Process(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrOptionRrep::Process(), ns3::Ipv6ExtensionRouting::Process(), ns3::dsr::DsrOptionSR::Process(), ns3::dsr::DsrOptionRerr::Process(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::dsr::DsrOptionAckReq::Process(), ns3::dsr::DsrOptionAck::Process(), ns3::Ipv4L3Protocol::ProcessFragment(), ns3::Ipv6Extension::ProcessOptions(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::dot11s::PeerManagementProtocolMac::Receive(), ns3::ArpL3Protocol::Receive(), ns3::ApWifiMac::Receive(), ns3::UdpL4Protocol::Receive(), ns3::Ipv6L3Protocol::Receive(), ns3::Ipv4L3Protocol::Receive(), ns3::CsmaNetDevice::Receive(), ns3::LteTestMac::Receive(), ns3::Icmpv6L4Protocol::Receive(), ns3::dsr::DsrRouting::Receive(), ns3::TapBridge::ReceiveFromBridgedDevice(), ns3::MeshPointDevice::ReceiveFromDevice(), ns3::EpcSgwPgwApplication::RecvFromTunDevice(), ns3::dot11s::HwmpProtocol::RequestRoute(), ns3::flame::FlameProtocol::RequestRoute(), ns3::aodv::RoutingProtocol::RouteInput(), ns3::dsdv::RoutingProtocol::RouteInput(), ns3::Ipv4ListRouting::RouteInput(), ns3::Ipv6ListRouting::RouteInput(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::UanMacRc::ScheduleData(), ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry(), ns3::SimpleChannel::Send(), ns3::ErrorChannel::Send(), ns3::YansWifiChannel::Send(), ns3::Ipv4L3Protocol::Send(), ns3::dsdv::RoutingProtocol::Send(), ns3::dsr::DsrRouting::Send(), ns3::Icmpv6L4Protocol::SendEchoReply(), ns3::dsr::DsrRouting::SendErrorRequest(), ns3::dsr::DsrRouting::SendInitialRequest(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), ns3::dsr::DsrRouting::SendRealDown(), ns3::dsr::DsrRouting::SendRerrWhenBreaksLinkToNextHop(), ns3::dsr::DsrRouting::SendUnreachError(), ns3::MacLow::StartTransmission(), ns3::PyViz::TraceDevQueueDrop(), ns3::PyViz::TraceIpv4Drop(), ns3::PyViz::TraceNetDevRxCommon(), ns3::PyViz::TraceNetDevTxCommon(), ns3::CsmaChannel::TransmitEnd(), and ns3::UanChannel::TxPacket().

uint32_t ns3::Packet::CopyData ( uint8_t *  buffer,
uint32_t  size 
) const
Parameters
buffera pointer to a byte buffer where the packet data should be copied.
sizethe size of the byte buffer.
Returns
the number of bytes read from the packet

No more than size bytes will be copied by this function.

Definition at line 379 of file packet.cc.

References ns3::Buffer::CopyData(), and m_buffer.

Referenced by ns3::dsr::DsrRouting::AddAckReqHeader(), ns3::EthernetTrailer::CalcFcs(), ns3::EthernetTrailer::CheckFcs(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::SimpleOfdmWimaxPhy::ConvertBurstToBits(), ns3::LteTestPdcp::DoReceivePdcpPdu(), ns3::Ipv4FragmentationTest::DoRun(), ns3::Ipv6FragmentationTest::DoRun(), ns3::PacketTest::DoRun(), ns3::dsr::DsrOptionRerr::DoSendError(), ns3::LteTestMac::DoTransmitPdu(), ns3::Ipv6ExtensionFragment::GetFragments(), ns3::GetString(), ns3::Icmpv6L4Protocol::HandleDestinationUnreachable(), ns3::Icmpv6L4Protocol::HandleEchoRequest(), ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandlePacketTooBig(), ns3::Icmpv6L4Protocol::HandleParameterError(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::Ping6::HandleRead(), ns3::Radvd::HandleRead(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::Icmpv6L4Protocol::HandleTimeExceeded(), Ns3TcpStateTestCase::Ipv4L3Tx(), Ns3TcpLossTestCase::Ipv4L3Tx(), Ns3TcpInteroperabilityTestCase::Ipv4L3Tx(), ns3::Ipv6L3Protocol::LocalDeliver(), ns3::dsr::DsrRouting::NetworkScheduleTimerExpire(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrOptionRrep::Process(), ns3::Ipv6ExtensionRouting::Process(), ns3::dsr::DsrOptionSR::Process(), ns3::dsr::DsrOptionRerr::Process(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::Ipv6Extension::ProcessOptions(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::NscTcpL4Protocol::Receive(), ns3::Icmpv6L4Protocol::Receive(), ns3::dsr::DsrRouting::Receive(), ns3::TapBridge::ReceiveFromBridgedDevice(), ns3::Socket::Recv(), ns3::Socket::RecvFrom(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::EmuNetDevice::SendFrom(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), ns3::Ipv6RawSocketImpl::SendTo(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), ns3::Icmpv6ParameterError::Serialize(), ns3::Icmpv6OptionRedirected::Serialize(), ns3::Icmpv4Echo::SetData(), ns3::Icmpv4DestinationUnreachable::SetData(), ns3::Icmpv4TimeExceeded::SetData(), and ns3::PcapFile::Write().

+ Here is the call graph for this function:

void ns3::Packet::CopyData ( std::ostream *  os,
uint32_t  size 
) const
Parameters
ospointer to output stream in which we want to write the packet data.
sizethe maximum number of bytes we want to write in the output stream.

Definition at line 385 of file packet.cc.

References ns3::Buffer::CopyData(), and m_buffer.

+ Here is the call graph for this function:

Ptr< Packet > ns3::Packet::CreateFragment ( uint32_t  start,
uint32_t  length 
) const
uint32_t ns3::Packet::Deserialize ( uint8_t const *  buffer,
uint32_t  size 
)
private

Definition at line 724 of file packet.cc.

References ns3::NixVector::Deserialize(), ns3::PacketMetadata::Deserialize(), ns3::Buffer::Deserialize(), m_buffer, m_metadata, m_nixVector, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Packet().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Packet::EnableChecking ( void  )
static

The packet metadata is also used to perform extensive sanity checks at runtime when performing operations on a Packet. For example, this metadata is used to verify that when you remove a header from a packet, this same header was actually present at the front of the packet. These errors will be detected and will abort the program.

Definition at line 557 of file packet.cc.

References NS_LOG_FUNCTION_NOARGS.

void ns3::Packet::EnablePrinting ( void  )
static

By default, packets do not keep around enough metadata to perform the operations requested by the Print methods. If you want to be able the Packet::Print method, you need to invoke this method at least once during the simulation setup and before any packet is created.

Definition at line 550 of file packet.cc.

References ns3::PacketMetadata::Enable(), and NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::LteRlcAmTransmitterTestCase::DoRun(), ns3::LteRlcUmTransmitterTestCase::DoRun(), ns3::UanHelper::EnableAscii(), ns3::EmuHelper::EnableAsciiInternal(), ns3::PointToPointHelper::EnableAsciiInternal(), ns3::CsmaHelper::EnableAsciiInternal(), ns3::YansWifiPhyHelper::EnableAsciiInternal(), ns3::WimaxHelper::EnableAsciiInternal(), ns3::InternetStackHelper::EnableAsciiIpv4Internal(), ns3::InternetStackHelper::EnableAsciiIpv6Internal(), ns3::AnimationInterface::EnablePacketMetadata(), and main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::Packet::FindFirstMatchingByteTag ( Tag tag) const
Parameters
tagthe tag to search in this packet
Returns
true if the requested tag type was found, false otherwise.

If the requested tag type is found, it is copied in the user's provided tag instance.

Definition at line 822 of file packet.cc.

References GetByteTagIterator(), ns3::ObjectBase::GetInstanceTypeId(), ns3::ByteTagIterator::Item::GetTag(), ns3::ByteTagIterator::Item::GetTypeId(), ns3::ByteTagIterator::HasNext(), and ns3::ByteTagIterator::Next().

Referenced by ns3::LteRlcUm::DoReceivePdu(), ns3::LteRlcAm::DoReceivePdu(), ns3::LtePdcp::DoReceivePdu(), ns3::LteRlcSm::DoReceivePdu(), CollisionExperiment::Receive(), ns3::DelayJitterEstimation::RecordRx(), and ns3::PyViz::TraceNetDevRxCommon().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ByteTagIterator ns3::Packet::GetByteTagIterator ( void  ) const
Returns
an iterator over the set of byte tags included in this packet.

Definition at line 816 of file packet.cc.

References ns3::ByteTagList::Begin(), ns3::Buffer::GetCurrentEndOffset(), ns3::Buffer::GetCurrentStartOffset(), m_buffer, and m_byteTagList.

Referenced by ns3::PacketTest::DoCheck(), FindFirstMatchingByteTag(), ns3::AnimationInterface::GetAnimUidFromPacket(), and PrintByteTags().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr< NixVector > ns3::Packet::GetNixVector ( void  ) const

Definition at line 245 of file packet.cc.

References m_nixVector.

Referenced by ns3::Ipv4NixVectorRouting::RouteInput().

+ Here is the caller graph for this function:

PacketTagIterator ns3::Packet::GetPacketTagIterator ( void  ) const
Returns
an object which can be used to iterate over the list of packet tags.

Definition at line 888 of file packet.cc.

References ns3::PacketTagList::Head(), and m_packetTagList.

Referenced by PrintPacketTags().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::Packet::GetSerializedSize ( void  ) const

For packet serializtion, the total size is checked in order to determine the size of the buffer required for serialization

Returns
number of bytes required for packet serialization

Definition at line 563 of file packet.cc.

References ns3::NixVector::GetSerializedSize(), ns3::PacketMetadata::GetSerializedSize(), ns3::Buffer::GetSerializedSize(), m_buffer, m_metadata, and m_nixVector.

Referenced by ns3::Icmpv6L4Protocol::HandleDestinationUnreachable(), and ns3::MpiInterface::SendPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::Packet::GetSize ( void  ) const
inline
Returns
the size in bytes of the packet (including the zero-filled initial payload)

Definition at line 620 of file packet.h.

References ns3::Buffer::GetSize(), and m_buffer.

Referenced by ns3::PendingData::Add(), ns3::TcpRxBuffer::Add(), ns3::TcpTxBuffer::Add(), AddAtEnd(), ns3::CsmaNetDevice::AddHeader(), ns3::MsduStandardAggregator::Aggregate(), ns3::BSSchedulerRtps::BSSchedulerBasicConnection(), ns3::BSSchedulerRtps::BSSchedulerBEConnection(), ns3::BSSchedulerRtps::BSSchedulerBroadcastConnection(), ns3::BSSchedulerRtps::BSSchedulerInitialRangingConnection(), ns3::BSSchedulerRtps::BSSchedulerNRTPSConnection(), ns3::BSSchedulerRtps::BSSchedulerPrimaryConnection(), ns3::EthernetTrailer::CalcFcs(), ns3::UanPhyPerUmodem::CalcPer(), ns3::dot11s::AirtimeLinkMetricCalculator::CalculateMetric(), ns3::MsduStandardAggregator::CalculatePadding(), ns3::EthernetTrailer::CheckFcs(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::SimpleOfdmWimaxPhy::ConvertBurstToBits(), ns3::PendingData::CopyFromOffset(), ns3::TcpTxBuffer::CopyFromSequence(), ns3::MsduAggregator::Deaggregate(), ns3::WimaxMacQueue::Dequeue(), ns3::Queue::Dequeue(), ns3::dsr::SendBuffer::Dequeue(), ns3::dsr::ErrorBuffer::Dequeue(), ns3::dsr::MaintainBuffer::Dequeue(), ns3::RateErrorModel::DoCorruptBit(), ns3::RateErrorModel::DoCorruptByte(), ns3::DropTailQueue::DoDequeue(), ns3::RedQueue::DoDequeue(), ns3::DropTailQueue::DoEnqueue(), ns3::RedQueue::DoEnqueue(), ns3::TcpSocketBase::DoForwardUp(), ns3::Ipv4L3Protocol::DoFragmentation(), ns3::LteRlcUm::DoNotifyTxOpportunity(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::BaseStationNetDevice::DoReceive(), ns3::SubscriberStationNetDevice::DoReceive(), ns3::LteTestPdcp::DoReceivePdcpPdu(), ns3::LteRlcUm::DoReceivePdu(), ns3::LteRlcAm::DoReceivePdu(), ns3::LtePdcp::DoReceivePdu(), ns3::LteRlcSm::DoReceivePdu(), ns3::LteEnbMac::DoReceivePhyPdu(), ns3::LteTestRrc::DoReceiveRrcPdu(), Ns3WimaxFragmentationTestCase::DoRun(), ns3::DsdvHeaderTestCase::DoRun(), ns3::Ipv4HeaderTest::DoRun(), ns3::Ipv4RawSocketImplTest::DoRun(), ns3::Ipv4FragmentationTest::DoRun(), ns3::Ipv6FragmentationTest::DoRun(), ns3::UdpSocketLoopbackTest::DoRun(), ns3::Udp6SocketLoopbackTest::DoRun(), ns3::OlsrHelloTestCase::DoRun(), ns3::UdpSocketImplTest::DoRun(), ns3::PacketTest::DoRun(), ns3::OlsrTcTestCase::DoRun(), ns3::OlsrHnaTestCase::DoRun(), ns3::Udp6SocketImplTest::DoRun(), ns3::MeshPointDevice::DoSend(), ns3::BaseStationNetDevice::DoSend(), ns3::SubscriberStationNetDevice::DoSend(), ns3::Ipv4RawSocketImplTest::DoSendData_IpHdr(), ns3::Ipv4HeaderTest::DoSendData_IpHdr_Dscp(), ns3::dsr::DsrOptionRerr::DoSendError(), ns3::UdpSocketImpl::DoSendTo(), ns3::LteRlcUm::DoTransmitPdcpPdu(), ns3::LteRlcAm::DoTransmitPdcpPdu(), ns3::LteTestMac::DoTransmitPdu(), ns3::LtePdcp::DoTransmitRrcPdu(), ns3::Queue::Drop(), ns3::RedQueue::DropEarly(), ns3::Ipv4FlowProbe::DropLogger(), ns3::YansWifiPhy::EndReceive(), ns3::Queue::Enqueue(), ns3::UanMacCw::Enqueue(), ns3::BaseStationNetDevice::Enqueue(), ns3::SubscriberStationNetDevice::Enqueue(), ns3::TapBridge::Filter(), ns3::Icmpv6L4Protocol::ForgeNA(), ns3::Icmpv6L4Protocol::ForgeNS(), ns3::Icmpv6L4Protocol::ForgeRS(), ns3::MeshWifiInterfaceMac::ForwardDown(), ns3::MacLow::ForwardDown(), ns3::Ipv4FlowProbe::ForwardLogger(), ns3::dot11s::HwmpProtocolMac::ForwardPerr(), ns3::dot11s::HwmpProtocol::ForwardUnicast(), ns3::UdpSocketImpl::ForwardUp(), ns3::PacketSocket::ForwardUp(), ns3::EmuNetDevice::ForwardUp(), ns3::UdpSocketImpl::ForwardUp6(), ns3::Ipv4FlowProbe::ForwardUpLogger(), ns3::PacketSizeMinMaxAvgTotalCalculator::FrameUpdate(), ns3::MacLow::GetDataTxMode(), ns3::WimaxMacQueue::GetFirstPacketPayloadSize(), ns3::Ipv6ExtensionFragment::GetFragments(), ns3::WifiRemoteStationManager::GetFragmentSize(), ns3::BlockAckManager::GetNextPacketSize(), ns3::WifiRemoteStationManager::GetNFragments(), ns3::Ipv4L3Protocol::Fragments::GetPacket(), ns3::Ipv4L3Protocol::Fragments::GetPartialPacket(), ns3::Icmpv6DestinationUnreachable::GetSerializedSize(), ns3::Icmpv6TooBig::GetSerializedSize(), ns3::Icmpv6TimeExceeded::GetSerializedSize(), ns3::Icmpv6ParameterError::GetSerializedSize(), ns3::Icmpv6OptionRedirected::GetSerializedSize(), ns3::PacketBurst::GetSize(), ns3::MacLow::GetSize(), ns3::GetString(), ns3::EdcaTxopN::GotAck(), ns3::DcaTxop::GotAck(), ns3::Icmpv6L4Protocol::HandleEchoRequest(), ns3::MacRxMiddle::HandleFragments(), ns3::Ipv4L3Protocol::HandleFragmentsTimeout(), ns3::Ipv6ExtensionFragment::HandleFragmentsTimeout(), DynamicGlobalRoutingTestCase::HandleRead(), ns3::UdpEchoServer::HandleRead(), ns3::UdpServer::HandleRead(), ns3::PacketSink::HandleRead(), ns3::Ping6::HandleRead(), ns3::UdpEchoClient::HandleRead(), Ns3TcpStateTestCase::Ipv4L3Tx(), Ns3TcpLossTestCase::Ipv4L3Tx(), Ns3TcpInteroperabilityTestCase::Ipv4L3Tx(), ns3::WifiRemoteStationManager::NeedFragmentation(), ns3::WifiRemoteStationManager::NeedRts(), ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::PacketSizeMinMaxAvgTotalCalculator::PacketUpdate(), ns3::PcapSniffTxRxEvent(), ns3::TcpSocketBase::PeerClose(), PhyRxEndOkTrace(), ns3::PhyRxEndOkTrace(), ns3::dot11s::HwmpProtocol::ProactivePathResolved(), ns3::Ipv6ExtensionFragment::Process(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrOptionSR::Process(), ns3::dsr::DsrOptionRerr::Process(), ns3::Ipv4L3Protocol::ProcessFragment(), ns3::Ipv6Extension::ProcessOptions(), ns3::TcpSocketBase::ProcessWait(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::EdcaTxopN::PushFront(), ns3::DcaTxop::Queue(), ns3::EdcaTxopN::Queue(), ns3::dot11s::HwmpProtocol::ReactivePathResolved(), ns3::NscTcpSocketImpl::ReadPendingData(), ns3::LteRlcUm::ReassembleAndDeliver(), ns3::LteRlcAm::ReassembleAndDeliver(), ns3::flame::FlameProtocolMac::Receive(), ns3::UanTransducerHd::Receive(), ns3::dot11s::PeerManagementProtocolMac::Receive(), ns3::V4Ping::Receive(), ns3::ArpL3Protocol::Receive(), ns3::NscTcpL4Protocol::Receive(), ns3::ApWifiMac::Receive(), ns3::TcpL4Protocol::Receive(), ns3::MeshWifiInterfaceMac::Receive(), ns3::CsmaNetDevice::Receive(), ns3::LteTestMac::Receive(), ns3::dsr::DsrRouting::Receive(), ns3::dot11s::HwmpProtocolMac::ReceiveAction(), ns3::TcpSocketBase::ReceivedAck(), ns3::dot11s::HwmpProtocolMac::ReceiveData(), ns3::TcpSocketBase::ReceivedData(), ns3::TapBridge::ReceiveFromBridgedDevice(), ns3::MeshPointDevice::ReceiveFromDevice(), ns3::UanMacRc::ReceiveOkFromPhy(), Experiment::ReceivePacket(), NetAnimExperiment::ReceivePacket(), DsdvManetExample::ReceivePacket(), ReceivePacket(), ns3::UanMacRcGw::ReceivePacket(), ns3::Ipv4HeaderTest::ReceivePkt(), ns3::Ipv4RawSocketImplTest::ReceivePkt(), ns3::UdpSocketLoopbackTest::ReceivePkt(), ns3::Udp6SocketLoopbackTest::ReceivePkt(), ns3::UdpSocketImplTest::ReceivePkt(), ns3::Udp6SocketImplTest::ReceivePkt(), ns3::Ipv4RawSocketImplTest::ReceivePkt2(), ns3::UdpSocketImplTest::ReceivePkt2(), ns3::Udp6SocketImplTest::ReceivePkt2(), ns3::UdpSocketImpl::Recv(), ns3::NscTcpSocketImpl::Recv(), ns3::TcpSocketBase::Recv(), ns3::PacketSocket::Recv(), ns3::Socket::Recv(), ns3::Ipv4RawSocketImpl::RecvFrom(), ns3::TcpSocketBase::RecvFrom(), ns3::Ipv6RawSocketImpl::RecvFrom(), ns3::Socket::RecvFrom(), ns3::EpcSgwPgwApplication::RecvFromTunDevice(), ns3::dot11s::HwmpProtocol::RequestRoute(), ns3::flame::FlameProtocol::RequestRoute(), ns3::dsdv::RoutingProtocol::RouteOutput(), ns3::Ipv6PacketInfoTagTest::RxCb(), ns3::Ipv4PacketInfoTagTest::RxCb(), UanTest::RxPacket(), ns3::AcousticModemEnergyTestCase::RxPacket(), ns3::SSScheduler::Schedule(), ns3::UanMacRc::ScheduleData(), ns3::NscTcpSocketImpl::Send(), ns3::TcpSocketBase::Send(), ns3::Radvd::Send(), ns3::LteUeRrc::Send(), ns3::Ipv6L3Protocol::Send(), ns3::Ipv4L3Protocol::Send(), ns3::dsr::DsrRouting::Send(), ns3::LteTestRrc::SendData(), ns3::TcpSocketBase::SendDataPacket(), ns3::Icmpv6L4Protocol::SendEchoReply(), ns3::Icmpv6L4Protocol::SendErrorDestinationUnreachable(), ns3::Icmpv6L4Protocol::SendErrorParameterError(), ns3::Icmpv6L4Protocol::SendErrorTimeExceeded(), ns3::Icmpv6L4Protocol::SendErrorTooBig(), ns3::EmuNetDevice::SendFrom(), ns3::MeshWifiInterfaceMac::SendManagementFrame(), ns3::Icmpv6L4Protocol::SendMessage(), ns3::Icmpv6L4Protocol::SendNA(), ns3::Icmpv6L4Protocol::SendNS(), ns3::Ipv4FlowProbe::SendOutgoingLogger(), ns3::YansWifiPhy::SendPacket(), ns3::TcpL4Protocol::SendPacket(), ns3::UanMacRcGw::SendPacket(), ns3::UanPhyGen::SendPacket(), ns3::olsr::RoutingProtocol::SendPacket(), ns3::UanMacRc::SendPacket(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), ns3::dot11s::PeerManagementProtocolMac::SendPeerLinkManagementFrame(), ns3::dot11s::HwmpProtocolMac::SendPrep(), ns3::dot11s::HwmpProtocolMac::SendPreq(), ns3::olsr::RoutingProtocol::SendQueuedMessages(), ns3::Ipv4L3Protocol::SendRealOut(), ns3::Ipv6L3Protocol::SendRealOut(), ns3::Icmpv6L4Protocol::SendRedirection(), ns3::Icmpv6L4Protocol::SendRS(), ns3::Ipv4RawSocketImpl::SendTo(), ns3::PacketSocket::SendTo(), ns3::Ipv6RawSocketImpl::SendTo(), ns3::EpcEnbApplication::SendToS1uSocket(), ns3::EpcSgwPgwApplication::SendToS1uSocket(), ns3::EpcSgwPgwApplication::SendToTunDevice(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), ns3::dsr::DsrRouting::SendUnreachError(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), ns3::Icmpv6ParameterError::Serialize(), ns3::Icmpv6OptionRedirected::Serialize(), ns3::Icmpv4Echo::SetData(), ns3::Icmpv6DestinationUnreachable::SetPacket(), ns3::Icmpv6TooBig::SetPacket(), ns3::Icmpv6TimeExceeded::SetPacket(), ns3::Icmpv6ParameterError::SetPacket(), ns3::Icmpv6OptionRedirected::SetPacket(), SinkRx(), Ns3TcpSocketTestCase1::SinkRx(), Ns3TcpNoDelayTestCase::SinkRx(), NscTcpLossTestCase1::SinkRx(), Ns3TcpSocketTestCase2::SinkRx(), NscTcpLossTestCase2::SinkRx(), SocketPrinter(), ns3::YansWifiPhy::StartReceivePacket(), ns3::ShannonSpectrumErrorModel::StartRx(), ns3::UanPhyGen::StartRxPacket(), ns3::HalfDuplexIdealPhy::StartTx(), ns3::PyViz::TraceDevQueueDrop(), ns3::PyViz::TraceNetDevRxCommon(), ns3::PyViz::TraceNetDevTxCommon(), ns3::UanTransducerHd::Transmit(), ns3::PointToPointNetDevice::TransmitStart(), ns3::CsmaNetDevice::TransmitStart(), ns3::flame::FlameProtocolMac::UpdateOutcomingFrame(), ns3::dot11s::HwmpProtocolMac::UpdateOutcomingFrame(), and ns3::PcapFile::Write().

+ Here is the call graph for this function:

uint64_t ns3::Packet::GetUid ( void  ) const

A packet is allocated a new uid when it is created empty or with zero-filled payload.

Note: This uid is an internal uid and cannot be counted on to provide an accurate counter of how many "simulated packets" of a particular protocol are in the system. It is not trivial to make this uid into such a counter, because of questions such as what should the uid be when the packet is sent over broadcast media, or when fragmentation occurs. If a user wants to trace actual packet counts, he or she should look at e.g. the IP ID field or transport sequence numbers, or other packet or frame counters at other protocol layers.

Returns
an integer identifier which uniquely identifies this packet.

Definition at line 391 of file packet.cc.

References ns3::PacketMetadata::GetUid(), and m_metadata.

Referenced by ns3::dsdv::RoutingProtocol::DeferredRouteOutput(), ns3::aodv::RoutingProtocol::DeferredRouteOutput(), ns3::ListErrorModel::DoCorrupt(), ns3::Icmpv6L4Protocol::DoDAD(), ns3::aodv::RequestQueue::Drop(), ns3::dsr::SendBuffer::Drop(), ns3::dsdv::PacketQueue::Drop(), ns3::dsr::ErrorBuffer::Drop(), ns3::dsdv::RoutingProtocol::Drop(), ns3::dsr::ErrorBuffer::DropLink(), ns3::aodv::RequestQueue::Enqueue(), ns3::dsr::SendBuffer::Enqueue(), ns3::dsdv::PacketQueue::Enqueue(), ns3::dsr::ErrorBuffer::Enqueue(), ns3::BridgeNetDevice::ForwardBroadcast(), ns3::aodv::RoutingProtocol::Forwarding(), ns3::BridgeNetDevice::ForwardUnicast(), ns3::PacketSocket::ForwardUp(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::UdpServer::HandleRead(), ns3::aodv::DuplicatePacketDetection::IsDuplicate(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::CsmaChannel::PropagationCompleteEvent(), ns3::CsmaNetDevice::Receive(), ns3::TapBridge::ReceiveFromBridgedDevice(), ns3::BridgeNetDevice::ReceiveFromDevice(), ns3::MeshPointDevice::ReceiveFromDevice(), ns3::Node::ReceiveFromDevice(), ns3::aodv::RoutingProtocol::RecvAodv(), ns3::aodv::RoutingProtocol::RouteInput(), ns3::dsdv::RoutingProtocol::RouteInput(), ns3::dsdv::RoutingProtocol::RouteOutput(), ns3::RedQueueTestCase::RunRedTest(), ns3::UdpClient::Send(), ns3::LteRadioBearerTagUdpClient::Send(), ns3::PointToPointNetDevice::Send(), ns3::dsr::DsrRouting::Send(), ns3::EmuNetDevice::SendFrom(), ns3::CsmaNetDevice::SendFrom(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), ns3::aodv::RoutingProtocol::SendReplyByIntermediateNode(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), ns3::dsr::DsrRouting::SendUnreachError(), ns3::PyViz::TraceDevQueueDrop(), ns3::PyViz::TraceNetDevRxCommon(), ns3::PyViz::TraceNetDevRxWifi(), ns3::PyViz::TraceNetDevTxCommon(), ns3::PyViz::TraceNetDevTxWifi(), ns3::CsmaNetDevice::TransmitAbort(), ns3::CsmaNetDevice::TransmitCompleteEvent(), ns3::CsmaChannel::TransmitEnd(), ns3::PointToPointRemoteChannel::TransmitStart(), ns3::PointToPointChannel::TransmitStart(), ns3::CsmaChannel::TransmitStart(), ns3::PointToPointNetDevice::TransmitStart(), and ns3::CsmaNetDevice::TransmitStart().

+ Here is the call graph for this function:

Packet & ns3::Packet::operator= ( const Packet o)

Definition at line 155 of file packet.cc.

References ns3::NixVector::Copy(), m_buffer, m_byteTagList, m_metadata, m_nixVector, and m_packetTagList.

+ Here is the call graph for this function:

uint8_t const * ns3::Packet::PeekData ( void  ) const

If you try to change the content of the buffer returned by this method, you will die. Note that this method is now deprecated and will be removed in the next version of ns-3. If you need to get access to the content of the byte buffer of a packet, you need to call ns3::Packet::CopyData to perform an explicit copy.

Returns
a pointer to the internal buffer of the packet.

Definition at line 366 of file packet.cc.

References data, ns3::Buffer::GetCurrentStartOffset(), m_buffer, m_byteTagList, NS_LOG_FUNCTION, and ns3::Buffer::PeekData().

Referenced by ns3::PacketTest::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::Packet::PeekTrailer ( Trailer trailer)

Deserialize but does not remove a trailer from the internal buffer. This method invokes the Trailer::Deserialize method.

Parameters
trailera reference to the trailer to read from the internal buffer.
Returns
the number of bytes read from the end of the packet.

Definition at line 307 of file packet.cc.

References ns3::Trailer::Deserialize(), ns3::Buffer::End(), ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), m_buffer, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::Packet::PrintByteTags ( std::ostream &  os) const
Parameters
osoutput stream in which the data should be printed.

Iterate over the tags present in this packet, and invoke the Print method of each tag stored in the packet.

Definition at line 397 of file packet.cc.

References GetByteTagIterator(), ns3::TypeId::GetConstructor(), ns3::ByteTagIterator::Item::GetEnd(), ns3::TypeId::GetName(), ns3::ByteTagIterator::Item::GetStart(), ns3::ByteTagIterator::Item::GetTag(), ns3::ByteTagIterator::Item::GetTypeId(), ns3::ByteTagIterator::HasNext(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::ByteTagIterator::Next(), NS_ASSERT, and ns3::Tag::Print().

+ Here is the call graph for this function:

void ns3::Packet::PrintPacketTags ( std::ostream &  os) const
Parameters
osthe stream in which we want to print data.

Print the list of 'packet' tags.

See Also
Packet::AddPacketTag, Packet::RemovePacketTag, Packet::PeekPacketTag, Packet::RemoveAllPacketTags

Definition at line 865 of file packet.cc.

References ns3::TypeId::GetConstructor(), GetPacketTagIterator(), ns3::PacketTagIterator::Item::GetTag(), ns3::PacketTagIterator::Item::GetTypeId(), ns3::TypeId::HasConstructor(), ns3::PacketTagIterator::HasNext(), ns3::PacketTagIterator::Next(), NS_ASSERT, and ns3::Tag::Print().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Packet::RemoveAllByteTags ( void  )

Remove all the tags stored in this packet.

Definition at line 359 of file packet.cc.

References m_byteTagList, NS_LOG_FUNCTION, and ns3::ByteTagList::RemoveAll().

Referenced by ns3::Ipv4HeaderTest::DoRun(), ns3::Ipv4RawSocketImplTest::DoRun(), ns3::UdpSocketImplTest::DoRun(), ns3::Udp6SocketImplTest::DoRun(), ns3::UdpEchoServer::HandleRead(), ns3::Ipv4FragmentationTest::HandleReadServer(), and ns3::Ipv6FragmentationTest::HandleReadServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Packet::RemoveAllPacketTags ( void  )

Remove all packet tags.

Definition at line 858 of file packet.cc.

References m_packetTagList, NS_LOG_FUNCTION, and ns3::PacketTagList::RemoveAll().

Referenced by ns3::PacketTest::DoRun(), ns3::UdpEchoServer::HandleRead(), ns3::Ipv4FragmentationTest::HandleReadServer(), and ns3::Ipv6FragmentationTest::HandleReadServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Packet::RemoveAtEnd ( uint32_t  size)

Remove size bytes from the end of the current packet It is safe to remove more bytes that what is present in the packet.

Parameters
sizenumber of bytes from remove

Definition at line 344 of file packet.cc.

References m_buffer, m_metadata, NS_LOG_FUNCTION, ns3::PacketMetadata::RemoveAtEnd(), and ns3::Buffer::RemoveAtEnd().

Referenced by ns3::Ipv6ExtensionFragment::Process(), and ns3::CsmaNetDevice::Receive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::Packet::RemoveHeader ( Header header)

Deserialize and remove the header from the internal buffer. This method invokes Header::Deserialize.

Parameters
headera reference to the header to remove from the internal buffer.
Returns
the number of bytes removed from the packet.

Definition at line 266 of file packet.cc.

References ns3::Buffer::Begin(), ns3::Header::Deserialize(), ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), m_buffer, m_metadata, NS_LOG_FUNCTION, ns3::Buffer::RemoveAtStart(), and ns3::PacketMetadata::RemoveHeader().

Referenced by ns3::dsr::DsrRouting::AddAckReqHeader(), benchA(), benchD(), C1(), C2(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::IpcsClassifier::Classify(), ns3::EpcTftClassifier::Classify(), ns3::MsduAggregator::Deaggregate(), ns3::TcpSocketBase::DoForwardUp(), ns3::Ipv4L3Protocol::DoFragmentation(), ns3::BaseStationNetDevice::DoReceive(), ns3::SubscriberStationNetDevice::DoReceive(), ns3::LtePdcp::DoReceivePdu(), ns3::flame::FlameHeaderTest::DoRun(), ns3::dot11s::MeshHeaderTest::DoRun(), ns3::MeshInformationElementVectorBist::DoRun(), ns3::EpsGtpuHeaderTestCase::DoRun(), ns3::OlsrMidTestCase::DoRun(), DsaRequestTestCase::DoRun(), Ns3WimaxFragmentationTestCase::DoRun(), ns3::DsdvHeaderTestCase::DoRun(), Ns3WimaxSfTlvTestCase::DoRun(), ns3::OlsrHelloTestCase::DoRun(), ns3::PacketTest::DoRun(), ns3::dot11s::PeerLinkFrameStartTest::DoRun(), ns3::aodv::RrepAckHeaderTest::DoRun(), ns3::OlsrTcTestCase::DoRun(), ns3::OlsrHnaTestCase::DoRun(), ns3::dsr::DsrOptionRerr::DoSendError(), ns3::LteTestMac::DoTransmitPdu(), ns3::TapBridge::Filter(), ns3::WifiNetDevice::ForwardUp(), ns3::WimaxNetDevice::ForwardUp(), ns3::EmuNetDevice::ForwardUp(), ns3::Ipv6ExtensionFragment::GetFragments(), ns3::EdcaTxopN::GotAck(), ns3::Icmpv6L4Protocol::HandleDestinationUnreachable(), ns3::Icmpv4L4Protocol::HandleEcho(), ns3::Icmpv6L4Protocol::HandleEchoRequest(), ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandlePacketTooBig(), ns3::Icmpv6L4Protocol::HandleParameterError(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::UdpServer::HandleRead(), ns3::Ping6::HandleRead(), ns3::Radvd::HandleRead(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::Icmpv6L4Protocol::HandleTimeExceeded(), Ns3TcpStateTestCase::Ipv4L3Tx(), Ns3TcpLossTestCase::Ipv4L3Tx(), Ns3TcpInteroperabilityTestCase::Ipv4L3Tx(), main(), ns3::dsr::DsrRouting::NetworkScheduleTimerExpire(), ns3::AlohaNoackNetDevice::NotifyReceptionEndOk(), ns3::UanMacCw::PhyRxPacketGood(), ns3::Ipv6OptionPad1::Process(), ns3::Ipv6OptionPadn::Process(), ns3::Ipv6ExtensionHopByHop::Process(), ns3::Ipv6OptionJumbogram::Process(), ns3::Ipv6ExtensionDestination::Process(), ns3::dsr::DsrOptionPad1::Process(), ns3::Ipv6OptionRouterAlert::Process(), ns3::Ipv6ExtensionFragment::Process(), ns3::dsr::DsrOptionPadn::Process(), ns3::dsr::DsrOptionRrep::Process(), ns3::dsr::DsrOptionSR::Process(), ns3::dsr::DsrOptionRerr::Process(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::dsr::DsrOptionAckReq::Process(), ns3::dsr::DsrOptionAck::Process(), ns3::UanMacRc::ProcessAck(), ns3::PointToPointNetDevice::ProcessHeader(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::LteRlcUm::ReassembleAndDeliver(), ns3::LteRlcAm::ReassembleAndDeliver(), ns3::Icmpv4L4Protocol::Receive(), ns3::dot11s::PeerManagementProtocolMac::Receive(), ns3::V4Ping::Receive(), ns3::StaWifiMac::Receive(), ns3::ApWifiMac::Receive(), ns3::UdpL4Protocol::Receive(), ns3::CsmaNetDevice::Receive(), ns3::RegularWifiMac::Receive(), ns3::dsr::DsrRouting::Receive(), ns3::dot11s::HwmpProtocolMac::ReceiveAction(), ns3::dot11s::HwmpProtocolMac::ReceiveData(), ns3::MacLow::ReceiveOk(), ns3::UanMacRc::ReceiveOkFromPhy(), ns3::UanMacRcGw::ReceivePacket(), ns3::aodv::RoutingProtocol::RecvAodv(), ns3::aodv::RoutingProtocol::RecvError(), ns3::EpcEnbApplication::RecvFromS1uSocket(), ns3::EpcSgwPgwApplication::RecvFromS1uSocket(), ns3::aodv::RoutingProtocol::RecvReply(), ns3::aodv::RoutingProtocol::RecvRequest(), ns3::flame::FlameProtocol::RemoveRoutingStuff(), ns3::flame::FlameProtocol::RequestRoute(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::UanMacAloha::RxPacketGood(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), ns3::Ipv4L3Protocol::SendRealOut(), ns3::dsr::DsrRouting::SendRerrWhenBreaksLinkToNextHop(), ns3::Ipv4RawSocketImpl::SendTo(), and ns3::Ipv6RawSocketImpl::SendTo().

+ Here is the call graph for this function:

bool ns3::Packet::RemovePacketTag ( Tag tag)
Parameters
tagthe tag to remove from this packet
Returns
true if the requested tag is found, false otherwise.

Remove a tag from this packet. This method calls Tag::Deserialize if the tag is found.

Definition at line 845 of file packet.cc.

References ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), ns3::Tag::GetSerializedSize(), m_packetTagList, NS_LOG_FUNCTION, and ns3::PacketTagList::Remove().

Referenced by benchD(), ns3::LteRlcUm::DoNotifyTxOpportunity(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::LteUeMac::DoReceivePhyPdu(), ns3::LteEnbMac::DoReceivePhyPdu(), ns3::PacketTest::DoRun(), ns3::UdpSocketImpl::DoSendTo(), ns3::MeshWifiInterfaceMac::ForwardDown(), ns3::Ipv4RawSocketImpl::ForwardUp(), ns3::UdpSocketImpl::ForwardUp(), ns3::Ipv6RawSocketImpl::ForwardUp(), Tunnel::N0SocketRecv(), Tunnel::N1SocketRecv(), Tunnel::N3SocketRecv(), ns3::dot11s::HwmpProtocol::ProactivePathResolved(), ns3::dot11s::HwmpProtocol::ReactivePathResolved(), ns3::MacLow::ReceiveOk(), ns3::EpcEnbApplication::RecvFromLteSocket(), ns3::EpcEnbApplication::RecvFromS1uSocket(), ns3::EpcSgwPgwApplication::RecvFromS1uSocket(), ns3::dot11s::HwmpProtocol::RemoveRoutingStuff(), ns3::flame::FlameProtocol::RemoveRoutingStuff(), ns3::dot11s::HwmpProtocol::RequestRoute(), ns3::flame::FlameProtocol::RequestRoute(), ns3::Ipv6PacketInfoTagTest::RxCb(), ns3::Ipv4PacketInfoTagTest::RxCb(), ns3::Ipv6L3Protocol::Send(), ns3::Ipv4L3Protocol::Send(), ns3::LteEnbRrc::Send(), ns3::dsdv::RoutingProtocol::SendPacketFromQueue(), ns3::aodv::RoutingProtocol::SendPacketFromQueue(), ns3::LteSpectrumPhy::StartRx(), ns3::flame::FlameProtocolMac::UpdateOutcomingFrame(), and ns3::dot11s::HwmpProtocolMac::UpdateOutcomingFrame().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::Packet::RemoveTrailer ( Trailer trailer)

Remove a deserialized trailer from the internal buffer. This method invokes the Deserialize method.

Parameters
trailera reference to the trailer to remove from the internal buffer.
Returns
the number of bytes removed from the end of the packet.

Definition at line 298 of file packet.cc.

References ns3::Trailer::Deserialize(), ns3::Buffer::End(), ns3::ObjectBase::GetInstanceTypeId(), ns3::TypeId::GetName(), m_buffer, m_metadata, NS_LOG_FUNCTION, ns3::Buffer::RemoveAtEnd(), and ns3::PacketMetadata::RemoveTrailer().

Referenced by ns3::PacketTest::DoRun(), ns3::CsmaNetDevice::Receive(), ns3::MacLow::ReceiveOk(), and ns3::MacLow::StoreMpduIfNeeded().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::Packet::Serialize ( uint8_t *  buffer,
uint32_t  maxSize 
) const
void ns3::Packet::SetNixVector ( Ptr< NixVector nixVector)

Definition at line 239 of file packet.cc.

References m_nixVector.

Referenced by ns3::Ipv4NixVectorRouting::RouteOutput().

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t ns3::Packet::m_globalUid = 0
staticprivate

Definition at line 570 of file packet.h.

Referenced by Packet().

Ptr<NixVector> ns3::Packet::m_nixVector
private
PacketTagList ns3::Packet::m_packetTagList
private

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