NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-net-device-link-service.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_NET_DEVICE_LINK_SERVICE_HPP
21 #define NDN_NET_DEVICE_LINK_SERVICE_HPP
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 #include "ns3/ndnSIM/NFD/daemon/face/link-service.hpp"
25 
26 #include "ns3/net-device.h"
27 
28 namespace ns3 {
29 namespace ndn {
30 
42 {
43 
44 public:
51  NetDeviceLinkService(Ptr<Node> node, const Ptr<NetDevice>& netDevice);
52 
53  virtual
55 
56 public:
60  Ptr<Node>
61  GetNode() const;
62 
66  Ptr<NetDevice>
67  GetNetDevice() const;
68 
69 private:
70  virtual void
71  doSendInterest(const ::ndn::Interest& interest) override;
72 
73  virtual void
74  doSendData(const ::ndn::Data& data) override;
75 
76  virtual void
77  doSendNack(const ::ndn::lp::Nack& nack) override;
78 
79  virtual void
80  doReceivePacket(nfd::face::Transport::Packet&& packet) override
81  {
82  // not used now
83  BOOST_ASSERT(false);
84  }
85 
86 private:
87  void
88  send(Ptr<Packet> packet);
89 
91  void
92  receiveFromNetDevice(Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t protocol,
93  const Address& from, const Address& to, NetDevice::PacketType packetType);
94 
95 private:
96  Ptr<Node> m_node;
97  Ptr<NetDevice> m_netDevice;
98 };
99 
100 } // namespace ndn
101 } // namespace ns3
102 
103 #endif // NDN_NET_DEVICE_LINK_SERVICE_HPP
Implementation of layer-2 (Ethernet) LinkService (current hack, to be changed eventually) ...
Copyright (c) 2011-2015 Regents of the University of California.
the upper part of a Face
stores a packet along with the remote endpoint
Definition: transport.hpp:113
Ptr< NetDevice > GetNetDevice() const
Get NetDevice associated with the LinkService.
Copyright (c) 2011-2015 Regents of the University of California.
Ptr< Node > GetNode() const
Get Node associated with the LinkService.
NetDeviceLinkService(Ptr< Node > node, const Ptr< NetDevice > &netDevice)
Constructor.