diff options
author | Mauro <you@example.com> | 2021-06-30 07:57:22 +0000 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2021-07-06 16:16:04 +0000 |
commit | 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch) | |
tree | 7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /libtransport/src/io_modules/memif/vpp_forwarder_module.cc | |
parent | 147ba39bed26887f5eba84757e2463ab8e370a9a (diff) |
[HICN-713] Transport Library Major Refactoring 2
Co-authored-by: Luca Muscariello <muscariello@ieee.org>
Co-authored-by: Michele Papalini <micpapal@cisco.com>
Co-authored-by: Olivier Roques <oroques+fdio@cisco.com>
Co-authored-by: Giulio Grassi <gigrassi@cisco.com>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2
Diffstat (limited to 'libtransport/src/io_modules/memif/vpp_forwarder_module.cc')
-rw-r--r-- | libtransport/src/io_modules/memif/vpp_forwarder_module.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libtransport/src/io_modules/memif/vpp_forwarder_module.cc b/libtransport/src/io_modules/memif/vpp_forwarder_module.cc index dcbcd7ed0..44c8376df 100644 --- a/libtransport/src/io_modules/memif/vpp_forwarder_module.cc +++ b/libtransport/src/io_modules/memif/vpp_forwarder_module.cc @@ -13,6 +13,7 @@ * limitations under the License. */ +#include <glog/logging.h> #include <hicn/transport/config.h> #include <hicn/transport/errors/not_implemented_exception.h> #include <io_modules/memif/hicn_vapi.h> @@ -148,21 +149,19 @@ void VPPForwarderModule::producerConnection() { void VPPForwarderModule::connect(bool is_consumer) { int retry = 20; - TRANSPORT_LOGI("Connecting to VPP through vapi."); + LOG(INFO) << "Connecting to VPP through vapi."; vapi_error_e ret = vapi_connect_safe(&sock_, 0); while (ret != VAPI_OK && retry > 0) { - TRANSPORT_LOGE("Error connecting to VPP through vapi. Retrying.."); + LOG(ERROR) << "Error connecting to VPP through vapi. Retrying.."; --retry; ret = vapi_connect_safe(&sock_, 0); } - if (ret != VAPI_OK) { - throw std::runtime_error( - "Impossible to connect to forwarder. Is VPP running?"); - } + CHECK_EQ(ret, VAPI_OK) + << "Impossible to connect to forwarder. Is VPP running?"; - TRANSPORT_LOGI("Connected to VPP through vapi."); + LOG(INFO) << "Connected to VPP through vapi."; sw_if_index_ = getMemifConfiguration(); @@ -247,7 +246,7 @@ void VPPForwarderModule::closeConnection() { int ret = memif_vapi_delete_memif(VPPForwarderModule::sock_, sw_if_index_); if (ret < 0) { - TRANSPORT_LOGE("Error deleting memif with sw idx %u.", sw_if_index_); + LOG(ERROR) << "Error deleting memif with sw idx " << sw_if_index_; } } |