18#include "ns3/assert.h"
174 for (
auto iter =
Begin(); iter !=
End(); iter++)
187 for (
auto iter =
Begin(); iter !=
End(); iter++)
189 size += (*iter)->GetSerializedSize();
200 start.WriteHtonU16(0);
208 for (
auto iter =
Begin(); iter !=
End(); iter++)
210 (*iter)->Serialize(start);
213 uint16_t size = start.GetDistanceFrom(tlvsize) - 2;
221 uint16_t size = start.ReadNtohU16();
226 while (start.GetDistanceFrom(tlvstart) < size)
229 newtlv->Deserialize(start);
246 std::string prefix =
"";
247 for (
int i = 0; i < level; i++)
252 os << prefix <<
"TLV Block {" << std::endl;
253 os << prefix <<
"\tsize = " <<
Size() << std::endl;
254 os << prefix <<
"\tmembers [" << std::endl;
256 for (
auto iter =
Begin(); iter !=
End(); iter++)
258 (*iter)->Print(os, level + 2);
261 os << prefix <<
"\t]" << std::endl;
262 os << prefix <<
"}" << std::endl;
275 for (ti =
Begin(), oi = other.
Begin(); ti !=
End() && oi != other.
End(); ti++, oi++)
288 return !(*
this == other);
413 for (
auto iter =
Begin(); iter !=
End(); iter++)
426 for (
auto iter =
Begin(); iter !=
End(); iter++)
428 size += (*iter)->GetSerializedSize();
439 start.WriteHtonU16(0);
447 for (
auto iter =
Begin(); iter !=
End(); iter++)
449 (*iter)->Serialize(start);
452 uint16_t size = start.GetDistanceFrom(tlvsize) - 2;
460 uint16_t size = start.ReadNtohU16();
465 while (start.GetDistanceFrom(tlvstart) < size)
468 newtlv->Deserialize(start);
485 std::string prefix =
"";
486 for (
int i = 0; i < level; i++)
491 os << prefix <<
"TLV Block {" << std::endl;
492 os << prefix <<
"\tsize = " <<
Size() << std::endl;
493 os << prefix <<
"\tmembers [" << std::endl;
495 for (
auto iter =
Begin(); iter !=
End(); iter++)
497 (*iter)->Print(os, level + 2);
500 os << prefix <<
"\t]" << std::endl;
501 os << prefix <<
"}" << std::endl;
514 for (it =
Begin(), ot = other.
Begin(); it !=
End() && ot != other.
End(); it++, ot++)
527 return !(*
this == other);
834 .SetGroupName(
"Network")
864 size += (*iter)->GetSerializedSize();
899 (*iter)->Serialize(start);
909 uint8_t flags = start.
ReadU8();
921 while (!start.IsEnd())
926 return start.GetDistanceFrom(begin);
934 return start.GetDistanceFrom(begin);
941 os <<
"PbbPacket {" << std::endl;
954 (*iter)->Print(os, 1);
957 os <<
"}" << std::endl;
1008 return !(*
this == other);
1421 size += (*iter)->GetSerializedSize();
1476 (*iter)->Serialize(start);
1489 uint8_t addrlen = start.ReadU8();
1494 addrlen = (addrlen & 0xf);
1510 newmsg->Deserialize(start);
1520 uint8_t flags = start.ReadU8();
1522 uint16_t size = start.ReadNtohU16();
1548 while (start.GetDistanceFrom(front) < size)
1567 std::string prefix =
"";
1568 for (
int i = 0; i < level; i++)
1570 prefix.append(
"\t");
1573 os << prefix <<
"PbbMessage {" << std::endl;
1575 os << prefix <<
"\tmessage type = " << (int)
GetType() << std::endl;
1580 os << prefix <<
"\toriginator address = ";
1587 os << prefix <<
"\thop limit = " << (int)
GetHopLimit() << std::endl;
1592 os << prefix <<
"\thop count = " << (int)
GetHopCount() << std::endl;
1604 (*iter)->Print(os, level + 1);
1606 os << prefix <<
"}" << std::endl;
1701 return !(*
this == other);
1751 newab->Deserialize(start);
1802 newab->Deserialize(start);
2176 uint8_t headlen = 0;
2178 uint8_t taillen = 0;
2184 size += 1 + headlen;
2237 uint8_t headlen = 0;
2238 uint8_t taillen = 0;
2245 start.WriteU8(headlen);
2246 start.Write(head, headlen);
2251 start.WriteU8(taillen);
2260 start.Write(tail, taillen);
2280 start.WriteU8(*iter);
2294 uint8_t numaddr = start.ReadU8();
2295 uint8_t flags = start.ReadU8();
2299 uint8_t headlen = 0;
2300 uint8_t taillen = 0;
2306 headlen = start.ReadU8();
2307 start.Read(addrtmp, headlen);
2312 taillen = start.ReadU8();
2320 for (
int i = 0; i < numaddr; i++)
2332 for (
int i = 0; i < numaddr; i++)
2355 std::string prefix =
"";
2356 for (
int i = 0; i < level; i++)
2358 prefix.append(
"\t");
2361 os << prefix <<
"PbbAddressBlock {" << std::endl;
2362 os << prefix <<
"\taddresses = " << std::endl;
2365 os << prefix <<
"\t\t";
2370 os << prefix <<
"\tprefixes = " << std::endl;
2373 os << prefix <<
"\t\t" << (int)(*iter) << std::endl;
2422 return !(*
this == other);
2447 <<
static_cast<uint32_t>(taillen));
2464 for (i = 0; i < headlen; i++)
2466 if (buflast[i] != bufcur[i])
2479 if (buflast[i] != bufcur[i])
2486 else if (headlen == 0)
2497 memcpy(head, bufcur, headlen);
2509 for (i = 0; i < taillen; i++)
2516 return i == taillen;
2823 start.WriteHtonU16(size);
2827 start.WriteU8(size);
2847 uint8_t flags = start.ReadU8();
2870 len = start.ReadNtohU16();
2874 len = start.ReadU8();
2897 std::string prefix =
"";
2898 for (
int i = 0; i < level; i++)
2900 prefix.append(
"\t");
2903 os << prefix <<
"PbbTlv {" << std::endl;
2904 os << prefix <<
"\ttype = " << (int)
GetType() << std::endl;
2908 os << prefix <<
"\ttypeext = " << (int)
GetTypeExt() << std::endl;
2913 os << prefix <<
"\tindexStart = " << (int)
GetIndexStart() << std::endl;
2918 os << prefix <<
"\tindexStop = " << (int)
GetIndexStop() << std::endl;
2921 os << prefix <<
"\tisMultivalue = " <<
IsMultivalue() << std::endl;
2925 os << prefix <<
"\thas value; size = " <<
GetValue().
GetSize() << std::endl;
2928 os << prefix <<
"}" << std::endl;
2979 return !(*
this == other);
a polymophic address class
iterator in a Buffer instance
void WriteU8(uint8_t data)
void Write(const uint8_t *buffer, uint32_t size)
void WriteHtonU16(uint16_t data)
uint32_t GetDistanceFrom(const Iterator &o) const
void Next()
go forward by one byte
automatically resized byte buffer
void RemoveAtEnd(uint32_t end)
void AddAtStart(uint32_t start)
Buffer::Iterator Begin() const
const uint8_t * PeekData() const
void Print(std::ostream &os) const
Print this address to the given output stream.
static Ipv4Address ConvertFrom(const Address &address)
void Serialize(uint8_t buf[4]) const
Serialize this address to a 4-byte buffer.
static Ipv4Address Deserialize(const uint8_t buf[4])
void Print(std::ostream &os) const
Print this address to the given output stream.
static Ipv6Address Deserialize(const uint8_t buf[16])
Deserialize this address.
void Serialize(uint8_t buf[16]) const
Serialize this address to a 16-byte buffer.
static Ipv6Address ConvertFrom(const Address &address)
Convert the Address object into an Ipv6Address ones.
An Address Block and its associated Address TLV Blocks.
void PrefixPopFront()
Removes a prefix from the front of this block.
Address AddressFront() const
std::list< uint8_t >::iterator PrefixIterator
Prefix iterator.
void AddressPopFront()
Removes an address from the front of this block.
uint8_t GetPrefixFlags() const
Get the prefix flags.
void PrefixPushFront(uint8_t prefix)
Prepends a prefix to the front of this block.
void Print(std::ostream &os) const
Pretty-prints the contents of this address block.
PrefixIterator PrefixEnd()
std::list< Address > m_addressList
Addresses container.
void PrefixClear()
Removes all prefixes from this block.
uint32_t GetSerializedSize() const
bool operator!=(const PbbAddressBlock &other) const
Inequality operator for PbbAddressBlock.
void Serialize(Buffer::Iterator &start) const
Serializes this address block into the specified buffer.
PbbAddressTlvBlock::Iterator TlvIterator
tlvblock iterator
Ptr< PbbAddressTlv > TlvBack()
virtual void PrintAddress(std::ostream &os, ConstAddressIterator iter) const =0
Print one or more addresses.
Ptr< PbbAddressTlv > TlvFront()
void GetHeadTail(uint8_t *head, uint8_t &headlen, uint8_t *tail, uint8_t &taillen) const
Get head and tail.
void TlvPopBack()
Removes an address TLV from the back of this message.
virtual void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const =0
Serialize one or more addresses.
std::list< Address >::const_iterator ConstAddressIterator
Address const iterator.
void TlvPushBack(Ptr< PbbAddressTlv > address)
Appends an address TLV to the back of this message.
Address AddressBack() const
void AddressClear()
Removes all addresses from this block.
void AddressPushBack(Address address)
Appends an address to the back of this block.
AddressIterator AddressErase(AddressIterator position)
Removes the address at the specified position.
bool HasZeroTail(const uint8_t *tail, uint8_t taillen) const
Check if the tail is empty.
std::list< uint8_t > m_prefixList
Prefixes container.
void PrefixPushBack(uint8_t prefix)
Appends a prefix to the back of this block.
void PrefixPopBack()
Removes a prefix from the back of this block.
uint8_t PrefixFront() const
PrefixIterator PrefixBegin()
void AddressPopBack()
Removes an address from the back of this block.
PrefixIterator PrefixErase(PrefixIterator position)
Removes the prefix at the specified position.
virtual Address DeserializeAddress(uint8_t *buffer) const =0
Deserialize one address.
uint8_t PrefixBack() const
void TlvClear()
Removes all address TLVs from this block.
PbbAddressTlvBlock::ConstIterator ConstTlvIterator
tlvblock const iterator
PrefixIterator PrefixInsert(PrefixIterator position, const uint8_t value)
Inserts a prefix at the specified position in this block.
void TlvPushFront(Ptr< PbbAddressTlv > address)
Prepends an address TLV to the front of this message.
void TlvPopFront()
Removes an address TLV from the front of this message.
virtual ~PbbAddressBlock()
virtual uint8_t GetAddressLength() const =0
Returns address length.
void Deserialize(Buffer::Iterator &start)
Deserializes an address block from the specified buffer.
AddressIterator AddressBegin()
TlvIterator TlvErase(TlvIterator position)
Removes the address TLV at the specified position.
std::list< uint8_t >::const_iterator ConstPrefixIterator
Prefix const iterator.
void AddressPushFront(Address address)
Prepends an address to the front of this block.
std::list< Address >::iterator AddressIterator
Address iterator.
AddressIterator AddressEnd()
bool AddressEmpty() const
bool operator==(const PbbAddressBlock &other) const
Equality operator for PbbAddressBlock.
PbbAddressTlvBlock m_addressTlvList
PbbAddressTlv container.
uint8_t GetAddressLength() const override
Returns address length.
void PrintAddress(std::ostream &os, ConstAddressIterator iter) const override
Print one or more addresses.
void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const override
Serialize one or more addresses.
~PbbAddressBlockIpv4() override
Address DeserializeAddress(uint8_t *buffer) const override
Deserialize one address.
~PbbAddressBlockIpv6() override
void SerializeAddress(uint8_t *buffer, ConstAddressIterator iter) const override
Serialize one or more addresses.
uint8_t GetAddressLength() const override
Returns address length.
void PrintAddress(std::ostream &os, ConstAddressIterator iter) const override
Print one or more addresses.
Address DeserializeAddress(uint8_t *buffer) const override
Deserialize one address.
A block of Address TLVs (PbbAddressTlv).
void Serialize(Buffer::Iterator &start) const
Serializes this block into the specified buffer.
void PushBack(Ptr< PbbAddressTlv > tlv)
Appends an Address TLV to the back of this block.
void Print(std::ostream &os) const
Pretty-prints the contents of this block.
Iterator Erase(Iterator position)
Removes the Address TLV at the specified position.
std::list< Ptr< PbbAddressTlv > > m_tlvList
PbbAddressTlv container.
void PopFront()
Removes an AddressTLV from the front of this block.
bool operator!=(const PbbAddressTlvBlock &other) const
Inequality operator for PbbAddressTlvBlock.
std::list< Ptr< PbbAddressTlv > >::const_iterator ConstIterator
PbbAddressTlv const iterator for PbbAddressTlvBlock.
void Clear()
Removes all Address TLVs from this block.
std::list< Ptr< PbbAddressTlv > >::iterator Iterator
PbbAddressTlv iterator for PbbAddressTlvBlock.
void Deserialize(Buffer::Iterator &start)
Deserializes a block from the specified buffer.
uint32_t GetSerializedSize() const
Ptr< PbbAddressTlv > Front() const
Ptr< PbbAddressTlv > Back() const
Iterator Insert(Iterator position, const Ptr< PbbAddressTlv > tlv)
Inserts an Address TLV at the specified position in this block.
void PushFront(Ptr< PbbAddressTlv > tlv)
Prepends an Address TLV to the front of this block.
void PopBack()
Removes an Address TLV from the back of this block.
bool operator==(const PbbAddressTlvBlock &other) const
Equality operator for PbbAddressTlvBlock.
bool HasIndexStart() const
Tests whether or not this address TLV has a start index.
bool IsMultivalue() const
Tests whether or not this address TLV is "multivalue".
void SetMultivalue(bool isMultivalue)
Sets whether or not this address TLV is "multivalue".
void SetIndexStart(uint8_t index)
Sets the index of the first address in the associated address block that this address TLV applies to.
bool HasIndexStop() const
Tests whether or not this address TLV has a stop index.
uint8_t GetIndexStop() const
uint8_t GetIndexStart() const
void SetIndexStop(uint8_t index)
Sets the index of the last address in the associated address block that this address TLV applies to.
A message within a PbbPacket packet.
void AddressBlockPushFront(Ptr< PbbAddressBlock > block)
Prepends an address block to the front of this message.
uint16_t m_sequenceNumber
Sequence number.
virtual PbbAddressLength GetAddressLength() const =0
Returns address length (IPV4 3 or IPV6 15)
std::list< Ptr< PbbAddressBlock > >::iterator AddressBlockIterator
PbbAddressBlock iterator.
bool HasOriginatorAddress() const
Tests whether or not this message has an originator address.
bool m_hasHopLimit
Hop limit present.
void TlvPopFront()
Removes a message TLV from the front of this message.
void TlvPushFront(Ptr< PbbTlv > tlv)
Prepends a message TLV to the front of this message.
Address m_originatorAddress
originator address
bool HasHopLimit() const
Tests whether or not this message has a hop limit.
bool operator!=(const PbbMessage &other) const
Inequality operator for PbbMessage.
int AddressBlockSize() const
AddressBlockIterator AddressBlockBegin()
void Deserialize(Buffer::Iterator &start)
Deserializes a message from the specified buffer.
std::list< Ptr< PbbTlv > >::const_iterator ConstTlvIterator
PbbTlv const iterator.
AddressBlockIterator AddressBlockEnd()
void SetType(uint8_t type)
Sets the type for this message.
std::list< Ptr< PbbAddressBlock > >::const_iterator ConstAddressBlockIterator
PbbAddressBlock const iterator.
void Serialize(Buffer::Iterator &start) const
Serializes this message into the specified buffer.
TlvIterator TlvErase(TlvIterator position)
Removes the message TLV at the specified position.
std::list< Ptr< PbbAddressBlock > > m_addressBlockList
PbbAddressBlock container.
void SetOriginatorAddress(Address address)
Sets the address for the node that created this packet.
void SetHopLimit(uint8_t hoplimit)
Sets the maximum number of hops this message should travel.
static Ptr< PbbMessage > DeserializeMessage(Buffer::Iterator &start)
Deserializes a message, returning the correct object depending on whether it is an IPv4 message or an...
Address GetOriginatorAddress() const
void TlvClear()
Removes all message TLVs from this block.
uint8_t m_hopLimit
Hop limit.
void AddressBlockPushBack(Ptr< PbbAddressBlock > block)
Appends an address block to the front of this message.
void TlvPopBack()
Removes a message TLV from the back of this message.
uint16_t GetSequenceNumber() const
bool m_hasOriginatorAddress
Originator address present.
virtual void PrintOriginatorAddress(std::ostream &os) const =0
Print the originator address.
bool HasSequenceNumber() const
Tests whether or not this message has a sequence number.
uint8_t GetHopLimit() const
std::list< Ptr< PbbTlv > >::iterator TlvIterator
PbbTlv iterator.
virtual Address DeserializeOriginatorAddress(Buffer::Iterator &start) const =0
Deserialize the originator address.
void SetHopCount(uint8_t hopcount)
Sets the current number of hops this message has traveled.
void Print(std::ostream &os) const
Pretty-prints the contents of this message.
void SetSequenceNumber(uint16_t seqnum)
Sets the sequence number of this message.
bool m_hasHopCount
Hop count present.
void AddressBlockClear()
Removes all address blocks from this message.
virtual Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const =0
Deserialize an address block.
PbbTlvBlock m_tlvList
PbbTlvBlock.
void TlvPushBack(Ptr< PbbTlv > tlv)
Appends a message TLV to the back of this message.
virtual void SerializeOriginatorAddress(Buffer::Iterator &start) const =0
Serialize the originator address.
AddressBlockIterator AddressBlockErase(AddressBlockIterator position)
Removes the address block at the specified position.
Ptr< PbbAddressBlock > AddressBlockBack()
uint8_t GetHopCount() const
void AddressBlockPopFront()
Removes an address block from the front of this message.
bool operator==(const PbbMessage &other) const
Equality operator for PbbMessage.
PbbAddressLength m_addrSize
the address size
uint8_t m_hopCount
Hop count.
bool m_hasSequenceNumber
Sequence number present.
uint32_t GetSerializedSize() const
Ptr< PbbAddressBlock > AddressBlockFront()
bool AddressBlockEmpty() const
bool HasHopCount() const
Tests whether or not this message has a hop count.
uint8_t m_type
the type for this message
void AddressBlockPopBack()
Removes an address block from the back of this message.
void PrintOriginatorAddress(std::ostream &os) const override
Print the originator address.
void SerializeOriginatorAddress(Buffer::Iterator &start) const override
Serialize the originator address.
PbbAddressLength GetAddressLength() const override
Returns address length (IPV4 3 or IPV6 15)
Address DeserializeOriginatorAddress(Buffer::Iterator &start) const override
Deserialize the originator address.
Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const override
Deserialize an address block.
Ptr< PbbAddressBlock > AddressBlockDeserialize(Buffer::Iterator &start) const override
Deserialize an address block.
void PrintOriginatorAddress(std::ostream &os) const override
Print the originator address.
void SerializeOriginatorAddress(Buffer::Iterator &start) const override
Serialize the originator address.
PbbAddressLength GetAddressLength() const override
Returns address length (IPV4 3 or IPV6 15)
Address DeserializeOriginatorAddress(Buffer::Iterator &start) const override
Deserialize the originator address.
Main PacketBB Packet object.
std::list< Ptr< PbbMessage > >::iterator MessageIterator
PbbMessage Iterator for PbbPacket.
std::list< Ptr< PbbMessage > >::const_iterator ConstMessageIterator
PbbMessage Const Iterator for PbbPacket.
MessageIterator MessageEnd()
std::list< Ptr< PbbMessage > > m_messageList
PbbTlvBlock container.
bool m_hasseqnum
Sequence number present.
void TlvPushBack(Ptr< PbbTlv > tlv)
Appends a packet TLV to the back of this packet.
void TlvClear()
Removes all packet TLVs from this packet.
static TypeId GetTypeId()
Get the type ID.
void TlvPopBack()
Removes a packet TLV from the back of this block.
void TlvPopFront()
Removes a packet TLV from the front of this packet.
void MessagePushBack(Ptr< PbbMessage > message)
Appends a message to the back of this packet.
std::list< Ptr< PbbTlv > >::iterator TlvIterator
PbbTlv iterator for PbbPacket.
void MessageClear()
Removes all messages from this packet.
Ptr< PbbMessage > MessageFront()
void SetSequenceNumber(uint16_t number)
Sets the sequence number of this packet.
void MessagePopFront()
Removes a message from the front of this packet.
void ForceTlv(bool forceTlv)
Forces a packet to write a TLV list even if it's empty, ignoring the phastlv bit.
uint32_t GetSerializedSize() const override
void TlvPushFront(Ptr< PbbTlv > tlv)
Prepends a packet TLV to the front of this packet.
bool MessageEmpty() const
uint16_t GetSequenceNumber() const
void MessagePopBack()
Removes a message from the back of this packet.
bool HasSequenceNumber() const
Tests whether or not this packet has a sequence number.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
MessageIterator MessageBegin()
TlvIterator Erase(TlvIterator position)
Removes the packet TLV at the specified position.
void MessagePushFront(Ptr< PbbMessage > message)
Prepends a message to the front of this packet.
void Serialize(Buffer::Iterator start) const override
Serializes this packet into the specified buffer.
Ptr< PbbMessage > MessageBack()
void Print(std::ostream &os) const override
Pretty-prints the contents of this block.
bool operator!=(const PbbPacket &other) const
Inequality operator for PbbPacket.
uint16_t m_seqnum
Sequence number.
uint8_t GetVersion() const
uint32_t Deserialize(Buffer::Iterator start) override
Deserializes a packet from the specified buffer.
bool m_forceTlv
Force writing a TLV list (even if it's empty)
std::list< Ptr< PbbTlv > >::const_iterator ConstTlvIterator
PbbTlv const iterator for PbbPacket.
PbbTlvBlock m_tlvList
PbbTlv container.
bool operator==(const PbbPacket &other) const
Equality operator for PbbPacket.
A block of packet or message TLVs (PbbTlv).
Iterator Erase(Iterator position)
Removes the TLV at the specified position.
void PushBack(Ptr< PbbTlv > tlv)
Appends a TLV to the back of this block.
bool operator==(const PbbTlvBlock &other) const
Equality operator for PbbTlvBlock.
void Serialize(Buffer::Iterator &start) const
Serializes this block into the specified buffer.
Ptr< PbbTlv > Front() const
void PushFront(Ptr< PbbTlv > tlv)
Prepends a TLV to the front of this block.
std::list< Ptr< PbbTlv > >::iterator Iterator
PbbTlv container iterator.
Ptr< PbbTlv > Back() const
void Clear()
Removes all TLVs from this block.
Iterator Insert(Iterator position, const Ptr< PbbTlv > tlv)
Inserts a TLV at the specified position in this block.
void PopFront()
Removes a TLV from the front of this block.
std::list< Ptr< PbbTlv > >::const_iterator ConstIterator
PbbTlv container const iterator.
uint32_t GetSerializedSize() const
void Deserialize(Buffer::Iterator &start)
Deserializes a block from the specified buffer.
std::list< Ptr< PbbTlv > > m_tlvList
PbbTlv container.
void PopBack()
Removes a TLV from the back of this block.
void Print(std::ostream &os) const
Pretty-prints the contents of this block.
bool operator!=(const PbbTlvBlock &other) const
Inequality operator for PbbTlvBlock.
bool m_isMultivalue
Is multivalue.
uint8_t m_indexStop
Stop index.
void SetValue(Buffer start)
Sets the value of this message to the specified buffer.
uint8_t GetIndexStop() const
Get the stop point index.
bool operator!=(const PbbTlv &other) const
Inequality operator for PbbTlv.
bool HasTypeExt() const
Tests whether or not this TLV has a type extension.
uint8_t GetIndexStart() const
Get the starting point index.
bool HasValue() const
Tests whether or not this TLV has a value.
bool HasIndexStart() const
Checks if there is a starting index.
uint8_t m_indexStart
Start index.
uint8_t m_type
Type of this TLV.
bool m_hasIndexStart
Start index present.
bool operator==(const PbbTlv &other) const
Equality operator for PbbTlv.
void Serialize(Buffer::Iterator &start) const
Serializes this TLV into the specified buffer.
bool IsMultivalue() const
Check the multivalue parameter.
void SetType(uint8_t type)
Sets the type of this TLV.
bool m_hasIndexStop
Stop index present.
uint8_t GetTypeExt() const
void SetIndexStop(uint8_t index)
Set an index as stop point.
bool HasIndexStop() const
Checks if there is a stop index.
void SetMultivalue(bool isMultivalue)
Set the multivalue parameter.
void Print(std::ostream &os) const
Pretty-prints the contents of this TLV.
void SetIndexStart(uint8_t index)
Set an index as starting point.
uint8_t m_typeExt
Extended type.
bool m_hasTypeExt
Extended type present.
uint32_t GetSerializedSize() const
void SetTypeExt(uint8_t type)
Sets the type extension of this TLV.
void Deserialize(Buffer::Iterator &start)
Deserializes a TLV from the specified buffer.
bool m_hasValue
Has value.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PbbAddressLength
Used in Messages to determine whether it contains IPv4 or IPv6 addresses.
static const uint8_t VERSION
GTPv2-C protocol version number.
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.
static const uint8_t AHAS_ZERO_TAIL
static const uint8_t TIS_MULTIVALUE
static const uint8_t AHAS_MULTI_PRE_LEN
static const uint8_t THAS_SINGLE_INDEX
static const uint8_t MHAS_HOP_LIMIT
static const uint8_t PHAS_SEQ_NUM
static const uint8_t MHAS_HOP_COUNT
static const uint8_t MHAS_SEQ_NUM
static const uint8_t THAS_MULTI_INDEX
static const uint8_t AHAS_HEAD
static const uint8_t THAS_TYPE_EXT
static const uint8_t VERSION
static const uint8_t AHAS_FULL_TAIL
static const uint8_t PHAS_TLV
static const uint8_t THAS_EXT_LEN
static const uint8_t MHAS_ORIG
static const uint8_t AHAS_SINGLE_PRE_LEN
static const uint8_t THAS_VALUE