vom: Fixes for g++-9
[vpp.git] / extras / vom / vom / acl_l2_list.cpp
index 939fb34..8684c2c 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "vom/acl_l2_list.hpp"
 #include "vom/acl_list_cmds.hpp"
+#include "vom/api_types.hpp"
 #include "vom/logger.hpp"
 #include "vom/singular_db_funcs.hpp"
 
@@ -42,28 +43,24 @@ l2_list::event_handler::event_handler()
 l2_list::l2_list(const key_t& key)
   : m_hdl(handle_t::INVALID)
   , m_key(key)
-{
-}
+{}
 
 l2_list::l2_list(const handle_t& hdl, const key_t& key)
   : m_hdl(hdl)
   , m_key(key)
-{
-}
+{}
 
 l2_list::l2_list(const key_t& key, const rules_t& rules)
   : m_hdl(handle_t::INVALID)
   , m_key(key)
   , m_rules(rules)
-{
-}
+{}
 
 l2_list::l2_list(const l2_list& o)
   : m_hdl(o.m_hdl)
   , m_key(o.m_key)
   , m_rules(o.m_rules)
-{
-}
+{}
 
 l2_list::~l2_list()
 {
@@ -199,11 +196,12 @@ l2_list::event_handler::handle_populate(const client_db::key_t& key)
     l2_list acl(hdl, std::string(reinterpret_cast<const char*>(payload.tag)));
 
     for (unsigned int ii = 0; ii < payload.count; ii++) {
-      const route::prefix_t pfx(payload.r[ii].is_ipv6,
-                                payload.r[ii].src_ip_addr,
-                                payload.r[ii].src_ip_prefix_len);
-      l2_rule rule(ii, action_t::from_int(payload.r[ii].is_permit), pfx,
-                   { payload.r[ii].src_mac }, { payload.r[ii].src_mac_mask });
+      const route::prefix_t pfx = from_api(payload.r[ii].src_prefix);
+      l2_rule rule(ii,
+                   action_t::from_int(payload.r[ii].is_permit),
+                   pfx,
+                   { payload.r[ii].src_mac },
+                   { payload.r[ii].src_mac_mask });
 
       acl.insert(rule);
     }