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