A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::PbbMessageIpv4 Class Reference

Concrete IPv4 specific PbbMessage. More...

#include "packetbb.h"

+ Inheritance diagram for ns3::PbbMessageIpv4:
+ Collaboration diagram for ns3::PbbMessageIpv4:

Public Member Functions

 PbbMessageIpv4 ()
 
- Public Member Functions inherited from ns3::PbbMessage
 PbbMessage ()
 
virtual ~PbbMessage ()
 
Ptr< PbbAddressBlockAddressBlockBack ()
 
const Ptr< PbbAddressBlockAddressBlockBack () const
 
AddressBlockIterator AddressBlockBegin ()
 
ConstAddressBlockIterator AddressBlockBegin () const
 
void AddressBlockClear ()
 Removes all address blocks from this message.
 
bool AddressBlockEmpty () const
 
AddressBlockIterator AddressBlockEnd ()
 
ConstAddressBlockIterator AddressBlockEnd () const
 
AddressBlockIterator AddressBlockErase (AddressBlockIterator first, AddressBlockIterator last)
 Removes all address blocks from [first, last) (includes first, not includes last).
 
AddressBlockIterator AddressBlockErase (AddressBlockIterator position)
 Removes the address block at the specified position.
 
Ptr< PbbAddressBlockAddressBlockFront ()
 
const Ptr< PbbAddressBlockAddressBlockFront () const
 
void AddressBlockPopBack ()
 Removes an address block from the back of this message.
 
void AddressBlockPopFront ()
 Removes an address block from the front of this message.
 
void AddressBlockPushBack (Ptr< PbbAddressBlock > block)
 Appends an address block to the front of this message.
 
void AddressBlockPushFront (Ptr< PbbAddressBlock > block)
 Prepends an address block to the front of this message.
 
int AddressBlockSize () const
 
void Deserialize (Buffer::Iterator &start)
 Deserializes a message from the specified buffer.
 
uint8_t GetHopCount () const
 
uint8_t GetHopLimit () const
 
Address GetOriginatorAddress () const
 
uint16_t GetSequenceNumber () const
 
uint32_t GetSerializedSize () const
 
uint8_t GetType () const
 
bool HasHopCount () const
 Tests whether or not this message has a hop count.
 
bool HasHopLimit () const
 Tests whether or not this message has a hop limit.
 
bool HasOriginatorAddress () const
 Tests whether or not this message has an originator address.
 
bool HasSequenceNumber () const
 Tests whether or not this message has a sequence number.
 
bool operator!= (const PbbMessage &other) const
 Inequality operator for PbbMessage.
 
bool operator== (const PbbMessage &other) const
 Equality operator for PbbMessage.
 
void Print (std::ostream &os) const
 Pretty-prints the contents of this message.
 
void Print (std::ostream &os, int level) const
 Pretty-prints the contents of this message, with specified indentation.
 
void Serialize (Buffer::Iterator &start) const
 Serializes this message into the specified buffer.
 
void SetHopCount (uint8_t hopcount)
 Sets the current number of hops this message has traveled.
 
void SetHopLimit (uint8_t hoplimit)
 Sets the maximum number of hops this message should travel.
 
void SetOriginatorAddress (Address address)
 Sets the address for the node that created this packet.
 
void SetSequenceNumber (uint16_t seqnum)
 Sets the sequence number of this message.
 
void SetType (uint8_t type)
 Sets the type for this message.
 
Ptr< PbbTlvTlvBack ()
 
const Ptr< PbbTlvTlvBack () const
 
TlvIterator TlvBegin ()
 
ConstTlvIterator TlvBegin () const
 
void TlvClear ()
 Removes all message TLVs from this block.
 
bool TlvEmpty () const
 
TlvIterator TlvEnd ()
 
ConstTlvIterator TlvEnd () const
 
TlvIterator TlvErase (TlvIterator first, TlvIterator last)
 Removes all message TLVs from [first, last) (includes first, not includes last).
 
TlvIterator TlvErase (TlvIterator position)
 Removes the message TLV at the specified position.
 
Ptr< PbbTlvTlvFront ()
 
const Ptr< PbbTlvTlvFront () const
 
void TlvPopBack ()
 Removes a message TLV from the back of this message.
 
void TlvPopFront ()
 Removes a message TLV from the front of this message.
 
void TlvPushBack (Ptr< PbbTlv > tlv)
 Appends a message TLV to the back of this message.
 
void TlvPushFront (Ptr< PbbTlv > tlv)
 Prepends a message TLV to the front of this message.
 
