A Discrete-Event Network Simulator
API
ns3::Buffer::Iterator Class Reference

iterator in a Buffer instance More...

#include "buffer.h"

+ Collaboration diagram for ns3::Buffer::Iterator:

Public Member Functions

 Iterator ()
 
uint16_t CalculateIpChecksum (uint16_t size)
 Calculate the checksum. More...
 
uint16_t CalculateIpChecksum (uint16_t size, uint32_t initialChecksum)
 Calculate the checksum. More...
 
uint32_t GetDistanceFrom (Iterator const &o) const
 
uint32_t GetRemainingSize (void) const
 
uint32_t GetSize (void) const
 
bool IsEnd (void) const
 
bool IsStart (void) const
 
void Next (uint32_t delta)
 
void Next (void)
 go forward by one byte More...
 
uint8_t PeekU8 (void)
 
void Prev (uint32_t delta)
 
void Prev (void)
 go backward by one byte More...
 
void Read (Iterator start, uint32_t size)
 
void Read (uint8_t *buffer, uint32_t size)
 
uint16_t ReadLsbtohU16 (void)
 
uint32_t ReadLsbtohU32 (void)
 
uint64_t ReadLsbtohU64 (void)
 
uint16_t ReadNtohU16 (void)
 
uint32_t ReadNtohU32 (void)
 
uint64_t ReadNtohU64 (void)
 
uint16_t ReadU16 (void)
 
uint32_t ReadU32 (void)
 
uint64_t ReadU64 (void)
 
uint8_t ReadU8 (void)
 
void Write (Iterator start, Iterator end)
 
void Write (uint8_t const *buffer, uint32_t size)
 
void WriteHtolsbU16 (uint16_t data)
 
void WriteHtolsbU32 (uint32_t data)
 
void WriteHtolsbU64 (uint64_t data)
 
void WriteHtonU16 (uint16_t data)
 
void WriteHtonU32 (uint32_t data)
 
void WriteHtonU64 (uint64_t data)
 
void WriteU16 (uint16_t data)
 
void WriteU32 (uint32_t data)
 
void WriteU64 (uint64_t data)
 
void WriteU8 (uint8_t data)
 
void WriteU8 (uint8_t data, uint32_t len)
 

Private Member Functions

 Iterator (Buffer const *buffer)
 Constructor - initializes the iterator to point to the buffer start. More...
 
 Iterator (Buffer const *buffer, bool dummy)
 Constructor - initializes the iterator to point to the buffer end. More...
 
bool Check (uint32_t i) const
 Checks that the buffer position is not in the "virtual zero area". More...
 
bool CheckNoZero (uint32_t start, uint32_t end) const
 Checks that the [start, end) is not in the "virtual zero area". More...
 
void Construct (const Buffer *buffer)
 Initializes the iterator values. More...
 
std::string GetReadErrorMessage (void) const
 Returns an appropriate message indicating a read error. More...
 
std::string GetWriteErrorMessage (void) const
 Returns an appropriate message indicating a write error. More...
 
uint16_t SlowReadNtohU16 (void)
 
uint32_t SlowReadNtohU32 (void)
 

Private Attributes

uint32_t m_current
 offset in virtual bytes from the start of the data buffer to the current position represented by this iterator. More...
 
uint8_t * m_data
 a pointer to the underlying byte buffer. More...
 
uint32_t m_dataEnd
 offset in virtual bytes from the start of the data buffer to the end of the data which can be read by this iterator More...
 
uint32_t m_dataStart
 offset in virtual bytes from the start of the data buffer to the start of the data which can be read by this iterator More...
 
uint32_t m_zeroEnd
 offset in virtual bytes from the start of the data buffer to the end of the "virtual zero area". More...
 
uint32_t m_zeroStart
 offset in virtual bytes from the start of the data buffer to the start of the "virtual zero area". More...
 

Friends

class Buffer
 Friend class. More...
 

Detailed Description

iterator in a Buffer instance

Definition at line 98 of file buffer.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

ns3::Buffer::Iterator::Iterator ( )
inline

Definition at line 814 of file buffer.h.

◆ Iterator() [2/3]

ns3::Buffer::Iterator::Iterator ( Buffer const *  buffer)
inlineprivate

Constructor - initializes the iterator to point to the buffer start.

Parameters
bufferthe buffer this iterator refers to

Definition at line 823 of file buffer.h.

◆ Iterator() [3/3]

ns3::Buffer::Iterator::Iterator ( Buffer const *  buffer,
bool  dummy 
)
inlineprivate

Constructor - initializes the iterator to point to the buffer end.

Parameters
bufferthe buffer this iterator refers to
dummynot used param

Definition at line 828 of file buffer.h.

Member Function Documentation

◆ CalculateIpChecksum() [1/2]

◆ CalculateIpChecksum() [2/2]

uint16_t ns3::Buffer::Iterator::CalculateIpChecksum ( uint16_t  size,
uint32_t  initialChecksum 
)

Calculate the checksum.

Parameters
sizesize of the buffer.
initialChecksuminitial value
Returns
checksum

Definition at line 1141 of file buffer.cc.

References NS_LOG_FUNCTION.

◆ Check()

bool ns3::Buffer::Iterator::Check ( uint32_t  i) const
private

Checks that the buffer position is not in the "virtual zero area".

Parameters
ibuffer position
Returns
true if not in the "virtual zero area".

Definition at line 826 of file buffer.cc.

References NS_LOG_FUNCTION.

◆ CheckNoZero()

bool ns3::Buffer::Iterator::CheckNoZero ( uint32_t  start,
uint32_t  end 
) const
private

Checks that the [start, end) is not in the "virtual zero area".

Parameters
startstart buffer position
endend buffer position
Returns
true if [start, end) is not in the "virtual zero area".

Definition at line 817 of file buffer.cc.

References NS_LOG_FUNCTION, and visualizer.core::start().

+ Here is the call graph for this function:

◆ Construct()

void ns3::Buffer::Iterator::Construct ( const Buffer buffer)
inlineprivate

Initializes the iterator values.

Parameters
bufferthe buffer this iterator refers to

Definition at line 835 of file buffer.h.

References ns3::Buffer::Data::m_data, ns3::Buffer::m_data, ns3::Buffer::m_end, ns3::Buffer::m_start, ns3::Buffer::m_zeroAreaEnd, and ns3::Buffer::m_zeroAreaStart.

◆ GetDistanceFrom()

uint32_t ns3::Buffer::Iterator::GetDistanceFrom ( Iterator const &  o) const
Parameters
othe second iterator
Returns
number of bytes included between the two iterators

This method works only if the two iterators point to the same underlying buffer. Debug builds ensure this with an assert.

Definition at line 788 of file buffer.cc.

