diff options
author | Neale Ranns <neale.ranns@cisco.com> | 2017-11-28 22:29:13 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-11-29 07:42:52 +0000 |
commit | a2ee029d0772e894911c84fb8a0cab5f253e145b (patch) | |
tree | 167d07ee3b3a482ef494f420ceef13a9657d4274 /src/vpp-api/vom/bridge_domain_entry.cpp | |
parent | e80ae9ea8ed04c82c151a548916926b5dbfe8ecb (diff) |
VOM: logging, populate and stats fixes
logging: allow a client to register a callback handler to recieve log messages
that way the client can maintain a correctly sequenced log
populate: fix the creation of interface and the setting of the handle
stats: the reset promise idea is not defined behaviour.
Use an eanble/disable command pair
Change-Id: I347720bb65df2874c7619e722d593bc863ee2bf1
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/bridge_domain_entry.cpp')
-rw-r--r-- | src/vpp-api/vom/bridge_domain_entry.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/vpp-api/vom/bridge_domain_entry.cpp b/src/vpp-api/vom/bridge_domain_entry.cpp index de1c4b7ba1f..9723bde4875 100644 --- a/src/vpp-api/vom/bridge_domain_entry.cpp +++ b/src/vpp-api/vom/bridge_domain_entry.cpp @@ -166,11 +166,21 @@ bridge_domain_entry::event_handler::handle_populate(const client_db::key_t& key) std::shared_ptr<interface> itf = interface::find(payload.sw_if_index); std::shared_ptr<bridge_domain> bd = bridge_domain::find(payload.bd_id); + + if (!bd || !itf) { + VOM_LOG(log_level_t::ERROR) << "bridge-domain-entry dump:" + << " itf:" << payload.sw_if_index + << " bd:" << payload.bd_id; + continue; + } + mac_address_t mac(payload.mac); bridge_domain_entry bd_e(*bd, mac, *itf); - VOM_LOG(log_level_t::DEBUG) << "bd-entry-dump: " << bd->to_string() - << mac.to_string() << itf->to_string(); + VOM_LOG(log_level_t::DEBUG) << "bridge-domain-entry dump:" + << " " << bd->to_string() << " " + << itf->to_string() << " mac:[" + << mac.to_string() << "]"; /* * Write each of the discovered interfaces into the OM, |