int TlvSize () const
 
- Public Member Functions inherited from ns3::SimpleRefCount< PbbMessage >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

Protected Member Functions

Ptr< PbbAddressBlockAddressBlockDeserialize (Buffer::Iterator &start) const override
 Deserialize an address block.
 
Address DeserializeOriginatorAddress (Buffer::Iterator &start) const override
 Deserialize the originator address.
 
PbbAddressLength GetAddressLength () const override
 Returns address length (IPV4 3 or IPV6 15)
 
void PrintOriginatorAddress (std::ostream &os) const override
 Print the originator address.
 
void SerializeOriginatorAddress (Buffer::Iterator &start) const override
 Serialize the originator address.
 

Additional Inherited Members

- Public Types inherited from ns3::PbbMessage
typedef std::list< Ptr< PbbAddressBlock > >::iterator AddressBlockIterator
 PbbAddressBlock iterator.
 
typedef std::list< Ptr< PbbAddressBlock > >::const_iterator ConstAddressBlockIterator
 PbbAddressBlock const iterator.
 
typedef std::list< Ptr< PbbTlv > >::const_iterator ConstTlvIterator
 PbbTlv const iterator.
 
typedef std::list< Ptr< PbbTlv > >::iterator TlvIterator
 PbbTlv iterator.
 
- Static Public Member Functions inherited from ns3::PbbMessage
static Ptr< PbbMessageDeserializeMessage (Buffer::Iterator &start)
 Deserializes a message, returning the correct object depending on whether it is an IPv4 message or an IPv6 message.
 

Detailed Description

Concrete IPv4 specific PbbMessage.

This message will only contain IPv4 addresses.

Definition at line 1127 of file packetbb.h.

Constructor & Destructor Documentation

◆ PbbMessageIpv4()

ns3::PbbMessageIpv4::PbbMessageIpv4 ( )

Definition at line 1706 of file packetbb.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddressBlockDeserialize()

Ptr< PbbAddressBlock > ns3::PbbMessageIpv4::AddressBlockDeserialize ( Buffer::Iterator & start) const
overrideprotectedvirtual

Deserialize an address block.

Parameters
startthe buffer iterator start
Returns
the deserialized address block

Implements ns3::PbbMessage.

Definition at line 1747 of file packetbb.cc.

References ns3::Create(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DeserializeOriginatorAddress()

Address ns3::PbbMessageIpv4::DeserializeOriginatorAddress ( Buffer::Iterator & start) const
overrideprotectedvirtual

Deserialize the originator address.

Parameters
startthe buffer iterator start
Returns
the deserialized address

Implements ns3::PbbMessage.

Definition at line 1729 of file packetbb.cc.

References ns3::Ipv4Address::Deserialize(), GetAddressLength(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetAddressLength()

PbbAddressLength ns3::PbbMessageIpv4::GetAddressLength ( ) const
overrideprotectedvirtual

Returns address length (IPV4 3 or IPV6 15)

Returns message size in bytes - 1 IPv4 = 4 - 1 = 3, IPv6 = 16 - 1 = 15

Returns
Address length (IPV4 3 or IPV6 15)

Implements ns3::PbbMessage.

Definition at line 1712 of file packetbb.cc.

References ns3::IPV4, and NS_LOG_FUNCTION.

Referenced by DeserializeOriginatorAddress(), and SerializeOriginatorAddress().

+ Here is the caller graph for this function:

◆ PrintOriginatorAddress()

void ns3::PbbMessageIpv4::PrintOriginatorAddress ( std::ostream & os) const
overrideprotectedvirtual

Print the originator address.

Parameters
osthe output stream

Implements ns3::PbbMessage.

Definition at line 1740 of file packetbb.cc.

References ns3::Ipv4Address::ConvertFrom(), ns3::PbbMessage::GetOriginatorAddress(), NS_LOG_FUNCTION, and ns3::Ipv4Address::Print().

+ Here is the call graph for this function:

◆ SerializeOriginatorAddress()

void ns3::PbbMessageIpv4::SerializeOriginatorAddress ( Buffer::Iterator & start) const
overrideprotectedvirtual

Serialize the originator address.

Parameters
startthe buffer iterator start

Implements ns3::PbbMessage.

Definition at line 1719 of file packetbb.cc.

References ns3::Ipv4Address::ConvertFrom(), GetAddressLength(), ns3::PbbMessage::GetOriginatorAddress(), NS_LOG_FUNCTION, and ns3::Ipv4Address::Serialize().

+ Here is the call graph for this function:

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