fib: fib api updates
[vpp.git] / extras / vom / vom / route_domain.cpp
index b97faf6..16bf5f3 100644 (file)
@@ -62,6 +62,18 @@ route_domain::key() const
   return (table_id());
 }
 
+route_domain::const_iterator_t
+route_domain::cbegin()
+{
+  return m_db.begin();
+}
+
+route_domain::const_iterator_t
+route_domain::cend()
+{
+  return m_db.end();
+}
+
 void
 route_domain::sweep()
 {
@@ -159,6 +171,26 @@ route_domain::dump(std::ostream& os)
 void
 route_domain::event_handler::handle_populate(const client_db::key_t& key)
 {
+  std::shared_ptr<route_domain_cmds::dump_cmd> cmd =
+    std::make_shared<route_domain_cmds::dump_cmd>();
+
+  HW::enqueue(cmd);
+  HW::write();
+
+  for (auto& record : *cmd) {
+    auto& payload = record.get_payload();
+
+    route_domain rd(payload.table.table_id);
+
+    VOM_LOG(log_level_t::DEBUG) << "ip-table-dump: " << rd.to_string();
+
+    /*
+     * Write each of the discovered interfaces into the OM,
+     * but disable the HW Command q whilst we do, so that no
+     * commands are sent to VPP
+     */
+    OM::commit(key, rd);
+  }
 }
 
 route_domain::event_handler::event_handler()