X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Froute_domain.cpp;h=16bf5f36c90cf92b8c45f732aedd5179eca3e495;hp=b97faf6ae49718e5a28a2610802223424e1ccd35;hb=097fa66b9;hpb=39baa32186fd3e4b20d9f58afbbfe7b8daebed62 diff --git a/extras/vom/vom/route_domain.cpp b/extras/vom/vom/route_domain.cpp index b97faf6ae49..16bf5f36c90 100644 --- a/extras/vom/vom/route_domain.cpp +++ b/extras/vom/vom/route_domain.cpp @@ -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 cmd = + std::make_shared(); + + 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()