diff options
author | Ole Trøan <otroan@employees.org> | 2019-03-15 16:14:41 +0000 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-03-15 17:34:06 +0000 |
commit | 3b0d7e42f65eaf8d84cfe26e2e9f5244c554b934 (patch) | |
tree | 4c7248e37fc7e0d3478fa5a77a8bfc7b2c9159d4 /extras/vom | |
parent | 3fef8f811a013d1392f702fda1347c5211471ed7 (diff) |
Revert "API: Cleanup APIs interface.api"
This reverts commit e63325e3ca03c847963863446345e6c80a2c0cfd.
Allow time for CSIT to accommodate.
Change-Id: I59435e4ab5e05e36a2796c3bf44889b5d4823cc2
Signed-off-by: ot@cisco.com
Diffstat (limited to 'extras/vom')
-rw-r--r-- | extras/vom/vom/interface.cpp | 4 | ||||
-rw-r--r-- | extras/vom/vom/interface_cmds.cpp | 10 | ||||
-rw-r--r-- | extras/vom/vom/interface_factory.cpp | 12 | ||||
-rw-r--r-- | extras/vom/vom/l3_binding_cmds.cpp | 8 |
4 files changed, 15 insertions, 19 deletions
diff --git a/extras/vom/vom/interface.cpp b/extras/vom/vom/interface.cpp index 15bc3733ec4..ec6204f1e0c 100644 --- a/extras/vom/vom/interface.cpp +++ b/extras/vom/vom/interface.cpp @@ -634,8 +634,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.buf - << " tag:" << (char*)payload.tag.buf << "]"; + << " name:" << (char*)payload.interface_name + << " tag:" << (char*)payload.tag << "]"; std::shared_ptr<interface> itf = interface_factory::new_interface(payload); diff --git a/extras/vom/vom/interface_cmds.cpp b/extras/vom/vom/interface_cmds.cpp index 7805fdb1a1d..3a7fb50f64b 100644 --- a/extras/vom/vom/interface_cmds.cpp +++ b/extras/vom/vom/interface_cmds.cpp @@ -252,7 +252,7 @@ state_change_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.sw_if_index = m_hdl.data().value(); - payload.flags = (vapi_enum_if_status_flags)m_hw_item.data().value(); + payload.admin_up_down = m_hw_item.data().value(); VAPI_CALL(req.execute()); @@ -450,8 +450,8 @@ events_cmd::notify() std::shared_ptr<interface> sp = interface::find(handle); if (sp) { - interface::oper_state_t oper_state = interface::oper_state_t::from_int( - payload.flags & vapi_enum_if_status_flags::IF_STATUS_API_FLAG_LINK_UP); + interface::oper_state_t oper_state = + interface::oper_state_t::from_int(payload.link_up_down); VOM_LOG(log_level_t::DEBUG) << "Interface Event: " << sp->to_string() << " state: " << oper_state.to_string(); @@ -569,8 +569,8 @@ set_tag::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.is_add = 1; payload.sw_if_index = m_hw_item.data().value(); - memset(payload.tag.buf, 0, payload.tag.length); - memcpy(payload.tag.buf, m_name.c_str(), m_name.length()); + memset(payload.tag, 0, sizeof(payload.tag)); + memcpy(payload.tag, m_name.c_str(), m_name.length()); VAPI_CALL(req.execute()); diff --git a/extras/vom/vom/interface_factory.cpp b/extras/vom/vom/interface_factory.cpp index 750df96b025..abb26f84a6f 100644 --- a/extras/vom/vom/interface_factory.cpp +++ b/extras/vom/vom/interface_factory.cpp @@ -30,12 +30,12 @@ interface_factory::new_interface(const vapi_payload_sw_interface_details& vd) /** * Determine the interface type from the name and VLAN attributes */ - std::string name = reinterpret_cast<const char*>(vd.interface_name.buf); + std::string name = reinterpret_cast<const char*>(vd.interface_name); interface::type_t type = interface::type_t::from_string(name); - interface::admin_state_t state = interface::admin_state_t::from_int( - vd.flags & vapi_enum_if_status_flags::IF_STATUS_API_FLAG_ADMIN_UP); + interface::admin_state_t state = + interface::admin_state_t::from_int(vd.admin_up_down); handle_t hdl(vd.sw_if_index); - l2_address_t l2_address(vd.l2_address, 6); + l2_address_t l2_address(vd.l2_address, vd.l2_address_length); std::string tag = ""; if (interface::type_t::UNKNOWN == type) { @@ -64,8 +64,8 @@ interface_factory::new_interface(const vapi_payload_sw_interface_details& vd) * if the tag is set, then we wrote that to specify a name to make * the interface type more specific */ - if (vd.tag.buf[0] != 0) { - tag = std::string(reinterpret_cast<const char*>(vd.tag.buf)); + if (vd.tag[0] != 0) { + tag = std::string(reinterpret_cast<const char*>(vd.tag)); } if (!tag.empty() && interface::type_t::LOOPBACK == type) { diff --git a/extras/vom/vom/l3_binding_cmds.cpp b/extras/vom/vom/l3_binding_cmds.cpp index 30bd4726886..4afe13e1076 100644 --- a/extras/vom/vom/l3_binding_cmds.cpp +++ b/extras/vom/vom/l3_binding_cmds.cpp @@ -44,9 +44,7 @@ bind_cmd::issue(connection& con) payload.is_add = 1; payload.del_all = 0; - m_pfx.to_vpp((uint8_t*)&payload.prefix.address.af, - (uint8_t*)&payload.prefix.address, - (uint8_t*)&payload.prefix.address_length); + m_pfx.to_vpp(&payload.is_ipv6, payload.address, &payload.address_length); VAPI_CALL(req.execute()); @@ -88,9 +86,7 @@ unbind_cmd::issue(connection& con) payload.is_add = 0; payload.del_all = 0; - m_pfx.to_vpp((uint8_t*)&payload.prefix.address.af, - (uint8_t*)&payload.prefix.address, - (uint8_t*)&payload.prefix.address_length); + m_pfx.to_vpp(&payload.is_ipv6, payload.address, &payload.address_length); VAPI_CALL(req.execute()); |