26 #include "ns3/type-id.h"
51 .SetGroupName (
"Internet")
72 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> ();
129 .SetGroupName (
"Internet")
144 os <<
"Unknown option";
158 NS_LOG_WARN (
"Can't Serialize an Unknown Tcp Option");
173 NS_LOG_WARN (
"Trying to Deserialize an Unknown Option of Kind " <<
int (
m_kind));
176 if (m_size < 2 || m_size > 40)
178 NS_LOG_WARN (
"Unable to parse an unknown option of kind " <<
int (
m_kind) <<
" with apparent size " <<
int (
m_size));
virtual uint8_t GetKind(void) const
Get the `kind' (as in RFC 793) of this option.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
static TypeId GetTypeId(void)
Get the type ID.
iterator in a Buffer instance
virtual void Print(std::ostream &os) const
Print the Option contents.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
virtual ~TcpOptionUnknown()
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the type ID.
void Read(uint8_t *buffer, uint32_t size)
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
uint8_t m_content[40]
The option data.
uint32_t m_size
The unknown option size.
not a standardized value; for unknown recv'd options
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
Instantiate subclasses of ns3::Object.
static TypeId GetTypeId(void)
Get the type ID.
void WriteU8(uint8_t data)
static bool IsKindKnown(uint8_t kind)
Check if the option is implemented.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
static TypeId GetTypeId(void)
Get the type ID.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t m_kind
The unknown option kind.
Kind
The option Kind, as defined in the respective RFCs.
void Write(uint8_t const *buffer, uint32_t size)
Base class for all kinds of TCP options.
A base class which provides memory management and object aggregation.
virtual TypeId GetInstanceTypeId(void) const
Implement the GetInstanceTypeId method defined in ObjectBase.
virtual TypeId GetInstanceTypeId(void) const
Implement the GetInstanceTypeId method defined in ObjectBase.
a unique identifier for an interface.
static TypeId GetTypeId(void)
Get the type ID.
static Ptr< TcpOption > CreateOption(uint8_t kind)
Creates an option.
TypeId SetParent(TypeId tid)
static TypeId GetTypeId(void)
Get the type ID.