References m_current, m_data, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::WifiInformationElement::Deserialize(), ns3::aodv::TypeHeader::Deserialize(), ns3::aodv::RreqHeader::Deserialize(), ns3::aodv::RrepHeader::Deserialize(), ns3::aodv::RrepAckHeader::Deserialize(), ns3::aodv::RerrHeader::Deserialize(), ns3::QKDAppHeader::Deserialize(), ns3::HttpHeader::Deserialize(), ns3::dsdv::DsdvHeader::Deserialize(), ns3::Icmpv4DestinationUnreachable::Deserialize(), ns3::Icmpv4TimeExceeded::Deserialize(), ns3::LrWpanMacHeader::Deserialize(), ns3::BeaconPayloadHeader::Deserialize(), ns3::CommandPayloadHeader::Deserialize(), ns3::dot11s::MeshHeader::Deserialize(), ns3::dot11s::PeerLinkOpenStart::Deserialize(), ns3::dot11s::PeerLinkCloseStart::Deserialize(), ns3::dot11s::PeerLinkConfirmStart::Deserialize(), ns3::flame::FlameHeader::Deserialize(), ns3::UanHeaderCommon::Deserialize(), ns3::UanHeaderRcData::Deserialize(), ns3::UanHeaderRcRts::Deserialize(), ns3::UanHeaderRcCtsGlobal::Deserialize(), ns3::UanHeaderRcCts::Deserialize(), ns3::UanHeaderRcAck::Deserialize(), ns3::CtrlBAckResponseHeader::Deserialize(), ns3::CtrlTriggerHeader::Deserialize(), ns3::MgtReassocRequestHeader::Deserialize(), ns3::MgtAssocResponseHeader::Deserialize(), ns3::MgtProbeRequestHeader::Deserialize(), ns3::MgtProbeResponseHeader::Deserialize(), ns3::WifiActionHeader::Deserialize(), ns3::MgtAddBaRequestHeader::Deserialize(), ns3::MgtAddBaResponseHeader::Deserialize(), ns3::MgtDelBaHeader::Deserialize(), ns3::Dcd::Deserialize(), ns3::DlMap::Deserialize(), ns3::ManagementMessageType::Deserialize(), ns3::RngRsp::Deserialize(), ns3::DsaAck::Deserialize(), ns3::RngReq::Deserialize(), ns3::Ucd::Deserialize(), ns3::UlMap::Deserialize(), ns3::GenericMacHeader::Deserialize(), ns3::BandwidthRequestHeader::Deserialize(), ns3::GrantManagementSubheader::Deserialize(), ns3::FragmentationSubheader::Deserialize(), ns3::AmpduSubframeHeader::Deserialize(), ns3::AmsduSubframeHeader::Deserialize(), ns3::CtrlBAckRequestHeader::Deserialize(), ns3::HePpdu::HeSigHeader::Deserialize(), ns3::HtPpdu::HtSigHeader::Deserialize(), ns3::MgtAssocRequestHeader::Deserialize(), ns3::DsssPpdu::DsssSigHeader::Deserialize(), ns3::OfdmPpdu::LSigHeader::Deserialize(), ns3::VhtPpdu::VhtSigHeader::Deserialize(), ns3::WifiMacHeader::Deserialize(), ns3::dot11s::IeBeaconTiming::DeserializeInformationField(), ns3::dot11s::IeConfiguration::DeserializeInformationField(), ns3::dot11s::IePeerManagement::DeserializeInformationField(), ns3::dot11s::IePeeringProtocol::DeserializeInformationField(), ns3::dot11s::IePreq::DeserializeInformationField(), ns3::dot11s::IeMeshId::DeserializeInformationField(), ns3::dot11s::IeLinkMetricReport::DeserializeInformationField(), ns3::dot11s::IePerr::DeserializeInformationField(), ns3::dot11s::IePrep::DeserializeInformationField(), ns3::dot11s::IeRann::DeserializeInformationField(), ns3::MeshInformationElementVector::DeserializeSingleIe(), and ns3::PbbMessage::Serialize().

+ Here is the caller graph for this function:

◆ GetReadErrorMessage()

std::string ns3::Buffer::Iterator::GetReadErrorMessage ( void  ) const
private

Returns an appropriate message indicating a read error.

Returns
the error message

Definition at line 1174 of file buffer.cc.

References NS_LOG_FUNCTION.

◆ GetRemainingSize()

◆ GetSize()

◆ GetWriteErrorMessage()

std::string ns3::Buffer::Iterator::GetWriteErrorMessage ( void  ) const
private

Returns an appropriate message indicating a write error.

The message depends on the actual Buffer::Iterator status.

Returns
the error message

Definition at line 1187 of file buffer.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

◆ IsEnd()

bool ns3::Buffer::Iterator::IsEnd ( void  ) const
Returns
true if this iterator points to the end of the byte array. false otherwise.

Definition at line 804 of file buffer.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::WifiInformationElement::DeserializeIfPresent().

+ Here is the caller graph for this function:

◆ IsStart()

bool ns3::Buffer::Iterator::IsStart ( void  ) const
Returns
true if this iterator points to the start of the byte array. false otherwise.

Definition at line 810 of file buffer.cc.

References NS_LOG_FUNCTION.

◆ Next() [1/2]

void ns3::Buffer::Iterator::Next ( uint32_t  delta)
inline
Parameters
deltanumber of bytes to go forward

Definition at line 857 of file buffer.h.

References NS_ASSERT.

◆ Next() [2/2]

void ns3::Buffer::Iterator::Next ( void  )
inline

go forward by one byte

Definition at line 845 of file buffer.h.

References NS_ASSERT.

