NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-fib-helper.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_FIB_HELPER_H
21 #define NDN_FIB_HELPER_H
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 #include "ns3/ndnSIM/model/ndn-face.hpp"
25 
26 #include "ns3/node.h"
27 #include "ns3/object-vector.h"
28 #include "ns3/pointer.h"
29 
30 #include <ndn-cxx/management/nfd-control-parameters.hpp>
31 
32 namespace ns3 {
33 namespace ndn {
34 
36 
45 class FibHelper {
46 public:
55  static void
56  AddRoute(Ptr<Node> node, const Name& prefix, shared_ptr<Face> face, int32_t metric);
57 
66  static void
67  AddRoute(const std::string& nodeName, const Name& prefix, uint32_t faceId, int32_t metric);
68 
77  static void
78  AddRoute(Ptr<Node> node, const Name& prefix, uint32_t faceId, int32_t metric);
79 
88  static void
89  AddRoute(Ptr<Node> node, const Name& prefix, Ptr<Node> otherNode, int32_t metric);
90 
100  static void
101  AddRoute(const std::string& nodeName, const Name& prefix, const std::string& otherNodeName,
102  int32_t metric);
103 
111  static void
112  RemoveRoute(Ptr<Node> node, const Name& prefix, shared_ptr<Face> face);
113 
121  static void
122  RemoveRoute(Ptr<Node> node, const Name& prefix, uint32_t faceId);
123 
131  static void
132  RemoveRoute(const std::string& nodeName, const Name& prefix, uint32_t faceId);
133 
141  static void
142  RemoveRoute(Ptr<Node> node, const Name& prefix, Ptr<Node> otherNode);
143 
151  static void
152  RemoveRoute(const std::string& nodeName, const Name& prefix, const std::string& otherNodeName);
153 
154 private:
155  static void
156  GenerateCommand(Interest& interest);
157 
158  static void
159  AddNextHop(const ControlParameters& parameters, Ptr<Node> node);
160 
161  static void
162  RemoveNextHop(const ControlParameters& parameters, Ptr<Node> node);
163 };
164 
165 } // namespace ndn
166 
167 } // namespace ns3
168 
169 #endif // NDN_FIB_HELPER_H
Copyright (c) 2011-2015 Regents of the University of California.
static void AddRoute(Ptr< Node > node, const Name &prefix, shared_ptr< Face > face, int32_t metric)
Add forwarding entry to FIB.
Copyright (c) 2011-2015 Regents of the University of California.
Forwarding Information Base (FIB) helper.
static void RemoveRoute(Ptr< Node > node, const Name &prefix, shared_ptr< Face > face)
remove forwarding entry in FIB