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. | |
Related Symbols inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
QKD app packet header that carries info about used encryption, auth tag and other.
Introspection did not find any typical Config paths.
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.
| ns3::QKDAppHeader::QKDAppHeader | ( | ) |
Constructor.
Definition at line 23 of file qkd-app-header.cc.
References m_authenticated, m_encryped, m_length, and m_messageId.
|
overridevirtual |
| start | an iterator which points to where the header should read from. |
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:| uint32_t ns3::QKDAppHeader::GetAuthenticated | ( | ) | const |
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:| std::string ns3::QKDAppHeader::GetAuthenticationKeyId | ( | ) | const |
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:| std::string ns3::QKDAppHeader::GetAuthTag | ( | ) | const |
| keyID | Get 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:| uint32_t ns3::QKDAppHeader::GetEncrypted | ( | ) | const |
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:| std::string ns3::QKDAppHeader::GetEncryptionKeyId | ( | ) | const |
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:
|
overridevirtual |
Get the type ID.
Implements ns3::ObjectBase.
Definition at line 42 of file qkd-app-header.cc.
References GetTypeId().
Here is the call graph for this function:| uint32_t ns3::QKDAppHeader::GetLength | ( | ) | const |
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:| uint32_t ns3::QKDAppHeader::GetMessageId | ( | ) | const |
Definition at line 160 of file qkd-app-header.cc.
References m_messageId, and NS_LOG_FUNCTION.
|
overridevirtual |
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:
|
static |
Get the type ID.
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:
|
inline |
| 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:
|
overridevirtual |
| os | output 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.
|
overridevirtual |
| start | an 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:| authenticated | Set 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:| void ns3::QKDAppHeader::SetAuthenticationKeyId | ( | std::string | keyID | ) |
| keyID | Set 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:| void ns3::QKDAppHeader::SetAuthTag | ( | std::string | value | ) |
| keyID | Set 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:| authenticated | Set 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:| void ns3::QKDAppHeader::SetEncryptionKeyId | ( | std::string | value | ) |
| keyID | Set 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:| authenticated | Set 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:| authenticated | Set 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:
|
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().
|
private |
authentication key id
Definition at line 173 of file qkd-app-header.h.
Referenced by Deserialize(), GetAuthenticationKeyId(), operator==(), Print(), Serialize(), and SetAuthenticationKeyId().
|
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().
|
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().
|
private |
encryption key id
Definition at line 172 of file qkd-app-header.h.
Referenced by Deserialize(), GetEncryptionKeyId(), Print(), Serialize(), and SetEncryptionKeyId().
|
private |
message length field
Definition at line 166 of file qkd-app-header.h.
Referenced by QKDAppHeader(), Deserialize(), GetLength(), Print(), Serialize(), and SetLength().
|
private |
message id field
Definition at line 167 of file qkd-app-header.h.
Referenced by QKDAppHeader(), Deserialize(), GetMessageId(), operator==(), Print(), Serialize(), and SetMessageId().
|
private |
Is header valid or corrupted.
Definition at line 176 of file qkd-app-header.h.
Referenced by Deserialize(), and IsValid().