summaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-08-22 10:00:17 +0000
committerGerrit Code Review <gerrit@fd.io>2019-08-22 10:00:17 +0000
commit7d14523ac8e0708e8877cce7f3a21a340740dd47 (patch)
tree3c131f3f52276c483967fadc44b365e2a80f3a7a /libtransport
parentae1a51414080f89e5dcf2d0c1bf8cd51b38abf63 (diff)
parent3abde45db1b56c5876029964d10c889e0f1ddfbb (diff)
Merge "[HICN-263] DO_NOT_MERGE Updating hicn-plugin and libtransport to vpp_1908"
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);