Introspection did not find any typical Config paths. More...
#include "qkd-header.h"
Public Member Functions | |
QKDHeader () | |
Constructor. More... | |
uint32_t | Deserialize (Buffer::Iterator start) |
uint32_t | GetAuthenticated (void) const |
uint32_t | GetAuthenticationKeyId (void) const |
std::string | GetAuthTag (void) const |
uint16_t | GetChannelId (void) const |
uint32_t | GetEncrypted (void) const |
uint32_t | GetEncryptionKeyId (void) const |
TypeId | GetInstanceTypeId () const |
Get the type ID. More... | |
uint32_t | GetLength (void) const |
uint32_t | GetMessageId (void) const |
uint32_t | GetSerializedSize () const |
uint8_t | GetVersion (void) const |
uint8_t | GetZipped (void) const |
bool | IsValid () const |
Check that type if valid. More... | |
bool | operator== (QKDHeader const &o) const |
void | Print (std::ostream &os) const |
void | Serialize (Buffer::Iterator start) const |
void | SetAuthenticated (uint32_t value) |
void | SetAuthenticationKeyId (uint32_t value) |
void | SetAuthTag (std::string value) |
void | SetChannelId (uint16_t value) |
void | SetEncrypted (uint32_t value) |
void | SetEncryptionKeyId (uint32_t value) |
void | SetLength (uint32_t value) |
void | SetMessageId (uint32_t value) |
void | SetVersion (uint8_t value) |
void | SetZipped (uint8_t value) |
![]() | |
virtual | ~Header () |
![]() | |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. More... | |
![]() | |
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 TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Attributes | |
uint8_t | m_authenticated |
is packet authenticated or not More... | |
uint32_t | m_authenticationKeyId |
authentication key id More... | |
std::string | m_authTag |
authentication tag of the packet More... | |
uint16_t | m_channelId |
QKD channel id. More... | |
uint8_t | m_encryped |
is packet encrypted or not More... | |
uint32_t | m_encryptionKeyId |
encryption key id More... | |
uint32_t | m_length |
message length field More... | |
uint32_t | m_messageId |
message id field More... | |
uint32_t | m_offset |
message offset field used with fragmentation More... | |
uint8_t | m_reserved |
reserved field for further use More... | |
bool | m_valid |
Is QKD Header valid or corrupted. More... | |
uint8_t | m_version |
flags and version field More... | |
uint8_t | m_zipped |
is payload zipped or not More... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Introspection did not find any typical Config paths.
QKD packet header that carries info about used encryption, auth tag and other.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 80 bytes (on a 64-bit architecture).
This class represents a single Q3P Message This is a buffer (== the data sent/received) plus some message stuff It includes the total package from head to toe. This means: It includes the header, the payload and the tag. In this order. This the Q3P message layout:
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 | Z | v | r | Channel | 12 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MaxDelay | Timestamp | 16 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Encryption Key Id | 20 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication Key Id | 24 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | A-Tag ... 28 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... A-Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... Data ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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 Z: Type of used compression algorithm where value 0 means non-compressed packet r: reserved for future use V: Q3P version field: ALWAYS 2 for this implementation Channel: Q3P Channel number MaxDelay: Maximum tolerated delay Timestamp: Timestamp of packet’s generation at the ingress node Protocols: List of protocol headers included in carried data (in order) E-KeyId: Encryption Key Id A-KeyId: Authentication Key Id Data: User Data A-Tag: Authentication tag
Definition at line 202 of file qkd-header.h.
ns3::QKDHeader::QKDHeader | ( | ) |
Constructor.
Definition at line 227 of file qkd-header.cc.
References m_authenticated, m_authenticationKeyId, m_channelId, m_encryped, m_encryptionKeyId, m_length, m_messageId, m_reserved, m_version, and m_zipped.
|
virtual |
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 289 of file qkd-header.cc.
References ns3::Buffer::Iterator::GetDistanceFrom(), GetSerializedSize(), m_authenticated, m_authenticationKeyId, m_authTag, m_channelId, m_encryped, m_encryptionKeyId, m_length, m_messageId, m_reserved, m_valid, m_version, m_zipped, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Buffer::Iterator::Read(), ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadNtohU32(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().
Referenced by ns3::QKDCrypto::StringToQKDHeader().
uint32_t ns3::QKDHeader::GetAuthenticated | ( | void | ) | const |
Definition at line 419 of file qkd-header.cc.
References m_authenticated, and NS_LOG_FUNCTION.
uint32_t ns3::QKDHeader::GetAuthenticationKeyId | ( | void | ) | const |
Definition at line 489 of file qkd-header.cc.
References m_authenticationKeyId, and NS_LOG_FUNCTION.
std::string ns3::QKDHeader::GetAuthTag | ( | void | ) | const |
Definition at line 503 of file qkd-header.cc.
References m_authTag, and NS_LOG_FUNCTION.
uint16_t ns3::QKDHeader::GetChannelId | ( | void | ) | const |
Definition at line 461 of file qkd-header.cc.
References m_channelId, and NS_LOG_FUNCTION.
uint32_t ns3::QKDHeader::GetEncrypted | ( | void | ) | const |
Definition at line 405 of file qkd-header.cc.
References m_encryped, and NS_LOG_FUNCTION.
uint32_t ns3::QKDHeader::GetEncryptionKeyId | ( | void | ) | const |
Definition at line 475 of file qkd-header.cc.
References m_encryptionKeyId, and NS_LOG_FUNCTION.
|
virtual |
Get the type ID.
Implements ns3::ObjectBase.
Definition at line 252 of file qkd-header.cc.
References GetTypeId().
uint32_t ns3::QKDHeader::GetLength | ( | void | ) | const |
Definition at line 378 of file qkd-header.cc.
References m_length, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::CheckForFragmentation(), and ns3::QKDCrypto::ProcessOutgoingPacket().
uint32_t ns3::QKDHeader::GetMessageId | ( | void | ) | const |
Definition at line 391 of file qkd-header.cc.
References m_messageId, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
|
virtual |
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 258 of file qkd-header.cc.
Referenced by Deserialize(), and ns3::QKDCrypto::QKDHeaderToVector().
|
static |
Get the type ID.
Definition at line 242 of file qkd-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
uint8_t ns3::QKDHeader::GetVersion | ( | void | ) | const |
Definition at line 447 of file qkd-header.cc.
References m_version, and NS_LOG_FUNCTION.
uint8_t ns3::QKDHeader::GetZipped | ( | void | ) | const |
Definition at line 433 of file qkd-header.cc.
References m_zipped, and NS_LOG_FUNCTION.
|
inline |
Check that type if valid.
Definition at line 261 of file qkd-header.h.
bool ns3::QKDHeader::operator== | ( | QKDHeader const & | o | ) | const |
Definition at line 358 of file qkd-header.cc.
References m_authenticationKeyId, m_authTag, and m_messageId.
|
virtual |
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 337 of file qkd-header.cc.
References m_authenticated, m_authenticationKeyId, m_authTag, m_channelId, m_encryped, m_encryptionKeyId, m_length, m_messageId, m_reserved, m_version, and m_zipped.
Referenced by ns3::operator<<().
|
virtual |
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 267 of file qkd-header.cc.
References m_authenticated, m_authenticationKeyId, m_authTag, m_channelId, m_encryped, m_encryptionKeyId, m_length, m_messageId, m_reserved, m_version, m_zipped, NS_LOG_FUNCTION, ns3::Buffer::Iterator::Write(), ns3::Buffer::Iterator::WriteHtonU16(), ns3::Buffer::Iterator::WriteHtonU32(), and ns3::Buffer::Iterator::WriteU8().
Referenced by ns3::QKDCrypto::QKDHeaderToVector().
void ns3::QKDHeader::SetAuthenticated | ( | uint32_t | value | ) |
Definition at line 413 of file qkd-header.cc.
References m_authenticated, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetAuthenticationKeyId | ( | uint32_t | value | ) |
Definition at line 483 of file qkd-header.cc.
References m_authenticationKeyId, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetAuthTag | ( | std::string | value | ) |
Definition at line 497 of file qkd-header.cc.
References m_authTag, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetChannelId | ( | uint16_t | value | ) |
Definition at line 455 of file qkd-header.cc.
References m_channelId, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetEncrypted | ( | uint32_t | value | ) |
Definition at line 399 of file qkd-header.cc.
References m_encryped, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetEncryptionKeyId | ( | uint32_t | value | ) |
Definition at line 469 of file qkd-header.cc.
References m_encryptionKeyId, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetLength | ( | uint32_t | value | ) |
Definition at line 372 of file qkd-header.cc.
References m_length, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetMessageId | ( | uint32_t | value | ) |
Definition at line 385 of file qkd-header.cc.
References m_messageId, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
void ns3::QKDHeader::SetVersion | ( | uint8_t | value | ) |
Definition at line 441 of file qkd-header.cc.
References m_version, and NS_LOG_FUNCTION.
void ns3::QKDHeader::SetZipped | ( | uint8_t | value | ) |
Definition at line 427 of file qkd-header.cc.
References m_zipped, and NS_LOG_FUNCTION.
Referenced by ns3::QKDCrypto::ProcessOutgoingPacket().
|
private |
is packet authenticated or not
Definition at line 273 of file qkd-header.h.
Referenced by Deserialize(), GetAuthenticated(), Print(), QKDHeader(), Serialize(), and SetAuthenticated().
|
private |
authentication key id
Definition at line 280 of file qkd-header.h.
Referenced by Deserialize(), GetAuthenticationKeyId(), operator==(), Print(), QKDHeader(), Serialize(), and SetAuthenticationKeyId().
|
private |
authentication tag of the packet
Definition at line 281 of file qkd-header.h.
Referenced by Deserialize(), GetAuthTag(), operator==(), Print(), Serialize(), and SetAuthTag().
|
private |
QKD channel id.
Definition at line 277 of file qkd-header.h.
Referenced by Deserialize(), GetChannelId(), Print(), QKDHeader(), Serialize(), and SetChannelId().
|
private |
is packet encrypted or not
Definition at line 272 of file qkd-header.h.
Referenced by Deserialize(), GetEncrypted(), Print(), QKDHeader(), Serialize(), and SetEncrypted().
|
private |
encryption key id
Definition at line 279 of file qkd-header.h.
Referenced by Deserialize(), GetEncryptionKeyId(), Print(), QKDHeader(), Serialize(), and SetEncryptionKeyId().
|
private |
message length field
Definition at line 268 of file qkd-header.h.
Referenced by Deserialize(), GetLength(), Print(), QKDHeader(), Serialize(), and SetLength().
|
private |
message id field
Definition at line 270 of file qkd-header.h.
Referenced by Deserialize(), GetMessageId(), operator==(), Print(), QKDHeader(), Serialize(), and SetMessageId().
|
private |
message offset field used with fragmentation
Definition at line 269 of file qkd-header.h.
|
private |
reserved field for further use
Definition at line 276 of file qkd-header.h.
Referenced by Deserialize(), Print(), QKDHeader(), and Serialize().
|
private |
Is QKD Header valid or corrupted.
Definition at line 283 of file qkd-header.h.
Referenced by Deserialize().
|
private |
flags and version field
Definition at line 275 of file qkd-header.h.
Referenced by Deserialize(), GetVersion(), Print(), QKDHeader(), Serialize(), and SetVersion().
|
private |
is payload zipped or not
Definition at line 274 of file qkd-header.h.
Referenced by Deserialize(), GetZipped(), Print(), QKDHeader(), Serialize(), and SetZipped().