From 9ef1c0adbf9399c55deeede3cf629dd4e8c20304 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Fri, 3 Nov 2017 04:39:05 -0700 Subject: VOM reshuffle split the VOM into two halves; a top/front-end and a bottom/backend. Only the backend includes the auto-generated VAPI. This serves two purposes: 1 - improves ompile times for VOM, since the VAPI is included only in the backend. 2 - does not expose VAPI to users of VOM Change-Id: I17b93aeaef10c0eba8612016d9034aca5628d9f7 Signed-off-by: Neale Ranns Signed-off-by: Mohsin Kazmi --- src/vpp-api/vom/interface_factory.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/vpp-api/vom/interface_factory.cpp') diff --git a/src/vpp-api/vom/interface_factory.cpp b/src/vpp-api/vom/interface_factory.cpp index aac968c1b3a..cd2d373f0bf 100644 --- a/src/vpp-api/vom/interface_factory.cpp +++ b/src/vpp-api/vom/interface_factory.cpp @@ -15,13 +15,13 @@ #include -#include "vom/interface.hpp" +#include "vom/interface_factory.hpp" #include "vom/sub_interface.hpp" #include "vom/tap_interface.hpp" namespace VOM { std::unique_ptr -interface::new_interface(const vapi_payload_sw_interface_details& vd) +interface_factory::new_interface(const vapi_payload_sw_interface_details& vd) { std::unique_ptr up_itf; @@ -29,12 +29,13 @@ interface::new_interface(const vapi_payload_sw_interface_details& vd) * Determine the interface type from the name and VLAN attributes */ std::string name = reinterpret_cast(vd.interface_name); - type_t type = interface::type_t::from_string(name); - admin_state_t state = interface::admin_state_t::from_int(vd.link_up_down); + interface::type_t type = interface::type_t::from_string(name); + interface::admin_state_t state = + interface::admin_state_t::from_int(vd.link_up_down); handle_t hdl(vd.sw_if_index); l2_address_t l2_address(vd.l2_address, vd.l2_address_length); - if (type_t::AFPACKET == type) { + if (interface::type_t::AFPACKET == type) { /* * need to strip VPP's "host-" prefix from the interface name */ @@ -52,7 +53,7 @@ interface::new_interface(const vapi_payload_sw_interface_details& vd) /* * pull out the other special cases */ - if (type_t::TAP == type) { + if (interface::type_t::TAP == type) { /* * TAP interface */ @@ -67,7 +68,7 @@ interface::new_interface(const vapi_payload_sw_interface_details& vd) interface parent(parts[0], type, state); up_itf.reset(new sub_interface(hdl, parent, state, vd.sub_id)); - } else if (type_t::VXLAN == type) { + } else if (interface::type_t::VXLAN == type) { /* * there's not enough inforation in a SW interface record to * construct @@ -79,7 +80,7 @@ interface::new_interface(const vapi_payload_sw_interface_details& vd) return (up_itf); } -} +}; // namespace VOM /* * fd.io coding-style-patch-verification: ON -- cgit 1.2.3-korg