Xuxiang Tian | 9101873 | 2016-08-17 16:24:47 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2011-2015 Regents of the University of California. |
| 4 | * |
| 5 | * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and |
| 6 | * contributors. |
| 7 | * |
| 8 | * ndnSIM is free software: you can redistribute it and/or modify it under the terms |
| 9 | * of the GNU General Public License as published by the Free Software Foundation, |
| 10 | * either version 3 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 13 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 | * PURPOSE. See the GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along with |
| 17 | * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 18 | **/ |
| 19 | |
| 20 | #ifndef NDN_NULL_TRANSPORT_HPP |
| 21 | #define NDN_NULL_TRANSPORT_HPP |
| 22 | |
| 23 | #include "ns3/ndnSIM/model/ndn-common.hpp" |
| 24 | #include "ns3/ndnSIM/NFD/daemon/face/transport.hpp" |
| 25 | |
| 26 | namespace ns3 { |
| 27 | namespace ndn { |
| 28 | |
| 29 | /** |
| 30 | * \ingroup ndn-face |
| 31 | * \brief Null transport (does nothing, just fulfills requirements of the interface) |
| 32 | */ |
| 33 | class NullTransport : public nfd::face::Transport |
| 34 | { |
| 35 | public: |
| 36 | NullTransport(const std::string& localUri, const std::string& remoteUri, |
| 37 | ::ndn::nfd::FaceScope scope = ::ndn::nfd::FACE_SCOPE_NON_LOCAL, |
| 38 | ::ndn::nfd::FacePersistency persistency = ::ndn::nfd::FACE_PERSISTENCY_PERSISTENT, |
| 39 | ::ndn::nfd::LinkType linkType = ::ndn::nfd::LINK_TYPE_POINT_TO_POINT) |
| 40 | { |
| 41 | this->setLocalUri(FaceUri(localUri)); |
| 42 | this->setRemoteUri(FaceUri(remoteUri)); |
| 43 | this->setScope(scope); |
| 44 | this->setPersistency(persistency); |
| 45 | this->setLinkType(linkType); |
| 46 | // this->setMtu(udp::computeMtu(m_socket.local_endpoint())); // not sure what should be here |
| 47 | } |
| 48 | |
| 49 | private: |
Alexander Afanasyev | 59090db | 2020-02-21 16:37:43 -0500 | [diff] [blame] | 50 | void |
| 51 | doClose() final |
Xuxiang Tian | 9101873 | 2016-08-17 16:24:47 -0700 | [diff] [blame] | 52 | { |
| 53 | this->setState(nfd::face::TransportState::CLOSED); |
| 54 | } |
| 55 | |
Alexander Afanasyev | 59090db | 2020-02-21 16:37:43 -0500 | [diff] [blame] | 56 | void |
Alexander Afanasyev | f007a99 | 2022-05-05 15:57:08 -0400 | [diff] [blame] | 57 | doSend(const Block& packet) final |
Xuxiang Tian | 9101873 | 2016-08-17 16:24:47 -0700 | [diff] [blame] | 58 | { |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | } // namespace ndn |
| 63 | } // namespace ns3 |
| 64 | |
| 65 | #endif // NDN_NULL_TRANSPORT_HPP |