30 #include "ns3/packet.h"
31 #include "ns3/object.h"
32 #include "ns3/callback.h"
33 #include "ns3/assert.h"
35 #include "ns3/simulator.h"
37 #include "ns3/nstime.h"
38 #include "ns3/traced-callback.h"
39 #include "ns3/random-variable-stream.h"
40 #include "ns3/deprecated.h"
105 QKDKey (std::string keyId, uint64_t keyIdnum, uint64_t keySize);
113 QKDKey (std::string keyId, uint64_t keyIdnum, std::string key);
120 QKDKey (std::string keyId, std::string key);
126 std::string
GetId (
void)
const;
132 void SetId (std::string value);
177 void SetSize(uint64_t sizeInBytes);
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
The QKD key is an elementary class of QKDNetSim.
void MarkUsed()
Mark the key as used.
std::string GenerateRandomString(const int len)
Get a random string.
void SetId(std::string value)
Set the key identifier.
Time GetKeyTimestamp()
Get the key timestamp.
std::string GetId(void) const
Get the key identifier.
std::string GetKeyString(void)
Get QKD key value.
std::string GetKeyBinary()
Get key value in bit notation.
void MarkReady()
Mark the key as ready.
QKDKeyState_e
The QKD key states.
std::string ConsumeKeyString(void)
Get the key value and switch the key state to SERVED.
uint8_t * GetKey(void)
Get key value in byte* format.
QKDKeyState_e m_state
The key state.
uint64_t GetSizeInBits(void) const
Get the key size in bits.
void MarkRestored()
Mark the key as restored.
ns3::TracedCallback< const std::string &, const std::string & > m_stateTransitionTrace
The StateTransition trace source.
void SetSize(uint64_t sizeInBytes)
Set the key size.
void MarkServed()
Mark the key as served.
std::string GetStateString() const
Get the current state of the key in a string format.
Ptr< UniformRandomVariable > m_random
void SwitchToState(QKDKeyState_e state)
Change the state of the key.
void MarkReserved()
Mark the key as reserved.
static TypeId GetTypeId(void)
Get the TypeId.
Ptr< QKDKey > Copy(void) const
Copy the key.
QKDKey(uint64_t keySize)
Constructor.
std::string ToString(void)
Get the key value.
QKDKeyState_e GetState() const
Get the current state of the key.
uint64_t GetSize(void) const
Get the key size in bytes.
void MarkTransformed()
Mark the key as transformed.
static uint64_t m_globalUid
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.