Alexander Afanasyev | c74a602 | 2011-08-15 20:01:35 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2011 UCLA |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
Ilya Moiseenko | 25f7d4d | 2011-09-29 18:41:06 -0700 | [diff] [blame] | 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 19 | * Ilya Moiseenko <iliamo@cs.ucla.edu> |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 22 | #ifndef NDN_STACK_HELPER_H |
| 23 | #define NDN_STACK_HELPER_H |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 24 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 25 | #include "ns3/packet.h" |
| 26 | #include "ns3/ptr.h" |
| 27 | #include "ns3/object-factory.h" |
Alexander Afanasyev | c39f0b4 | 2011-11-28 12:51:12 -0800 | [diff] [blame] | 28 | #include "ns3/nstime.h" |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 29 | |
| 30 | namespace ns3 { |
| 31 | |
| 32 | class Node; |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 33 | |
| 34 | namespace ndn { |
| 35 | |
| 36 | class FaceContainer; |
| 37 | class Face; |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 38 | |
| 39 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 40 | * \ingroup ndn |
| 41 | * \defgroup ndn-helpers Helpers |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 42 | */ |
| 43 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 44 | * \ingroup ndn-helpers |
| 45 | * \brief Adding Ndn functionality to existing Nodes. |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 46 | * |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 47 | * This helper enables pcap and ascii tracing of events in the ndn stack |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 48 | * associated with a node. This is substantially similar to the tracing that |
| 49 | * happens in device helpers, but the important difference is that, well, there |
| 50 | * is no device. This means that the creation of output file names will change, |
| 51 | * and also the user-visible methods will not reference devices and therefore |
| 52 | * the number of trace enable methods is reduced. |
| 53 | * |
| 54 | * Normally we eschew multiple inheritance, however, the classes |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 55 | * PcapUserHelperForNdn and AsciiTraceUserHelperForNdn are treated as |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 56 | * "mixins". A mixin is a self-contained class that encapsulates a general |
| 57 | * attribute or a set of functionality that may be of interest to many other |
| 58 | * classes. |
| 59 | */ |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 60 | class StackHelper |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 61 | { |
| 62 | public: |
| 63 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 64 | * \brief Create a new NdnStackHelper with a default NDN_FLOODING forwarding stategy |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 65 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 66 | StackHelper(); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 67 | |
Ilya Moiseenko | 25f7d4d | 2011-09-29 18:41:06 -0700 | [diff] [blame] | 68 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 69 | * \brief Destroy the NdnStackHelper |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 70 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 71 | virtual ~StackHelper (); |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 72 | |
| 73 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 74 | * @brief Set parameters of NdnL3Protocol |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 75 | */ |
| 76 | void |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 77 | SetStackAttributes (const std::string &attr1 = "", const std::string &value1 = "", |
| 78 | const std::string &attr2 = "", const std::string &value2 = "", |
| 79 | const std::string &attr3 = "", const std::string &value3 = "", |
| 80 | const std::string &attr4 = "", const std::string &value4 = ""); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 81 | |
| 82 | |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 83 | /** |
| 84 | * @brief Set forwarding strategy class and its attributes |
| 85 | * @param forwardingStrategyClass string containing name of the forwarding strategy class |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 86 | * |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 87 | * Valid options are "ns3::NdnFloodingStrategy" (default) and "ns3::NdnBestRouteStrategy" |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 88 | * |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 89 | * Other strategies can be implemented, inheriting ns3::NdnForwardingStrategy class |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 90 | */ |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 91 | void |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 92 | SetForwardingStrategy (const std::string &forwardingStrategyClass, |
| 93 | const std::string &attr1 = "", const std::string &value1 = "", |
| 94 | const std::string &attr2 = "", const std::string &value2 = "", |
| 95 | const std::string &attr3 = "", const std::string &value3 = "", |
| 96 | const std::string &attr4 = "", const std::string &value4 = ""); |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 97 | |
| 98 | /** |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 99 | * @brief Set content store class and its attributes |
| 100 | * @param contentStoreClass string, representing class of the content store |
Alexander Afanasyev | d9fecdd | 2012-06-08 16:22:24 -0700 | [diff] [blame] | 101 | */ |
| 102 | void |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 103 | SetContentStore (const std::string &contentStoreClass, |
| 104 | const std::string &attr1 = "", const std::string &value1 = "", |
| 105 | const std::string &attr2 = "", const std::string &value2 = "", |
| 106 | const std::string &attr3 = "", const std::string &value3 = "", |
| 107 | const std::string &attr4 = "", const std::string &value4 = ""); |
| 108 | |
| 109 | /** |
| 110 | * @brief Set PIT class and its attributes |
| 111 | * @param pitClass string, representing class of PIT |
| 112 | */ |
| 113 | void |
| 114 | SetPit (const std::string &pitClass, |
| 115 | const std::string &attr1 = "", const std::string &value1 = "", |
| 116 | const std::string &attr2 = "", const std::string &value2 = "", |
| 117 | const std::string &attr3 = "", const std::string &value3 = "", |
| 118 | const std::string &attr4 = "", const std::string &value4 = ""); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 119 | |
Alexander Afanasyev | d9fecdd | 2012-06-08 16:22:24 -0700 | [diff] [blame] | 120 | /** |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 121 | * @brief Set FIB class and its attributes |
| 122 | * @param pitClass string, representing class of FIB |
| 123 | */ |
| 124 | void |
| 125 | SetFib (const std::string &fibClass, |
| 126 | const std::string &attr1 = "", const std::string &value1 = "", |
| 127 | const std::string &attr2 = "", const std::string &value2 = "", |
| 128 | const std::string &attr3 = "", const std::string &value3 = "", |
| 129 | const std::string &attr4 = "", const std::string &value4 = ""); |
| 130 | |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 131 | typedef Callback< Ptr<NetDeviceFace>, Ptr<Node>, Ptr<NetDevice> > NetDeviceFaceCreateCallback; |
| 132 | |
| 133 | /** |
| 134 | * @brief Add callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice> |
| 135 | * |
| 136 | * It is possible to set up several callbacks for different NetDevice types. |
| 137 | * |
| 138 | * Currently, there is only one specialized callback for PointToPointNetDevice, which creates face and sets limits (if enabled) |
| 139 | * based on PointToPoint link parameters |
| 140 | * |
| 141 | * If none of the callbacks fit the TypeId of NetDevice, a default callback is used (DefaultNetDeviceCallback) |
| 142 | */ |
| 143 | void |
| 144 | AddNetDeviceFaceCreateCallback (TypeId netDeviceType, NetDeviceFaceCreateCallback callback); |
| 145 | |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 146 | /** |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 147 | * @brief Enable Interest limits (disabled by default) |
Alexander Afanasyev | c39f0b4 | 2011-11-28 12:51:12 -0800 | [diff] [blame] | 148 | * |
| 149 | * @param enable Enable or disable limits |
| 150 | * @param avgRtt Average RTT |
| 151 | * @param avgContentObject Average size of contentObject packets (including all headers) |
| 152 | * @param avgInterest Average size of interest packets (including all headers) |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 153 | */ |
| 154 | void |
Alexander Afanasyev | c39f0b4 | 2011-11-28 12:51:12 -0800 | [diff] [blame] | 155 | EnableLimits (bool enable = true, Time avgRtt=Seconds(0.1), uint32_t avgContentObject=1100, uint32_t avgInterest=40); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 156 | |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 157 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 158 | * \brief Install Ndn stack on the node |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 159 | * |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 160 | * This method will assert if called on a node that already has Ndn object |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 161 | * installed on it |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 162 | * |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 163 | * \param nodeName The name of the node on which to install the stack. |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 164 | * |
| 165 | * \returns list of installed faces in the form of a smart pointer |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 166 | * to NdnFaceContainer object |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 167 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 168 | Ptr<FaceContainer> |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 169 | Install (const std::string &nodeName) const; |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 170 | |
| 171 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 172 | * \brief Install Ndn stack on the node |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 173 | * |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 174 | * This method will assert if called on a node that already has Ndn object |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 175 | * installed on it |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 176 | * |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 177 | * \param node The node on which to install the stack. |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 178 | * |
| 179 | * \returns list of installed faces in the form of a smart pointer |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 180 | * to FaceContainer object |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 181 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 182 | Ptr<FaceContainer> |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 183 | Install (Ptr<Node> node) const; |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 184 | |
| 185 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 186 | * \brief Install Ndn stack on each node in the input container |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 187 | * |
| 188 | * The program will assert if this method is called on a container with a node |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 189 | * that already has an ndn object aggregated to it. |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 190 | * |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 191 | * \param c NodeContainer that holds the set of nodes on which to install the |
| 192 | * new stacks. |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 193 | * |
| 194 | * \returns list of installed faces in the form of a smart pointer |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 195 | * to FaceContainer object |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 196 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 197 | Ptr<FaceContainer> |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 198 | Install (const NodeContainer &c) const; |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 199 | |
| 200 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 201 | * \brief Install Ndn stack on all nodes in the simulation |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 202 | * |
| 203 | * \returns list of installed faces in the form of a smart pointer |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 204 | * to FaceContainer object |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 205 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 206 | Ptr<FaceContainer> |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 207 | InstallAll () const; |
| 208 | |
| 209 | /** |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 210 | * \brief Add forwarding entry to FIB |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 211 | * |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 212 | * \param nodeName Node name |
| 213 | * \param prefix Routing prefix |
| 214 | * \param faceId Face index |
| 215 | * \param metric Routing metric |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 216 | */ |
Alexander Afanasyev | b762684 | 2012-01-12 13:43:33 -0800 | [diff] [blame] | 217 | static void |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 218 | AddRoute (const std::string &nodeName, const std::string &prefix, uint32_t faceId, int32_t metric); |
Alexander Afanasyev | 52e9aa9 | 2011-11-15 20:23:20 -0800 | [diff] [blame] | 219 | |
| 220 | /** |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 221 | * \brief Add forwarding entry to FIB |
Alexander Afanasyev | 52e9aa9 | 2011-11-15 20:23:20 -0800 | [diff] [blame] | 222 | * |
Alexander Afanasyev | 8bedcaf | 2012-07-20 15:30:44 -0700 | [diff] [blame] | 223 | * \param nodeName Node |
| 224 | * \param prefix Routing prefix |
| 225 | * \param faceId Face index |
| 226 | * \param metric Routing metric |
| 227 | */ |
| 228 | static void |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 229 | AddRoute (Ptr<Node> node, const std::string &prefix, uint32_t faceId, int32_t metric); |
Alexander Afanasyev | 8bedcaf | 2012-07-20 15:30:44 -0700 | [diff] [blame] | 230 | |
| 231 | /** |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 232 | * \brief Add forwarding entry to FIB |
Alexander Afanasyev | 8bedcaf | 2012-07-20 15:30:44 -0700 | [diff] [blame] | 233 | * |
Alexander Afanasyev | 52e9aa9 | 2011-11-15 20:23:20 -0800 | [diff] [blame] | 234 | * \param node Node |
| 235 | * \param prefix Routing prefix |
| 236 | * \param face Face |
| 237 | * \param metric Routing metric |
| 238 | */ |
Alexander Afanasyev | b762684 | 2012-01-12 13:43:33 -0800 | [diff] [blame] | 239 | static void |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 240 | AddRoute (Ptr<Node> node, const std::string &prefix, Ptr<Face> face, int32_t metric); |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 241 | |
| 242 | /** |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 243 | * @brief Add forwarding entry to FIB (work only with point-to-point links) |
| 244 | * |
| 245 | * \param node Node |
| 246 | * \param prefix Routing prefix |
| 247 | * \param otherNode The other node, to which interests (will be used to infer face id |
| 248 | * \param metric Routing metric |
| 249 | */ |
| 250 | static void |
| 251 | AddRoute (Ptr<Node> node, const std::string &prefix, Ptr<Node> otherNode, int32_t metric); |
| 252 | |
| 253 | /** |
| 254 | * @brief Add forwarding entry to FIB (work only with point-to-point links) |
| 255 | * |
| 256 | * \param nodeName Node name (refer to ns3::Names) |
| 257 | * \param prefix Routing prefix |
| 258 | * \param otherNode The other node name, to which interests (will be used to infer face id (refer to ns3::Names) |
| 259 | * \param metric Routing metric |
| 260 | */ |
| 261 | static void |
| 262 | AddRoute (const std::string &nodeName, const std::string &prefix, const std::string &otherNodeName, int32_t metric); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 263 | |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 264 | /** |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 265 | * \brief Set flag indicating necessity to install default routes in FIB |
| 266 | */ |
| 267 | void |
| 268 | SetDefaultRoutes (bool needSet); |
Alexander Afanasyev | 52e9aa9 | 2011-11-15 20:23:20 -0800 | [diff] [blame] | 269 | |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 270 | private: |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 271 | Ptr<NetDeviceFace> |
| 272 | DefaultNetDeviceCallback (Ptr<Node> node, Ptr<NetDevice> netDevice) const; |
| 273 | |
| 274 | Ptr<NetDeviceFace> |
| 275 | PointToPointNetDeviceCallback (Ptr<Node> node, Ptr<NetDevice> netDevice) const; |
| 276 | |
| 277 | private: |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 278 | StackHelper (const StackHelper &); |
| 279 | StackHelper &operator = (const StackHelper &o); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 280 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 281 | private: |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 282 | ObjectFactory m_ndnFactory; |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 283 | ObjectFactory m_strategyFactory; |
Alexander Afanasyev | d9fecdd | 2012-06-08 16:22:24 -0700 | [diff] [blame] | 284 | ObjectFactory m_contentStoreFactory; |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 285 | ObjectFactory m_pitFactory; |
| 286 | ObjectFactory m_fibFactory; |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 287 | |
Alexander Afanasyev | fd25826 | 2012-11-23 14:59:19 -0800 | [diff] [blame] | 288 | bool m_limitsEnabled; |
Alexander Afanasyev | c39f0b4 | 2011-11-28 12:51:12 -0800 | [diff] [blame] | 289 | Time m_avgRtt; |
| 290 | uint32_t m_avgContentObjectSize; |
| 291 | uint32_t m_avgInterestSize; |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 292 | bool m_needSetDefaultRoutes; |
| 293 | |
| 294 | std::list< std::pair<TypeId, NetDeviceFaceCreateCallback> > m_netDeviceCallbacks; |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 295 | }; |
| 296 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 297 | } // namespace ndn |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 298 | } // namespace ns3 |
| 299 | |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 300 | #endif /* NDN_STACK_HELPER_H */ |