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

QKD app packet header that carries info about used encryption, auth tag and other. More...

#include "qkd-app-header.h"

+ Inheritance diagram for ns3::QKDAppHeader:
+ Collaboration diagram for ns3::QKDAppHeader:

Public Member Functions

 QKDAppHeader ()
 Constructor. More...
 
uint32_t Deserialize (Buffer::Iterator start)
 Deserialize the packet. More...
 
uint32_t GetAuthenticated (void) const
 Read the authentication field. More...
 
std::string GetAuthenticationKeyId (void) const
 Read the authentication key identifier. More...
 
std::string GetAuthTag (void) const
 Read the authentication tag. More...
 
uint32_t GetEncrypted (void) const
 Read the encrypted field. More...
 
std::string GetEncryptionKeyId (void) const
 Read the encryption key identifier. More...
 
TypeId GetInstanceTypeId () const
 Get the type ID. More...
 
uint32_t GetLength (void) const
 Get message length. More...
 
uint32_t GetMessageId (void) const
 Get message identifier. More...
 
uint32_t GetSerializedSize () const
 Get the serialized size of a packet. More...
 
bool IsValid () const
 Check that type is valid. More...
 
bool operator== (QKDAppHeader const &o) const
 Compare the two QKDApp packets. More...
 
void Print (std::ostream &os) const
 Print the QKDApp packet. More...
 
void Serialize (Buffer::Iterator start) const
 Serialize the packet. More...
 
void SetAuthenticated (uint32_t value)
 Set the authentication field. More...
 
void SetAuthenticationKeyId (std::string keyID)
 Set the authentication key identifier. More...
 
void SetAuthTag (std::string value)
 Set the authentication tag. More...
 
void SetEncrypted (uint32_t value)
 Set the encrypted field. More...
 
void SetEncryptionKeyId (std::string value)
 Set the encryption key identifier. More...
 
void SetLength (uint32_t value)
 Set the message length. More...
 
void SetMessageId (uint32_t value)
 Set message identifier. More...
 
- Public Member Functions inherited from ns3::Header
 ~Header () override
 
virtual uint32_t Deserialize (Buffer::Iterator start)=0
 Deserialize the object from a buffer iterator. More...
 
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
- 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 errors. 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 ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Chunk
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Attributes

uint8_t m_authenticated
 The authentication flag. More...
 
std::string m_authenticationKeyId
 The authentication key identifier field. More...
 
std::string m_authTag
 The authentication tag field. More...
 
uint8_t m_encryped
 The encryption flag. More...
 
std::string m_encryptionKeyId
 The encryption key identifier field. More...
 
uint32_t m_length
 The message length field. More...
 
uint32_t m_messageId
 The message identifier field. More...
 
bool m_valid
 Is the header valid or corrupted? 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 ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

QKD app packet header that carries info about used encryption, auth tag and other.

Note
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Msg-Id | 8 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | E | A | 16 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Encryption Key Id | 20 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication Key Id | 24 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | A-Tag ... | 28 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... A-Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

with:

 Length:         total size of packet, including the length field itself
 Msg-Id:         message number (inside a channel)
 E:              Type of used encryption cipher where value 0 means unencrypted packet
 A:              Type of used authentication algorithm where value 0 means non-authenticated packet
 E-KeyId:        Encryption Key Id
 A-KeyId:        Authentication Key Id
 A-Tag:          Authentication tag

Definition at line 70 of file qkd-app-header.h.

Constructor & Destructor Documentation

◆ QKDAppHeader()

ns3::QKDAppHeader::QKDAppHeader ( )

Constructor.

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

References m_authenticated, m_encryped, m_length, and m_messageId.

Member Function Documentation

◆ Deserialize()

uint32_t ns3::QKDAppHeader::Deserialize ( Buffer::Iterator  start)
virtual

◆ GetAuthenticated()

uint32_t ns3::QKDAppHeader::GetAuthenticated ( void  ) const

Read the authentication field.

Returns
The authentication flag.

Definition at line 264 of file qkd-app-header.cc.

References m_authenticated, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::ProcessDataPacketFromApp(), and ns3::QKDApp014::ProcessDataPacketFromApp().

+ Here is the caller graph for this function:

◆ GetAuthenticationKeyId()

std::string ns3::QKDAppHeader::GetAuthenticationKeyId ( void  ) const

Read the authentication key identifier.

