A Discrete-Event Network Simulator
API
ns3::QKDCommandTag Class Reference

Introspection did not find any typical Config paths. More...

#include "qkd-internal-tag.h"

+ Inheritance diagram for ns3::QKDCommandTag:
+ Collaboration diagram for ns3::QKDCommandTag:

Public Member Functions

virtual void Deserialize (TagBuffer i)
 
char GetCommand (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
uint32_t GetRoutingProtocolNumber (void) const
 
virtual uint32_t GetSerializedSize (void) const
 
virtual void Print (std::ostream &os) const
 
virtual void Serialize (TagBuffer i) const
 
void SetCommand (char value)
 
void SetRoutingProtocolNumber (uint32_t value)
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the TypeId. More...
 
- Static Public Member Functions inherited from ns3::Tag
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Attributes

char m_command
 Used to distinguish between routing and data packet. More...
 
uint32_t m_routingProtocolNumber
 If it is a routing packet, we use this value to distinguish the protocol type. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

Introspection did not find any typical Config paths.

QKDCommandTag is used to describe the content of the packet payload.


No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 16 bytes (on a 64-bit architecture).

QKDCommandTag is used in routing protocols to mark the packet that needs to be analyzed further from L4 layer. For example, we mark DSDV packet using this Tag, by using "SetCommand('R')" and "SetRoutingProtocolNumber(DSDV_PACKET_HEADER_PROTOCOL_NUMBER)" Later, in QCrypto by analyzing the tag we know that the packet contains DSDV headers that needs to be encrypted. Without the tag, there is no way to know what is inside TCP/UDP payload. Tag is removed after encryption. If the tag has some other value, such as "SetCommand('A')" it is not a routing packet, and the payload of the TCP/UDP header is encrypted as it is.

Note
This mechanism is mandatory since in the NS-3 simulator, we cannot provide the packet with all its headers and payload in a simple array of bytes or simmilar (version 3.29).

Definition at line 50 of file qkd-internal-tag.h.

Member Function Documentation

void ns3::QKDCommandTag::Deserialize ( TagBuffer  i)
virtual
Parameters
ithe buffer to read data from.

Read the content of the tag from the provided tag buffer. DO NOT attempt to read more bytes than you wrote with Tag::Serialize.

Implements ns3::Tag.

Definition at line 62 of file qkd-internal-tag.cc.

References m_command, m_routingProtocolNumber, NS_LOG_DEBUG, ns3::TagBuffer::ReadU32(), and ns3::TagBuffer::ReadU8().

+ Here is the call graph for this function:

char ns3::QKDCommandTag::GetCommand ( void  ) const

Definition at line 84 of file qkd-internal-tag.cc.

References m_command, and NS_LOG_FUNCTION.

Referenced by ns3::QKDCrypto::CreateQKDCommandHeader().

+ Here is the caller graph for this function:

TypeId ns3::QKDCommandTag::GetInstanceTypeId ( void  ) const
virtual

Get the most derived TypeId for this Object.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

Definition at line 44 of file qkd-internal-tag.cc.

References GetTypeId().

+ Here is the call graph for this function:

uint32_t ns3::QKDCommandTag::GetRoutingProtocolNumber ( void  ) const

Definition at line 98 of file qkd-internal-tag.cc.

References m_routingProtocolNumber, NS_LOG_FUNCTION, and NS_OBJECT_ENSURE_REGISTERED.

Referenced by ns3::QKDCrypto::CreateQKDCommandHeader().

+ Here is the caller graph for this function:

uint32_t ns3::QKDCommandTag::GetSerializedSize ( void  ) const
virtual
Returns
the number of bytes required to serialize the data of the tag.

This method is typically invoked by Packet::AddPacketTag or Packet::AddByteTag just prior to calling Tag::Serialize.

Implements ns3::Tag.

Definition at line 49 of file qkd-internal-tag.cc.

TypeId ns3::QKDCommandTag::GetTypeId ( void  )
static

Get the TypeId.

Returns
The TypeId for this class

Definition at line 35 of file qkd-internal-tag.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId(), ns3::QKDInternalTOSTag::GetInstanceTypeId(), and ns3::QKDInternalTag::GetInstanceTypeId().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::QKDCommandTag::Print ( std::ostream &  os) const
virtual
Parameters
osthe stream to print to

This method is typically invoked from the Packet::PrintByteTags or Packet::PrintPacketTags methods.

Implements ns3::Tag.

Definition at line 70 of file qkd-internal-tag.cc.

References m_command, and m_routingProtocolNumber.

void ns3::QKDCommandTag::Serialize ( TagBuffer  i) const
virtual
Parameters
ithe buffer to write data into.

Write the content of the tag in the provided tag buffer. DO NOT attempt to write more bytes than you requested with Tag::GetSerializedSize.

Implements ns3::Tag.

Definition at line 55 of file qkd-internal-tag.cc.

References m_command, m_routingProtocolNumber, ns3::TagBuffer::WriteU32(), and ns3::TagBuffer::WriteU8().

+ Here is the call graph for this function:

void ns3::QKDCommandTag::SetCommand ( char  value)

Definition at line 77 of file qkd-internal-tag.cc.

References m_command, and NS_LOG_FUNCTION.

Referenced by ns3::aodv::RoutingProtocol::RecvError(), ns3::aodvq::RoutingProtocol::RecvError(), ns3::aodvq::RoutingProtocol::RecvReply(), ns3::aodv::RoutingProtocol::RecvReply(), ns3::aodvq::RoutingProtocol::RecvRequest(), ns3::aodv::RoutingProtocol::RecvRequest(), ns3::aodv::RoutingProtocol::SendHello(), ns3::aodvq::RoutingProtocol::SendHello(), ns3::olsr::RoutingProtocol::SendPacket(), ns3::dsdvq::RoutingProtocol::SendPeriodicUpdate(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), ns3::olsr::RoutingProtocol::SendQueuedMessages(), ns3::aodvq::RoutingProtocol::SendReply(), ns3::aodv::RoutingProtocol::SendReply(), ns3::aodv::RoutingProtocol::SendReplyAck(), ns3::aodvq::RoutingProtocol::SendReplyAck(), ns3::aodv::RoutingProtocol::SendReplyByIntermediateNode(), ns3::aodvq::RoutingProtocol::SendReplyByIntermediateNode(), ns3::aodv::RoutingProtocol::SendRequest(), ns3::aodvq::RoutingProtocol::SendRequest(), ns3::aodvq::RoutingProtocol::SendRerrMessage(), ns3::aodv::RoutingProtocol::SendRerrMessage(), ns3::aodvq::RoutingProtocol::SendRerrWhenBreaksLinkToNextHop(), ns3::aodv::RoutingProtocol::SendRerrWhenBreaksLinkToNextHop(), ns3::aodvq::RoutingProtocol::SendRerrWhenNoRouteToForward(), ns3::aodv::RoutingProtocol::SendRerrWhenNoRouteToForward(), ns3::dsdvq::RoutingProtocol::SendTriggeredUpdate(), and ns3::dsdv::RoutingProtocol::SendTriggeredUpdate().

+ Here is the caller graph for this function:

Member Data Documentation

char ns3::QKDCommandTag::m_command
private

Used to distinguish between routing and data packet.

Definition at line 72 of file qkd-internal-tag.h.

Referenced by Deserialize(), GetCommand(), Print(), Serialize(), and SetCommand().

uint32_t ns3::QKDCommandTag::m_routingProtocolNumber
private

If it is a routing packet, we use this value to distinguish the protocol type.

Definition at line 73 of file qkd-internal-tag.h.

Referenced by Deserialize(), GetRoutingProtocolNumber(), Print(), Serialize(), and SetRoutingProtocolNumber().


The documentation for this class was generated from the following files: