aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-08-14 13:31:56 +0200
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-08-22 10:51:56 +0200
commit3abde45db1b56c5876029964d10c889e0f1ddfbb (patch)
tree701da4ff41c68d95425d734b6b59d6f3d769f295 /libtransport
parent1d896a7f11998346b7ceb0385b1c94ecb5c90c2e (diff)
[HICN-263] DO_NOT_MERGEv19.08
Updating hicn-plugin and libtransport to vpp_1908 Change-Id: I8bdad9725ec50597d79b3dc9a8d151ca149c3808 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/hicn/transport/core/memif_connector.cc16
-rw-r--r--libtransport/src/hicn/transport/core/memif_connector.h2
2 files changed, 13 insertions, 5 deletions
diff --git a/libtransport/src/hicn/transport/core/memif_connector.cc b/libtransport/src/hicn/transport/core/memif_connector.cc
index a77f14839..43dfab345 100644
--- a/libtransport/src/hicn/transport/core/memif_connector.cc
+++ b/libtransport/src/hicn/transport/core/memif_connector.cc
@@ -139,14 +139,22 @@ int MemifConnector::createMemif(uint32_t index, uint8_t mode, char *s) {
args.num_m2s_rings = 1;
strncpy((char *)args.interface_name, IF_NAME, strlen(IF_NAME) + 1);
args.mode = memif_interface_mode_t::MEMIF_INTERFACE_MODE_IP;
- args.socket_filename = (uint8_t *)socket_filename_.c_str();
- TRANSPORT_LOGD("Socket filename: %s", args.socket_filename);
+ int err;
+
+ err= memif_create_socket (&args.socket, socket_filename_.c_str(),
+ nullptr);
+
+ if (TRANSPORT_EXPECT_FALSE(err != MEMIF_ERR_SUCCESS)) {
+ throw errors::RuntimeException(memif_strerror(err));
+ }
+
+ TRANSPORT_LOGD("Socket filename: %s", socket_filename_.c_str());
args.interface_id = index;
/* last argument for memif_create (void * private_ctx) is used by user
to identify connection. this context is returned with callbacks */
- int err;
+
/* default interrupt */
if (s == nullptr) {
err = memif_create(&c->conn, &args, onConnect, onDisconnect, onInterrupt,
@@ -204,7 +212,7 @@ int MemifConnector::deleteMemif() {
return 0;
}
-int MemifConnector::controlFdUpdate(int fd, uint8_t events) {
+int MemifConnector::controlFdUpdate(int fd, uint8_t events, void *private_ctx) {
/* convert memif event definitions to epoll events */
if (events & MEMIF_FD_EVENT_DEL) {
return MemifConnector::main_event_reactor_.delFileDescriptor(fd);
diff --git a/libtransport/src/hicn/transport/core/memif_connector.h b/libtransport/src/hicn/transport/core/memif_connector.h
index ef100e3fb..4f43c97ef 100644
--- a/libtransport/src/hicn/transport/core/memif_connector.h
+++ b/libtransport/src/hicn/transport/core/memif_connector.h
@@ -78,7 +78,7 @@ class MemifConnector : public Connector {
int deleteMemif();
- static int controlFdUpdate(int fd, uint8_t events);
+ static int controlFdUpdate(int fd, uint8_t events, void *private_ctx);
static int onConnect(memif_conn_handle_t conn, void *private_ctx);