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 | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 2 | /* |
Ilya Moiseenko | 956d054 | 2012-01-02 15:26:40 -0800 | [diff] [blame] | 3 | * Copyright (c) 2011 University of California, Los Angeles |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 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 | * |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 18 | * Authors: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 19 | */ |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 20 | |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 21 | #ifndef NDN_FACE_H |
| 22 | #define NDN_FACE_H |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 23 | |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 24 | #include <ostream> |
Alexander Afanasyev | 19426ef | 2011-11-23 20:55:28 -0800 | [diff] [blame] | 25 | #include <algorithm> |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 26 | |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 27 | #include "ns3/ptr.h" |
Alexander Afanasyev | cf6dc92 | 2012-08-10 16:55:27 -0700 | [diff] [blame] | 28 | #include "ns3/object.h" |
Alexander Afanasyev | 19426ef | 2011-11-23 20:55:28 -0800 | [diff] [blame] | 29 | #include "ns3/nstime.h" |
Alexander Afanasyev | 7f3e49e | 2012-04-30 00:17:07 -0700 | [diff] [blame] | 30 | #include "ns3/type-id.h" |
Alexander Afanasyev | cf6dc92 | 2012-08-10 16:55:27 -0700 | [diff] [blame] | 31 | #include "ns3/traced-callback.h" |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 32 | |
| 33 | namespace ns3 { |
| 34 | |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 35 | class Packet; |
| 36 | class Node; |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 37 | |
| 38 | namespace ndn { |
| 39 | |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 40 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 41 | * \ingroup ndn |
| 42 | * \defgroup ndn-face Faces |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 43 | */ |
| 44 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 45 | * \ingroup ndn-face |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 46 | * \brief Virtual class defining NDN face |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 47 | * |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 48 | * This class defines basic functionality of NDN face. Face is core |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 49 | * component responsible for actual delivery of data packet to and |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 50 | * from NDN stack |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 51 | * |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 52 | * \see ndn::LocalFace, ndn::NetDeviceFace, ndn::Ipv4Face, ndn::UdpFace |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 53 | */ |
Alexander Afanasyev | cf6dc92 | 2012-08-10 16:55:27 -0700 | [diff] [blame] | 54 | class Face : |
| 55 | public Object |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 56 | { |
| 57 | public: |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 58 | static TypeId |
| 59 | GetTypeId (); |
| 60 | |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 61 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 62 | * \brief Ndn protocol handler |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 63 | * |
| 64 | * \param face Face from which packet has been received |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 65 | * \param packet Original packet |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 66 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 67 | typedef Callback<void,const Ptr<Face>&,const Ptr<const Packet>& > ProtocolHandler; |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 68 | |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 69 | /** |
| 70 | * \brief Default constructor |
| 71 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 72 | Face (Ptr<Node> node); |
| 73 | virtual ~Face(); |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 74 | |
Alexander Afanasyev | b4fee8b | 2012-06-06 12:54:26 -0700 | [diff] [blame] | 75 | /** |
| 76 | * @brief Get node to which this face is associated |
| 77 | */ |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 78 | Ptr<Node> |
| 79 | GetNode () const; |
| 80 | |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 81 | //////////////////////////////////////////////////////////////////// |
| 82 | |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 83 | /** |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 84 | * \brief Register callback to call when new packet arrives on the face |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 85 | * |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 86 | * This method should call protocol-dependent registration function |
| 87 | */ |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 88 | virtual void |
| 89 | RegisterProtocolHandler (ProtocolHandler handler); |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 90 | |
| 91 | /** |
Alexander Afanasyev | 19426ef | 2011-11-23 20:55:28 -0800 | [diff] [blame] | 92 | * @brief Check if Interest limit is reached |
| 93 | * |
| 94 | * Side effect: if limit is not yet reached, the number of outstanding packets will be increased |
| 95 | * |
| 96 | * @returns true if Interest limit is not yet reached |
| 97 | */ |
| 98 | bool |
| 99 | IsBelowLimit (); |
| 100 | |
| 101 | /** |
| 102 | * \brief Send packet on a face |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 103 | * |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 104 | * This method will be called by lower layers to send data to device or application |
| 105 | * |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 106 | * \param p smart pointer to a packet to send |
| 107 | * |
Alexander Afanasyev | 19426ef | 2011-11-23 20:55:28 -0800 | [diff] [blame] | 108 | * @return false if either limit is reached |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 109 | */ |
| 110 | bool |
Alexander Afanasyev | 19426ef | 2011-11-23 20:55:28 -0800 | [diff] [blame] | 111 | Send (Ptr<Packet> p); |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 112 | |
| 113 | /** |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 114 | * \brief Receive packet from application or another node and forward it to the Ndn stack |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 115 | * |
| 116 | * \todo The only reason for this call is to handle tracing, if requested |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 117 | */ |
Alexander Afanasyev | 19426ef | 2011-11-23 20:55:28 -0800 | [diff] [blame] | 118 | bool |
| 119 | Receive (const Ptr<const Packet> &p); |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 120 | //////////////////////////////////////////////////////////////////// |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 121 | |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 122 | /** |
| 123 | * \Brief Assign routing/forwarding metric with face |
| 124 | * |
| 125 | * \param metric configured routing metric (cost) of this face |
| 126 | */ |
| 127 | virtual void SetMetric (uint16_t metric); |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 128 | |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 129 | /** |
| 130 | * \brief Get routing/forwarding metric assigned to the face |
| 131 | * |
| 132 | * \returns configured routing/forwarding metric (cost) of this face |
| 133 | */ |
| 134 | virtual uint16_t GetMetric (void) const; |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 135 | |
| 136 | /** |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 137 | * These are face states and may be distinct from actual lower-layer |
| 138 | * device states, such as found in real implementations (where the |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 139 | * device may be down but ndn face state is still up). |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 140 | */ |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 141 | |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 142 | /** |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 143 | * \brief Enable or disable this face |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 144 | */ |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 145 | virtual void |
| 146 | SetUp (bool up = true); |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 147 | |
| 148 | /** |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 149 | * \brief Returns true if this face is enabled, false otherwise. |
| 150 | */ |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 151 | virtual bool |
| 152 | IsUp () const; |
Alexander Afanasyev | b4fee8b | 2012-06-06 12:54:26 -0700 | [diff] [blame] | 153 | |
| 154 | /** |
| 155 | * @brief Print information about the face into the stream |
| 156 | * @param os stream to write information to |
| 157 | */ |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 158 | virtual std::ostream& |
| 159 | Print (std::ostream &os) const; |
| 160 | |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 161 | /** |
| 162 | * \brief Set node Id |
| 163 | * |
| 164 | * Id is purely informative and should not be used for any other purpose |
| 165 | * |
| 166 | * \param id id to set |
| 167 | */ |
| 168 | inline void |
| 169 | SetId (uint32_t id); |
| 170 | |
| 171 | /** |
| 172 | * \brief Get node Id |
| 173 | * |
| 174 | * Id is purely informative and should not be used for any other purpose |
| 175 | * |
| 176 | * \returns id id to set |
| 177 | */ |
| 178 | inline uint32_t |
| 179 | GetId () const; |
| 180 | |
Alexander Afanasyev | 7fd74f9 | 2011-08-25 19:40:17 -0700 | [diff] [blame] | 181 | /** |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 182 | * @brief Set maximum value for Interest allowance |
| 183 | * |
| 184 | * @param bucket maximum value for Interest allowance. If < 0, then limit will be disabled |
| 185 | */ |
Alexander Afanasyev | c39f0b4 | 2011-11-28 12:51:12 -0800 | [diff] [blame] | 186 | void |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 187 | SetBucketMax (double bucket); |
| 188 | |
| 189 | /** |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 190 | * @brief Set a normalized value (one second) for Interest allowance bucket leak |
| 191 | */ |
Alexander Afanasyev | c39f0b4 | 2011-11-28 12:51:12 -0800 | [diff] [blame] | 192 | void |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 193 | SetBucketLeak (double leak); |
| 194 | |
| 195 | /** |
Alexander Afanasyev | 4975f73 | 2011-12-20 17:52:19 -0800 | [diff] [blame] | 196 | * @brief Leak the Interest allowance bucket by (1/interval) * m_bucketMax amount, |
| 197 | * where interval is time between two consecutive calls of LeakBucket |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 198 | */ |
Alexander Afanasyev | b5703a9 | 2011-11-25 16:46:15 -0800 | [diff] [blame] | 199 | void |
Alexander Afanasyev | 4975f73 | 2011-12-20 17:52:19 -0800 | [diff] [blame] | 200 | LeakBucket (); |
Alexander Afanasyev | 9d313d4 | 2011-11-25 13:36:15 -0800 | [diff] [blame] | 201 | |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 202 | /** |
Alexander Afanasyev | 7fd74f9 | 2011-08-25 19:40:17 -0700 | [diff] [blame] | 203 | * \brief Compare two faces. Only two faces on the same node could be compared. |
| 204 | * |
| 205 | * Internal index is used for comparison. |
| 206 | */ |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 207 | bool |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 208 | operator== (const Face &face) const; |
Alexander Afanasyev | 7fd74f9 | 2011-08-25 19:40:17 -0700 | [diff] [blame] | 209 | |
| 210 | /** |
| 211 | * \brief Compare two faces. Only two faces on the same node could be compared. |
| 212 | * |
| 213 | * Internal index is used for comparison. |
| 214 | */ |
Alexander Afanasyev | 0845c09 | 2012-07-13 17:45:33 -0700 | [diff] [blame] | 215 | inline bool |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 216 | operator!= (const Face &face) const; |
Alexander Afanasyev | 0845c09 | 2012-07-13 17:45:33 -0700 | [diff] [blame] | 217 | |
| 218 | /** |
| 219 | * \brief Compare two faces. Only two faces on the same node could be compared. |
| 220 | * |
| 221 | * Internal index is used for comparison. |
| 222 | */ |
Alexander Afanasyev | 7fd74f9 | 2011-08-25 19:40:17 -0700 | [diff] [blame] | 223 | bool |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 224 | operator< (const Face &face) const; |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 225 | |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 226 | protected: |
| 227 | /** |
| 228 | * \brief Send packet on a face (actual implementation) |
| 229 | * |
| 230 | * \param p smart pointer to a packet to send |
| 231 | */ |
Alexander Afanasyev | 1c0248b | 2012-07-24 15:59:50 -0700 | [diff] [blame] | 232 | virtual bool |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 233 | SendImpl (Ptr<Packet> p) = 0; |
| 234 | |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 235 | private: |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 236 | Face (const Face &); ///< \brief Disabled copy constructor |
| 237 | Face& operator= (const Face &); ///< \brief Disabled copy operator |
Alexander Afanasyev | ab1d560 | 2011-08-17 19:17:18 -0700 | [diff] [blame] | 238 | |
| 239 | protected: |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 240 | // uint16_t m_metric; ///< \brief Routing/forwarding metric |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 241 | Ptr<Node> m_node; ///< \brief Smart pointer to Node |
Alexander Afanasyev | a46844b | 2011-11-21 19:13:26 -0800 | [diff] [blame] | 242 | |
Alexander Afanasyev | 09c7deb | 2011-11-23 14:50:10 -0800 | [diff] [blame] | 243 | double m_bucket; ///< \brief Value representing current size of the Interest allowance for this face |
| 244 | double m_bucketMax; ///< \brief Maximum Interest allowance for this face |
| 245 | double m_bucketLeak; ///< \brief Normalized amount that should be leaked every second |
| 246 | |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 247 | private: |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 248 | ProtocolHandler m_protocolHandler; ///< Callback via which packets are getting send to Ndn stack |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 249 | bool m_ifup; ///< \brief flag indicating that the interface is UP |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 250 | uint32_t m_id; ///< \brief id of the interface in Ndn stack (per-node uniqueness) |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 251 | Time m_lastLeakTime; |
| 252 | uint32_t m_metric; ///< \brief metric of the face |
Alexander Afanasyev | 98d85e1 | 2012-08-09 10:06:05 -0700 | [diff] [blame] | 253 | bool m_randomizeLimitChecking; |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 254 | |
Alexander Afanasyev | 30c33e3 | 2012-06-05 21:28:44 -0700 | [diff] [blame] | 255 | // bool m_enableMetricTagging; |
| 256 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 257 | TracedCallback<Ptr<const Packet> > m_txTrace; |
| 258 | TracedCallback<Ptr<const Packet> > m_rxTrace; |
| 259 | TracedCallback<Ptr<const Packet> > m_dropTrace; |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 260 | }; |
| 261 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 262 | std::ostream& operator<< (std::ostream& os, const Face &face); |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 263 | |
Alexander Afanasyev | 78cf0c9 | 2011-09-01 19:57:14 -0700 | [diff] [blame] | 264 | inline bool |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 265 | operator < (const Ptr<Face> &lhs, const Ptr<Face> &rhs) |
Alexander Afanasyev | 78cf0c9 | 2011-09-01 19:57:14 -0700 | [diff] [blame] | 266 | { |
| 267 | return *lhs < *rhs; |
| 268 | } |
| 269 | |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 270 | void |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 271 | Face::SetId (uint32_t id) |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 272 | { |
| 273 | m_id = id; |
| 274 | } |
| 275 | |
| 276 | uint32_t |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 277 | Face::GetId () const |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 278 | { |
| 279 | return m_id; |
| 280 | } |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 281 | |
Alexander Afanasyev | 0845c09 | 2012-07-13 17:45:33 -0700 | [diff] [blame] | 282 | inline bool |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 283 | Face::operator!= (const Face &face) const |
Alexander Afanasyev | 0845c09 | 2012-07-13 17:45:33 -0700 | [diff] [blame] | 284 | { |
| 285 | return !(*this == face); |
| 286 | } |
| 287 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 288 | } // namespace ndn |
Alexander Afanasyev | 08d984e | 2011-08-13 19:20:22 -0700 | [diff] [blame] | 289 | } // namespace ns3 |
| 290 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 291 | #endif // NDN_FACE_H |