NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndn-net-device-face.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_NET_DEVICE_FACE_H
21 #define NDN_NET_DEVICE_FACE_H
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 #include "ns3/ndnSIM/model/ndn-face.hpp"
25 
26 #include "ns3/net-device.h"
27 
28 namespace ns3 {
29 namespace ndn {
30 
45 class NetDeviceFace : public Face {
46 public:
54  NetDeviceFace(Ptr<Node> node, const Ptr<NetDevice>& netDevice);
55 
56  virtual ~NetDeviceFace();
57 
58 public: // from nfd::Face
59  virtual void
60  sendInterest(const Interest& interest);
61 
62  virtual void
63  sendData(const Data& data);
64 
65  virtual void
66  close();
67 
68 public:
74  Ptr<NetDevice>
75  GetNetDevice() const;
76 
77 private:
78  void
79  send(Ptr<Packet> packet);
80 
82  void
83  receiveFromNetDevice(Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t protocol,
84  const Address& from, const Address& to, NetDevice::PacketType packetType);
85 
86 private:
87  Ptr<Node> m_node;
88  Ptr<NetDevice> m_netDevice;
89 };
90 
91 } // namespace ndn
92 } // namespace ns3
93 
94 #endif // NDN_NET_DEVICE_FACE_H
virtual void close()
Close the face.
Ptr< NetDevice > GetNetDevice() const
Get NetDevice associated with the face.
Implementation of layer-2 (Ethernet) Ndn face.
represents a face
Definition: face.hpp:59
NetDeviceFace(Ptr< Node > node, const Ptr< NetDevice > &netDevice)
Constructor.
virtual void sendData(const Data &data)
virtual void sendInterest(const Interest &interest)