A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
qkd-app-header.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2020 DOTFEESA www.tk.etf.unsa.ba
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Miralem Mehic <miralem.mehic@ieee.org>,
19
* Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
20
* Oliver Mauhart <oliver.maurhart@ait.ac.at>
21
*/
22
23
#ifndef QKD_APP_HEADER_H
24
#define QKD_APP_HEADER_H
25
26
#include <queue>
27
#include <string>
28
#include "ns3/packet.h"
29
#include "ns3/header.h"
30
#include "ns3/object.h"
31
32
namespace
ns3
{
33
70
class
QKDAppHeader
:
public
Header
71
{
72
public
:
73
77
QKDAppHeader
();
78
83
static
TypeId
GetTypeId
();
88
TypeId
GetInstanceTypeId
()
const
;
89
94
void
Print
(std::ostream &os)
const
;
95
101
bool
operator==
(
QKDAppHeader
const
& o)
const
;
102
107
uint32_t
GetSerializedSize
()
const
;
108
113
void
Serialize
(
Buffer::Iterator
start
)
const
;
114
119
uint32_t
Deserialize
(
Buffer::Iterator
start
);
120
125
void
SetLength
(uint32_t value);
126
131
uint32_t
GetLength
(
void
)
const
;
132
137
void
SetMessageId
(uint32_t value);
138
143
uint32_t
GetMessageId
(
void
)
const
;
144
149
void
SetEncrypted
(uint32_t value);
150
155
uint32_t
GetEncrypted
(
void
)
const
;
156
161
void
SetAuthenticated
(uint32_t value);
162
167
uint32_t
GetAuthenticated
(
void
)
const
;
168
173
void
SetEncryptionKeyId
(std::string value);
174
179
std::string
GetEncryptionKeyId
(
void
)
const
;
180
185
void
SetAuthenticationKeyId
(std::string keyID);
186
191
std::string
GetAuthenticationKeyId
(
void
)
const
;
192
197
void
SetAuthTag
(std::string value);
198
203
std::string
GetAuthTag
(
void
)
const
;
204
209
bool
IsValid
()
const
210
{
211
return
m_valid
;
212
}
213
214
private
:
215
216
uint32_t
m_length
;
217
uint32_t
m_messageId
;
218
219
uint8_t
m_encryped
;
220
uint8_t
m_authenticated
;
221
222
std::string
m_encryptionKeyId
;
223
std::string
m_authenticationKeyId
;
224
std::string
m_authTag
;
225
226
bool
m_valid
;
227
228
};
229
230
231
}
232
// namespace ns3
233
234
#endif
/* QKD_APP_HEADER_H */
235
236
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:99
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:43
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::QKDAppHeader
QKD app packet header that carries info about used encryption, auth tag and other.
Definition:
qkd-app-header.h:71
ns3::QKDAppHeader::m_valid
bool m_valid
Is the header valid or corrupted?
Definition:
qkd-app-header.h:226
ns3::QKDAppHeader::operator==
bool operator==(QKDAppHeader const &o) const
Compare the two QKDApp packets.
Definition:
qkd-app-header.cc:148
ns3::QKDAppHeader::QKDAppHeader
QKDAppHeader()
Constructor.
Definition:
qkd-app-header.cc:33
ns3::QKDAppHeader::GetEncryptionKeyId
std::string GetEncryptionKeyId(void) const
Read the encryption key identifier.
Definition:
qkd-app-header.cc:202
ns3::QKDAppHeader::GetAuthTag
std::string GetAuthTag(void) const
Read the authentication tag.
Definition:
qkd-app-header.cc:238
ns3::QKDAppHeader::m_messageId
uint32_t m_messageId
The message identifier field.
Definition:
qkd-app-header.h:217
ns3::QKDAppHeader::GetSerializedSize
uint32_t GetSerializedSize() const
Get the serialized size of a packet.
Definition:
qkd-app-header.cc:58
ns3::QKDAppHeader::m_authTag
std::string m_authTag
The authentication tag field.
Definition:
qkd-app-header.h:224
ns3::QKDAppHeader::m_length
uint32_t m_length
The message length field.
Definition:
qkd-app-header.h:216
ns3::QKDAppHeader::m_authenticated
uint8_t m_authenticated
The authentication flag.
Definition:
qkd-app-header.h:220
ns3::QKDAppHeader::SetMessageId
void SetMessageId(uint32_t value)
Set message identifier.
Definition:
qkd-app-header.cc:175
ns3::QKDAppHeader::SetEncryptionKeyId
void SetEncryptionKeyId(std::string value)
Set the encryption key identifier.
Definition:
qkd-app-header.cc:188
ns3::QKDAppHeader::m_encryped
uint8_t m_encryped
The encryption flag.
Definition:
qkd-app-header.h:219
ns3::QKDAppHeader::SetEncrypted
void SetEncrypted(uint32_t value)
Set the encrypted field.
Definition:
qkd-app-header.cc:245
ns3::QKDAppHeader::GetLength
uint32_t GetLength(void) const
Get message length.
Definition:
qkd-app-header.cc:168
ns3::QKDAppHeader::SetLength
void SetLength(uint32_t value)
Set the message length.
Definition:
qkd-app-header.cc:162
ns3::QKDAppHeader::IsValid
bool IsValid() const
Check that type is valid.
Definition:
qkd-app-header.h:209
ns3::QKDAppHeader::SetAuthenticated
void SetAuthenticated(uint32_t value)
Set the authentication field.
Definition:
qkd-app-header.cc:258
ns3::QKDAppHeader::GetAuthenticated
uint32_t GetAuthenticated(void) const
Read the authentication field.
Definition:
qkd-app-header.cc:264
ns3::QKDAppHeader::SetAuthTag
void SetAuthTag(std::string value)
Set the authentication tag.
Definition:
qkd-app-header.cc:231
ns3::QKDAppHeader::GetAuthenticationKeyId
std::string GetAuthenticationKeyId(void) const
Read the authentication key identifier.
Definition:
qkd-app-header.cc:224
ns3::QKDAppHeader::GetMessageId
uint32_t GetMessageId(void) const
Get message identifier.
Definition:
qkd-app-header.cc:181
ns3::QKDAppHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const
Get the type ID.
Definition:
qkd-app-header.cc:52
ns3::QKDAppHeader::m_authenticationKeyId
std::string m_authenticationKeyId
The authentication key identifier field.
Definition:
qkd-app-header.h:223
ns3::QKDAppHeader::Print
void Print(std::ostream &os) const
Print the QKDApp packet.
Definition:
qkd-app-header.cc:131
ns3::QKDAppHeader::SetAuthenticationKeyId
void SetAuthenticationKeyId(std::string keyID)
Set the authentication key identifier.
Definition:
qkd-app-header.cc:210
ns3::QKDAppHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
qkd-app-header.cc:42
ns3::QKDAppHeader::GetEncrypted
uint32_t GetEncrypted(void) const
Read the encrypted field.
Definition:
qkd-app-header.cc:251
ns3::QKDAppHeader::m_encryptionKeyId
std::string m_encryptionKeyId
The encryption key identifier field.
Definition:
qkd-app-header.h:222
ns3::QKDAppHeader::Serialize
void Serialize(Buffer::Iterator start) const
Serialize the packet.
Definition:
qkd-app-header.cc:66
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
visualizer.core.start
def start()
Definition:
core.py:1853
src
applications
model
qkd-app-header.h
Generated on Tue Feb 6 2024 19:21:15 for ns-3 by
1.9.1