X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Finterface.cpp;h=c80dc793604c120d94328cca99b0cd780ec39fd8;hb=053204ab0;hp=a94be683424d7e69eeaea9ca02143dd6c82af2d1;hpb=7752cb6f0d2e05eb2d38238cf51c2647afd4915e;p=vpp.git diff --git a/extras/vom/vom/interface.cpp b/extras/vom/vom/interface.cpp index a94be683424..c80dc793604 100644 --- a/extras/vom/vom/interface.cpp +++ b/extras/vom/vom/interface.cpp @@ -14,6 +14,7 @@ */ #include "vom/interface.hpp" +#include "vom/api_types.hpp" #include "vom/bond_group_binding.hpp" #include "vom/bond_group_binding_cmds.hpp" #include "vom/bond_interface_cmds.hpp" @@ -159,6 +160,12 @@ interface::l2_address() const return (m_l2_address.data()); } +const interface::admin_state_t& +interface::admin_state() const +{ + return (m_state.data()); +} + interface::const_iterator_t interface::cbegin() { @@ -275,13 +282,17 @@ interface::key() const std::queue& interface::mk_create_cmd(std::queue& q) { - if ((type_t::LOOPBACK == m_type) || (type_t::BVI == m_type)) { + if (type_t::LOOPBACK == m_type) { q.push(new interface_cmds::loopback_create_cmd(m_hdl, m_name)); q.push(new interface_cmds::set_tag(m_hdl, m_name)); /* * set the m_tag for pretty-print */ m_tag = m_name; + } else if (type_t::BVI == m_type) { + q.push(new interface_cmds::bvi_create_cmd(m_hdl, m_name)); + q.push(new interface_cmds::set_tag(m_hdl, m_name)); + m_tag = m_name; } else if (type_t::AFPACKET == m_type) { q.push(new interface_cmds::af_packet_create_cmd(m_hdl, m_name)); if (!m_tag.empty()) @@ -301,8 +312,10 @@ interface::mk_create_cmd(std::queue& q) std::queue& interface::mk_delete_cmd(std::queue& q) { - if ((type_t::LOOPBACK == m_type) || (type_t::BVI == m_type)) { + if (type_t::LOOPBACK == m_type) { q.push(new interface_cmds::loopback_delete_cmd(m_hdl)); + } else if (type_t::BVI == m_type) { + q.push(new interface_cmds::bvi_delete_cmd(m_hdl)); } else if (type_t::AFPACKET == m_type) { q.push(new interface_cmds::af_packet_delete_cmd(m_hdl, m_name)); } else if (type_t::VHOST == m_type) { @@ -394,7 +407,7 @@ interface::set(const admin_state_t& state) void interface::set(const l2_address_t& addr) { - m_l2_address.update(addr); + m_l2_address = { addr, rc_t::NOOP }; } void @@ -634,8 +647,8 @@ interface::event_handler::handle_populate(const client_db::key_t& key) for (auto& itf_record : *cmd) { auto payload = itf_record.get_payload(); VOM_LOG(log_level_t::DEBUG) << "dump: [" << payload.sw_if_index - << " name:" << (char*)payload.interface_name - << " tag:" << (char*)payload.tag << "]"; + << " name:" << (char*)payload.interface_name.buf + << " tag:" << (char*)payload.tag.buf << "]"; std::shared_ptr itf = interface_factory::new_interface(payload); @@ -660,8 +673,7 @@ interface::event_handler::handle_populate(const client_db::key_t& key) for (auto& l3_record : *dcmd) { auto& payload = l3_record.get_payload(); - const route::prefix_t pfx(payload.is_ipv6, payload.ip, - payload.prefix_length); + const route::prefix_t pfx = from_api(payload.prefix); VOM_LOG(log_level_t::DEBUG) << "dump: " << pfx.to_string();