Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Eric Newberry | 41aba10 | 2017-11-01 16:42:13 -0700 | [diff] [blame] | 2 | /* |
Davide Pesavento | 264af77 | 2021-02-09 21:48:24 -0500 | [diff] [blame] | 3 | * Copyright (c) 2014-2021, Regents of the University of California, |
Alexander Afanasyev | 319f2c8 | 2015-01-07 14:56:53 -0800 | [diff] [blame] | 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis. |
Alexander Afanasyev | 9bcbc7c | 2014-04-06 19:37:37 -0700 | [diff] [blame] | 10 | * |
| 11 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 12 | * See AUTHORS.md for complete list of NFD authors and contributors. |
| 13 | * |
| 14 | * NFD is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
Junxiao Shi | 33152f1 | 2014-07-16 19:54:32 -0700 | [diff] [blame] | 24 | */ |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 25 | |
Eric Newberry | 41aba10 | 2017-11-01 16:42:13 -0700 | [diff] [blame] | 26 | #ifndef NFD_DAEMON_FACE_FACE_HPP |
| 27 | #define NFD_DAEMON_FACE_FACE_HPP |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 28 | |
Davide Pesavento | cb425e8 | 2019-07-14 21:48:22 -0400 | [diff] [blame] | 29 | #include "face-common.hpp" |
Junxiao Shi | 33152f1 | 2014-07-16 19:54:32 -0700 | [diff] [blame] | 30 | #include "face-counters.hpp" |
Eric Newberry | 41aba10 | 2017-11-01 16:42:13 -0700 | [diff] [blame] | 31 | #include "link-service.hpp" |
| 32 | #include "transport.hpp" |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 33 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 34 | namespace nfd { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 35 | namespace face { |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 36 | |
Alexander Afanasyev | 3a2339a | 2020-05-27 23:05:06 -0400 | [diff] [blame] | 37 | class Channel; |
| 38 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 39 | /** \brief indicates the state of a face |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 40 | */ |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 41 | typedef TransportState FaceState; |
| 42 | |
| 43 | /** \brief generalization of a network interface |
| 44 | * |
| 45 | * A face generalizes a network interface. |
| 46 | * It provides best-effort network-layer packet delivery services |
| 47 | * on a physical interface, an overlay tunnel, or a link to a local application. |
| 48 | * |
| 49 | * A face combines two parts: LinkService and Transport. |
| 50 | * Transport is the lower part, which provides best-effort TLV block deliveries. |
| 51 | * LinkService is the upper part, which translates between network-layer packets |
| 52 | * and TLV blocks, and may provide additional services such as fragmentation and reassembly. |
| 53 | */ |
Davide Pesavento | 264af77 | 2021-02-09 21:48:24 -0500 | [diff] [blame] | 54 | class Face NFD_FINAL_UNLESS_WITH_TESTS : public std::enable_shared_from_this<Face>, noncopyable |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 55 | { |
Junxiao Shi | 32bfeb3 | 2014-01-25 18:22:02 -0700 | [diff] [blame] | 56 | public: |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 57 | Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport); |
| 58 | |
| 59 | LinkService* |
Eric Newberry | c05918c | 2016-09-29 10:38:13 -0700 | [diff] [blame] | 60 | getLinkService() const; |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 61 | |
| 62 | Transport* |
Eric Newberry | c05918c | 2016-09-29 10:38:13 -0700 | [diff] [blame] | 63 | getTransport() const; |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 64 | |
Eric Newberry | cb6551e | 2020-03-02 14:12:16 -0800 | [diff] [blame] | 65 | /** \brief Request that the face be closed |
| 66 | * |
| 67 | * This operation is effective only if face is in the UP or DOWN state; otherwise, it has no effect. |
| 68 | * The face will change state to CLOSING, and then perform a cleanup procedure. |
| 69 | * When the cleanup is complete, the state will be changed to CLOSED, which may happen |
| 70 | * synchronously or asynchronously. |
| 71 | * |
| 72 | * \warning The face must not be deallocated until its state changes to CLOSED. |
| 73 | */ |
| 74 | void |
| 75 | close(); |
| 76 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 77 | public: // upper interface connected to forwarding |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 78 | /** \brief send Interest |
Alexander Afanasyev | a0a10fb | 2014-02-13 19:56:15 -0800 | [diff] [blame] | 79 | */ |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 80 | void |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 81 | sendInterest(const Interest& interest); |
Alexander Afanasyev | a0a10fb | 2014-02-13 19:56:15 -0800 | [diff] [blame] | 82 | |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 83 | /** \brief send Data |
Alexander Afanasyev | a0a10fb | 2014-02-13 19:56:15 -0800 | [diff] [blame] | 84 | */ |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 85 | void |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 86 | sendData(const Data& data); |
Junxiao Shi | 16b8bc9 | 2014-02-17 22:24:55 -0700 | [diff] [blame] | 87 | |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 88 | /** \brief send Nack |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 89 | */ |
| 90 | void |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 91 | sendNack(const lp::Nack& nack); |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 92 | |
| 93 | /** \brief signals on Interest received |
| 94 | */ |
ashiqopu | 075bb7d | 2019-03-10 01:38:21 +0000 | [diff] [blame] | 95 | signal::Signal<LinkService, Interest, EndpointId>& afterReceiveInterest; |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 96 | |
| 97 | /** \brief signals on Data received |
| 98 | */ |
ashiqopu | 075bb7d | 2019-03-10 01:38:21 +0000 | [diff] [blame] | 99 | signal::Signal<LinkService, Data, EndpointId>& afterReceiveData; |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 100 | |
| 101 | /** \brief signals on Nack received |
| 102 | */ |
ashiqopu | 075bb7d | 2019-03-10 01:38:21 +0000 | [diff] [blame] | 103 | signal::Signal<LinkService, lp::Nack, EndpointId>& afterReceiveNack; |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 104 | |
Eric Newberry | 41aba10 | 2017-11-01 16:42:13 -0700 | [diff] [blame] | 105 | /** \brief signals on Interest dropped by reliability system for exceeding allowed number of retx |
| 106 | */ |
| 107 | signal::Signal<LinkService, Interest>& onDroppedInterest; |
| 108 | |
Eric Newberry | cb6551e | 2020-03-02 14:12:16 -0800 | [diff] [blame] | 109 | public: // properties |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 110 | /** \return face ID |
| 111 | */ |
Junxiao Shi | 7949416 | 2014-04-02 18:25:11 -0700 | [diff] [blame] | 112 | FaceId |
| 113 | getId() const; |
| 114 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 115 | /** \brief sets face ID |
| 116 | * \note Normally, this should only be invoked by FaceTable. |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 117 | */ |
| 118 | void |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 119 | setId(FaceId id); |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 120 | |
Alexander Afanasyev | b0a3da3 | 2014-12-31 00:11:43 -0800 | [diff] [blame] | 121 | void |
| 122 | setMetric(uint64_t metric); |
| 123 | |
| 124 | uint64_t |
| 125 | getMetric() const; |
| 126 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 127 | /** \return a FaceUri representing local endpoint |
Davide Pesavento | 0ff10db | 2014-02-28 03:12:27 +0100 | [diff] [blame] | 128 | */ |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 129 | FaceUri |
| 130 | getLocalUri() const; |
Davide Pesavento | 0ff10db | 2014-02-28 03:12:27 +0100 | [diff] [blame] | 131 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 132 | /** \return a FaceUri representing remote endpoint |
| 133 | */ |
| 134 | FaceUri |
| 135 | getRemoteUri() const; |
| 136 | |
| 137 | /** \return whether face is local or non-local for scope control purpose |
| 138 | */ |
| 139 | ndn::nfd::FaceScope |
| 140 | getScope() const; |
| 141 | |
| 142 | /** \return face persistency setting |
Junxiao Shi | 32bfeb3 | 2014-01-25 18:22:02 -0700 | [diff] [blame] | 143 | */ |
Yukai Tu | 731f0d7 | 2015-07-04 11:14:44 +0800 | [diff] [blame] | 144 | ndn::nfd::FacePersistency |
| 145 | getPersistency() const; |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 146 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 147 | /** \brief changes face persistency setting |
Junxiao Shi | 08d07a7 | 2014-06-09 23:17:57 -0700 | [diff] [blame] | 148 | */ |
| 149 | void |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 150 | setPersistency(ndn::nfd::FacePersistency persistency); |
Junxiao Shi | 08d07a7 | 2014-06-09 23:17:57 -0700 | [diff] [blame] | 151 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 152 | /** \return whether face is point-to-point or multi-access |
| 153 | */ |
| 154 | ndn::nfd::LinkType |
| 155 | getLinkType() const; |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 156 | |
Eric Newberry | cb6551e | 2020-03-02 14:12:16 -0800 | [diff] [blame] | 157 | /** \brief Returns face effective MTU |
| 158 | * |
| 159 | * This function is a wrapper. The effective MTU of a face is determined by the link service. |
| 160 | */ |
| 161 | ssize_t |
| 162 | getMtu() const; |
| 163 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 164 | /** \return face state |
| 165 | */ |
| 166 | FaceState |
| 167 | getState() const; |
Junxiao Shi | c099ddb | 2014-12-25 20:53:20 -0700 | [diff] [blame] | 168 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 169 | /** \brief signals after face state changed |
| 170 | */ |
| 171 | signal::Signal<Transport, FaceState/*old*/, FaceState/*new*/>& afterStateChange; |
| 172 | |
Eric Newberry | c64d30a | 2015-12-26 11:07:27 -0700 | [diff] [blame] | 173 | /** \return expiration time of the face |
| 174 | * \retval time::steady_clock::TimePoint::max() the face has an indefinite lifetime |
| 175 | */ |
| 176 | time::steady_clock::TimePoint |
| 177 | getExpirationTime() const; |
| 178 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 179 | const FaceCounters& |
Davide Pesavento | 0498ce8 | 2021-06-14 02:02:21 -0400 | [diff] [blame] | 180 | getCounters() const |
| 181 | { |
| 182 | return m_counters; |
| 183 | } |
| 184 | |
| 185 | FaceCounters& |
| 186 | getCounters() |
| 187 | { |
| 188 | return m_counters; |
| 189 | } |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 190 | |
Alexander Afanasyev | 3a2339a | 2020-05-27 23:05:06 -0400 | [diff] [blame] | 191 | /** |
| 192 | * \brief Get channel on which face was created (unicast) or the associated channel (multicast) |
| 193 | */ |
| 194 | weak_ptr<Channel> |
| 195 | getChannel() const |
| 196 | { |
| 197 | return m_channel; |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * \brief Set channel on which face was created (unicast) or the associated channel (multicast) |
| 202 | */ |
| 203 | void |
| 204 | setChannel(weak_ptr<Channel> channel) |
| 205 | { |
| 206 | m_channel = std::move(channel); |
| 207 | } |
| 208 | |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 209 | private: |
Junxiao Shi | 32bfeb3 | 2014-01-25 18:22:02 -0700 | [diff] [blame] | 210 | FaceId m_id; |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 211 | unique_ptr<LinkService> m_service; |
| 212 | unique_ptr<Transport> m_transport; |
| 213 | FaceCounters m_counters; |
Alexander Afanasyev | 3a2339a | 2020-05-27 23:05:06 -0400 | [diff] [blame] | 214 | weak_ptr<Channel> m_channel; |
Alexander Afanasyev | b0a3da3 | 2014-12-31 00:11:43 -0800 | [diff] [blame] | 215 | uint64_t m_metric; |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 216 | }; |
| 217 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 218 | inline LinkService* |
Eric Newberry | c05918c | 2016-09-29 10:38:13 -0700 | [diff] [blame] | 219 | Face::getLinkService() const |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 220 | { |
| 221 | return m_service.get(); |
| 222 | } |
| 223 | |
| 224 | inline Transport* |
Eric Newberry | c05918c | 2016-09-29 10:38:13 -0700 | [diff] [blame] | 225 | Face::getTransport() const |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 226 | { |
| 227 | return m_transport.get(); |
| 228 | } |
| 229 | |
| 230 | inline void |
Eric Newberry | cb6551e | 2020-03-02 14:12:16 -0800 | [diff] [blame] | 231 | Face::close() |
| 232 | { |
| 233 | m_transport->close(); |
| 234 | } |
| 235 | |
| 236 | inline void |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 237 | Face::sendInterest(const Interest& interest) |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 238 | { |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 239 | m_service->sendInterest(interest); |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | inline void |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 243 | Face::sendData(const Data& data) |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 244 | { |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 245 | m_service->sendData(data); |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | inline void |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 249 | Face::sendNack(const lp::Nack& nack) |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 250 | { |
Teng Liang | f3bc3ae | 2020-06-08 10:19:25 -0700 | [diff] [blame] | 251 | m_service->sendNack(nack); |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 254 | inline FaceId |
| 255 | Face::getId() const |
| 256 | { |
| 257 | return m_id; |
| 258 | } |
| 259 | |
| 260 | inline void |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 261 | Face::setId(FaceId id) |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 262 | { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 263 | m_id = id; |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 264 | } |
| 265 | |
Alexander Afanasyev | b0a3da3 | 2014-12-31 00:11:43 -0800 | [diff] [blame] | 266 | inline void |
| 267 | Face::setMetric(uint64_t metric) |
| 268 | { |
| 269 | m_metric = metric; |
| 270 | } |
| 271 | |
| 272 | inline uint64_t |
| 273 | Face::getMetric() const |
| 274 | { |
| 275 | return m_metric; |
| 276 | } |
| 277 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 278 | inline FaceUri |
| 279 | Face::getLocalUri() const |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 280 | { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 281 | return m_transport->getLocalUri(); |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 282 | } |
| 283 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 284 | inline FaceUri |
| 285 | Face::getRemoteUri() const |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 286 | { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 287 | return m_transport->getRemoteUri(); |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 288 | } |
| 289 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 290 | inline ndn::nfd::FaceScope |
| 291 | Face::getScope() const |
Davide Pesavento | 0ff10db | 2014-02-28 03:12:27 +0100 | [diff] [blame] | 292 | { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 293 | return m_transport->getScope(); |
Davide Pesavento | 0ff10db | 2014-02-28 03:12:27 +0100 | [diff] [blame] | 294 | } |
| 295 | |
Yukai Tu | 731f0d7 | 2015-07-04 11:14:44 +0800 | [diff] [blame] | 296 | inline ndn::nfd::FacePersistency |
| 297 | Face::getPersistency() const |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 298 | { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 299 | return m_transport->getPersistency(); |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | inline void |
Yukai Tu | 731f0d7 | 2015-07-04 11:14:44 +0800 | [diff] [blame] | 303 | Face::setPersistency(ndn::nfd::FacePersistency persistency) |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 304 | { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 305 | return m_transport->setPersistency(persistency); |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 306 | } |
| 307 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 308 | inline ndn::nfd::LinkType |
| 309 | Face::getLinkType() const |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 310 | { |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 311 | return m_transport->getLinkType(); |
Davide Pesavento | 9427941 | 2015-02-27 01:29:32 +0100 | [diff] [blame] | 312 | } |
| 313 | |
Eric Newberry | cb6551e | 2020-03-02 14:12:16 -0800 | [diff] [blame] | 314 | inline ssize_t |
| 315 | Face::getMtu() const |
| 316 | { |
| 317 | return m_service->getEffectiveMtu(); |
| 318 | } |
| 319 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 320 | inline FaceState |
| 321 | Face::getState() const |
| 322 | { |
| 323 | return m_transport->getState(); |
| 324 | } |
| 325 | |
Eric Newberry | c64d30a | 2015-12-26 11:07:27 -0700 | [diff] [blame] | 326 | inline time::steady_clock::TimePoint |
| 327 | Face::getExpirationTime() const |
| 328 | { |
| 329 | return m_transport->getExpirationTime(); |
| 330 | } |
| 331 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 332 | std::ostream& |
| 333 | operator<<(std::ostream& os, const FaceLogHelper<Face>& flh); |
Alexander Afanasyev | a39b90b | 2014-03-05 15:31:00 +0000 | [diff] [blame] | 334 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 335 | } // namespace face |
| 336 | |
Junxiao Shi | cde37ad | 2015-12-24 01:02:05 -0700 | [diff] [blame] | 337 | using face::Face; |
| 338 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 339 | } // namespace nfd |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 340 | |
Eric Newberry | 41aba10 | 2017-11-01 16:42:13 -0700 | [diff] [blame] | 341 | #endif // NFD_DAEMON_FACE_FACE_HPP |