29 #include "ns3/type-id.h"
71 static KindToTid toTid[] = {
82 for (
unsigned int i = 0; i <
sizeof(toTid) /
sizeof(KindToTid); ++i)
84 if (toTid[i].kind == kind)
91 return CreateObject<TcpOptionUnknown>();
131 .SetGroupName(
"Internet")
145 os <<
"Unknown option";
159 NS_LOG_WARN(
"Can't Serialize an Unknown Tcp Option");
177 if (m_size < 2 || m_size > 40)
179 NS_LOG_WARN(
"Unable to parse an unknown option of kind "
180 <<
int(
m_kind) <<
" with apparent size " <<
int(
m_size));
iterator in a Buffer instance
void WriteU8(uint8_t data)
void Write(const uint8_t *buffer, uint32_t size)
void Read(uint8_t *buffer, uint32_t size)
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
static TypeId GetTypeId()
Get the type ID.
Base class for all kinds of TCP options.
static Ptr< TcpOption > CreateOption(uint8_t kind)
Creates an option.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static bool IsKindKnown(uint8_t kind)
Check if the option is implemented.
Kind
The option Kind, as defined in the respective RFCs.
@ UNKNOWN
not a standardized value; for unknown recv'd options
@ SACKPERMITTED
SACKPERMITTED.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the Option from a buffer iterator.
void Serialize(Buffer::Iterator start) const override
Serialize the Option to a buffer iterator.
uint8_t GetKind() const override
Get the ‘kind’ (as in RFC 793) of this option.
uint8_t m_content[40]
The option data.
void Print(std::ostream &os) const override
Print the Option contents.
static TypeId GetTypeId()
Get the type ID.
uint32_t GetSerializedSize() const override
Returns number of bytes required for Option serialization.
uint32_t m_size
The unknown option size.
~TcpOptionUnknown() override
uint8_t m_kind
The unknown option kind.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Get the type ID.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.