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 
35 {
36 public:
41  {
42  public:
43  explicit
44  Error(const std::string& what)
45  : ProtocolFactory::Error(what)
46  {
47  }
48  };
49 
50  typedef std::map<std::pair<std::string, ethernet::Address>,
51  shared_ptr<Face>> MulticastFaceMap;
52 
68  shared_ptr<Face>
70  const ethernet::Address& address);
71 
75  const MulticastFaceMap&
76  getMulticastFaces() const;
77 
78 public: // from ProtocolFactory
79  virtual void
80  createFace(const FaceUri& uri,
81  ndn::nfd::FacePersistency persistency,
82  const FaceCreatedCallback& onCreated,
83  const FaceCreationFailedCallback& onConnectFailed) DECL_OVERRIDE;
84 
85  virtual std::vector<shared_ptr<const Channel>>
86  getChannels() const DECL_OVERRIDE;
87 
88 private:
95  shared_ptr<Face>
96  findMulticastFace(const std::string& interfaceName,
97  const ethernet::Address& address) const;
98 
99 private:
100  MulticastFaceMap m_multicastFaces;
101 };
102 
103 inline const EthernetFactory::MulticastFaceMap&
105 {
106  return m_multicastFaces;
107 }
108 
109 } // namespace nfd
110 
111 #endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
function< void(const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
Definition: channel.hpp:44
Base class for all exceptions thrown by protocol factories.
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 FaceCreationFailedCallback &onConnectFailed) 1
Try to create Face using the supplied FaceUri.
virtual std::vector< shared_ptr< const Channel > > getChannels() const 1
STL namespace.
#define DECL_OVERRIDE
expands to &#39;override&#39; if compiler supports &#39;override&#39; specifier, otherwise expands to nothing ...
Definition: common.hpp:50
const MulticastFaceMap & getMulticastFaces() const
Get map of configured multicast faces.
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
Abstract base class for all protocol factories.
shared_ptr< Face > createMulticastFace(const NetworkInterfaceInfo &interface, const ethernet::Address &address)
Create an EthernetFace to communicate with the given multicast group.
Exception of EthernetFactory.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
Definition: channel.hpp:38
std::map< std::pair< std::string, ethernet::Address >, shared_ptr< Face > > MulticastFaceMap
Error(const std::string &what)