NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
internal-transport.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
28 
29 #include "transport.hpp"
30 #include <ndn-cxx/transport/transport.hpp>
31 
32 namespace nfd {
33 namespace face {
34 
38 {
39 public:
42  virtual void
43  receiveFromLink(const Block& packet) = 0;
44 
46 
47 protected:
48  DECLARE_SIGNAL_EMIT(afterSend)
49 };
50 
54 {
55 public:
56  InternalForwarderTransport(const FaceUri& localUri = FaceUri("internal://"),
57  const FaceUri& remoteUri = FaceUri("internal://"),
60 
61  virtual void
62  receiveFromLink(const Block& packet) override;
63 
64 protected:
65  virtual void
66  beforeChangePersistency(ndn::nfd::FacePersistency newPersistency) override;
67 
68  virtual void
69  doClose() override;
70 
71 private:
72  virtual void
73  doSend(Packet&& packet) override;
74 
75 private:
77 };
78 
82 {
83 public:
92  void
93  connectToForwarder(InternalForwarderTransport* forwarderTransport);
94 
95  virtual void
96  receiveFromLink(const Block& packet) override;
97 
98  virtual void
99  close() override
100  {
101  }
102 
103  virtual void
104  pause() override
105  {
106  }
107 
108  virtual void
109  resume() override
110  {
111  }
112 
113  virtual void
114  send(const Block& wire) override;
115 
116  virtual void
117  send(const Block& header, const Block& payload) override;
118 
119 private:
121 
122  signal::ScopedConnection m_fwToClientTransmitConn;
123  signal::ScopedConnection m_clientToFwTransmitConn;
124  signal::ScopedConnection m_fwTransportStateConn;
125 };
126 
127 } // namespace face
128 } // namespace nfd
129 
130 #endif // NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
implements a client-side transport that can be paired with another
#define NFD_LOG_INCLASS_DECLARE()
Definition: logger.hpp:36
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
signal::Signal< InternalTransportBase, Block > afterSend
stores a packet along with the remote endpoint
Definition: transport.hpp:113
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
virtual void receiveFromLink(const Block &packet)=0
causes the transport to receive a link-layer packet
provides a lightweight signal / event system
abstracts a transport that can be paired with another
virtual void close() override
Close the connection.
implements a forwarder-side transport that can be paired with another
virtual void pause() override
pause the transport
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
disconnects a Connection automatically upon destruction
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a &#39;emit_signalName&#39; method
Definition: signal-emit.hpp:59
provides TLV-block delivery service
Definition: transport.hpp:40
virtual void resume() override
resume the transport
the lower part of a Face
Definition: transport.hpp:104