diff options
author | Jakub Grajciar <jgrajcia@cisco.com> | 2020-01-30 14:01:17 +0100 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2020-02-26 11:48:35 +0000 |
commit | 1c684f9af219752cf1e5f30b7932094ab9d12551 (patch) | |
tree | cc8bb59aff294587aa37e26d0002d4b915d74b7d /extras | |
parent | db86329abb4ea164b9061a1d6b47f186c6b9b8fb (diff) |
lldp: API cleanup
Use consistent API types.
Type: fix
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I2fe6b56dc0f224f438ed5f14c0f276d94afbaea8
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'extras')
-rw-r--r-- | extras/vom/vom/lldp_binding_cmds.cpp | 10 | ||||
-rw-r--r-- | extras/vom/vom/lldp_global_cmds.cpp | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/extras/vom/vom/lldp_binding_cmds.cpp b/extras/vom/vom/lldp_binding_cmds.cpp index 8c27579a643..02ed8cd450a 100644 --- a/extras/vom/vom/lldp_binding_cmds.cpp +++ b/extras/vom/vom/lldp_binding_cmds.cpp @@ -26,8 +26,7 @@ bind_cmd::bind_cmd(HW::item<bool>& item, : rpc_cmd(item) , m_itf(itf) , m_port_desc(port_desc) -{ -} +{} bool bind_cmd::operator==(const bind_cmd& other) const @@ -44,8 +43,8 @@ bind_cmd::issue(connection& con) payload.sw_if_index = m_itf.value(); payload.enable = 1; - memcpy(payload.port_desc, m_port_desc.c_str(), - std::min(sizeof(payload.port_desc), m_port_desc.length())); + memcpy(payload.port_desc.buf, m_port_desc.c_str(), m_port_desc.length()); + payload.port_desc.length = m_port_desc.length(); VAPI_CALL(req.execute()); @@ -65,8 +64,7 @@ bind_cmd::to_string() const unbind_cmd::unbind_cmd(HW::item<bool>& item, const handle_t& itf) : rpc_cmd(item) , m_itf(itf) -{ -} +{} bool unbind_cmd::operator==(const unbind_cmd& other) const diff --git a/extras/vom/vom/lldp_global_cmds.cpp b/extras/vom/vom/lldp_global_cmds.cpp index 7ea9b7895ea..32931a621f0 100644 --- a/extras/vom/vom/lldp_global_cmds.cpp +++ b/extras/vom/vom/lldp_global_cmds.cpp @@ -25,8 +25,7 @@ config_cmd::config_cmd(HW::item<bool>& item, , m_system_name(system_name) , m_tx_hold(tx_hold) , m_tx_interval(tx_interval) -{ -} +{} bool config_cmd::operator==(const config_cmd& other) const @@ -43,8 +42,9 @@ config_cmd::issue(connection& con) payload.tx_hold = m_tx_hold; payload.tx_interval = m_tx_interval; - memcpy(payload.system_name, m_system_name.c_str(), - std::min(sizeof(payload.system_name), m_system_name.length())); + memcpy( + payload.system_name.buf, m_system_name.c_str(), m_system_name.length()); + payload.system_name.length = m_system_name.length(); VAPI_CALL(req.execute()); |