|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
31 #include "ns3/address.h"
32 #include "ns3/header.h"
33 #include "ns3/buffer.h"
34 #include "ns3/simple-ref-count.h"
40 class PbbAddressBlock;
59 typedef std::list< Ptr<PbbTlv> >::iterator
Iterator;
89 int Size (
void)
const;
94 bool Empty (
void)
const;
185 void Print (std::ostream &os)
const;
195 void Print (std::ostream &os,
int level)
const;
223 typedef std::list< Ptr<PbbAddressTlv> >::iterator
Iterator;
253 int Size (
void)
const;
258 bool Empty (
void)
const;
351 void Print (std::ostream &os)
const;
361 void Print (std::ostream &os,
int level)
const;
660 virtual void Print (std::ostream &os)
const;
1041 void Print (std::ostream &os)
const;
1052 void Print (std::ostream &os,
int level)
const;
1531 void Print (std::ostream &os)
const;
1542 void Print (std::ostream &os,
int level)
const;
1596 void GetHeadTail (uint8_t *head, uint8_t &headlen,
1597 uint8_t *tail, uint8_t &taillen)
const;
1605 bool HasZeroTail (
const uint8_t *tail, uint8_t taillen)
const;
1719 void SetValue (
const uint8_t * buffer, uint32_t size);
1765 void Print (std::ostream &os)
const;
1775 void Print (std::ostream &os,
int level)
const;
bool HasIndexStart(void) const
Checks if there is a starting index.
a unique identifier for an interface.
bool operator!=(const PbbAddressBlock &other) const
Inequality operator for PbbAddressBlock.
bool AddressBlockEmpty(void) const
void TlvPushFront(Ptr< PbbTlv > tlv)
Prepends a packet TLV to the front of this packet.
void Serialize(Buffer::Iterator &start) const
Serializes this TLV into the specified buffer.
void TlvPopBack(void)
Removes a packet TLV from the back of this block.
uint8_t m_type
Type of this TLV.
void AddressPushFront(Address address)
Prepends an address to the front of this block.
int MessageSize(void) const
bool m_hasseqnum
Sequence number present.
Ptr< PbbAddressBlock > AddressBlockBack(void)
static Ptr< PbbMessage > DeserializeMessage(Buffer::Iterator &start)
Deserializes a message, returning the correct object depending on whether it is an IPv4 message or an...
std::list< Ptr< PbbTlv > > m_tlvList
PbbTlv container.
std::list< Address >::const_iterator ConstAddressIterator
Address const iterator.
void AddressBlockPopBack(void)
Removes an address block from the back of this message.
std::list< Ptr< PbbTlv > >::const_iterator ConstTlvIterator
PbbTlv const iterator for PbbPacket.
bool operator==(const PbbAddressBlock &other) const
Equality operator for PbbAddressBlock.
uint8_t GetHopLimit(void) const
uint8_t GetVersion(void) const
uint8_t m_hopLimit
Hop limit.
virtual Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const =0
Deserialize an address block.
Concrete IPv6 specific PbbAddressBlock.
void Serialize(Buffer::Iterator &start) const
Serializes this block into the specified buffer.
std::list< Ptr< PbbMessage > > m_messageList
PbbTlvBlock container.
AddressBlockIterator AddressBlockEnd()
Ptr< PbbTlv > TlvFront(void)
bool m_hasValue
Has value.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void TlvPopBack(void)
Removes a message TLV from the back of this message.
int AddressSize(void) const
PbbAddressTlvBlock::ConstIterator ConstTlvIterator
tlvblock const iterator
std::list< Ptr< PbbAddressBlock > > m_addressBlockList
PbbAddressBlock container.
void Clear(void)
Removes all Address TLVs from this block.
AddressIterator AddressBegin(void)
void Deserialize(Buffer::Iterator &start)
Deserializes a block from the specified buffer.
virtual PbbAddressLength GetAddressLength(void) const =0
Returns address length (IPV4 3 or IPV6 15)
virtual void PrintAddress(std::ostream &os, ConstAddressIterator iter) const =0
Print one or more addresses.
virtual Address DeserializeAddress(uint8_t *buffer) const
Deserialize one address.
void TlvPopFront(void)
Removes a packet TLV from the front of this packet.
virtual Address DeserializeOriginatorAddress(Buffer::Iterator &start) const
Deserialize the originator address.
virtual ~PbbAddressBlockIpv6()
Address AddressFront(void) const
void Serialize(Buffer::Iterator &start) const
Serializes this address block into the specified buffer.
virtual Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const
Deserialize an address block.
bool m_isMultivalue
Is multivalue.
std::list< uint8_t > m_prefixList
Prefixes container.
void Deserialize(Buffer::Iterator &start)
Deserializes a TLV from the specified buffer.
virtual Address DeserializeAddress(uint8_t *buffer) const =0
Deserialize one address.
bool m_hasIndexStop
Stop index present.
void MessagePopBack(void)
Removes a message from the back of this packet.
uint8_t GetType(void) const
bool operator!=(const PbbAddressTlvBlock &other) const
Inequality operator for PbbAddressTlvBlock.
std::list< uint8_t >::iterator PrefixIterator
Prefix iterator.
bool HasOriginatorAddress(void) const
Tests whether or not this message has an originator address.
uint8_t m_typeExt
Extended type.
PbbAddressTlvBlock m_addressTlvList
PbbAddressTlv container.
void AddressBlockPushBack(Ptr< PbbAddressBlock > block)
Appends an address block to the front of this message.
MessageIterator Erase(MessageIterator position)
Removes the message at the specified position.
void TlvPopBack(void)
Removes an address TLV from the back of this message.
uint8_t GetTypeExt(void) const
PrefixIterator PrefixEnd(void)
virtual uint8_t GetAddressLength(void) const
Returns address length.
void TlvClear(void)
Removes all message TLVs from this block.
void AddressBlockPushFront(Ptr< PbbAddressBlock > block)
Prepends an address block to the front of this message.
uint32_t GetSerializedSize(void) const
uint8_t GetIndexStart(void) const
Get the starting point index.
A template-based reference counting class.
int AddressBlockSize(void) const
void PrefixPushBack(uint8_t prefix)
Appends a prefix to the back of this block.
bool HasIndexStart(void) const
Tests whether or not this address TLV has a start index.
virtual ~PbbMessageIpv6()
bool HasValue(void) const
Tests whether or not this TLV has a value.
std::list< Ptr< PbbTlv > >::const_iterator ConstIterator
PbbTlv container const iterator.
void Clear(void)
Removes all TLVs from this block.
Concrete IPv6 specific PbbMessage class.
virtual void SerializeOriginatorAddress(Buffer::Iterator &start) const =0
Serialize the originator address.
PbbAddressLength m_addrSize
the address size
void PopBack(void)
Removes a TLV from the back of this block.
void PushBack(Ptr< PbbAddressTlv > tlv)
Appends an Address TLV to the back of this block.
void PopFront(void)
Removes an AddressTLV from the front of this block.
void Print(std::ostream &os) const
Pretty-prints the contents of this address block.
bool TlvEmpty(void) const
An Address Block and its associated Address TLV Blocks.
int PrefixSize(void) const
uint16_t m_sequenceNumber
Sequence number.
virtual PbbAddressLength GetAddressLength(void) const
Returns address length (IPV4 3 or IPV6 15)
std::list< Ptr< PbbAddressTlv > >::const_iterator ConstIterator
PbbAddressTlv const iterator for PbbAddressTlvBlock.
bool operator!=(const PbbTlvBlock &other) const
Inequality operator for PbbTlvBlock.
std::list< Ptr< PbbMessage > >::const_iterator ConstMessageIterator
PbbMessage Const Iterator for PbbPacket.
virtual uint32_t GetSerializedSize(void) const
std::list< Ptr< PbbAddressBlock > >::const_iterator ConstAddressBlockIterator
PbbAddressBlock const iterator.
virtual void SerializeOriginatorAddress(Buffer::Iterator &start) const
Serialize the originator address.
uint8_t GetPrefixFlags(void) const
Get the prefix flags.
uint8_t m_indexStart
Start index.
std::list< Ptr< PbbAddressTlv > >::iterator Iterator
PbbAddressTlv iterator for PbbAddressTlvBlock.
std::list< Address > m_addressList
Addresses container.
Ptr< PbbAddressTlv > TlvBack(void)
void MessagePushBack(Ptr< PbbMessage > message)
Appends a message to the back of this packet.
bool operator!=(const PbbPacket &other) const
Inequality operator for PbbPacket.
bool HasIndexStop(void) const
Tests whether or not this address TLV has a stop index.
void AddressBlockPopFront(void)
Removes an address block from the front of this message.
Iterator Erase(Iterator position)
Removes the TLV at the specified position.
bool PrefixEmpty(void) const
uint8_t GetHopCount(void) const
void MessageClear(void)
Removes all messages from this packet.
void SetMultivalue(bool isMultivalue)
Sets whether or not this address TLV is "multivalue".
void TlvPushFront(Ptr< PbbTlv > tlv)
Prepends a message TLV to the front of this message.
virtual ~PbbMessageIpv4()
void SetTypeExt(uint8_t type)
Sets the type extension of this TLV.
void Print(std::ostream &os) const
Pretty-prints the contents of this message.
void SetType(uint8_t type)
Sets the type for this message.
void GetHeadTail(uint8_t *head, uint8_t &headlen, uint8_t *tail, uint8_t &taillen) const
Get head and tail.
bool m_hasTypeExt
Extended type present.
Address m_originatorAddress
originator address
Ptr< PbbAddressTlv > Front(void) const
Ptr< PbbTlv > TlvBack(void)
Smart pointer class similar to boost::intrusive_ptr.
virtual Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const
Deserialize an address block.
A block of Address TLVs (PbbAddressTlv).
uint32_t GetSerializedSize(void) const
AddressIterator AddressInsert(AddressIterator position, const Address value)
Inserts an address at the specified position in this block.
PrefixIterator PrefixBegin(void)
virtual void Print(std::ostream &os) const
Pretty-prints the contents of this block.
uint8_t GetIndexStop(void) const
std::list< Ptr< PbbTlv > >::iterator TlvIterator
PbbTlv iterator.
PbbAddressTlvBlock::Iterator TlvIterator
tlvblock iterator
virtual void PrintAddress(std::ostream &os, ConstAddressIterator iter) const
Print one or more addresses.
void Print(std::ostream &os) const
Pretty-prints the contents of this block.
void PushFront(Ptr< PbbTlv > tlv)
Prepends a TLV to the front of this block.
bool TlvEmpty(void) const
virtual Address DeserializeAddress(uint8_t *buffer) const
Deserialize one address.
a polymophic address class
void Serialize(Buffer::Iterator &start) const
Serializes this message into the specified buffer.
uint8_t GetType(void) const
Ptr< PbbTlv > TlvBack(void)
void SetType(uint8_t type)
Sets the type of this TLV.
TlvIterator TlvBegin(void)
void Deserialize(Buffer::Iterator &start)
Deserializes a message from the specified buffer.
virtual ~PbbAddressBlockIpv4()
virtual void PrintOriginatorAddress(std::ostream &os) const =0
Print the originator address.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
virtual void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const
Serialize one or more addresses.
uint32_t GetSerializedSize(void) const
void SetIndexStop(uint8_t index)
Sets the index of the last address in the associated address block that this address TLV applies to.
bool m_hasHopCount
Hop count present.
PbbAddressLength
Used in Messages to determine whether it contains IPv4 or IPv6 addresses.
void TlvPushBack(Ptr< PbbAddressTlv > address)
Appends an address TLV to the back of this message.
Iterator Insert(Iterator position, const Ptr< PbbAddressTlv > tlv)
Inserts an Address TLV at the specified position in this block.
uint8_t m_indexStop
Stop index.
bool TlvEmpty(void) const
void TlvPushFront(Ptr< PbbAddressTlv > address)
Prepends an address TLV to the front of this message.
uint16_t m_seqnum
Sequence number.
std::list< Ptr< PbbTlv > >::iterator TlvIterator
PbbTlv iterator for PbbPacket.
Ptr< PbbAddressTlv > TlvFront(void)
TlvIterator TlvErase(TlvIterator position)
Removes the address TLV at the specified position.
bool operator!=(const PbbTlv &other) const
Inequality operator for PbbTlv.
automatically resized byte buffer
Concrete IPv4 specific PbbAddressBlock.
uint8_t PrefixBack(void) const
static TypeId GetTypeId(void)
Get the type ID.
void AddressPushBack(Address address)
Appends an address to the back of this block.
void MessagePushFront(Ptr< PbbMessage > message)
Prepends a message to the front of this packet.
bool HasIndexStop(void) const
Checks if there is a stop index.
bool AddressEmpty(void) const
void SetHopCount(uint8_t hopcount)
Sets the current number of hops this message has traveled.
virtual void PrintOriginatorAddress(std::ostream &os) const
Print the originator address.
bool HasTypeExt(void) const
Tests whether or not this TLV has a type extension.
bool HasSequenceNumber(void) const
Tests whether or not this message has a sequence number.
virtual ~PbbAddressBlock()
std::list< Ptr< PbbMessage > >::iterator MessageIterator
PbbMessage Iterator for PbbPacket.
virtual void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const
Serialize one or more addresses.
bool HasHopLimit(void) const
Tests whether or not this message has a hop limit.
void SetHopLimit(uint8_t hoplimit)
Sets the maximum number of hops this message should travel.
bool HasHopCount(void) const
Tests whether or not this message has a hop count.
PbbTlvBlock m_tlvList
PbbTlv container.
uint8_t GetIndexStart(void) const
virtual void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const =0
Serialize one or more addresses.
TlvIterator TlvBegin(void)
uint8_t GetIndexStop(void) const
Get the stop point index.
void SetMultivalue(bool isMultivalue)
Set the multivalue parameter.
bool operator==(const PbbTlv &other) const
Equality operator for PbbTlv.
Iterator Insert(Iterator position, const Ptr< PbbTlv > tlv)
Inserts a TLV at the specified position in this block.
TlvIterator Erase(TlvIterator position)
Removes the packet TLV at the specified position.
iterator in a Buffer instance
void PopBack(void)
Removes an Address TLV from the back of this block.
PrefixIterator PrefixErase(PrefixIterator position)
Removes the prefix at the specified position.
Ptr< PbbMessage > MessageFront(void)
void PushBack(Ptr< PbbTlv > tlv)
Appends a TLV to the back of this block.
void TlvPushBack(Ptr< PbbTlv > tlv)
Appends a message TLV to the back of this message.
Concrete IPv4 specific PbbMessage.
std::list< uint8_t >::const_iterator ConstPrefixIterator
Prefix const iterator.
std::list< Ptr< PbbAddressBlock > >::iterator AddressBlockIterator
PbbAddressBlock iterator.
void TlvPopFront(void)
Removes an address TLV from the front of this message.
MessageIterator MessageEnd(void)
bool m_hasOriginatorAddress
Originator address present.
void SetSequenceNumber(uint16_t number)
Sets the sequence number of this packet.
PrefixIterator PrefixInsert(PrefixIterator position, const uint8_t value)
Inserts a prefix at the specified position in this block.
void PrefixPopBack(void)
Removes a prefix from the back of this block.
virtual void PrintAddress(std::ostream &os, ConstAddressIterator iter) const
Print one or more addresses.
Ptr< PbbTlv > Front(void) const
Iterator Erase(Iterator position)
Removes the Address TLV at the specified position.
void TlvClear(void)
Removes all address TLVs from this block.
void AddressClear(void)
Removes all addresses from this block.
AddressBlockIterator AddressBlockBegin()
void Deserialize(Buffer::Iterator &start)
Deserializes a block from the specified buffer.
bool m_hasHopLimit
Hop limit present.
virtual PbbAddressLength GetAddressLength(void) const
Returns address length (IPV4 3 or IPV6 15)
Address GetOriginatorAddress(void) const
uint8_t PrefixFront(void) const
Address AddressBack(void) const
void Print(std::ostream &os) const
Pretty-prints the contents of this block.
AddressBlockIterator AddressBlockErase(AddressBlockIterator position)
Removes the address block at the specified position.
void PrefixClear(void)
Removes all prefixes from this block.
Buffer GetValue(void) const
void SetIndexStart(uint8_t index)
Sets the index of the first address in the associated address block that this address TLV applies to.
uint16_t GetSequenceNumber(void) const
void PrefixPushFront(uint8_t prefix)
Prepends a prefix to the front of this block.
bool m_hasIndexStart
Start index present.
bool IsMultivalue(void) const
Check the multivalue parameter.
void AddressBlockClear(void)
Removes all address blocks from this message.
void TlvPushBack(Ptr< PbbTlv > tlv)
Appends a packet TLV to the back of this packet.
Main PacketBB Packet object.
AddressIterator AddressErase(AddressIterator position)
Removes the address at the specified position.
void TlvClear(void)
Removes all packet TLVs from this packet.
Ptr< PbbAddressBlock > AddressBlockFront(void)
void SetIndexStop(uint8_t index)
Set an index as stop point.
~PbbAddressTlvBlock(void)
Ptr< PbbTlv > Back(void) const
void AddressPopFront(void)
Removes an address from the front of this block.
void SetSequenceNumber(uint16_t seqnum)
Sets the sequence number of this message.
PbbTlvBlock m_tlvList
PbbTlvBlock.
void SetValue(Buffer start)
Sets the value of this message to the specified buffer.
bool operator==(const PbbAddressTlvBlock &other) const
Equality operator for PbbAddressTlvBlock.
MessageIterator Erase(MessageIterator first, MessageIterator last)
Removes all messages from [first, last) (includes first, not includes last).
bool HasZeroTail(const uint8_t *tail, uint8_t taillen) const
Check if the tail is empty.
bool operator==(const PbbPacket &other) const
Equality operator for PbbPacket.
TlvIterator TlvInsert(TlvIterator position, const Ptr< PbbTlv > value)
Inserts an address TLV at the specified position in this block.
virtual void SerializeOriginatorAddress(Buffer::Iterator &start) const
Serialize the originator address.
MessageIterator MessageBegin(void)
uint8_t m_type
the type for this message
virtual void PrintOriginatorAddress(std::ostream &os) const
Print the originator address.
void PrefixPopFront(void)
Removes a prefix from the front of this block.
bool operator==(const PbbMessage &other) const
Equality operator for PbbMessage.
void MessagePopFront(void)
Removes a message from the front of this packet.
Ptr< PbbMessage > MessageBack(void)
void TlvPopFront(void)
Removes a message TLV from the front of this message.
uint32_t GetSerializedSize(void) const
void Deserialize(Buffer::Iterator &start)
Deserializes an address block from the specified buffer.
uint8_t m_hopCount
Hop count.
A block of packet or message TLVs (PbbTlv).
A message within a PbbPacket packet.
TlvIterator TlvErase(TlvIterator position)
Removes the message TLV at the specified position.
bool m_hasSequenceNumber
Sequence number present.
void SetIndexStart(uint8_t index)
Set an index as starting point.
bool IsMultivalue(void) const
Tests whether or not this address TLV is "multivalue".
virtual uint8_t GetAddressLength(void) const
Returns address length.
bool HasSequenceNumber(void) const
Tests whether or not this packet has a sequence number.
bool MessageEmpty(void) const
virtual Address DeserializeOriginatorAddress(Buffer::Iterator &start) const =0
Deserialize the originator address.
std::list< Ptr< PbbTlv > >::const_iterator ConstTlvIterator
PbbTlv const iterator.
void SetOriginatorAddress(Address address)
Sets the address for the node that created this packet.
void PushFront(Ptr< PbbAddressTlv > tlv)
Prepends an Address TLV to the front of this block.
uint32_t GetSerializedSize(void) const
std::list< Ptr< PbbAddressTlv > > m_tlvList
PbbAddressTlv container.
std::list< Ptr< PbbTlv > >::iterator Iterator
PbbTlv container iterator.
uint16_t GetSequenceNumber(void) const
Ptr< PbbAddressTlv > Back(void) const
Ptr< PbbTlv > TlvFront(void)
bool operator==(const PbbTlvBlock &other) const
Equality operator for PbbTlvBlock.
void Print(std::ostream &os) const
Pretty-prints the contents of this TLV.
virtual Address DeserializeOriginatorAddress(Buffer::Iterator &start) const
Deserialize the originator address.
virtual uint8_t GetAddressLength(void) const =0
Returns address length.
void PopFront(void)
Removes a TLV from the front of this block.
bool operator!=(const PbbMessage &other) const
Inequality operator for PbbMessage.
AddressIterator AddressEnd(void)
void AddressPopBack(void)
Removes an address from the back of this block.
void Serialize(Buffer::Iterator &start) const
Serializes this block into the specified buffer.
virtual void Serialize(Buffer::Iterator start) const
Serializes this packet into the specified buffer.
std::list< Address >::iterator AddressIterator
Address iterator.