NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
unix-transport.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_TRANSPORT_UNIX_TRANSPORT_HPP
23 #define NDN_TRANSPORT_UNIX_TRANSPORT_HPP
24 
25 #include "../common.hpp"
26 #include "transport.hpp"
27 #include "../util/config-file.hpp"
28 
29 // forward declaration
30 namespace boost { namespace asio { namespace local { class stream_protocol; } } }
31 
32 namespace ndn {
33 
34 // forward declaration
35 template<class T, class U>
36 class StreamTransportImpl;
37 
38 class UnixTransport : public Transport
39 {
40 public:
41 
48  UnixTransport(const std::string& unixSocket);
49 
50  ~UnixTransport();
51 
52  // from Transport
53  virtual void
54  connect(boost::asio::io_service& ioService,
55  const ReceiveCallback& receiveCallback);
56 
57  virtual void
58  close();
59 
60  virtual void
61  pause();
62 
63  virtual void
64  resume();
65 
66  virtual void
67  send(const Block& wire);
68 
69  virtual void
70  send(const Block& header, const Block& payload);
71 
72  static shared_ptr<UnixTransport>
73  create(const ConfigFile& config);
74 
82  static std::string
83  getDefaultSocketName(const ConfigFile& config);
84 
85 private:
86  std::string m_unixSocket;
87 
89  friend class StreamTransportImpl<UnixTransport, boost::asio::local::stream_protocol>;
90  shared_ptr< Impl > m_impl;
91 };
92 
93 } // namespace ndn
94 
95 #endif // NDN_TRANSPORT_UNIX_TRANSPORT_HPP
Copyright (c) 2011-2015 Regents of the University of California.
Copyright (c) 2013-2015 Regents of the University of California.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition: common.hpp:43
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
function< void(const Block &wire)> ReceiveCallback
Definition: transport.hpp:49