From 79e0d4f89c4d532189aae06cc5dfbc14e3269703 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 11 Feb 2019 10:44:29 +0100 Subject: [HICN-50] Added udp application connector. Change-Id: I0c5afad4b404ec485f50b1342b81e70ef85a5163 Signed-off-by: Mauro Sardara Signed-off-by: michele papalini --- .../hicn/transport/core/vpp_forwarder_interface.cc | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'libtransport/src/hicn/transport/core/vpp_forwarder_interface.cc') diff --git a/libtransport/src/hicn/transport/core/vpp_forwarder_interface.cc b/libtransport/src/hicn/transport/core/vpp_forwarder_interface.cc index 69b18c0d9..8dc607295 100644 --- a/libtransport/src/hicn/transport/core/vpp_forwarder_interface.cc +++ b/libtransport/src/hicn/transport/core/vpp_forwarder_interface.cc @@ -47,20 +47,7 @@ VPPForwarderInterface::VPPForwarderInterface(MemifConnector &connector) sw_if_index_(~0), face_id_(~0) {} -VPPForwarderInterface::~VPPForwarderInterface() { - if (sw_if_index_ != uint32_t(~0) && VPPForwarderInterface::memif_api_) { - int ret = memif_binary_api_delete_memif(VPPForwarderInterface::memif_api_, - sw_if_index_); - - if (ret < 0) { - TRANSPORT_LOGE("Error deleting memif with sw idx %u.", sw_if_index_); - } - } - - if (VPPForwarderInterface::api_) { - vpp_binary_api_destroy(VPPForwarderInterface::api_); - } -} +VPPForwarderInterface::~VPPForwarderInterface() {} /** * @brief Create a memif interface in the local VPP forwarder. @@ -220,6 +207,23 @@ void VPPForwarderInterface::registerRoute(Prefix &prefix) { } } +void VPPForwarderInterface::closeConnection() { + if (sw_if_index_ != uint32_t(~0) && VPPForwarderInterface::memif_api_) { + int ret = memif_binary_api_delete_memif(VPPForwarderInterface::memif_api_, + sw_if_index_); + + if (ret < 0) { + TRANSPORT_LOGE("Error deleting memif with sw idx %u.", sw_if_index_); + } + } + + if (VPPForwarderInterface::api_) { + vpp_binary_api_destroy(VPPForwarderInterface::api_); + } + + connector_.close(); +} + } // namespace core } // namespace transport -- cgit 1.2.3-korg