NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
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:
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
represents the Routing Information Base
Definition: rib.hpp:59
void withdraw(const ReadvertisedRoute &rr, std::function< void()> successCb, std::function< void(const std::string &)> failureCb) override
remove a name prefix from NFD RIB
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
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
state of a readvertised route
disconnects a Connection automatically upon destruction
NFD Management protocol client.
Definition: controller.hpp:50
Represents an absolute name.
Definition: name.hpp:42
a destination to readvertise into
NfdRibReadvertiseDestination(ndn::nfd::Controller &controller, const Name &commandPrefix, Rib &rib)