NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ethernet-factory.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
27 #define NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
28 
29 #include "protocol-factory.hpp"
31 
32 namespace nfd {
33 
34 class EthernetFace;
35 
37 {
38 public:
43  {
44  public:
45  explicit
46  Error(const std::string& what)
47  : ProtocolFactory::Error(what)
48  {
49  }
50  };
51 
52  typedef std::map<std::pair<std::string, ethernet::Address>,
53  shared_ptr<EthernetFace>> MulticastFaceMap;
54 
55  // from ProtocolFactory
56  virtual void
57  createFace(const FaceUri& uri,
58  ndn::nfd::FacePersistency persistency,
59  const FaceCreatedCallback& onCreated,
60  const FaceConnectFailedCallback& onConnectFailed) DECL_OVERRIDE;
61 
77  shared_ptr<EthernetFace>
79  const ethernet::Address& address);
80 
84  const MulticastFaceMap&
85  getMulticastFaces() const;
86 
87  virtual std::list<shared_ptr<const Channel>>
88  getChannels() const;
89 
90 private:
99  shared_ptr<EthernetFace>
100  findMulticastFace(const std::string& interfaceName,
101  const ethernet::Address& address) const;
102 
103 private:
104  MulticastFaceMap m_multicastFaces;
105 };
106 
109 {
110  return m_multicastFaces;
111 }
112 
113 } // namespace nfd
114 
115 #endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
function< void(const std::string &reason)> FaceConnectFailedCallback
Prototype for the callback that is called when face is failed to get created.
std::map< std::pair< std::string, ethernet::Address >, shared_ptr< EthernetFace > > MulticastFaceMap
represents an Ethernet hardware address
Definition: ethernet.hpp:53
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
contains information about a network interface
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onCreated, const FaceConnectFailedCallback &onConnectFailed) 1
Try to create Face using the supplied FaceUri.
#define DECL_OVERRIDE
expands to &#39;override&#39; if compiler supports this feature, otherwise expands to nothing ...
Definition: common.hpp:49
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
Base class for all exceptions thrown by channel factories.
shared_ptr< EthernetFace > createMulticastFace(const NetworkInterfaceInfo &interface, const ethernet::Address &address)
Create an EthernetFace to communicate with the given multicast group.
virtual std::list< shared_ptr< const Channel > > getChannels() const
Exception of EthernetFactory.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback called when face is created (as a response to incoming connection or after...
const MulticastFaceMap & getMulticastFaces() const
Get map of configured multicast faces.
Error(const std::string &what)