NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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  bool wantLocalFieldsEnabled,
83  const FaceCreatedCallback& onCreated,
84  const FaceCreationFailedCallback& onFailure) override;
85 
86  virtual std::vector<shared_ptr<const Channel>>
87  getChannels() const override;
88 
89 private:
96  shared_ptr<Face>
97  findMulticastFace(const std::string& interfaceName,
98  const ethernet::Address& address) const;
99 
100 private:
101  MulticastFaceMap m_multicastFaces;
102 };
103 
106 {
107  return m_multicastFaces;
108 }
109 
110 } // namespace nfd
111 
112 #endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
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 std::vector< shared_ptr< const Channel > > getChannels() const override
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.
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override
Try to create Face using the supplied FaceUri.
shared_ptr< Face > createMulticastFace(const NetworkInterfaceInfo &interface, const ethernet::Address &address)
Create an EthernetFace to communicate with the given multicast group.
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
Definition: channel.hpp:44
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)