Referenced by TcpHeaderWithRFC793OptionTestCase::CheckNoPadding(), ns3::dsr::DsrOptionHeader::Deserialize(), ns3::dsr::DsrOptionRerrHeader::Deserialize(), ns3::ArpHeader::Deserialize(), ns3::Icmpv4DestinationUnreachable::Deserialize(), ns3::Icmpv4TimeExceeded::Deserialize(), ns3::Ipv6OptionHeader::Deserialize(), ns3::RipHeader::Deserialize(), ns3::RipNgHeader::Deserialize(), ns3::TcpHeader::Deserialize(), ns3::dot11s::PeerLinkOpenStart::Deserialize(), ns3::dot11s::PeerLinkCloseStart::Deserialize(), ns3::dot11s::PeerLinkConfirmStart::Deserialize(), ns3::flame::FlameHeader::Deserialize(), ns3::LlcSnapHeader::Deserialize(), ns3::CtrlTriggerUserInfoField::Deserialize(), ns3::SfVectorTlvValue::Deserialize(), ns3::CsParamVectorTlvValue::Deserialize(), ns3::ClassificationRuleVectorTlvValue::Deserialize(), ns3::WifiInformationElement::DeserializeIfPresent(), ns3::dot11s::IePerr::DeserializeInformationField(), ns3::MeshInformationElementVector::DeserializeSingleIe(), ns3::GtpcIes::DeserializeUliEcgi(), BufferTest::DoRun(), ns3::PacketMetadata::ItemIterator::Next(), TcpHeaderWithRFC793OptionTestCase::OneOptionAtTime(), ns3::Packet::PeekHeader(), ns3::Packet::Print(), Read(), ns3::Packet::RemoveHeader(), ns3::WifiInformationElement::Serialize(), ns3::Icmpv4Header::Serialize(), ns3::Icmpv6Header::Serialize(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6Echo::Serialize(), ns3::Ipv4Header::Serialize(), ns3::RipHeader::Serialize(), ns3::RipNgHeader::Serialize(), ns3::TcpHeader::Serialize(), ns3::UdpHeader::Serialize(), ns3::CtrlTriggerUserInfoField::Serialize(), and ns3::VectorTlvValue::Serialize().

+ Here is the caller graph for this function:

◆ PeekU8()

uint8_t ns3::Buffer::Iterator::PeekU8 ( void  )
inline
Returns
the byte read in the buffer.

Read data, but do not advance the Iterator read.

Definition at line 998 of file buffer.h.

References data, ns3::Buffer::m_data, and NS_ASSERT_MSG.

Referenced by ns3::TcpHeader::Deserialize().

+ Here is the caller graph for this function:

◆ Prev() [1/2]

void ns3::Buffer::Iterator::Prev ( uint32_t  delta)
inline
Parameters
deltanumber of bytes to go backward

Definition at line 863 of file buffer.h.

References NS_ASSERT.

◆ Prev() [2/2]

◆ Read() [1/2]

void ns3::Buffer::Iterator::Read ( Buffer::Iterator  start,
uint32_t  size 
)
inline
Parameters
startstart iterator of the buffer to copy data into
sizenumber of bytes to copy

Copy size bytes of data from the internal buffer to the input buffer via the provided iterator and advance the Iterator by the number of bytes read.

Definition at line 1041 of file buffer.h.

References Next(), and visualizer.core::start().

+ Here is the call graph for this function:

◆ Read() [2/2]

◆ ReadLsbtohU16()

◆ ReadLsbtohU32()

◆ ReadLsbtohU64()

uint64_t ns3::Buffer::Iterator::ReadLsbtohU64 ( void  )
Returns
the eight bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in least significant byte format and returned in host format.

Definition at line 1094 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by ns3::LrWpanMacHeader::Deserialize(), ns3::CtrlTriggerHeader::Deserialize(), ns3::MgtProbeResponseHeader::Deserialize(), ns3::HeCapabilities::DeserializeInformationField(), ns3::HtCapabilities::DeserializeInformationField(), ns3::HtOperation::DeserializeInformationField(), ns3::VhtCapabilities::DeserializeInformationField(), and BufferTest::DoRun().

+ Here is the caller graph for this function:

◆ ReadNtohU16()

uint16_t ns3::Buffer::Iterator::ReadNtohU16 ( void  )
inline
Returns
the two bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in network format and returned in host format.

Definition at line 946 of file buffer.h.

References ns3::Buffer::m_data.

Referenced by ns3::dsr::DsrOptionRreqHeader::Deserialize(), ns3::DhcpHeader::Deserialize(), ns3::ArpHeader::Deserialize(), ns3::Icmpv4DestinationUnreachable::Deserialize(), ns3::Icmpv6Header::Deserialize(), ns3::Icmpv6RA::Deserialize(), ns3::Icmpv6Echo::Deserialize(), ns3::Icmpv6OptionMtu::Deserialize(), ns3::Ipv4Header::Deserialize(), ns3::Ipv6ExtensionFragmentHeader::Deserialize(), ns3::Ipv6Header::Deserialize(), ns3::Ipv6OptionJumbogramHeader::Deserialize(), ns3::Ipv6OptionRouterAlertHeader::Deserialize(), ns3::RipRte::Deserialize(), ns3::RipNgRte::Deserialize(), ns3::TcpHeader::Deserialize(), ns3::TcpOptionMSS::Deserialize(), ns3::UdpHeader::Deserialize(), ns3::GtpuHeader::Deserialize(), ns3::EpcX2Header::Deserialize(), ns3::EpcX2HandoverRequestHeader::Deserialize(), ns3::EpcX2HandoverRequestAckHeader::Deserialize(), ns3::EpcX2HandoverPreparationFailureHeader::Deserialize(), ns3::EpcX2SnStatusTransferHeader::Deserialize(), ns3::EpcX2UeContextReleaseHeader::Deserialize(), ns3::EpcX2LoadInformationHeader::Deserialize(), ns3::EpcX2ResourceStatusUpdateHeader::Deserialize(), ns3::flame::FlameHeader::Deserialize(), ns3::EthernetHeader::Deserialize(), ns3::LlcSnapHeader::Deserialize(), ns3::SllHeader::Deserialize(), ns3::olsr::PacketHeader::Deserialize(), ns3::olsr::MessageHeader::Deserialize(), ns3::SixLowPanIphc::Deserialize(), ns3::SixLowPanUdpNhcExtension::Deserialize(), ns3::U16TlvValue::Deserialize(), ns3::AmsduSubframeHeader::Deserialize(), ns3::olsr::MessageHeader::Hello::Deserialize(), ns3::olsr::MessageHeader::Tc::Deserialize(), ns3::PortRangeTlvValue::Deserialize(), ns3::GtpcIes::DeserializeBearerContextHeader(), ns3::GtpcIes::DeserializeBearerQos(), ns3::GtpcIes::DeserializeBearerTft(), ns3::GtpcIes::DeserializeCause(), ns3::GtpcIes::DeserializeEbi(), ns3::GtpcIes::DeserializeFteid(), ns3::GtpcIes::DeserializeImsi(), ns3::GtpcIes::DeserializeUliEcgi(), BufferTest::DoRun(), and ns3::GtpcHeader::PreDeserialize().

+ Here is the caller graph for this function:

◆ ReadNtohU32()

uint32_t ns3::Buffer::Iterator::ReadNtohU32 ( void  )
inline
Returns
the four bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in network format and returned in host format.

Definition at line 970 of file buffer.h.

References ns3::Buffer::m_data.

Referenced by ns3::aodv::RreqHeader::Deserialize(), ns3::aodv::RrepHeader::Deserialize(), ns3::aodv::RerrHeader::Deserialize(), ns3::QKDAppHeader::Deserialize(), ns3::SeqTsHeader::Deserialize(), ns3::dsdv::DsdvHeader::Deserialize(), ns3::DhcpHeader::Deserialize(), ns3::Icmpv6NS::Deserialize(), ns3::Icmpv6NA::Deserialize(), ns3::Icmpv6RA::Deserialize(), ns3::Icmpv6RS::Deserialize(), ns3::Icmpv6TooBig::Deserialize(), ns3::Icmpv6ParameterError::Deserialize(), ns3::Icmpv6OptionMtu::Deserialize(), ns3::Icmpv6OptionPrefixInformation::Deserialize(), ns3::Ipv4Header::Deserialize(), ns3::Ipv6ExtensionFragmentHeader::Deserialize(), ns3::Ipv6Header::Deserialize(), ns3::RipRte::Deserialize(), ns3::TcpHeader::Deserialize(), ns3::TcpOptionSack::Deserialize(), ns3::TcpOptionTS::Deserialize(), ns3::GtpuHeader::Deserialize(), ns3::EpcX2HandoverRequestHeader::Deserialize(), ns3::EpcX2HandoverRequestAckHeader::Deserialize(), ns3::EpcX2SnStatusTransferHeader::Deserialize(), ns3::olsr::MessageHeader::Deserialize(), ns3::U32TlvValue::Deserialize(), ns3::SeqTsEchoHeader::Deserialize(), ns3::olsr::MessageHeader::Mid::Deserialize(), ns3::olsr::MessageHeader::Hello::Deserialize(), ns3::olsr::MessageHeader::Tc::Deserialize(), ns3::olsr::MessageHeader::Hna::Deserialize(), ns3::Ipv4AddressTlvValue::Deserialize(), ns3::GtpcIes::DeserializeBearerTft(), ns3::GtpcIes::DeserializeFteid(), ns3::GtpcIes::DeserializeUliEcgi(), ns3::GtpcHeader::PreDeserialize(), and ns3::ReadFrom().

+ Here is the caller graph for this function:

◆ ReadNtohU64()

uint64_t ns3::Buffer::Iterator::ReadNtohU64 ( void  )
Returns
the eight bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in network format and returned in host format.

Definition at line 1044 of file buffer.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::SeqTsHeader::Deserialize(), ns3::EpcX2HandoverRequestHeader::Deserialize(), ns3::EpcX2SnStatusTransferHeader::Deserialize(), ns3::SllHeader::Deserialize(), ns3::SeqTsEchoHeader::Deserialize(), ns3::SeqTsSizeHeader::Deserialize(), ns3::GtpcIes::DeserializeImsi(), and BufferTest::DoRun().

+ Here is the caller graph for this function:

◆ ReadU16()

uint16_t ns3::Buffer::Iterator::ReadU16 ( void  )
inline
Returns
the two bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in the format written by writeU16.

Definition at line 1029 of file buffer.h.

References data.

Referenced by ns3::dsr::DsrFsHeader::Deserialize(), ns3::dsr::DsrRoutingHeader::Deserialize(), ns3::dsr::DsrOptionRerrUnsupportHeader::Deserialize(), ns3::dsr::DsrOptionAckReqHeader::Deserialize(), ns3::dsr::DsrOptionAckHeader::Deserialize(), ns3::DhcpHeader::Deserialize(), ns3::Icmpv6NS::Deserialize(), ns3::Icmpv6NA::Deserialize(), ns3::Icmpv6RA::Deserialize(), ns3::Icmpv6RS::Deserialize(), ns3::Icmpv6Redirection::Deserialize(), ns3::Icmpv6Echo::Deserialize(), ns3::Icmpv6DestinationUnreachable::Deserialize(), ns3::Icmpv6TooBig::Deserialize(), ns3::Icmpv6TimeExceeded::Deserialize(), ns3::Icmpv6ParameterError::Deserialize(), ns3::Icmpv6OptionRedirected::Deserialize(), ns3::Ipv4Header::Deserialize(), ns3::RipHeader::Deserialize(), ns3::RipNgHeader::Deserialize(), ns3::UdpHeader::Deserialize(), ns3::SixLowPanFrag1::Deserialize(), ns3::SixLowPanFragN::Deserialize(), ns3::SixLowPanUdpNhcExtension::Deserialize(), ns3::UanHeaderRcRts::Deserialize(), ns3::UanHeaderRcCtsGlobal::Deserialize(), ns3::CtrlTriggerHeader::Deserialize(), ns3::RngRsp::Deserialize(), ns3::DsaReq::Deserialize(), ns3::DsaRsp::Deserialize(), ns3::DsaAck::Deserialize(), ns3::GrantManagementSubheader::Deserialize(), ns3::HePpdu::HeSigHeader::Deserialize(), ns3::HtPpdu::HtSigHeader::Deserialize(), ns3::DsssPpdu::DsssSigHeader::Deserialize(), ns3::OfdmPpdu::LSigHeader::Deserialize(), ns3::VhtPpdu::VhtSigHeader::Deserialize(), ns3::HeOperation::DeserializeInformationField(), ns3::HtCapabilities::DeserializeInformationField(), ns3::HtOperation::DeserializeInformationField(), ns3::VhtOperation::DeserializeInformationField(), BufferTest::DoRun(), ns3::DcdChannelEncodings::Read(), ns3::OfdmDlMapIe::Read(), ns3::DlFramePrefixIe::Read(), ns3::UcdChannelEncodings::Read(), and ns3::OfdmUlMapIe::Read().

+ Here is the caller graph for this function:

◆ ReadU32()

◆ ReadU64()

uint64_t ns3::Buffer::Iterator::ReadU64 ( void  )
Returns
the eight bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in the format written by writeU64.

Definition at line 990 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by ns3::EthernetHeader::Deserialize(), and BufferTest::DoRun().

+ Here is the caller graph for this function:

◆ ReadU8()

uint8_t ns3::Buffer::Iterator::ReadU8 ( void  )
inline
Returns
the byte read in the buffer.

Read data and advance the Iterator by the number of bytes read.

Definition at line 1021 of file buffer.h.

Referenced by TcpHeaderWithRFC793OptionTestCase::CheckCorrectDeserialize(), TcpHeaderWithRFC793OptionTestCase::CheckNoPadding(), ns3::GtsFields::Deserialize(), ns3::PendingAddrFields::Deserialize(), ns3::dot11s::Dot11sMeshCapability::Deserialize(), anonymous_namespace{packet-test-suite.cc}::ATestHeader< N >::Deserialize(), anonymous_namespace{packet-test-suite.cc}::ATestTrailer< N >::Deserialize(), ns3::aodv::TypeHeader::Deserialize(), ns3::aodv::RreqHeader::Deserialize(), ns3::aodv::RrepHeader::Deserialize(), ns3::aodv::RrepAckHeader::Deserialize(), ns3::aodv::RerrHeader::Deserialize(), ns3::QKDAppHeader::Deserialize(), ns3::dsr::DsrFsHeader::Deserialize(), ns3::dsr::DsrRoutingHeader::Deserialize(), ns3::dsr::DsrOptionHeader::Deserialize(), ns3::dsr::DsrOptionPad1Header::Deserialize(), ns3::dsr::DsrOptionPadnHeader::Deserialize(), ns3::dsr::DsrOptionRreqHeader::Deserialize(), ns3::dsr::DsrOptionRrepHeader::Deserialize(), ns3::dsr::DsrOptionSRHeader::Deserialize(), ns3::dsr::DsrOptionRerrHeader::Deserialize(), ns3::dsr::DsrOptionRerrUnreachHeader::Deserialize(), ns3::dsr::DsrOptionRerrUnsupportHeader::Deserialize(), ns3::dsr::DsrOptionAckReqHeader::Deserialize(), ns3::dsr::DsrOptionAckHeader::Deserialize(), ns3::DhcpHeader::Deserialize(), ns3::ArpHeader::Deserialize(), ns3::Icmpv4DestinationUnreachable::Deserialize(), ns3::Icmpv4TimeExceeded::Deserialize(), ns3::Icmpv6Header::Deserialize(), ns3::Icmpv6NS::Deserialize(), ns3::Icmpv6NA::Deserialize(), ns3::Icmpv6RA::Deserialize(), ns3::Icmpv6RS::Deserialize(), ns3::Icmpv6Redirection::Deserialize(), ns3::Icmpv6Echo::Deserialize(), ns3::Icmpv6DestinationUnreachable::Deserialize(), ns3::Icmpv6TooBig::Deserialize(), ns3::Icmpv6TimeExceeded::Deserialize(), ns3::Icmpv6ParameterError::Deserialize(), ns3::Icmpv6OptionMtu::Deserialize(), ns3::Icmpv6OptionPrefixInformation::Deserialize(), ns3::Icmpv6OptionLinkLayerAddress::Deserialize(), ns3::Icmpv6OptionRedirected::Deserialize(), ns3::Ipv4Header::Deserialize(), ns3::Ipv6ExtensionHeader::Deserialize(), ns3::Ipv6ExtensionHopByHopHeader::Deserialize(), ns3::Ipv6ExtensionDestinationHeader::Deserialize(), ns3::Ipv6ExtensionFragmentHeader::Deserialize(), ns3::Ipv6ExtensionRoutingHeader::Deserialize(), ns3::Ipv6ExtensionLooseRoutingHeader::Deserialize(), ns3::Ipv6Header::Deserialize(), ns3::Ipv6OptionHeader::Deserialize(), ns3::Ipv6OptionPad1Header::Deserialize(), ns3::Ipv6OptionPadnHeader::Deserialize(), ns3::Ipv6OptionJumbogramHeader::Deserialize(), ns3::Ipv6OptionRouterAlertHeader::Deserialize(), ns3::RipHeader::Deserialize(), ns3::RipNgRte::Deserialize(), ns3::RipNgHeader::Deserialize(), ns3::TcpOptionEnd::Deserialize(), ns3::TcpOptionNOP::Deserialize(), ns3::TcpOptionMSS::Deserialize(), ns3::TcpOptionSackPermitted::Deserialize(), ns3::TcpOptionSack::Deserialize(), ns3::TcpOptionTS::Deserialize(), ns3::TcpOptionWinScale::Deserialize(), ns3::TcpOptionUnknown::Deserialize(), ns3::LrWpanMacHeader::Deserialize(), ns3::CommandPayloadHeader::Deserialize(), ns3::GtpuHeader::Deserialize(), ns3::EpcX2Header::Deserialize(), ns3::EpcX2HandoverRequestHeader::Deserialize(), ns3::EpcX2LoadInformationHeader::Deserialize(), ns3::EpcX2ResourceStatusUpdateHeader::Deserialize(), ns3::LtePdcpHeader::Deserialize(), ns3::LteRlcAmHeader::Deserialize(), ns3::LteRlcHeader::Deserialize(), ns3::dot11s::MeshHeader::Deserialize(), ns3::dot11s::PeerLinkOpenStart::Deserialize(), ns3::dot11s::PeerLinkCloseStart::Deserialize(), ns3::dot11s::PeerLinkConfirmStart::Deserialize(), ns3::flame::FlameHeader::Deserialize(), ns3::olsr::MessageHeader::Deserialize(), ns3::SixLowPanHc1::Deserialize(), ns3::SixLowPanFrag1::Deserialize(), ns3::SixLowPanFragN::Deserialize(), ns3::SixLowPanIpv6::Deserialize(), ns3::SixLowPanIphc::Deserialize(), ns3::SixLowPanNhcExtension::Deserialize(), ns3::SixLowPanUdpNhcExtension::Deserialize(), ns3::SixLowPanBc0::Deserialize(), ns3::SixLowPanMesh::Deserialize(), ns3::UanHeaderCommon::Deserialize(), ns3::UanHeaderRcRts::Deserialize(), ns3::UanHeaderRcCts::Deserialize(), ns3::UanHeaderRcAck::Deserialize(), ns3::CtrlTriggerUserInfoField::Deserialize(), ns3::WifiActionHeader::Deserialize(), ns3::MgtAddBaRequestHeader::Deserialize(), ns3::MgtAddBaResponseHeader::Deserialize(), ns3::Dcd::Deserialize(), ns3::DlMap::Deserialize(), ns3::ManagementMessageType::Deserialize(), ns3::RngRsp::Deserialize(), ns3::DsaRsp::Deserialize(), ns3::DsaAck::Deserialize(), ns3::RngReq::Deserialize(), ns3::OfdmDownlinkFramePrefix::Deserialize(), ns3::Ucd::Deserialize(), ns3::UlMap::Deserialize(), ns3::GenericMacHeader::Deserialize(), ns3::BandwidthRequestHeader::Deserialize(), ns3::GrantManagementSubheader::Deserialize(), ns3::FragmentationSubheader::Deserialize(), ns3::Tlv::Deserialize(), ns3::U8TlvValue::Deserialize(), ns3::AmpduSubframeHeader::Deserialize(), ns3::HePpdu::HeSigHeader::Deserialize(), ns3::HtPpdu::HtSigHeader::Deserialize(), ns3::DsssPpdu::DsssSigHeader::Deserialize(), ns3::OfdmPpdu::LSigHeader::Deserialize(), ns3::VhtPpdu::VhtSigHeader::Deserialize(), ns3::olsr::MessageHeader::Hello::Deserialize(), ns3::SfVectorTlvValue::Deserialize(), ns3::CsParamVectorTlvValue::Deserialize(), ns3::ClassificationRuleVectorTlvValue::Deserialize(), ns3::TosTlvValue::Deserialize(), ns3::ProtocolTlvValue::Deserialize(), ns3::GtpcIes::DeserializeBearerContextHeader(), ns3::GtpcIes::DeserializeBearerQos(), ns3::GtpcIes::DeserializeBearerTft(), ns3::CtrlBAckResponseHeader::DeserializeBitmap(), ns3::Asn1Header::DeserializeBitset(), ns3::GtpcIes::DeserializeCause(), ns3::GtpcIes::DeserializeEbi(), ns3::GtpcIes::DeserializeFteid(), ns3::WifiInformationElement::DeserializeIfPresent(), ns3::GtpcIes::DeserializeImsi(), ns3::dot11s::IeBeaconTiming::DeserializeInformationField(), ns3::dot11s::IeConfiguration::DeserializeInformationField(), ns3::dot11s::IePeerManagement::DeserializeInformationField(), ns3::dot11s::IePeeringProtocol::DeserializeInformationField(), ns3::dot11s::IePreq::DeserializeInformationField(), ns3::dot11s::IePerr::DeserializeInformationField(), ns3::dot11s::IePrep::DeserializeInformationField(), ns3::dot11s::IeRann::DeserializeInformationField(), ns3::MuEdcaParameterSet::DeserializeInformationField(), ns3::EdcaParameterSet::DeserializeInformationField(), ns3::ExtendedCapabilities::DeserializeInformationField(), ns3::HeCapabilities::DeserializeInformationField(), ns3::HtCapabilities::DeserializeInformationField(), ns3::HtOperation::DeserializeInformationField(), ns3::DsssParameterSet::DeserializeInformationField(), ns3::ErpInformation::DeserializeInformationField(), ns3::VhtOperation::DeserializeInformationField(), ns3::MeshInformationElementVector::DeserializeSingleIe(), ns3::WifiInformationElementVector::DeserializeSingleIe(), ns3::GtpcIes::DeserializeUliEcgi(), ns3::OfdmDcdChannelEncodings::DoRead(), ns3::OfdmUcdChannelEncodings::DoRead(), BufferTest::DoRun(), TcpHeaderWithRFC793OptionTestCase::OneOptionAtTime(), ns3::GtpcHeader::PreDeserialize(), ns3::OfdmDlBurstProfile::Read(), ns3::OfdmDlMapIe::Read(), ns3::DlFramePrefixIe::Read(), ns3::OfdmUlBurstProfile::Read(), ns3::OfdmUlMapIe::Read(), and ns3::GtpcIes::ReadNtohU40().

◆ SlowReadNtohU16()

uint16_t ns3::Buffer::Iterator::SlowReadNtohU16 ( void  )
private
Returns
the two bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in network format and returned in host format.

Warning
this is the slow version, please use ReadNtohU16 (void)

Definition at line 1020 of file buffer.cc.

References NS_LOG_FUNCTION.

◆ SlowReadNtohU32()

uint32_t ns3::Buffer::Iterator::SlowReadNtohU32 ( void  )
private
Returns
the four bytes read in the buffer.

Read data and advance the Iterator by the number of bytes read. The data is read in network format and returned in host format.

Warning
this is the slow version, please use ReadNtohU32 (void)

Definition at line 1030 of file buffer.cc.

References NS_LOG_FUNCTION.

◆ Write() [1/2]

void ns3::Buffer::Iterator::Write ( Iterator  start,
Iterator  end 
)
Parameters
startthe start of the data to copy
endthe end of the data to copy

Write the data delimited by start and end in internal buffer and advance the iterator position by the number of bytes copied. The input iterators must not point to the same Buffer as we do to avoid overlapping copies. This is enforced in debug builds by asserts.

Definition at line 836 of file buffer.cc.

References m_current, m_data, ns3::Buffer::m_data, m_zeroEnd, m_zeroStart, min, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, and visualizer.core::start().

+ Here is the call graph for this function:

◆ Write() [2/2]

void ns3::Buffer::Iterator::Write ( uint8_t const *  buffer,
uint32_t  size 
)
Parameters
buffera byte buffer to copy in the internal buffer.
sizenumber of bytes to copy.

Write the data in buffer and advance the iterator position by size bytes.

Definition at line 954 of file buffer.cc.

References ns3::Buffer::m_data, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::Packet::Packet(), PbbTestCase::PbbTestCase(), ns3::Buffer::AddAtEnd(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Buffer::CreateFullCopy(), ns3::SixLowPanNetDevice::DecompressLowPanNhc(), ns3::PbbTlv::Deserialize(), ns3::dsr::DsrFsHeader::Deserialize(), ns3::dsr::DsrOptionHeader::Deserialize(), ns3::dsr::DsrOptionRerrHeader::Deserialize(), ns3::Ipv6ExtensionHeader::Deserialize(), ns3::Ipv6OptionHeader::Deserialize(), ns3::dsr::DsrOptionField::Deserialize(), ns3::OptionField::Deserialize(), ns3::Buffer::Deserialize(), BufferTest::DoRun(), ns3::Asn1Header::Serialize(), ns3::QKDAppHeader::Serialize(), ns3::dsr::DsrFsHeader::Serialize(), ns3::dsr::DsrOptionHeader::Serialize(), ns3::dsr::DsrOptionRreqHeader::Serialize(), ns3::dsr::DsrOptionRrepHeader::Serialize(), ns3::dsr::DsrOptionSRHeader::Serialize(), ns3::dsr::DsrOptionRerrHeader::Serialize(), ns3::DhcpHeader::Serialize(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), ns3::Icmpv6ParameterError::Serialize(), ns3::Icmpv6OptionPrefixInformation::Serialize(), ns3::Icmpv6OptionLinkLayerAddress::Serialize(), ns3::Icmpv6OptionRedirected::Serialize(), ns3::Ipv6ExtensionHeader::Serialize(), ns3::Ipv6ExtensionLooseRoutingHeader::Serialize(), ns3::Ipv6OptionHeader::Serialize(), ns3::RipNgRte::Serialize(), ns3::TcpOptionUnknown::Serialize(), ns3::LlcSnapHeader::Serialize(), ns3::SixLowPanHc1::Serialize(), ns3::SixLowPanIphc::Serialize(), ns3::SixLowPanNhcExtension::Serialize(), ns3::SixLowPanMesh::Serialize(), ns3::PbbTlv::SetValue(), and ns3::WriteTo().

+ Here is the caller graph for this function:

◆ WriteHtolsbU16()

◆ WriteHtolsbU32()

void ns3::Buffer::Iterator::WriteHtolsbU32 ( uint32_t  data)
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by four bytes. The data is written in least significant byte order and the input data is expected to be in host order.

Definition at line 918 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by ns3::LrWpanMacHeader::Serialize(), ns3::dot11s::MeshHeader::Serialize(), ns3::CtrlBAckResponseHeader::Serialize(), ns3::CtrlTriggerUserInfoField::Serialize(), ns3::dot11s::IeLinkMetricReport::SerializeInformationField(), ns3::dot11s::IePerr::SerializeInformationField(), ns3::dot11s::IePrep::SerializeInformationField(), ns3::dot11s::IePreq::SerializeInformationField(), and ns3::dot11s::IeRann::SerializeInformationField().

+ Here is the caller graph for this function:

◆ WriteHtolsbU64()

void ns3::Buffer::Iterator::WriteHtolsbU64 ( uint64_t  data)
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by eight bytes. The data is written in least significant byte order and the input data is expected to be in host order.

Definition at line 927 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by BufferTest::DoRun(), ns3::LrWpanMacHeader::Serialize(), ns3::CtrlTriggerHeader::Serialize(), and ns3::MgtProbeResponseHeader::Serialize().

+ Here is the caller graph for this function:

◆ WriteHtonU16()

void ns3::Buffer::Iterator::WriteHtonU16 ( uint16_t  data)
inline
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by two bytes. The data is written in network order and the input data is expected to be in host order.

Definition at line 905 of file buffer.h.

References data, ns3::Buffer::m_data, and NS_ASSERT_MSG.

Referenced by BufferTest::DoRun(), ns3::GtpcHeader::PreSerialize(), ns3::PbbTlvBlock::Serialize(), ns3::PbbAddressTlvBlock::Serialize(), ns3::PbbMessage::Serialize(), ns3::dsr::DsrOptionRreqHeader::Serialize(), ns3::DhcpHeader::Serialize(), ns3::ArpHeader::Serialize(), ns3::Icmpv4Header::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6Echo::Serialize(), ns3::Icmpv6OptionMtu::Serialize(), ns3::Ipv4Header::Serialize(), ns3::Ipv6ExtensionFragmentHeader::Serialize(), ns3::Ipv6Header::Serialize(), ns3::Ipv6OptionRouterAlertHeader::Serialize(), ns3::RipRte::Serialize(), ns3::RipNgRte::Serialize(), ns3::TcpHeader::Serialize(), ns3::TcpOptionMSS::Serialize(), ns3::UdpHeader::Serialize(), ns3::GtpuHeader::Serialize(), ns3::EpcX2Header::Serialize(), ns3::EpcX2HandoverRequestHeader::Serialize(), ns3::EpcX2HandoverRequestAckHeader::Serialize(), ns3::EpcX2HandoverPreparationFailureHeader::Serialize(), ns3::EpcX2SnStatusTransferHeader::Serialize(), ns3::EpcX2UeContextReleaseHeader::Serialize(), ns3::EpcX2LoadInformationHeader::Serialize(), ns3::EpcX2ResourceStatusUpdateHeader::Serialize(), ns3::flame::FlameHeader::Serialize(), ns3::EthernetHeader::Serialize(), ns3::LlcSnapHeader::Serialize(), ns3::SllHeader::Serialize(), ns3::olsr::PacketHeader::Serialize(), ns3::olsr::MessageHeader::Serialize(), ns3::olsr::MessageHeader::Hello::Serialize(), ns3::olsr::MessageHeader::Tc::Serialize(), ns3::SixLowPanIphc::Serialize(), ns3::SixLowPanUdpNhcExtension::Serialize(), ns3::U16TlvValue::Serialize(), ns3::PortRangeTlvValue::Serialize(), ns3::AmsduSubframeHeader::Serialize(), ns3::GtpcIes::SerializeBearerQos(), ns3::GtpcIes::SerializeBearerTft(), ns3::GtpcIes::SerializeCause(), ns3::GtpcIes::SerializeEbi(), ns3::GtpcIes::SerializeFteid(), ns3::GtpcIes::SerializeImsi(), and ns3::GtpcIes::SerializeUliEcgi().

+ Here is the caller graph for this function:

◆ WriteHtonU32()

void ns3::Buffer::Iterator::WriteHtonU32 ( uint32_t  data)
inline
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by four bytes. The data is written in network order and the input data is expected to be in host order.

Definition at line 924 of file buffer.h.

References data, ns3::Buffer::m_data, and NS_ASSERT_MSG.

Referenced by BufferTest::DoRun(), ns3::GtpcHeader::PreSerialize(), ns3::aodv::RerrHeader::Serialize(), ns3::aodv::RreqHeader::Serialize(), ns3::aodv::RrepHeader::Serialize(), ns3::QKDAppHeader::Serialize(), ns3::SeqTsHeader::Serialize(), ns3::dsdv::DsdvHeader::Serialize(), ns3::DhcpHeader::Serialize(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6ParameterError::Serialize(), ns3::Icmpv6OptionMtu::Serialize(), ns3::Icmpv6OptionPrefixInformation::Serialize(), ns3::Ipv4Header::Serialize(), ns3::Ipv6ExtensionFragmentHeader::Serialize(), ns3::Ipv6Header::Serialize(), ns3::Ipv6OptionJumbogramHeader::Serialize(), ns3::RipRte::Serialize(), ns3::TcpHeader::Serialize(), ns3::TcpOptionSack::Serialize(), ns3::TcpOptionTS::Serialize(), ns3::GtpuHeader::Serialize(), ns3::EpcX2HandoverRequestHeader::Serialize(), ns3::EpcX2HandoverRequestAckHeader::Serialize(), ns3::EpcX2SnStatusTransferHeader::Serialize(), ns3::olsr::MessageHeader::Serialize(), ns3::olsr::MessageHeader::Mid::Serialize(), ns3::olsr::MessageHeader::Hello::Serialize(), ns3::olsr::MessageHeader::Tc::Serialize(), ns3::olsr::MessageHeader::Hna::Serialize(), ns3::U32TlvValue::Serialize(), ns3::Ipv4AddressTlvValue::Serialize(), ns3::SeqTsEchoHeader::Serialize(), ns3::GtpcIes::SerializeBearerTft(), ns3::GtpcIes::SerializeFteid(), ns3::GtpcIes::SerializeUliEcgi(), and ns3::WriteTo().

+ Here is the caller graph for this function:

◆ WriteHtonU64()

void ns3::Buffer::Iterator::WriteHtonU64 ( uint64_t  data)
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by eight bytes. The data is written in network order and the input data is expected to be in host order.

Definition at line 941 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by BufferTest::DoRun(), ns3::SeqTsHeader::Serialize(), ns3::EpcX2HandoverRequestHeader::Serialize(), ns3::EpcX2SnStatusTransferHeader::Serialize(), ns3::SllHeader::Serialize(), ns3::SeqTsEchoHeader::Serialize(), ns3::SeqTsSizeHeader::Serialize(), and ns3::GtpcIes::SerializeImsi().

+ Here is the caller graph for this function:

◆ WriteU16()

void ns3::Buffer::Iterator::WriteU16 ( uint16_t  data)
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by two bytes. The format of the data written in the byte buffer is non-portable. We only ensure that readU16 will return exactly what we wrote with writeU16 if the program is run on the same machine.

Definition at line 871 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by ns3::TcpHeader::CalculateHeaderChecksum(), ns3::UdpHeader::CalculateHeaderChecksum(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), BufferTest::DoRun(), ns3::dsr::DsrFsHeader::Serialize(), ns3::dsr::DsrRoutingHeader::Serialize(), ns3::dsr::DsrOptionRerrUnsupportHeader::Serialize(), ns3::dsr::DsrOptionAckReqHeader::Serialize(), ns3::dsr::DsrOptionAckHeader::Serialize(), ns3::DhcpHeader::Serialize(), ns3::Icmpv4Header::Serialize(), ns3::Icmpv6Header::Serialize(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6Echo::Serialize(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), ns3::Icmpv6ParameterError::Serialize(), ns3::Icmpv6OptionRedirected::Serialize(), ns3::Ipv4Header::Serialize(), ns3::RipHeader::Serialize(), ns3::RipNgHeader::Serialize(), ns3::TcpHeader::Serialize(), ns3::UdpHeader::Serialize(), ns3::olsr::MessageHeader::Hello::Serialize(), ns3::SixLowPanFrag1::Serialize(), ns3::SixLowPanFragN::Serialize(), ns3::SixLowPanUdpNhcExtension::Serialize(), ns3::RngRsp::Serialize(), ns3::DsaReq::Serialize(), ns3::DsaRsp::Serialize(), ns3::DsaAck::Serialize(), ns3::GrantManagementSubheader::Serialize(), ns3::WimaxMacToMacHeader::Serialize(), ns3::GtpcIes::SerializeBearerContextHeader(), ns3::DcdChannelEncodings::Write(), ns3::OfdmDlMapIe::Write(), ns3::DlFramePrefixIe::Write(), ns3::UcdChannelEncodings::Write(), and ns3::OfdmUlMapIe::Write().

+ Here is the caller graph for this function:

◆ WriteU32()

void ns3::Buffer::Iterator::WriteU32 ( uint32_t  data)
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by four bytes. The format of the data written in the byte buffer is non-portable. We only ensure that readU32 will return exactly what we wrote with writeU32 if the program is run on the same machine.

Definition at line 879 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by ns3::OfdmDcdChannelEncodings::DoWrite(), ns3::EthernetTrailer::Serialize(), ns3::DhcpHeader::Serialize(), ns3::Icmpv6Header::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), ns3::Icmpv6OptionRedirected::Serialize(), ns3::Ipv6ExtensionLooseRoutingHeader::Serialize(), ns3::RngRsp::Serialize(), ns3::OfdmDownlinkFramePrefix::Serialize(), ns3::UlMap::Serialize(), ns3::DcdChannelEncodings::Write(), and ns3::UcdChannelEncodings::Write().

+ Here is the caller graph for this function:

◆ WriteU64()

void ns3::Buffer::Iterator::WriteU64 ( uint64_t  data)
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by eight bytes. The format of the data written in the byte buffer is non-portable. We only ensure that readU64 will return exactly what we wrote with writeU64 if the program is run on the same machine.

Definition at line 891 of file buffer.cc.

References data, and NS_LOG_FUNCTION.

Referenced by BufferTest::DoRun(), and ns3::EthernetHeader::Serialize().

+ Here is the caller graph for this function:

◆ WriteU8() [1/2]

void ns3::Buffer::Iterator::WriteU8 ( uint8_t  data)
inline
Parameters
datadata to write in buffer

Write the data in buffer and advance the iterator position by one byte.

Definition at line 869 of file buffer.h.

References data, ns3::Buffer::m_data, and NS_ASSERT_MSG.

Referenced by ns3::TcpHeader::CalculateHeaderChecksum(), ns3::UdpHeader::CalculateHeaderChecksum(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), TcpHeaderWithRFC793OptionTestCase::CheckCorrectDeserialize(), ns3::Buffer::CreateFullCopy(), BufferTest::DoRun(), ns3::OfdmDcdChannelEncodings::DoWrite(), ns3::OfdmUcdChannelEncodings::DoWrite(), ns3::GtpcHeader::PreSerialize(), ns3::PbbMessage::Serialize(), ns3::PbbAddressBlock::Serialize(), ns3::PbbTlv::Serialize(), ns3::aodv::RerrHeader::Serialize(), ns3::GtsFields::Serialize(), ns3::PendingAddrFields::Serialize(), ns3::dot11s::Dot11sMeshCapability::Serialize(), ns3::WifiInformationElement::Serialize(), anonymous_namespace{packet-test-suite.cc}::ATestHeader< N >::Serialize(), anonymous_namespace{packet-test-suite.cc}::ATestTrailer< N >::Serialize(), ns3::aodv::TypeHeader::Serialize(), ns3::aodv::RreqHeader::Serialize(), ns3::aodv::RrepHeader::Serialize(), ns3::aodv::RrepAckHeader::Serialize(), ns3::QKDAppHeader::Serialize(), ns3::dsr::DsrFsHeader::Serialize(), ns3::dsr::DsrRoutingHeader::Serialize(), ns3::dsr::DsrOptionHeader::Serialize(), ns3::dsr::DsrOptionPad1Header::Serialize(), ns3::dsr::DsrOptionPadnHeader::Serialize(), ns3::dsr::DsrOptionRreqHeader::Serialize(), ns3::dsr::DsrOptionRrepHeader::Serialize(), ns3::dsr::DsrOptionSRHeader::Serialize(), ns3::dsr::DsrOptionRerrHeader::Serialize(), ns3::dsr::DsrOptionRerrUnreachHeader::Serialize(), ns3::dsr::DsrOptionRerrUnsupportHeader::Serialize(), ns3::dsr::DsrOptionAckReqHeader::Serialize(), ns3::dsr::DsrOptionAckHeader::Serialize(), ns3::DhcpHeader::Serialize(), ns3::ArpHeader::Serialize(), ns3::Icmpv4Header::Serialize(), ns3::Icmpv6Header::Serialize(), ns3::Icmpv6NS::Serialize(), ns3::Icmpv6NA::Serialize(), ns3::Icmpv6RA::Serialize(), ns3::Icmpv6RS::Serialize(), ns3::Icmpv6Redirection::Serialize(), ns3::Icmpv6Echo::Serialize(), ns3::Icmpv6DestinationUnreachable::Serialize(), ns3::Icmpv6TooBig::Serialize(), ns3::Icmpv6TimeExceeded::Serialize(), ns3::Icmpv6ParameterError::Serialize(), ns3::Icmpv6OptionMtu::Serialize(), ns3::Icmpv6OptionPrefixInformation::Serialize(), ns3::Icmpv6OptionLinkLayerAddress::Serialize(), ns3::Icmpv6OptionRedirected::Serialize(), ns3::Ipv4Header::Serialize(), ns3::Ipv6ExtensionHeader::Serialize(), ns3::Ipv6ExtensionHopByHopHeader::Serialize(), ns3::Ipv6ExtensionDestinationHeader::Serialize(), ns3::Ipv6ExtensionFragmentHeader::Serialize(), ns3::Ipv6ExtensionRoutingHeader::Serialize(), ns3::Ipv6ExtensionLooseRoutingHeader::Serialize(), ns3::Ipv6Header::Serialize(), ns3::Ipv6OptionHeader::Serialize(), ns3::Ipv6OptionPad1Header::Serialize(), ns3::Ipv6OptionPadnHeader::Serialize(), ns3::Ipv6OptionJumbogramHeader::Serialize(), ns3::Ipv6OptionRouterAlertHeader::Serialize(), ns3::RipHeader::Serialize(), ns3::RipNgRte::Serialize(), ns3::RipNgHeader::Serialize(), ns3::TcpHeader::Serialize(), ns3::TcpOptionEnd::Serialize(), ns3::TcpOptionNOP::Serialize(), ns3::TcpOptionMSS::Serialize(), ns3::TcpOptionSackPermitted::Serialize(), ns3::TcpOptionSack::Serialize(), ns3::TcpOptionTS::Serialize(), ns3::TcpOptionWinScale::Serialize(), ns3::TcpOptionUnknown::Serialize(), ns3::LrWpanMacHeader::Serialize(), ns3::CommandPayloadHeader::Serialize(), ns3::GtpuHeader::Serialize(), ns3::EpcX2Header::Serialize(), ns3::EpcX2HandoverRequestHeader::Serialize(), ns3::EpcX2LoadInformationHeader::Serialize(), ns3::EpcX2ResourceStatusUpdateHeader::Serialize(), ns3::LtePdcpHeader::Serialize(), ns3::LteRlcAmHeader::Serialize(), ns3::LteRlcHeader::Serialize(), ns3::dot11s::MeshHeader::Serialize(), ns3::flame::FlameHeader::Serialize(), ns3::PbbPacket::Serialize(), ns3::olsr::MessageHeader::Serialize(), ns3::olsr::MessageHeader::Hello::Serialize(), ns3::SixLowPanHc1::Serialize(), ns3::SixLowPanFrag1::Serialize(), ns3::SixLowPanFragN::Serialize(), ns3::SixLowPanIpv6::Serialize(), ns3::SixLowPanIphc::Serialize(), ns3::SixLowPanNhcExtension::Serialize(), ns3::SixLowPanUdpNhcExtension::Serialize(), ns3::SixLowPanBc0::Serialize(), ns3::SixLowPanMesh::Serialize(), ns3::CtrlTriggerUserInfoField::Serialize(), ns3::MgtAddBaRequestHeader::Serialize(), ns3::MgtAddBaResponseHeader::Serialize(), ns3::Dcd::Serialize(), ns3::DlMap::Serialize(), ns3::ManagementMessageType::Serialize(), ns3::RngRsp::Serialize(), ns3::DsaRsp::Serialize(), ns3::DsaAck::Serialize(), ns3::RngReq::Serialize(), ns3::OfdmDownlinkFramePrefix::Serialize(), ns3::Ucd::Serialize(), ns3::UlMap::Serialize(), ns3::GenericMacHeader::Serialize(), ns3::BandwidthRequestHeader::Serialize(), ns3::GrantManagementSubheader::Serialize(), ns3::FragmentationSubheader::Serialize(), ns3::WimaxMacToMacHeader::Serialize(), ns3::Tlv::Serialize(), ns3::U8TlvValue::Serialize(), ns3::TosTlvValue::Serialize(), ns3::ProtocolTlvValue::Serialize(), ns3::AmpduSubframeHeader::Serialize(), ns3::GtpcIes::SerializeBearerContextHeader(), ns3::GtpcIes::SerializeBearerQos(), ns3::GtpcIes::SerializeBearerTft(), ns3::CtrlBAckResponseHeader::SerializeBitmap(), ns3::GtpcIes::SerializeCause(), ns3::GtpcIes::SerializeEbi(), ns3::GtpcIes::SerializeFteid(), ns3::GtpcIes::SerializeImsi(), ns3::dot11s::IeBeaconTiming::SerializeInformationField(), ns3::dot11s::IeConfiguration::SerializeInformationField(), ns3::dot11s::IeMeshId::SerializeInformationField(), ns3::dot11s::IePeerManagement::SerializeInformationField(), ns3::dot11s::IePeeringProtocol::SerializeInformationField(), ns3::dot11s::IePerr::SerializeInformationField(), ns3::dot11s::IePrep::SerializeInformationField(), ns3::dot11s::IePreq::SerializeInformationField(), ns3::dot11s::IeRann::SerializeInformationField(), ns3::GtpcIes::SerializeUliEcgi(), ns3::OfdmDlBurstProfile::Write(), ns3::OfdmDlMapIe::Write(), ns3::DlFramePrefixIe::Write(), ns3::OfdmUlBurstProfile::Write(), ns3::OfdmUlMapIe::Write(), ns3::GtpcIes::WriteHtonU40(), and ns3::Asn1Header::WriteOctet().

◆ WriteU8() [2/2]

void ns3::Buffer::Iterator::WriteU8 ( uint8_t  data,
uint32_t  len 
)
inline
Parameters
datadata to write in buffer
lennumber of times data must be written in buffer

Write the data in buffer len times and advance the iterator position by len byte.

Definition at line 887 of file buffer.h.

References data, ns3::Buffer::m_data, and NS_ASSERT_MSG.

Friends And Related Function Documentation

◆ Buffer

friend class Buffer
friend

Friend class.

Definition at line 386 of file buffer.h.

Member Data Documentation

◆ m_current

uint32_t ns3::Buffer::Iterator::m_current
private

offset in virtual bytes from the start of the data buffer to the current position represented by this iterator.

Definition at line 479 of file buffer.h.

Referenced by GetDistanceFrom(), and Write().

◆ m_data

uint8_t* ns3::Buffer::Iterator::m_data
private

a pointer to the underlying byte buffer.

All offsets are relative to this pointer.

Definition at line 484 of file buffer.h.

Referenced by GetDistanceFrom(), and Write().

◆ m_dataEnd

uint32_t ns3::Buffer::Iterator::m_dataEnd
private

offset in virtual bytes from the start of the data buffer to the end of the data which can be read by this iterator

Definition at line 474 of file buffer.h.

◆ m_dataStart

uint32_t ns3::Buffer::Iterator::m_dataStart
private

offset in virtual bytes from the start of the data buffer to the start of the data which can be read by this iterator

Definition at line 469 of file buffer.h.

◆ m_zeroEnd

uint32_t ns3::Buffer::Iterator::m_zeroEnd
private

offset in virtual bytes from the start of the data buffer to the end of the "virtual zero area".

Definition at line 464 of file buffer.h.

Referenced by Write().

◆ m_zeroStart

uint32_t ns3::Buffer::Iterator::m_zeroStart
private

offset in virtual bytes from the start of the data buffer to the start of the "virtual zero area".

Definition at line 459 of file buffer.h.

Referenced by Write().


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