A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
uint32_t Deserialize (Buffer::Iterator start) override
 
uint32_t GetAuthenticated () const
 
std::string GetAuthenticationKeyId () const
 
std::string GetAuthTag () const
 
uint32_t GetEncrypted () const
 
std::string GetEncryptionKeyId () const
 
TypeId GetInstanceTypeId () const override
 Get the type ID.
 
uint32_t GetLength () const
 
uint32_t GetMessageId () const
 
uint32_t GetSerializedSize () const override
 
bool IsValid () const
 Check that type if valid.
 
bool operator== (QKDAppHeader const &o) const
 
void Print (std::ostream &os) const override
 
void Serialize (Buffer::Iterator start) const override
 
void SetAuthenticated (uint32_t value)
 
void SetAuthenticationKeyId (std::string keyID)
 
void SetAuthTag (std::string value)
 
void SetEncrypted (uint32_t value)
 
void SetEncryptionKeyId (std::string value)
 
void SetLength (uint32_t value)
 
void SetMessageId (uint32_t value)
 
- Public Member Functions inherited from ns3::Header
 ~Header () override
 
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

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

Private Attributes

uint8_t m_authenticated
 is packet authenticated or not
 
std::string m_authenticationKeyId
 authentication key id
 
std::string m_authTag
 authentication tag of the packet
 
uint8_t m_encryped
 is packet encrypted or not
 
std::string m_encryptionKeyId
 encryption key id
 
uint32_t m_length
 message length field
 
uint32_t m_messageId
 message id field
 
bool m_valid
 Is header valid or corrupted.
 

Additional Inherited Members

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

Detailed Description

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

Introspection did not find any typical Config paths.

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


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

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

Constructor & Destructor Documentation

◆ QKDAppHeader()

ns3::QKDAppHeader::QKDAppHeader ( )

Constructor.

Definition at line 23 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)
overridevirtual
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 69 of file qkd-app-header.cc.

References ns3::Create(), GetSerializedSize(), m_authenticated, m_authenticationKeyId, m_authTag, m_encryped, m_encryptionKeyId, m_length, m_messageId, m_valid, NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetAuthenticated()

uint32_t ns3::QKDAppHeader::GetAuthenticated ( ) const
Returns
Get the authentication flag

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

References m_authenticated, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ GetAuthenticationKeyId()

std::string ns3::QKDAppHeader::GetAuthenticationKeyId ( ) const
Returns
Get the authentication QKD Key ID

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

References m_authenticationKeyId, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ GetAuthTag()

std::string ns3::QKDAppHeader::GetAuthTag ( ) const
Parameters
keyIDGet the authentication tag

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

References m_authTag, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ GetEncrypted()

uint32_t ns3::QKDAppHeader::GetEncrypted ( ) const
Returns
Get the encryption flag

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

References m_encryped, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ GetEncryptionKeyId()

std::string ns3::QKDAppHeader::GetEncryptionKeyId ( ) const
Returns
Get the encryption QKD Key ID

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

References m_encryptionKeyId, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::QKDAppHeader::GetInstanceTypeId ( ) const
overridevirtual

Get the type ID.

Returns
the object TypeId

Implements ns3::ObjectBase.

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

References GetTypeId().

+ Here is the call graph for this function:

◆ GetLength()

uint32_t ns3::QKDAppHeader::GetLength ( ) const
Returns
Get the message length

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

References m_length, and NS_LOG_FUNCTION.

Referenced by ns3::QKDApp004::DataPacketReceived(), and ns3::QKDApp014::QAppPacketReceived().

+ Here is the caller graph for this function:

◆ GetMessageId()

uint32_t ns3::QKDAppHeader::GetMessageId ( ) const
Returns
Get the message ID

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

References m_messageId, and NS_LOG_FUNCTION.

◆ GetSerializedSize()

uint32_t ns3::QKDAppHeader::GetSerializedSize ( ) const
overridevirtual
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 48 of file qkd-app-header.cc.

Referenced by ns3::QKDApp004::DataPacketReceived(), Deserialize(), and ns3::QKDApp014::QAppPacketReceived().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::QKDAppHeader::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

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

References ns3::Create(), and 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 if valid.

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

References m_valid.

◆ operator==()

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

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

References ns3::Create(), m_authenticationKeyId, m_authTag, and m_messageId.

+ Here is the call graph for this function:

◆ Print()

void ns3::QKDAppHeader::Print ( std::ostream &  os) const
overridevirtual
Parameters
osoutput stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5

Implements ns3::Header.

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

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

◆ Serialize()

void ns3::QKDAppHeader::Serialize ( Buffer::Iterator  start) const
overridevirtual
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 56 of file qkd-app-header.cc.

References ns3::Create(), m_authenticated, m_authenticationKeyId, m_authTag, m_encryped, m_encryptionKeyId, m_length, and m_messageId.

+ Here is the call graph for this function:

◆ SetAuthenticated()

void ns3::QKDAppHeader::SetAuthenticated ( uint32_t  value)
Parameters
authenticatedSet the authentication flag

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

References m_authenticated, NS_LOG_FUNCTION, and ns3::value().

+ Here is the call graph for this function:

◆ SetAuthenticationKeyId()

void ns3::QKDAppHeader::SetAuthenticationKeyId ( std::string  keyID)
Parameters
keyIDSet the authentication QKD Key ID

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

References ns3::Create(), m_authenticationKeyId, NS_ASSERT, NS_LOG_FUNCTION, and ns3::value().

+ Here is the call graph for this function:

◆ SetAuthTag()

void ns3::QKDAppHeader::SetAuthTag ( std::string  value)
Parameters
keyIDSet the authentication tag

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

References m_authTag, NS_LOG_FUNCTION, and ns3::value().

+ Here is the call graph for this function:

◆ SetEncrypted()

void ns3::QKDAppHeader::SetEncrypted ( uint32_t  value)
Parameters
authenticatedSet the encryption flag

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

References m_encryped, NS_LOG_FUNCTION, and ns3::value().

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

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

◆ SetEncryptionKeyId()

void ns3::QKDAppHeader::SetEncryptionKeyId ( std::string  value)
Parameters
keyIDSet the encryption QKD Key ID

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

References ns3::Create(), m_encryptionKeyId, NS_ASSERT, NS_LOG_FUNCTION, and ns3::value().

+ Here is the call graph for this function:

◆ SetLength()

void ns3::QKDAppHeader::SetLength ( uint32_t  value)
Parameters
authenticatedSet the message length

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

References m_length, NS_LOG_FUNCTION, and ns3::value().

+ Here is the call graph for this function:

◆ SetMessageId()

void ns3::QKDAppHeader::SetMessageId ( uint32_t  value)
Parameters
authenticatedSet the message ID

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

References m_messageId, NS_LOG_FUNCTION, and ns3::value().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_authenticated

uint8_t ns3::QKDAppHeader::m_authenticated
private

is packet authenticated or not

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

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

◆ m_authenticationKeyId

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

authentication key id

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

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

◆ m_authTag

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

authentication tag of the packet

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

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

◆ m_encryped

uint8_t ns3::QKDAppHeader::m_encryped
private

is packet encrypted or not

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

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

◆ m_encryptionKeyId

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

encryption key id

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

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

◆ m_length

uint32_t ns3::QKDAppHeader::m_length
private

message length field

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

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

◆ m_messageId

uint32_t ns3::QKDAppHeader::m_messageId
private

message id field

Definition at line 167 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 header valid or corrupted.

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

Referenced by Deserialize(), and IsValid().


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