Returns
The authentication key identifier.

Definition at line 224 of file qkd-app-header.cc.

References m_authenticationKeyId, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::ProcessDataPacketFromApp(), and ns3::QKDApp014::ProcessDataPacketFromApp().

+ Here is the caller graph for this function:

◆ GetAuthTag()

std::string ns3::QKDAppHeader::GetAuthTag ( void  ) const

Read the authentication tag.

Returns
The authentication tag.

Definition at line 238 of file qkd-app-header.cc.

References m_authTag, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::ProcessDataPacketFromApp(), and ns3::QKDApp014::ProcessDataPacketFromApp().

+ Here is the caller graph for this function:

◆ GetEncrypted()

uint32_t ns3::QKDAppHeader::GetEncrypted ( void  ) const

Read the encrypted field.

Returns
The encrypted flag.

Definition at line 251 of file qkd-app-header.cc.

References m_encryped, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::ProcessDataPacketFromApp(), and ns3::QKDApp014::ProcessDataPacketFromApp().

+ Here is the caller graph for this function:

◆ GetEncryptionKeyId()

std::string ns3::QKDAppHeader::GetEncryptionKeyId ( void  ) const

Read the encryption key identifier.

Returns
The encryption key identifier.

Definition at line 202 of file qkd-app-header.cc.

References m_encryptionKeyId, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::ProcessDataPacketFromApp(), and ns3::QKDApp014::ProcessDataPacketFromApp().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

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

Get the type ID.

Returns
The object TypeId.

Implements ns3::ObjectBase.

Definition at line 52 of file qkd-app-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetLength()

uint32_t ns3::QKDAppHeader::GetLength ( void  ) const

Get message length.

Returns
The messsage length.

Definition at line 168 of file qkd-app-header.cc.

References m_length, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::DataPacketReceivedFromApp(), and ns3::QKDApp014::DataPacketReceivedFromApp().

+ Here is the caller graph for this function:

◆ GetMessageId()

uint32_t ns3::QKDAppHeader::GetMessageId ( void  ) const

Get message identifier.

Returns
The identifier.

Definition at line 181 of file qkd-app-header.cc.

References m_messageId, and NS_LOG_FUNCTION.

◆ GetSerializedSize()

uint32_t ns3::QKDAppHeader::GetSerializedSize ( ) const
virtual

Get the serialized size of a packet.

Returns
The size.

Implements ns3::Header.

Definition at line 58 of file qkd-app-header.cc.

Referenced by ns3::QKDApp004::DataPacketReceivedFromApp(), ns3::QKDApp014::DataPacketReceivedFromApp(), Deserialize(), ns3::QKDApp004::SendPacket(), and ns3::QKDApp014::SendPacket().

+ Here is the caller graph for this function:

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

Definition at line 42 of file qkd-app-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsValid()

bool ns3::QKDAppHeader::IsValid ( ) const
inline

Check that type is valid.

Returns
The success indicator.

Definition at line 209 of file qkd-app-header.h.

References m_valid.

◆ operator==()

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

Compare the two QKDApp packets.

Parameters
oThe other packets.
Returns
The equality result.

Definition at line 148 of file qkd-app-header.cc.

References m_authenticationKeyId, m_authTag, and m_messageId.

◆ Print()

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

Print the QKDApp packet.

Parameters
osThe stream.

Implements ns3::Header.

Definition at line 131 of file qkd-app-header.cc.

References m_authenticated, m_authenticationKeyId, m_authTag, m_encryped, m_encryptionKeyId, m_length, and m_messageId.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ Serialize()

void ns3::QKDAppHeader::Serialize ( Buffer::Iterator  start) const
virtual

Serialize the packet.

Parameters
startThe starting point.

Implements ns3::Header.

Definition at line 66 of file qkd-app-header.cc.

