aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/io_modules
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/io_modules')
-rw-r--r--libtransport/src/io_modules/CMakeLists.txt6
-rw-r--r--libtransport/src/io_modules/hicn-light/CMakeLists.txt (renamed from libtransport/src/io_modules/hicn-light-ng/CMakeLists.txt)27
-rw-r--r--libtransport/src/io_modules/hicn-light/hicn_forwarder_module.cc (renamed from libtransport/src/io_modules/hicn-light-ng/hicn_forwarder_module.cc)4
-rw-r--r--libtransport/src/io_modules/hicn-light/hicn_forwarder_module.h (renamed from libtransport/src/io_modules/hicn-light-ng/hicn_forwarder_module.h)6
-rw-r--r--libtransport/src/io_modules/loopback/local_face.cc18
-rw-r--r--libtransport/src/io_modules/memif/hicn_vapi.c40
-rw-r--r--libtransport/src/io_modules/memif/hicn_vapi.h12
-rw-r--r--libtransport/src/io_modules/memif/vpp_forwarder_module.cc10
8 files changed, 67 insertions, 56 deletions
diff --git a/libtransport/src/io_modules/CMakeLists.txt b/libtransport/src/io_modules/CMakeLists.txt
index f1a27d3cb..fcf69cd42 100644
--- a/libtransport/src/io_modules/CMakeLists.txt
+++ b/libtransport/src/io_modules/CMakeLists.txt
@@ -17,11 +17,11 @@
##############################################################
if (${CMAKE_SYSTEM_NAME} MATCHES Android OR ${CMAKE_SYSTEM_NAME} MATCHES iOS)
list(APPEND SOURCE_FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/hicn-light-ng/hicn_forwarder_module.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/hicn-light/hicn_forwarder_module.cc
)
list(APPEND HEADER_FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/hicn-light-ng/hicn_forwarder_module.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/hicn-light/hicn_forwarder_module.h
)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
@@ -69,7 +69,7 @@ else()
##############################################################
# Compile submodules
##############################################################
- add_subdirectory(hicn-light-ng)
+ add_subdirectory(hicn-light)
add_subdirectory(loopback)
add_subdirectory(forwarder)
diff --git a/libtransport/src/io_modules/hicn-light-ng/CMakeLists.txt b/libtransport/src/io_modules/hicn-light/CMakeLists.txt
index 325a8bd1d..ae3aec52d 100644
--- a/libtransport/src/io_modules/hicn-light-ng/CMakeLists.txt
+++ b/libtransport/src/io_modules/hicn-light/CMakeLists.txt
@@ -12,7 +12,7 @@
# limitations under the License.
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
- find_package(Libhicnctrl ${CURRENT_VERSION} REQUIRED NO_MODULE)
+ find_package(Libhicnctrl ${HICN_CURRENT_VERSION} REQUIRED NO_MODULE)
if (DISABLE_SHARED_LIBRARIES)
set(LIBTYPE static)
@@ -47,16 +47,17 @@ list(APPEND MODULE_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/hicn_forwarder_module.cc
)
-build_module(hicnlightng_module
- SHARED
- SOURCES ${MODULE_SOURCE_FILES}
- DEPENDS ${DEPENDENCIES}
- COMPONENT ${LIBTRANSPORT_COMPONENT}
- LINK_LIBRARIES PRIVATE ${LIBHICNCTRL_LIBRARIES}
- INCLUDE_DIRS
- PRIVATE
- ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS}
- ${Libhicnctrl_INCLUDE_DIRS}
- DEFINITIONS ${COMPILER_DEFINITIONS}
- COMPILE_OPTIONS ${COMPILER_OPTIONS}
+build_module(hicnlight_module
+ SHARED
+ SOURCES ${MODULE_SOURCE_FILES}
+ DEPENDS ${DEPENDENCIES}
+ COMPONENT ${LIBTRANSPORT_COMPONENT}
+ LINK_LIBRARIES PRIVATE ${LIBHICNCTRL_LIBRARIES}
+ INCLUDE_DIRS
+ PRIVATE
+ ${LIBTRANSPORT_INTERNAL_INCLUDE_DIRS}
+ ${Libhicn_INCLUDE_DIRS}
+ ${Libhicnctrl_INCLUDE_DIRS}
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ COMPILE_OPTIONS ${COMPILER_OPTIONS}
)
diff --git a/libtransport/src/io_modules/hicn-light-ng/hicn_forwarder_module.cc b/libtransport/src/io_modules/hicn-light/hicn_forwarder_module.cc
index 95f04822f..ae8aebec6 100644
--- a/libtransport/src/io_modules/hicn-light-ng/hicn_forwarder_module.cc
+++ b/libtransport/src/io_modules/hicn-light/hicn_forwarder_module.cc
@@ -14,10 +14,10 @@
*/
#include <core/udp_connector.h>
-#include <io_modules/hicn-light-ng/hicn_forwarder_module.h>
+#include <io_modules/hicn-light/hicn_forwarder_module.h>
extern "C" {
-#include <hicn/ctrl/hicn-light-ng.h>
+#include <hicn/ctrl/hicn-light.h>
}
namespace transport {
diff --git a/libtransport/src/io_modules/hicn-light-ng/hicn_forwarder_module.h b/libtransport/src/io_modules/hicn-light/hicn_forwarder_module.h
index 7f0e7aca8..0d6acb484 100644
--- a/libtransport/src/io_modules/hicn-light-ng/hicn_forwarder_module.h
+++ b/libtransport/src/io_modules/hicn-light/hicn_forwarder_module.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Copyright (c) 2021-2022 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -19,7 +19,7 @@
#include <hicn/transport/core/prefix.h>
extern "C" {
-#include <hicn/ctrl/hicn-light-ng.h>
+#include <hicn/ctrl/hicn-light.h>
}
namespace transport {
@@ -32,6 +32,7 @@ class HicnForwarderModule : public IoModule {
static constexpr std::uint16_t interface_mtu = 1500;
public:
+#if 0
union addressLight {
uint32_t ipv4;
struct in6_addr ipv6;
@@ -50,6 +51,7 @@ class HicnForwarderModule : public IoModule {
};
using route_to_self_command = struct route_to_self_command;
+#endif
HicnForwarderModule();
diff --git a/libtransport/src/io_modules/loopback/local_face.cc b/libtransport/src/io_modules/loopback/local_face.cc
index 7ef3f1a59..30a46c93b 100644
--- a/libtransport/src/io_modules/loopback/local_face.cc
+++ b/libtransport/src/io_modules/loopback/local_face.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Copyright (c) 2021-2022 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -57,12 +57,18 @@ Face &Face::operator=(Face &&other) {
void Face::onPacket(const Packet &packet) {
DLOG_IF(INFO, VLOG_IS_ON(3)) << "Sending content to local socket.";
- if (Packet::isInterest(packet.data())) {
- rescheduleOnIoService<Interest>(packet);
- } else {
- rescheduleOnIoService<ContentObject>(packet);
+ switch (packet->getFormat()) {
+ case HICN_PACKET_FORMAT_INTEREST:
+ rescheduleOnIoService<Interest>(packet);
+ break;
+ case HICN_PACKET_FORMAT_DATA:
+ rescheduleOnIoService<ContentObject>(packet);
+ break;
+ default:
+ /* Should not occur */
+ break;
}
}
} // namespace core
-} // namespace transport \ No newline at end of file
+} // namespace transport
diff --git a/libtransport/src/io_modules/memif/hicn_vapi.c b/libtransport/src/io_modules/memif/hicn_vapi.c
index 753679f54..9fc64f720 100644
--- a/libtransport/src/io_modules/memif/hicn_vapi.c
+++ b/libtransport/src/io_modules/memif/hicn_vapi.c
@@ -53,14 +53,15 @@ static vapi_error_e register_prod_app_cb(
if (reply == NULL) return rv;
output_params->cs_reserved = reply->cs_reserved;
- output_params->prod_addr = (ip_address_t *)malloc(sizeof(ip_address_t));
- memset(output_params->prod_addr, 0, sizeof(ip_address_t));
+ output_params->prod_addr =
+ (hicn_ip_address_t *)malloc(sizeof(hicn_ip_address_t));
+ memset(output_params->prod_addr, 0, sizeof(hicn_ip_address_t));
if (reply->prod_addr.af == ADDRESS_IP6)
memcpy(&output_params->prod_addr->v6, reply->prod_addr.un.ip6,
- sizeof(ip6_address_t));
+ sizeof(ipv6_address_t));
else
memcpy(&output_params->prod_addr->v4, reply->prod_addr.un.ip4,
- sizeof(ip4_address_t));
+ sizeof(ipv4_address_t));
output_params->face_id = reply->faceid;
return reply->retval;
@@ -73,13 +74,14 @@ int hicn_vapi_register_prod_app(vapi_ctx_t ctx,
vapi_msg_hicn_api_register_prod_app *msg =
vapi_alloc_hicn_api_register_prod_app(ctx);
- if (ip_address_is_v4((ip_address_t *)&input_params->prefix->address)) {
+ if (hicn_ip_address_is_v4(
+ (hicn_ip_address_t *)&input_params->prefix->address)) {
memcpy(&msg->payload.prefix.address.un.ip4, &input_params->prefix->address,
- sizeof(ip4_address_t));
+ sizeof(ipv4_address_t));
msg->payload.prefix.address.af = ADDRESS_IP4;
} else {
memcpy(&msg->payload.prefix.address.un.ip6, &input_params->prefix->address,
- sizeof(ip6_address_t));
+ sizeof(ipv6_address_t));
msg->payload.prefix.address.af = ADDRESS_IP6;
}
msg->payload.prefix.len = input_params->prefix->len;
@@ -121,14 +123,14 @@ static vapi_error_e register_cons_app_cb(
if (reply == NULL) return rv;
- output_params->src6 = (ip_address_t *)malloc(sizeof(ip_address_t));
- output_params->src4 = (ip_address_t *)malloc(sizeof(ip_address_t));
- memset(output_params->src6, 0, sizeof(ip_address_t));
- memset(output_params->src4, 0, sizeof(ip_address_t));
+ output_params->src6 = (hicn_ip_address_t *)malloc(sizeof(hicn_ip_address_t));
+ output_params->src4 = (hicn_ip_address_t *)malloc(sizeof(hicn_ip_address_t));
+ memset(output_params->src6, 0, sizeof(hicn_ip_address_t));
+ memset(output_params->src4, 0, sizeof(hicn_ip_address_t));
memcpy(&output_params->src6->v6, &reply->src_addr6.un.ip6,
- sizeof(ip6_address_t));
+ sizeof(ipv6_address_t));
memcpy(&output_params->src4->v4, &reply->src_addr4.un.ip4,
- sizeof(ip4_address_t));
+ sizeof(ipv4_address_t));
output_params->face_id1 = reply->faceid1;
output_params->face_id2 = reply->faceid2;
@@ -185,27 +187,27 @@ int hicn_vapi_register_route(vapi_ctx_t ctx,
vapi_msg_ip_route_add_del *msg = vapi_alloc_ip_route_add_del(ctx, 1);
msg->payload.is_add = 1;
- if (ip_address_is_v4((ip_address_t *)(input_params->prod_addr))) {
+ if (hicn_ip_address_is_v4((hicn_ip_address_t *)(input_params->prod_addr))) {
memcpy(&msg->payload.route.prefix.address.un.ip4,
- &input_params->prefix->address.v4, sizeof(ip4_address_t));
+ &input_params->prefix->address.v4, sizeof(ipv4_address_t));
msg->payload.route.prefix.address.af = ADDRESS_IP4;
msg->payload.route.prefix.len = input_params->prefix->len;
} else {
memcpy(&msg->payload.route.prefix.address.un.ip6,
- &input_params->prefix->address.v6, sizeof(ip6_address_t));
+ &input_params->prefix->address.v6, sizeof(ipv6_address_t));
msg->payload.route.prefix.address.af = ADDRESS_IP6;
msg->payload.route.prefix.len = input_params->prefix->len;
}
msg->payload.route.paths[0].sw_if_index = ~0;
msg->payload.route.paths[0].table_id = 0;
- if (ip_address_is_v4((ip_address_t *)(input_params->prod_addr))) {
+ if (hicn_ip_address_is_v4((hicn_ip_address_t *)(input_params->prod_addr))) {
memcpy(&(msg->payload.route.paths[0].nh.address.ip4),
- input_params->prod_addr->v4.as_u8, sizeof(ip4_address_t));
+ input_params->prod_addr->v4.as_u8, sizeof(ipv4_address_t));
msg->payload.route.paths[0].proto = FIB_API_PATH_NH_PROTO_IP4;
} else {
memcpy(&(msg->payload.route.paths[0].nh.address.ip6),
- input_params->prod_addr->v6.as_u8, sizeof(ip6_address_t));
+ input_params->prod_addr->v6.as_u8, sizeof(ipv6_address_t));
msg->payload.route.paths[0].proto = FIB_API_PATH_NH_PROTO_IP6;
}
diff --git a/libtransport/src/io_modules/memif/hicn_vapi.h b/libtransport/src/io_modules/memif/hicn_vapi.h
index 967179f68..cfdc93fe3 100644
--- a/libtransport/src/io_modules/memif/hicn_vapi.h
+++ b/libtransport/src/io_modules/memif/hicn_vapi.h
@@ -27,7 +27,7 @@ extern "C" {
#include "stdint.h"
typedef struct {
- ip_prefix_t* prefix;
+ hicn_ip_prefix_t* prefix;
uint32_t swif;
uint32_t cs_reserved;
} hicn_producer_input_params;
@@ -42,20 +42,20 @@ typedef struct {
typedef struct {
uint32_t cs_reserved;
- ip_address_t* prod_addr;
+ hicn_ip_address_t* prod_addr;
uint32_t face_id;
} hicn_producer_output_params;
typedef struct {
- ip_address_t* src4;
- ip_address_t* src6;
+ hicn_ip_address_t* src4;
+ hicn_ip_address_t* src6;
uint32_t face_id1;
uint32_t face_id2;
} hicn_consumer_output_params;
typedef struct {
- ip_prefix_t* prefix;
- ip_address_t* prod_addr;
+ hicn_ip_prefix_t* prefix;
+ hicn_ip_address_t* prod_addr;
} hicn_producer_set_route_params;
int hicn_vapi_register_prod_app(vapi_ctx_t ctx,
diff --git a/libtransport/src/io_modules/memif/vpp_forwarder_module.cc b/libtransport/src/io_modules/memif/vpp_forwarder_module.cc
index c096a71b8..ab11828ec 100644
--- a/libtransport/src/io_modules/memif/vpp_forwarder_module.cc
+++ b/libtransport/src/io_modules/memif/vpp_forwarder_module.cc
@@ -124,8 +124,8 @@ uint32_t VPPForwarderModule::getMemifConfiguration() {
void VPPForwarderModule::consumerConnection() {
hicn_consumer_input_params input = {0};
hicn_consumer_output_params output = {0};
- ip_address_t ip4_address;
- ip_address_t ip6_address;
+ hicn_ip_address_t ip4_address;
+ hicn_ip_address_t ip6_address;
output.src4 = &ip4_address;
output.src6 = &ip6_address;
@@ -181,10 +181,10 @@ void VPPForwarderModule::connect(bool is_consumer) {
}
void VPPForwarderModule::registerRoute(const Prefix &prefix) {
- const ip_prefix_t &addr = prefix.toIpPrefixStruct();
+ const hicn_ip_prefix_t &addr = prefix.toIpPrefixStruct();
- ip_prefix_t producer_prefix;
- ip_address_t producer_locator;
+ hicn_ip_prefix_t producer_prefix;
+ hicn_ip_address_t producer_locator;
if (face_id1_ == uint32_t(~0)) {
hicn_producer_input_params input;