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"
30 
31 namespace nfd {
32 namespace face {
33 
39 {
40 public:
41  static const std::string&
42  getId();
43 
46  void
48  FaceSystem::ConfigContext& context) override;
49 
52  void
53  createFace(const FaceUri& uri,
54  ndn::nfd::FacePersistency persistency,
55  bool wantLocalFieldsEnabled,
56  const FaceCreatedCallback& onCreated,
57  const FaceCreationFailedCallback& onFailure) override;
58 
61  std::vector<shared_ptr<const Channel>>
62  getChannels() const override;
63 
64 private:
72  shared_ptr<Face>
73  createMulticastFace(const NetworkInterfaceInfo& netif, const ethernet::Address& group);
74 
75  void
76  applyConfig(const FaceSystem::ConfigContext& context);
77 
78 private:
79  struct MulticastConfig
80  {
81  bool isEnabled = false;
82  ethernet::Address group = ethernet::getDefaultMulticastAddress();
83  NetworkInterfacePredicate netifPredicate;
84  };
85 
86  MulticastConfig m_mcastConfig;
87 
89  std::map<std::pair<std::string, ethernet::Address>, shared_ptr<Face>> m_mcastFaces;
90 };
91 
92 } // namespace face
93 } // namespace nfd
94 
95 #endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
contains information about a network interface
std::vector< shared_ptr< const Channel > > getChannels() const override
context for processing a config section in ProtocolFactory
Definition: face-system.hpp:77
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
boost::optional< const ConfigSection & > OptionalConfigSection
an optional config file section
Definition: config-file.hpp:41
static const std::string & getId()
void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override
unicast face creation is not supported and will always fail
protocol factory for Ethernet
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
provide support for an underlying protocol
void processConfig(OptionalConfigSection configSection, FaceSystem::ConfigContext &context) override
process face_system.ether config section
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
Represents a predicate to accept or reject a NetworkInterfaceInfo.