aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn/transport/core/memif_connector.h
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-02-01 17:12:38 +0100
committerMauro Sardara <msardara@cisco.com>2019-02-01 18:41:39 +0100
commite8fabe3f6313a3b9050fe16458e4714d9dce426e (patch)
treeb379acde21e48a0f2e047d47f79ea30e8d43bd80 /libtransport/src/hicn/transport/core/memif_connector.h
parentc00bc6fc2af9a54fe339f8d6a3ec1ab889c2931e (diff)
[HICN-10] Compile libtransport with libmemif support
Change-Id: I81d1cb4d5f16a61c35f66fe347985f05d8c97383 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/core/memif_connector.h')
-rw-r--r--libtransport/src/hicn/transport/core/memif_connector.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/libtransport/src/hicn/transport/core/memif_connector.h b/libtransport/src/hicn/transport/core/memif_connector.h
index 4667ec0b2..ff838930f 100644
--- a/libtransport/src/hicn/transport/core/memif_connector.h
+++ b/libtransport/src/hicn/transport/core/memif_connector.h
@@ -32,33 +32,11 @@
#define _Static_assert static_assert
-extern "C" {
-#include <memif/libmemif.h>
-};
-
namespace transport {
namespace core {
-typedef struct {
- uint16_t index;
- /* memif conenction handle */
- memif_conn_handle_t conn;
- /* transmit queue id */
- uint16_t tx_qid;
- /* tx buffers */
- memif_buffer_t *tx_bufs;
- /* allocated tx buffers counter */
- /* number of tx buffers pointing to shared memory */
- uint16_t tx_buf_num;
- /* rx buffers */
- memif_buffer_t *rx_bufs;
- /* allcoated rx buffers counter */
- /* number of rx buffers pointing to shared memory */
- uint16_t rx_buf_num;
- /* interface ip address */
- uint8_t ip_addr[4];
-} memif_connection_t;
+typedef struct memif_connection memif_connection_t;
#define APP_NAME "libtransport"
#define IF_NAME "vpp_connection"
@@ -68,6 +46,7 @@ typedef struct {
#define MEMIF_LOG2_RING_SIZE 11
class MemifConnector : public Connector {
+ typedef void *memif_conn_handle_t;
public:
MemifConnector(PacketReceivedCallback &&receive_callback,
OnReconnect &&on_reconnect_callback,
@@ -135,7 +114,7 @@ class MemifConnector : public Connector {
asio::io_service &io_service_;
std::unique_ptr<asio::io_service::work> work_;
uint32_t packet_counter_;
- memif_connection_t memif_connection_;
+ std::unique_ptr<memif_connection_t> memif_connection_;
uint16_t tx_buf_counter_;
PacketRing input_buffer_;