17#include "ns3/net-device.h"
19#include "ns3/traced-callback.h"
20#include "ns3/type-id.h"
22#include "ns3/q2ns-types.h"
97 bool Send(std::shared_ptr<Qubit> q);
104 ns3::Ptr<ns3::Channel>
GetChannel()
const override;
110 void SetNode(ns3::Ptr<ns3::Node> node)
override;
116 ns3::Ptr<ns3::Node>
GetNode()
const override;
132 return ns3::Address();
148 return ns3::Address();
154 return ns3::Address();
157 return ns3::Address();
173 bool Send(ns3::Ptr<ns3::Packet>,
const ns3::Address&, std::uint16_t)
override {
176 bool SendFrom(ns3::Ptr<ns3::Packet>,
const ns3::Address&,
const ns3::Address&,
177 std::uint16_t)
override {
Minimal quantum net device that bridges a QChannel and a QNetworker.
ns3::Address GetBroadcast() const override
void SetPromiscReceiveCallback(PromiscReceiveCallback) override
void BindNetworker(QNetworker &networker)
Bind the owning networker.
ns3::Address GetMulticast(ns3::Ipv4Address) const override
QNetDevice()
Default constructor.
ns3::Ptr< ns3::Node > GetNode() const override
Get the owning ns-3 node.
bool Send(ns3::Ptr< ns3::Packet >, const ns3::Address &, std::uint16_t) override
void SetReceiveCallback(ReceiveCallback) override
bool IsLinkUp() const override
bool Send(std::shared_ptr< Qubit > q)
Send a qubit through the attached channel.
std::uint16_t GetMtu() const override
bool SupportsSendFrom() const override
std::uint32_t GetIfIndex() const override
Get the interface index assigned by the owning node.
ns3::Address GetAddress() const override
ns3::Ptr< ns3::Node > node_
Owning ns-3 node.
std::uint32_t ifIndex_
Interface index.
bool SendFrom(ns3::Ptr< ns3::Packet >, const ns3::Address &, const ns3::Address &, std::uint16_t) override
ns3::Address GetMulticast(ns3::Ipv6Address) const override
bool IsBridge() const override
bool SetMtu(std::uint16_t) override
void SetNode(ns3::Ptr< ns3::Node > node) override
Set the owning ns-3 node.
void SetIfIndex(std::uint32_t i) override
Set the interface index assigned by the owning node.
ns3::Ptr< QChannel > channel_
Attached quantum channel.
ns3::Ptr< ns3::Channel > GetChannel() const override
Return the attached channel.
QNetworker * networker_
Bound networker, not owned.
bool IsMulticast() const override
void SetAddress(ns3::Address) override
bool IsBroadcast() const override
bool IsPointToPoint() const override
void ReceiveFromChannel(std::shared_ptr< Qubit > q, const QMapInstance &map={})
Receive a qubit from the attached channel and forward it upward.
void AttachChannel(ns3::Ptr< QChannel > ch)
Attach this device to a quantum channel.
static ns3::TypeId GetTypeId(void)
Get the ns-3 TypeId.
bool NeedsArp() const override
void AddLinkChangeCallback(ns3::Callback< void >) override
Internal helper owned by QNode for node-local quantum networking.
std::function< void(QNode &, std::shared_ptr< Qubit > &)> QMapInstance
Per-transmission quantum map callable applied to a received qubit.