NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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) DECL_OVERRIDE;
63 
64 protected:
65  virtual void
66  beforeChangePersistency(ndn::nfd::FacePersistency newPersistency) DECL_OVERRIDE;
67 
68  virtual void
69  doClose() DECL_OVERRIDE;
70 
71 private:
72  virtual void
73  doSend(Packet&& packet) DECL_OVERRIDE;
74 
75 private:
77 };
78 
82 {
83 public:
92  void
93  connectToForwarder(InternalForwarderTransport* forwarderTransport);
94 
95  virtual void
96  receiveFromLink(const Block& packet) DECL_OVERRIDE;
97 
98  virtual void
99  close() DECL_OVERRIDE
100  {
101  }
102 
103  virtual void
104  pause() DECL_OVERRIDE
105  {
106  }
107 
108  virtual void
109  resume() DECL_OVERRIDE
110  {
111  }
112 
113  virtual void
114  send(const Block& wire) DECL_OVERRIDE;
115 
116  virtual void
117  send(const Block& header, const Block& payload) DECL_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
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
#define NFD_LOG_INCLASS_DECLARE()
Definition: logger.hpp:36
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
#define DECL_OVERRIDE
expands to &#39;override&#39; if compiler supports &#39;override&#39; specifier, otherwise expands to nothing ...
Definition: common.hpp:50
abstracts a transport that can be paired with another
implements a forwarder-side transport that can be paired with another
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
disconnects a Connection automatically upon destruction
virtual void close() 1
Close the connection.
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a &#39;emit_signalName&#39; method
Definition: signal-emit.hpp:59
the lower part of a Face
Definition: transport.hpp:104