nfd-rib-readvertise-destination.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_RIB_READVERTISE_NFD_RIB_READVERTISE_DESTINATION_HPP
27 #define NFD_RIB_READVERTISE_NFD_RIB_READVERTISE_DESTINATION_HPP
28 
30 #include "../rib.hpp"
31 
32 #include <ndn-cxx/mgmt/nfd/controller.hpp>
33 
34 namespace nfd {
35 namespace rib {
36 
40 {
41 public:
42  NfdRibReadvertiseDestination(ndn::nfd::Controller& controller,
43  const Name& commandPrefix,
44  Rib& rib);
45 
48  void
49  advertise(const ReadvertisedRoute& rr,
50  std::function<void()> successCb,
51  std::function<void(const std::string&)> failureCb) override;
52 
55  void
56  withdraw(const ReadvertisedRoute& rr,
57  std::function<void()> successCb,
58  std::function<void(const std::string&)> failureCb) override;
59 
60 private:
61  void
62  handleRibInsert(const Name& name);
63 
64  void
65  handleRibErase(const Name& name);
66 
67 private:
68  ndn::nfd::Controller& m_controller;
69  Name m_commandPrefix;
70 
71  signal::ScopedConnection m_ribInsertConn;
72  signal::ScopedConnection m_ribEraseConn;
73 };
74 
75 } // namespace rib
76 } // namespace nfd
77 
78 #endif // NFD_RIB_READVERTISE_NFD_RIB_READVERTISE_DESTINATION_HPP
void withdraw(const ReadvertisedRoute &rr, std::function< void()> successCb, std::function< void(const std::string &)> failureCb) override
remove a name prefix from NFD RIB
represents the Routing Information Base
Definition: rib.hpp:59
state of a readvertised route
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
a destination to readvertise into
void advertise(const ReadvertisedRoute &rr, std::function< void()> successCb, std::function< void(const std::string &)> failureCb) override
add a name prefix into NFD RIB
a readvertise destination using NFD RIB management protocol
NfdRibReadvertiseDestination(ndn::nfd::Controller &controller, const Name &commandPrefix, Rib &rib)