25 #include "ns3/ipv4-address.h" 26 #include "ns3/ipv6-address.h" 27 #include "ns3/assert.h" 199 size += (*iter)->GetSerializedSize ();
210 start.WriteHtonU16 (0);
220 (*iter)->Serialize (
start);
223 uint16_t size =
start.GetDistanceFrom (tlvsize) - 2;
231 uint16_t size =
start.ReadNtohU16 ();
236 while (
start.GetDistanceFrom (tlvstart) < size)
239 newtlv->Deserialize (
start);
256 std::string prefix =
"";
257 for (
int i = 0; i < level; i++)
259 prefix.append (
"\t");
262 os << prefix <<
"TLV Block {" << std::endl;
263 os << prefix <<
"\tsize = " <<
Size () << std::endl;
264 os << prefix <<
"\tmembers [" << std::endl;
268 (*iter)->Print (os, level+2);
271 os << prefix <<
"\t]" << std::endl;
272 os << prefix <<
"}" << std::endl;
285 ti !=
End () && oi != other.
End ();
299 return !(*
this == other);
440 size += (*iter)->GetSerializedSize ();
451 start.WriteHtonU16 (0);
461 (*iter)->Serialize (
start);
464 uint16_t size =
start.GetDistanceFrom (tlvsize) - 2;
472 uint16_t size =
start.ReadNtohU16 ();
477 while (
start.GetDistanceFrom (tlvstart) < size)
480 newtlv->Deserialize (
start);
497 std::string prefix =
"";
498 for (
int i = 0; i < level; i++)
500 prefix.append (
"\t");
503 os << prefix <<
"TLV Block {" << std::endl;
504 os << prefix <<
"\tsize = " <<
Size () << std::endl;
505 os << prefix <<
"\tmembers [" << std::endl;
509 (*iter)->Print (os, level+2);
512 os << prefix <<
"\t]" << std::endl;
513 os << prefix <<
"}" << std::endl;
526 it !=
End () && ot != other.
End ();
540 return !(*
this == other);
842 .SetGroupName(
"Network")
875 size += (*iter)->GetSerializedSize ();
912 (*iter)->Serialize (
start);
922 uint8_t flags =
start.ReadU8 ();
934 while (!
start.IsEnd ())
939 return start.GetDistanceFrom (begin);
947 return start.GetDistanceFrom (begin);
954 os <<
"PbbPacket {" << std::endl;
969 (*iter)->Print (os, 1);
972 os <<
"}" << std::endl;
1020 return !(*
this == other);
1437 size += (*iter)->GetSerializedSize ();
1494 (*iter)->Serialize (
start);
1507 uint8_t addrlen =
start.ReadU8 ();
1512 addrlen = (addrlen & 0xf);
1520 newmsg = Create<PbbMessageIpv4> ();
1523 newmsg = Create<PbbMessageIpv6> ();
1529 newmsg->Deserialize (
start);
1539 uint8_t flags =
start.ReadU8 ();
1541 uint16_t size =
start.ReadNtohU16 ();
1567 while (
start.GetDistanceFrom (front) < size)
1586 std::string prefix =
"";
1587 for (
int i = 0; i < level; i++)
1589 prefix.append (
"\t");
1592 os << prefix <<
"PbbMessage {" << std::endl;
1594 os << prefix <<
"\tmessage type = " << (int)
GetType () << std::endl;
1599 os << prefix <<
"\toriginator address = ";
1606 os << prefix <<
"\thop limit = " << (int)
GetHopLimit () << std::endl;
1611 os << prefix <<
"\thop count = " << (int)
GetHopCount () << std::endl;
1625 (*iter)->Print (os, level+1);
1627 os << prefix <<
"}" << std::endl;
1721 return !(*
this == other);
1776 newab->Deserialize (
start);
1832 newab->Deserialize (
start);
2205 uint8_t headlen = 0;
2207 uint8_t taillen = 0;
2213 size += 1 + headlen;
2266 uint8_t headlen = 0;
2267 uint8_t taillen = 0;
2274 start.WriteU8 (headlen);
2275 start.Write (head, headlen);
2280 start.WriteU8 (taillen);
2289 start.Write (tail, taillen);
2313 start.WriteU8 (*iter);
2327 uint8_t numaddr =
start.ReadU8 ();
2328 uint8_t flags =
start.ReadU8 ();
2332 uint8_t headlen = 0;
2333 uint8_t taillen = 0;
2339 headlen =
start.ReadU8 ();
2340 start.Read (addrtmp, headlen);
2345 taillen =
start.ReadU8 ();
2353 for (
int i = 0; i < numaddr; i++)
2365 for (
int i = 0; i < numaddr; i++)
2388 std::string prefix =
"";
2389 for (
int i = 0; i < level; i++)
2391 prefix.append (
"\t");
2394 os << prefix <<
"PbbAddressBlock {" << std::endl;
2395 os << prefix <<
"\taddresses = " << std::endl;
2400 os << prefix <<
"\t\t";
2405 os << prefix <<
"\tprefixes = " << std::endl;
2410 os << prefix <<
"\t\t" << (int)(*iter) << std::endl;
2462 return !(*
this == other);
2488 uint8_t *tail, uint8_t &taillen)
const 2491 << &tail << static_cast<uint32_t> (taillen));
2510 for (i = 0; i < headlen; i++)
2512 if (buflast[i] != bufcur[i])
2526 if (buflast[i] != bufcur[i])
2533 else if (headlen == 0)
2544 memcpy (head, bufcur, headlen);
2556 for (i = 0; i < taillen; i++)
2563 return i == taillen;
2870 start.WriteHtonU16 (size);
2874 start.WriteU8 (size);
2894 uint8_t flags =
start.ReadU8 ();
2917 len =
start.ReadNtohU16 ();
2921 len =
start.ReadU8 ();
2944 std::string prefix =
"";
2945 for (
int i = 0; i < level; i++)
2947 prefix.append (
"\t");
2950 os << prefix <<
"PbbTlv {" << std::endl;
2951 os << prefix <<
"\ttype = " << (int)
GetType () << std::endl;
2955 os << prefix <<
"\ttypeext = " << (int)
GetTypeExt () << std::endl;
2960 os << prefix <<
"\tindexStart = " << (int)
GetIndexStart () << std::endl;
2965 os << prefix <<
"\tindexStop = " << (int)
GetIndexStop () << std::endl;
2968 os << prefix <<
"\tisMultivalue = " <<
IsMultivalue () << std::endl;
2972 os << prefix <<
"\thas value; size = " <<
GetValue ().
GetSize () << std::endl;
2975 os << prefix <<
"}" << std::endl;
3026 return !(*
this == other);
virtual void SerializeOriginatorAddress(Buffer::Iterator &start) const
Serialize the originator address.
bool operator==(const PbbAddressTlvBlock &other) const
Equality operator for PbbAddressTlvBlock.
bool m_hasOriginatorAddress
Originator address present.
bool operator!=(const PbbTlvBlock &other) const
Inequality operator for PbbTlvBlock.
static const uint8_t THAS_MULTI_INDEX
PrefixIterator PrefixEnd(void)
bool HasSequenceNumber(void) const
Tests whether or not this message has a sequence number.
AddressBlockIterator AddressBlockEnd()
bool m_hasHopCount
Hop count present.
static Ipv4Address Deserialize(const uint8_t buf[4])
virtual void SerializeOriginatorAddress(Buffer::Iterator &start) const
Serialize the originator address.
void AddAtStart(uint32_t start)
void TlvPushBack(Ptr< PbbTlv > tlv)
Appends a packet TLV to the back of this packet.
void AddressBlockPushBack(Ptr< PbbAddressBlock > block)
Appends an address block to the front of this message.
TlvIterator TlvBegin(void)
virtual uint8_t GetAddressLength(void) const
Returns address length.
std::list< Ptr< PbbTlv > >::iterator Iterator
PbbTlv container iterator.
bool operator!=(const PbbAddressBlock &other) const
Inequality operator for PbbAddressBlock.
bool m_hasIndexStart
Start index present.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t PrefixBack(void) const
void MessagePushFront(Ptr< PbbMessage > message)
Prepends a message to the front of this packet.
Ptr< PbbMessage > MessageBack(void)
bool operator==(const PbbTlvBlock &other) const
Equality operator for PbbTlvBlock.
std::list< Ptr< PbbMessage > >::const_iterator ConstMessageIterator
PbbMessage Const Iterator for PbbPacket.
void PushFront(Ptr< PbbTlv > tlv)
Prepends a TLV to the front of this block.
int AddressSize(void) const
void RemoveAtEnd(uint32_t end)
virtual Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const
Deserialize an address block.
Buffer GetValue(void) const
static const uint8_t AHAS_HEAD
Address AddressFront(void) const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Main PacketBB Packet object.
void Serialize(Buffer::Iterator &start) const
Serializes this block into the specified buffer.
static const uint8_t THAS_TYPE_EXT
void MessagePushBack(Ptr< PbbMessage > message)
Appends a message to the back of this packet.
void PopFront(void)
Removes an AddressTLV from the front of this block.
bool HasHopCount(void) const
Tests whether or not this message has a hop count.
virtual ~PbbMessageIpv6()
virtual ~PbbAddressBlockIpv6()
void Print(std::ostream &os) const
Pretty-prints the contents of this TLV.
void PushFront(Ptr< PbbAddressTlv > tlv)
Prepends an Address TLV to the front of this block.
void SetSequenceNumber(uint16_t number)
Sets the sequence number of this packet.
Ptr< PbbAddressTlv > Front(void) const
static Ipv6Address Deserialize(const uint8_t buf[16])
Deserialize this address.
bool PrefixEmpty(void) const
void SetIndexStop(uint8_t index)
Set an index as stop point.
virtual Address DeserializeOriginatorAddress(Buffer::Iterator &start) const =0
Deserialize the originator address.
automatically resized byte buffer
uint32_t GetSize(Ptr< const Packet > packet, const WifiMacHeader *hdr, bool isAmpdu)
Return the total size of the packet after WifiMacHeader and FCS trailer have been added...
~PbbAddressTlvBlock(void)
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void AddressBlockPopBack(void)
Removes an address block from the back of this message.
void SetIndexStop(uint8_t index)
Sets the index of the last address in the associated address block that this address TLV applies to...
virtual void PrintAddress(std::ostream &os, ConstAddressIterator iter) const
Print one or more addresses.
static const uint8_t VERSION
Ptr< PbbTlv > Back(void) const
Address GetOriginatorAddress(void) const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
virtual uint8_t GetAddressLength(void) const
Returns address length.
void TlvPushFront(Ptr< PbbTlv > tlv)
Prepends a packet TLV to the front of this packet.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
PbbAddressLength
Used in Messages to determine whether it contains IPv4 or IPv6 addresses.
std::list< Address > m_addressList
Addresses container.
Ptr< PbbAddressBlock > AddressBlockBack(void)
void PrefixPopBack(void)
Removes a prefix from the back of this block.
static const uint8_t AHAS_SINGLE_PRE_LEN
bool TlvEmpty(void) const
AddressIterator AddressEnd(void)
void SetMultivalue(bool isMultivalue)
Sets whether or not this address TLV is "multivalue".
A message within a PbbPacket packet.
void MessageClear(void)
Removes all messages from this packet.
void PushBack(Ptr< PbbTlv > tlv)
Appends a TLV to the back of this block.
int AddressBlockSize(void) const
virtual void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const
Serialize one or more addresses.
std::list< Ptr< PbbTlv > >::const_iterator ConstIterator
PbbTlv container const iterator.
int PrefixSize(void) const
uint8_t GetHopCount(void) const
bool AddressBlockEmpty(void) const
static const uint8_t PHAS_SEQ_NUM
uint8_t m_type
Type of this TLV.
uint32_t GetSerializedSize(void) const
std::list< Ptr< PbbAddressBlock > >::const_iterator ConstAddressBlockIterator
PbbAddressBlock const iterator.
uint8_t GetIndexStart(void) const
Get the starting point index.
static const uint8_t MHAS_HOP_LIMIT
uint8_t const * PeekData(void) const
void SetMultivalue(bool isMultivalue)
Set the multivalue parameter.
void MessagePopFront(void)
Removes a message from the front of this packet.
void SetSequenceNumber(uint16_t seqnum)
Sets the sequence number of this message.
uint32_t GetSerializedSize(void) const
static const uint8_t AHAS_FULL_TAIL
void TlvPopBack(void)
Removes a message TLV from the back of this message.
uint8_t PrefixFront(void) const
std::list< Ptr< PbbMessage > >::iterator MessageIterator
PbbMessage Iterator for PbbPacket.
Ptr< PbbAddressTlv > TlvFront(void)
uint8_t m_type
the type for this message
std::list< uint8_t > m_prefixList
Prefixes container.
bool HasIndexStart(void) const
Checks if there is a starting index.
std::list< Ptr< PbbAddressBlock > >::iterator AddressBlockIterator
PbbAddressBlock iterator.
Ptr< PbbTlv > TlvBack(void)
iterator in a Buffer instance
a polymophic address class
virtual void PrintOriginatorAddress(std::ostream &os) const
Print the originator address.
bool m_hasSequenceNumber
Sequence number present.
MessageIterator MessageEnd(void)
bool HasOriginatorAddress(void) const
Tests whether or not this message has an originator address.
uint16_t m_sequenceNumber
Sequence number.
AddressBlockIterator AddressBlockBegin()
static const uint8_t TIS_MULTIVALUE
virtual Address DeserializeAddress(uint8_t *buffer) const =0
Deserialize one address.
uint32_t GetDistanceFrom(Iterator const &o) const
void SetType(uint8_t type)
Sets the type of this TLV.
void PopBack(void)
Removes an Address TLV from the back of this block.
void Serialize(Buffer::Iterator &start) const
Serializes this address block into the specified buffer.
static const uint8_t AHAS_ZERO_TAIL
uint16_t GetSequenceNumber(void) const
bool operator==(const PbbPacket &other) const
Equality operator for PbbPacket.
bool operator!=(const PbbAddressTlvBlock &other) const
Inequality operator for PbbAddressTlvBlock.
void Print(std::ostream &os) const
Pretty-prints the contents of this message.
void AddressBlockClear(void)
Removes all address blocks from this message.
uint8_t GetIndexStop(void) const
void TlvPushFront(Ptr< PbbAddressTlv > address)
Prepends an address TLV to the front of this message.
virtual void Serialize(Buffer::Iterator start) const
Serializes this packet into the specified buffer.
int MessageSize(void) const
std::list< Address >::const_iterator ConstAddressIterator
Address const iterator.
Iterator Erase(Iterator position)
Removes the Address TLV at the specified position.
Address AddressBack(void) const
bool MessageEmpty(void) const
void AddressPopFront(void)
Removes an address from the front of this block.
TlvIterator TlvBegin(void)
std::list< Address >::iterator AddressIterator
Address iterator.
TlvIterator Erase(TlvIterator position)
Removes the packet TLV at the specified position.
void SetIndexStart(uint8_t index)
Sets the index of the first address in the associated address block that this address TLV applies to...
static const uint8_t THAS_EXT_LEN
Ptr< PbbAddressTlv > TlvBack(void)
static const uint8_t MHAS_ORIG
bool HasIndexStop(void) const
Tests whether or not this address TLV has a stop index.
bool m_hasHopLimit
Hop limit present.
bool m_isMultivalue
Is multivalue.
void PushBack(Ptr< PbbAddressTlv > tlv)
Appends an Address TLV to the back of this block.
void SetType(uint8_t type)
Sets the type for this message.
std::list< Ptr< PbbTlv > >::iterator TlvIterator
PbbTlv iterator for PbbPacket.
void TlvPopBack(void)
Removes an address TLV from the back of this message.
void Print(std::ostream &os) const
Pretty-prints the contents of this block.
uint8_t GetIndexStop(void) const
Get the stop point index.
uint8_t m_hopCount
Hop count.
void GetHeadTail(uint8_t *head, uint8_t &headlen, uint8_t *tail, uint8_t &taillen) const
Get head and tail.
void AddressPushBack(Address address)
Appends an address to the back of this block.
void WriteHtonU16(uint16_t data)
void TlvClear(void)
Removes all message TLVs from this block.
Ptr< PbbAddressBlock > AddressBlockFront(void)
PbbAddressLength m_addrSize
the address size
std::list< uint8_t >::const_iterator ConstPrefixIterator
Prefix const iterator.
bool m_hasValue
Has value.
bool TlvEmpty(void) const
virtual void PrintAddress(std::ostream &os, ConstAddressIterator iter) const =0
Print one or more addresses.
uint8_t m_typeExt
Extended type.
void Deserialize(Buffer::Iterator &start)
Deserializes a block from the specified buffer.
std::list< Ptr< PbbTlv > >::iterator TlvIterator
PbbTlv iterator.
void Print(std::ostream &os) const
Pretty-prints the contents of this block.
void Deserialize(Buffer::Iterator &start)
Deserializes a block from the specified buffer.
virtual Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const =0
Deserialize an address block.
static const uint8_t THAS_SINGLE_INDEX
uint8_t GetTypeExt(void) const
void Print(std::ostream &os) const
Pretty-prints the contents of this address block.
void Deserialize(Buffer::Iterator &start)
Deserializes a message from the specified buffer.
void TlvPopFront(void)
Removes a message TLV from the front of this message.
bool operator==(const PbbAddressBlock &other) const
Equality operator for PbbAddressBlock.
virtual void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const =0
Serialize one or more addresses.
bool HasValue(void) const
Tests whether or not this TLV has a value.
virtual ~PbbAddressBlock()
virtual Address DeserializeOriginatorAddress(Buffer::Iterator &start) const
Deserialize the originator address.
void Serialize(Buffer::Iterator &start) const
Serializes this message into the specified buffer.
void Deserialize(Buffer::Iterator &start)
Deserializes a TLV from the specified buffer.
void TlvPopBack(void)
Removes a packet TLV from the back of this block.
void SetHopLimit(uint8_t hoplimit)
Sets the maximum number of hops this message should travel.
void PrefixPushFront(uint8_t prefix)
Prepends a prefix to the front of this block.
bool operator!=(const PbbMessage &other) const
Inequality operator for PbbMessage.
std::list< Ptr< PbbAddressTlv > >::iterator Iterator
PbbAddressTlv iterator for PbbAddressTlvBlock.
bool IsMultivalue(void) const
Check the multivalue parameter.
PbbAddressTlvBlock::Iterator TlvIterator
tlvblock iterator
AddressBlockIterator AddressBlockErase(AddressBlockIterator position)
Removes the address block at the specified position.
bool HasHopLimit(void) const
Tests whether or not this message has a hop limit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint8_t MHAS_SEQ_NUM
PbbAddressTlvBlock m_addressTlvList
PbbAddressTlv container.
virtual ~PbbMessageIpv4()
void TlvClear(void)
Removes all address TLVs from this block.
bool HasSequenceNumber(void) const
Tests whether or not this packet has a sequence number.
bool operator!=(const PbbPacket &other) const
Inequality operator for PbbPacket.
void PrefixPushBack(uint8_t prefix)
Appends a prefix to the back of this block.
bool m_hasIndexStop
Stop index present.
virtual Address DeserializeAddress(uint8_t *buffer) const
Deserialize one address.
std::list< Ptr< PbbAddressTlv > > m_tlvList
PbbAddressTlv container.
void AddressBlockPopFront(void)
Removes an address block from the front of this message.
Address m_originatorAddress
originator address
A block of packet or message TLVs (PbbTlv).
uint8_t m_indexStart
Start index.
uint8_t GetHopLimit(void) const
virtual void Print(std::ostream &os) const
Pretty-prints the contents of this block.
std::list< Ptr< PbbMessage > > m_messageList
PbbTlvBlock container.
virtual PbbAddressLength GetAddressLength(void) const
Returns address length (IPV4 3 or IPV6 15)
bool AddressEmpty(void) const
uint32_t GetSerializedSize(void) const
void SetIndexStart(uint8_t index)
Set an index as starting point.
void TlvPushBack(Ptr< PbbAddressTlv > address)
Appends an address TLV to the back of this message.
std::list< Ptr< PbbTlv > > m_tlvList
PbbTlv container.
PbbTlvBlock m_tlvList
PbbTlv container.
std::list< Ptr< PbbAddressBlock > > m_addressBlockList
PbbAddressBlock container.
bool m_hasTypeExt
Extended type present.
A block of Address TLVs (PbbAddressTlv).
bool HasIndexStart(void) const
Tests whether or not this address TLV has a start index.
void PopBack(void)
Removes a TLV from the back of this block.
uint16_t GetSequenceNumber(void) const
void TlvPopFront(void)
Removes a packet TLV from the front of this packet.
virtual void PrintAddress(std::ostream &os, ConstAddressIterator iter) const
Print one or more addresses.
uint16_t m_seqnum
Sequence number.
PbbAddressTlvBlock::ConstIterator ConstTlvIterator
tlvblock const iterator
virtual ~PbbAddressBlockIpv4()
virtual void PrintOriginatorAddress(std::ostream &os) const =0
Print the originator address.
void WriteU8(uint8_t data)
PrefixIterator PrefixInsert(PrefixIterator position, const uint8_t value)
Inserts a prefix at the specified position in this block.
Ptr< PbbTlv > TlvBack(void)
TlvIterator TlvErase(TlvIterator position)
Removes the message TLV at the specified position.
void AddressBlockPushFront(Ptr< PbbAddressBlock > block)
Prepends an address block to the front of this message.
virtual Address DeserializeAddress(uint8_t *buffer) const
Deserialize one address.
static const uint8_t THAS_VALUE
uint8_t GetIndexStart(void) const
void MessagePopBack(void)
Removes a message from the back of this packet.
Ptr< PbbTlv > TlvFront(void)
Iterator Insert(Iterator position, const Ptr< PbbAddressTlv > tlv)
Inserts an Address TLV at the specified position in this block.
virtual PbbAddressLength GetAddressLength(void) const =0
Returns address length (IPV4 3 or IPV6 15)
void SetTypeExt(uint8_t type)
Sets the type extension of this TLV.
virtual Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const
Deserialize an address block.
bool TlvEmpty(void) const
virtual uint32_t GetSerializedSize(void) const
uint32_t GetSerializedSize(void) const
AddressIterator AddressBegin(void)
void AddressClear(void)
Removes all addresses from this block.
virtual void SerializeOriginatorAddress(Buffer::Iterator &start) const =0
Serialize the originator address.
void SetHopCount(uint8_t hopcount)
Sets the current number of hops this message has traveled.
bool HasZeroTail(const uint8_t *tail, uint8_t taillen) const
Check if the tail is empty.
virtual uint8_t GetAddressLength(void) const =0
Returns address length.
Ptr< PbbTlv > TlvFront(void)
uint8_t GetPrefixFlags(void) const
Get the prefix flags.
uint32_t GetSize(void) const
Ptr< PbbAddressTlv > Back(void) const
void PrefixPopFront(void)
Removes a prefix from the front of this block.
static const uint8_t MHAS_HOP_COUNT
virtual Address DeserializeOriginatorAddress(Buffer::Iterator &start) const
Deserialize the originator address.
void Write(uint8_t const *buffer, uint32_t size)
PrefixIterator PrefixErase(PrefixIterator position)
Removes the prefix at the specified position.
void SetOriginatorAddress(Address address)
Sets the address for the node that created this packet.
std::list< Ptr< PbbAddressTlv > >::const_iterator ConstIterator
PbbAddressTlv const iterator for PbbAddressTlvBlock.
uint8_t m_hopLimit
Hop limit.
void Deserialize(Buffer::Iterator &start)
Deserializes an address block from the specified buffer.
Iterator Insert(Iterator position, const Ptr< PbbTlv > tlv)
Inserts a TLV at the specified position in this block.
void Serialize(Buffer::Iterator &start) const
Serializes this block into the specified buffer.
void TlvPopFront(void)
Removes an address TLV from the front of this message.
uint8_t GetType(void) const
bool operator!=(const PbbTlv &other) const
Inequality operator for PbbTlv.
static const uint8_t AHAS_MULTI_PRE_LEN
void Serialize(Buffer::Iterator &start) const
Serializes this TLV into the specified buffer.
bool HasTypeExt(void) const
Tests whether or not this TLV has a type extension.
virtual void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const
Serialize one or more addresses.
static Ipv4Address ConvertFrom(const Address &address)
uint32_t GetSerializedSize(void) const
uint8_t GetType(void) const
void Print(std::ostream &os) const
Print this address to the given output stream.
void Clear(void)
Removes all Address TLVs from this block.
void SetValue(Buffer start)
Sets the value of this message to the specified buffer.
bool HasIndexStop(void) const
Checks if there is a stop index.
PrefixIterator PrefixBegin(void)
bool m_hasseqnum
Sequence number present.
Ptr< PbbMessage > MessageFront(void)
void TlvPushFront(Ptr< PbbTlv > tlv)
Prepends a message TLV to the front of this message.
MessageIterator MessageBegin(void)
void Clear(void)
Removes all TLVs from this block.
std::list< uint8_t >::iterator PrefixIterator
Prefix iterator.
bool operator==(const PbbMessage &other) const
Equality operator for PbbMessage.
AddressIterator AddressErase(AddressIterator position)
Removes the address at the specified position.
void AddressPopBack(void)
Removes an address from the back of this block.
bool IsMultivalue(void) const
Tests whether or not this address TLV is "multivalue".
PbbTlvBlock m_tlvList
PbbTlvBlock.
uint8_t m_indexStop
Stop index.
a unique identifier for an interface.
Ptr< PbbTlv > Front(void) const
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Buffer::Iterator Begin(void) const
std::list< Ptr< PbbTlv > >::const_iterator ConstTlvIterator
PbbTlv const iterator for PbbPacket.
static Ptr< PbbMessage > DeserializeMessage(Buffer::Iterator &start)
Deserializes a message, returning the correct object depending on whether it is an IPv4 message or an...
An Address Block and its associated Address TLV Blocks.
void Print(std::ostream &os) const
Print this address to the given output stream.
void Serialize(uint8_t buf[4]) const
Serialize this address to a 4-byte buffer.
void TlvPushBack(Ptr< PbbTlv > tlv)
Appends a message TLV to the back of this message.
std::list< Ptr< PbbTlv > >::const_iterator ConstTlvIterator
PbbTlv const iterator.
static const uint8_t PHAS_TLV
void Serialize(uint8_t buf[16]) const
Serialize this address to a 16-byte buffer.
virtual void PrintOriginatorAddress(std::ostream &os) const
Print the originator address.
static TypeId GetTypeId(void)
Get the type ID.
void AddressPushFront(Address address)
Prepends an address to the front of this block.
void PrefixClear(void)
Removes all prefixes from this block.
virtual PbbAddressLength GetAddressLength(void) const
Returns address length (IPV4 3 or IPV6 15)
bool operator==(const PbbTlv &other) const
Equality operator for PbbTlv.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserializes a packet from the specified buffer.
static Ipv6Address ConvertFrom(const Address &address)
Convert the Address object into an Ipv6Address ones.
void TlvClear(void)
Removes all packet TLVs from this packet.
TlvIterator TlvErase(TlvIterator position)
Removes the address TLV at the specified position.
Iterator Erase(Iterator position)
Removes the TLV at the specified position.
void PopFront(void)
Removes a TLV from the front of this block.
uint8_t GetVersion(void) const