diff options
author | Neale Ranns <neale.ranns@cisco.com> | 2017-11-03 04:39:05 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-11-06 17:44:21 +0000 |
commit | 9ef1c0adbf9399c55deeede3cf629dd4e8c20304 (patch) | |
tree | 0eeed8f869eee35a48797b6b837c16222a627e46 /src/vpp-api/vom/interface_factory.cpp | |
parent | addb55b9e0533c5f720b1cc1bdeeb4bbd0e6bf2a (diff) |
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 <neale.ranns@cisco.com>
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/interface_factory.cpp')
-rw-r--r-- | src/vpp-api/vom/interface_factory.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
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 <boost/algorithm/string.hpp> -#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> -interface::new_interface(const vapi_payload_sw_interface_details& vd) +interface_factory::new_interface(const vapi_payload_sw_interface_details& vd) { std::unique_ptr<interface> 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<const char*>(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 |