References m_authenticated, m_authenticationKeyId, m_authTag, m_encryped, m_encryptionKeyId, m_length, m_messageId, NS_LOG_FUNCTION, ns3::Buffer::Iterator::Write(), ns3::Buffer::Iterator::WriteHtonU32(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

◆ SetAuthenticated()

void ns3::QKDAppHeader::SetAuthenticated ( uint32_t  value)

Set the authentication field.

Parameters
valueThe authentication flag.

Definition at line 258 of file qkd-app-header.cc.

References m_authenticated, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::SendPacket(), and ns3::QKDApp014::SendPacket().

+ Here is the caller graph for this function:

◆ SetAuthenticationKeyId()

void ns3::QKDAppHeader::SetAuthenticationKeyId ( std::string  keyID)

Set the authentication key identifier.

Parameters
keyIDThe authentication key identifier.

Definition at line 210 of file qkd-app-header.cc.

References m_authenticationKeyId, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::SendPacket(), and ns3::QKDApp014::SendPacket().

+ Here is the caller graph for this function:

◆ SetAuthTag()

void ns3::QKDAppHeader::SetAuthTag ( std::string  value)

Set the authentication tag.

Parameters
valueThe authentication tag.

Definition at line 231 of file qkd-app-header.cc.

References m_authTag, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::SendPacket(), and ns3::QKDApp014::SendPacket().

+ Here is the caller graph for this function:

◆ SetEncrypted()

void ns3::QKDAppHeader::SetEncrypted ( uint32_t  value)

Set the encrypted field.

Parameters
valueThe encrypted flag.

Definition at line 245 of file qkd-app-header.cc.

References m_encryped, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::SendPacket(), and ns3::QKDApp014::SendPacket().

+ Here is the caller graph for this function:

◆ SetEncryptionKeyId()

void ns3::QKDAppHeader::SetEncryptionKeyId ( std::string  value)

Set the encryption key identifier.

Parameters
valueThe encryption key identifier.

Definition at line 188 of file qkd-app-header.cc.

References m_encryptionKeyId, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::SendPacket(), and ns3::QKDApp014::SendPacket().

+ Here is the caller graph for this function:

◆ SetLength()

void ns3::QKDAppHeader::SetLength ( uint32_t  value)

Set the message length.

Parameters
valueThe length.

Definition at line 162 of file qkd-app-header.cc.

References m_length, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::SendPacket(), and ns3::QKDApp014::SendPacket().

+ Here is the caller graph for this function:

◆ SetMessageId()

void ns3::QKDAppHeader::SetMessageId ( uint32_t  value)

Set message identifier.

Parameters
valueThe identifier.

Definition at line 175 of file qkd-app-header.cc.

References m_messageId, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_authenticated

uint8_t ns3::QKDAppHeader::m_authenticated
private

The authentication flag.


Definition at line 220 of file qkd-app-header.h.

Referenced by QKDAppHeader(), Deserialize(), GetAuthenticated(), Print(), Serialize(), and SetAuthenticated().

◆ m_authenticationKeyId

std::string ns3::QKDAppHeader::m_authenticationKeyId
private

The authentication key identifier field.

Definition at line 223 of file qkd-app-header.h.

Referenced by Deserialize(), GetAuthenticationKeyId(), operator==(), Print(), Serialize(), and SetAuthenticationKeyId().

◆ m_authTag

std::string ns3::QKDAppHeader::m_authTag
private

The authentication tag field.

Definition at line 224 of file qkd-app-header.h.

Referenced by Deserialize(), GetAuthTag(), operator==(), Print(), Serialize(), and SetAuthTag().

◆ m_encryped

uint8_t ns3::QKDAppHeader::m_encryped
private

The encryption flag.

Definition at line 219 of file qkd-app-header.h.

Referenced by QKDAppHeader(), Deserialize(), GetEncrypted(), Print(), Serialize(), and SetEncrypted().

◆ m_encryptionKeyId

std::string ns3::QKDAppHeader::m_encryptionKeyId
private

The encryption key identifier field.

Definition at line 222 of file qkd-app-header.h.

Referenced by Deserialize(), GetEncryptionKeyId(), Print(), Serialize(), and SetEncryptionKeyId().

◆ m_length

uint32_t ns3::QKDAppHeader::m_length
private

The message length field.

Definition at line 216 of file qkd-app-header.h.

Referenced by QKDAppHeader(), Deserialize(), GetLength(), Print(), Serialize(), and SetLength().

◆ m_messageId

uint32_t ns3::QKDAppHeader::m_messageId
private

The message identifier field.

Definition at line 217 of file qkd-app-header.h.

Referenced by QKDAppHeader(), Deserialize(), GetMessageId(), operator==(), Print(), Serialize(), and SetMessageId().

◆ m_valid

bool ns3::QKDAppHeader::m_valid
private

Is the header valid or corrupted?

Definition at line 226 of file qkd-app-header.h.

Referenced by Deserialize(), and IsValid().


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