VOM fixes for 9090 - ships in the night commits

Change-Id: I4b03a4f86a7e0e47874715398ca9f8ff0f5386ee
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
diff --git a/src/vpp-api/vom/bridge_domain_entry.cpp b/src/vpp-api/vom/bridge_domain_entry.cpp
index 4041e31..7a1245b 100644
--- a/src/vpp-api/vom/bridge_domain_entry.cpp
+++ b/src/vpp-api/vom/bridge_domain_entry.cpp
@@ -39,8 +39,8 @@
   , m_tx_itf(tx_itf.singular())
 {
   /*
- * the route goes in the default table
- */
+   * the entry goes in the default bridge-domain
+   */
   bridge_domain bd(bridge_domain::DEFAULT_TABLE);
 
   m_bd = bd.singular();
@@ -92,8 +92,8 @@
 bridge_domain_entry::update(const bridge_domain_entry& r)
 {
   /*
- * create the table if it is not yet created
- */
+   * create the table if it is not yet created
+   */
   if (rc_t::OK != m_hw.rc()) {
     HW::enqueue(new create_cmd(m_hw, m_mac, m_bd->id(), m_tx_itf->handle()));
   }
@@ -151,10 +151,10 @@
                                 << mac.to_string() << itf->to_string();
 
     /*
- * Write each of the discovered interfaces into the OM,
- * but disable the HW Command q whilst we do, so that no
- * commands are sent to VPP
- */
+     * Write each of the discovered interfaces into the OM,
+     * but disable the HW Command q whilst we do, so that no
+     * commands are sent to VPP
+     */
     OM::commit(key, bd_e);
   }
 }
diff --git a/src/vpp-api/vom/bridge_domain_entry_cmds.cpp b/src/vpp-api/vom/bridge_domain_entry_cmds.cpp
index ad0786f..990af06 100644
--- a/src/vpp-api/vom/bridge_domain_entry_cmds.cpp
+++ b/src/vpp-api/vom/bridge_domain_entry_cmds.cpp
@@ -42,7 +42,7 @@
   auto& payload = req.get_request().get_payload();
   payload.bd_id = m_bd;
   payload.is_add = 1;
-  payload.mac = m_mac.to_u64();
+  m_mac.to_bytes(payload.mac, 6);
   payload.sw_if_index = m_tx_itf.value();
 
   VAPI_CALL(req.execute());
@@ -85,7 +85,7 @@
   auto& payload = req.get_request().get_payload();
   payload.bd_id = m_bd;
   payload.is_add = 1;
-  payload.mac = m_mac.to_u64();
+  m_mac.to_bytes(payload.mac, 6);
   payload.sw_if_index = ~0;
 
   VAPI_CALL(req.execute());
diff --git a/src/vpp-api/vom/types.cpp b/src/vpp-api/vom/types.cpp
index c362a60..128d757 100644
--- a/src/vpp-api/vom/types.cpp
+++ b/src/vpp-api/vom/types.cpp
@@ -101,16 +101,6 @@
   return (os);
 }
 
-mac_address_t::mac_address_t(uint64_t address)
-{
-  uint8_t mac[6];
-
-  std::memcpy(mac, &address, 6);
-  for (int i = 0; i < 6; i++) {
-    bytes[i] = mac[5 - i];
-  }
-}
-
 mac_address_t::mac_address_t(uint8_t b[6])
 {
   std::copy(b, b + 6, std::begin(bytes));
@@ -133,23 +123,6 @@
   }
 }
 
-uint64_t
-mac_address_t::to_u64() const
-{
-  uint64_t mac6 = 0;
-  uint8_t* b = reinterpret_cast<uint8_t*>(&mac6);
-
-  // whack hack. the vapi will byte swap.
-  b[2] = bytes[5];
-  b[3] = bytes[4];
-  b[4] = bytes[3];
-  b[5] = bytes[2];
-  b[6] = bytes[1];
-  b[7] = bytes[0];
-
-  return (mac6);
-}
-
 std::string
 mac_address_t::to_string() const
 {
diff --git a/src/vpp-api/vom/types.hpp b/src/vpp-api/vom/types.hpp
index fd3b24b..ca488fe 100644
--- a/src/vpp-api/vom/types.hpp
+++ b/src/vpp-api/vom/types.hpp
@@ -221,7 +221,6 @@
  */
 struct mac_address_t
 {
-  mac_address_t(uint64_t address);
   mac_address_t(uint8_t bytes[6]);
   mac_address_t(std::initializer_list<uint8_t> bytes);
   /**
@@ -255,11 +254,6 @@
   std::string to_string() const;
 
   /**
-   * U64 conversion
-   */
-  uint64_t to_u64() const;
-
-  /**
    * Underlying bytes array
    */
   std::array<uint8_t, 6> bytes;