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

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

#include "qkd-header.h"

+ Inheritance diagram for ns3::QKDCommandHeader:
+ Collaboration diagram for ns3::QKDCommandHeader:

Public Member Functions

 QKDCommandHeader ()
 Constructor. More...
 
uint32_t Deserialize (Buffer::Iterator start)
 
char GetCommand (void) const
 
TypeId GetInstanceTypeId () const
 Get the type ID. More...
 
uint16_t GetProtocol (void) const
 
uint32_t GetSerializedSize () const
 
bool operator== (QKDCommandHeader const &o) const
 
void Print (std::ostream &os) const
 Print the header in the output stream. More...
 
void Serialize (Buffer::Iterator start) const
 
void SetCommand (char value)
 
void SetProtocol (uint16_t value)
 
- Public Member Functions inherited from ns3::Header
virtual ~Header ()
 
- Public Member Functions inherited from ns3::Chunk
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
- 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 ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Header
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Chunk
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
 command and protocol field used in AIT R10 software. More...
 
uint16_t m_protocol
 ipv4 by default. 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.

QKDCommandHeader is encrypted with packet payload while QKDHeader is not encrypted! So QKDCommandHeader is able to carry info about the sensitive intrnal protocol commands (LOAD, STORE, DATA...) and the type of first header in the list of headers (IPv4 or IPv6)


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).

0 4 8 16 24 32 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Protocol | Command | 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Command: Protocol Command (HANDSHAKE, DATA, LOAD, LOAD-REQUEST, STORE, ...) Protocol: ID of next protocol header in the encrypted header chain

Definition at line 49 of file qkd-header.h.

Constructor & Destructor Documentation

ns3::QKDCommandHeader::QKDCommandHeader ( )

Constructor.

Definition at line 33 of file qkd-header.cc.

References m_command.

Member Function Documentation

uint32_t ns3::QKDCommandHeader::Deserialize ( Buffer::Iterator  start)
virtual
Parameters
startan iterator which points to where the header should read from.
Returns
the number of bytes read.

This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.

Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.

Implements ns3::Header.

Definition at line 67 of file qkd-header.cc.

References ns3::Buffer::Iterator::GetDistanceFrom(), GetSerializedSize(), m_command, m_protocol, NS_ASSERT, NS_LOG_DEBUG, ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 109 of file qkd-header.cc.

References m_command, and NS_LOG_FUNCTION.

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

Get the type ID.

Returns
the object TypeId

Implements ns3::ObjectBase.

Definition at line 48 of file qkd-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

uint16_t ns3::QKDCommandHeader::GetProtocol ( void  ) const

Definition at line 123 of file qkd-header.cc.

References m_protocol, NS_LOG_FUNCTION, and NS_OBJECT_ENSURE_REGISTERED.

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

+ Here is the caller graph for this function:

uint32_t ns3::QKDCommandHeader::GetSerializedSize ( ) const
virtual
Returns
the expected size of the header.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.

Implements ns3::Header.

Definition at line 54 of file qkd-header.cc.

Referenced by Deserialize(), and ns3::QKDDelimiterHeader::Deserialize().

+ Here is the caller graph for this function:

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

Get the type ID.

Returns
the object TypeId

Definition at line 38 of file qkd-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId(), and ns3::QKDDelimiterHeader::GetInstanceTypeId().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::QKDCommandHeader::operator== ( QKDCommandHeader const &  o) const

Definition at line 88 of file qkd-header.cc.

References m_command.

void ns3::QKDCommandHeader::Print ( std::ostream &  os) const
virtual

Print the header in the output stream.

Implements ns3::Header.

Definition at line 81 of file qkd-header.cc.

References m_command, and m_protocol.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

void ns3::QKDCommandHeader::Serialize ( Buffer::Iterator  start) const
virtual
Parameters
startan iterator which points to where the header should be written.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.

Implements ns3::Header.

Definition at line 60 of file qkd-header.cc.

References m_command, m_protocol, ns3::Buffer::Iterator::WriteHtonU16(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

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

Definition at line 102 of file qkd-header.cc.

References m_command, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

void ns3::QKDCommandHeader::SetProtocol ( uint16_t  value)

Definition at line 116 of file qkd-header.cc.

References m_protocol, and NS_LOG_FUNCTION.

Member Data Documentation

char ns3::QKDCommandHeader::m_command
private

command and protocol field used in AIT R10 software.

not used in QKD simulation module!

Definition at line 86 of file qkd-header.h.

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

uint16_t ns3::QKDCommandHeader::m_protocol
private

ipv4 by default.

Info about the first protocol header to be decrypted

Definition at line 87 of file qkd-header.h.

Referenced by Deserialize(), GetProtocol(), Print(), Serialize(), and SetProtocol().


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