blob: 07858d06b5e3617c293401ddacb1d22db49da904 [file] [log] [blame]
Xuxiang Tian91018732016-08-17 16:24:47 -07001/* -*- 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
26namespace ns3 {
27namespace ndn {
28
29/**
30 * \ingroup ndn-face
31 * \brief Null transport (does nothing, just fulfills requirements of the interface)
32 */
33class NullTransport : public nfd::face::Transport
34{
35public:
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
49private:
Alexander Afanasyev59090db2020-02-21 16:37:43 -050050 void
51 doClose() final
Xuxiang Tian91018732016-08-17 16:24:47 -070052 {
53 this->setState(nfd::face::TransportState::CLOSED);
54 }
55
Alexander Afanasyev59090db2020-02-21 16:37:43 -050056 void
Alexander Afanasyevf007a992022-05-05 15:57:08 -040057 doSend(const Block& packet) final
Xuxiang Tian91018732016-08-17 16:24:47 -070058 {
59 }
60};
61
62} // namespace ndn
63} // namespace ns3
64
65#endif // NDN_NULL_TRANSPORT_HPP