X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Ftap_interface.cpp;h=6555aeae5ee974f23e8abf7abe1816e6286c882c;hp=4054e26466c2e5a383be25255f6bd788c23dc6a0;hb=8e1cc46b2bba1ade546d611cdf7b6e48c97d90a1;hpb=b6a47953973f7c94239c394b649100e91bdb2152 diff --git a/extras/vom/vom/tap_interface.cpp b/extras/vom/vom/tap_interface.cpp index 4054e26466c..6555aeae5ee 100644 --- a/extras/vom/vom/tap_interface.cpp +++ b/extras/vom/vom/tap_interface.cpp @@ -25,21 +25,19 @@ tap_interface::event_handler tap_interface::m_evh; * Construct a new object matching the desried state */ tap_interface::tap_interface(const std::string& name, - type_t type, - admin_state_t state, - route::prefix_t prefix) - : interface(name, type, state) + const admin_state_t& state, + const route::prefix_t& prefix) + : interface(name, type_t::TAPV2, state) , m_prefix(prefix) , m_l2_address(l2_address_t::ZERO) { } tap_interface::tap_interface(const std::string& name, - type_t type, - admin_state_t state, - route::prefix_t prefix, + const admin_state_t& state, + const route::prefix_t& prefix, const l2_address_t& l2_address) - : interface(name, type, state) + : interface(name, type_t::TAPV2, state) , m_prefix(prefix) , m_l2_address(l2_address) { @@ -61,11 +59,7 @@ tap_interface::tap_interface(const tap_interface& o) std::queue& tap_interface::mk_create_cmd(std::queue& q) { - if (type_t::TAPV2 == type()) - q.push(new tap_interface_cmds::tapv2_create_cmd(m_hdl, name(), m_prefix, - m_l2_address)); - else - q.push(new tap_interface_cmds::tap_create_cmd(m_hdl, name(), m_prefix, + q.push(new tap_interface_cmds::tapv2_create_cmd(m_hdl, name(), m_prefix, m_l2_address)); return (q); @@ -74,10 +68,7 @@ tap_interface::mk_create_cmd(std::queue& q) std::queue& tap_interface::mk_delete_cmd(std::queue& q) { - if (type_t::TAPV2 == type()) - q.push(new tap_interface_cmds::tapv2_delete_cmd(m_hdl)); - else - q.push(new tap_interface_cmds::tap_delete_cmd(m_hdl)); + q.push(new tap_interface_cmds::tapv2_delete_cmd(m_hdl)); return (q); }