NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-l3-protocol.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_L3_PROTOCOL_H
21 #define NDN_L3_PROTOCOL_H
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 #include "ns3/ndnSIM/model/ndn-face.hpp"
25 
26 #include <list>
27 #include <vector>
28 
29 #include "ns3/ptr.h"
30 #include "ns3/net-device.h"
31 #include "ns3/nstime.h"
32 #include "ns3/traced-callback.h"
33 
34 #include <boost/property_tree/ptree_fwd.hpp>
35 
36 namespace nfd {
37 class Forwarder;
38 class FibManager;
40 typedef boost::property_tree::ptree ConfigSection;
41 namespace pit {
42 class Entry;
43 } // namespace pit
44 } // namespace nfd
45 
46 namespace ns3 {
47 
48 class Packet;
49 class Node;
50 class Header;
51 
52 namespace ndn {
53 
75 class L3Protocol : boost::noncopyable, public Object {
76 public:
82  static TypeId
83  GetTypeId();
84 
85  static const uint16_t ETHERNET_FRAME_TYPE;
86  static const uint16_t IP_STACK_PORT;
87  // static const uint16_t IP_PROTOCOL_TYPE; ///< \brief IP protocol type of NDN
88 
92  L3Protocol();
93 
94  virtual ~L3Protocol();
95 
99  shared_ptr<nfd::Forwarder>
100  getForwarder();
101 
105  shared_ptr<nfd::FibManager>
106  getFibManager();
107 
111  shared_ptr<nfd::StrategyChoiceManager>
112  getStrategyChoiceManager();
113 
123  addFace(shared_ptr<Face> face);
124 
130  shared_ptr<Face>
131  getFaceById(nfd::FaceId face) const;
132 
133  // /**
134  // * \brief Remove face from ndn stack (remove callbacks)
135  // */
136  // virtual void
137  // removeFace(shared_ptr<Face> face);
138 
142  shared_ptr<Face>
143  getFaceByNetDevice(Ptr<NetDevice> netDevice) const;
144 
149  getConfig();
150 
151 public: // Workaround for python bindings
152  static Ptr<L3Protocol>
153  getL3Protocol(Ptr<Object> node);
154 
155 public:
156  typedef void (*InterestTraceCallback)(const Interest&, const Face&);
157  typedef void (*DataTraceCallback)(const Data&, const Face&);
158 
159  typedef void (*SatisfiedInterestsCallback)(const nfd::pit::Entry& pitEntry, const Face& inFace, const Data& data);
160  typedef void (*TimedOutInterestsCallback)(const nfd::pit::Entry& pitEntry);
161 
162 protected:
163  virtual void
164  DoDispose(void);
165 
172  virtual void
173  NotifyNewAggregate();
174 
175 private:
176  void
177  initialize();
178 
179  void
180  initializeManagement();
181 
182  void
183  initializeRibManager();
184 
185 private:
186  class Impl;
187  std::unique_ptr<Impl> m_impl;
188 
189  // These objects are aggregated, but for optimization, get them here
190  Ptr<Node> m_node;
191 
192  TracedCallback<const Interest&, const Face&>
193  m_inInterests;
194  TracedCallback<const Interest&, const Face&>
195  m_outInterests;
196 
197  TracedCallback<const Data&, const Face&> m_outData;
198  TracedCallback<const Data&, const Face&> m_inData;
199 
200  TracedCallback<const nfd::pit::Entry&, const Face&/*in face*/, const Data&> m_satisfiedInterests;
201  TracedCallback<const nfd::pit::Entry&> m_timedOutInterests;
202 };
203 
204 } // namespace ndn
205 } // namespace ns3
206 
207 #endif /* NDN_L3_PROTOCOL_H */
static const uint16_t IP_STACK_PORT
TCP/UDP port for NDN stack.
Copyright (c) 2011-2015 Regents of the University of California.
static const uint16_t ETHERNET_FRAME_TYPE
Ethernet Frame Type of Ndn.
FibManager
Definition: fib-manager.cpp:38
represents a face
Definition: face.hpp:57
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
represents a PIT entry
Definition: pit-entry.hpp:67
Copyright (c) 2011-2015 Regents of the University of California.
boost::property_tree::ptree ConfigSection
ndn L3Protocol
Copyright (c) 2011-2015 Regents of the University of California.
Forwarder
Definition: forwarder.cpp:38
Implementation network-layer of NDN stack.
int FaceId
Definition: face.hpp:40