aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt5
-rw-r--r--apps/CMakeLists.txt58
-rw-r--r--apps/cmake/Modules/Packaging.cmake28
-rwxr-xr-xapps/src/higet.cc165
-rw-r--r--hicn-plugin/src/faces/face.h2
-rw-r--r--hicn-plugin/src/faces/ip/face_ip.c20
-rw-r--r--hicn-plugin/src/hicn.api10
-rw-r--r--hicn-plugin/src/hicn_api.c54
-rw-r--r--hicn-plugin/src/hicn_api_test.c52
-rw-r--r--libtransport/src/hicn/transport/CMakeLists.txt14
-rw-r--r--libtransport/src/hicn/transport/http/facade.h6
-rw-r--r--libtransport/src/hicn/transport/utils/CMakeLists.txt1
-rw-r--r--utils/CMakeLists.txt1
14 files changed, 362 insertions, 55 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..378eac25d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff8c87002..999b54ef9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,7 @@ option(BUILD_LIBHICN "Build the hicn core library" ON)
option(BUILD_HICNLIGHT "Build the hicn light forwarder" ON)
option(BUILD_LIBTRANSPORT "Build the hicn transport library" ON)
option(BUILD_UTILS "Build the hicn utils" ON)
+option(BUILD_APPS "Build the hicn apps" ON)
option(BUILD_HICNPLUGIN "Build the hicn vpp plugin" OFF)
list(APPEND dir_options
@@ -33,12 +34,14 @@ list(APPEND dir_options
BUILD_HICNLIGHT
BUILD_LIBTRANSPORT
BUILD_UTILS
+ BUILD_APPS
)
set(BUILD_LIBHICN_DIR lib)
set(BUILD_HICNLIGHT_DIR hicn-light)
set(BUILD_LIBTRANSPORT_DIR libtransport)
set(BUILD_UTILS_DIR utils)
+set(BUILD_APPS_DIR apps)
set(BUILD_HICNPLUGIN_DIR hicn-plugin)
## HEADER FILES
@@ -63,6 +66,7 @@ set(HICN_LIGHT_DAEMON hicnLightDaemon)
set(HICN_PLUGIN hicn-plugin)
set(LIBTRANSPORT hicntransport)
set(HICN_UTILS hicn-utils)
+set(HICN_APPS hicn-apps)
if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
list(APPEND subdirs
@@ -76,6 +80,7 @@ if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
set(LIBTRANSPORT ${LIBTRANSPORT}-memif)
set(HICN_UTILS ${HICN_UTILS}-memif)
+ set(HICN_APPS ${HICN_APPS}-memif)
endif()
## Shared targets
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
new file mode 100644
index 000000000..0f7a5c289
--- /dev/null
+++ b/apps/CMakeLists.txt
@@ -0,0 +1,58 @@
+# Copyright (c) 2017-2019 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:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
+set(CMAKE_CXX_STANDARD 14)
+
+project(apps)
+
+set(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+ "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules"
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
+)
+
+include(BuildMacros)
+include(WindowsMacros)
+
+if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
+ find_package(Libtransport REQUIRED)
+ set(HICN_APPS hicn-apps)
+else()
+ set(LIBTRANSPORT_LIBRARIES ${LIBTRANSPORT_SHARED})
+endif()
+
+include(Packaging)
+
+set (COMPILER_DEFINITIONS "")
+
+list(APPEND APPS_SRC
+ src/higet.cc
+)
+
+if (WIN32)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4200 /wd4996")
+endif ()
+
+foreach(app ${APPS_SRC})
+ get_filename_component(_app_name ${app} NAME)
+ string(REGEX REPLACE ".cc" "" app_name ${_app_name})
+
+ build_executable(${app_name}
+ SOURCES ${app}
+ LINK_LIBRARIES ${LIBTRANSPORT_LIBRARIES} ${WSOCK32_LIBRARY} ${WS2_32_LIBRARY}
+ DEPENDS ${LIBTRANSPORT}
+ COMPONENT ${HICN_APPS}
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ )
+endforeach()
diff --git a/apps/cmake/Modules/Packaging.cmake b/apps/cmake/Modules/Packaging.cmake
new file mode 100644
index 000000000..6a6e34777
--- /dev/null
+++ b/apps/cmake/Modules/Packaging.cmake
@@ -0,0 +1,28 @@
+# Copyright (c) 2017-2019 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:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set(${HICN_APPS}_DESCRIPTION
+"Hicn apps provide the higet application, \
+useful for testing and debugging within a hicn network."
+ CACHE STRING "Description for deb/rpm package."
+)
+
+set(${HICN_APPS}_DEB_DEPENDENCIES
+ "lib${LIBTRANSPORT} (>= stable_version)"
+ CACHE STRING "Dependencies for deb/rpm package."
+)
+
+set(${HICN_APPS}_RPM_DEPENDENCIES
+ "lib${LIBTRANSPORT} >= stable_version"
+ CACHE STRING "Dependencies for deb/rpm package."
+) \ No newline at end of file
diff --git a/apps/src/higet.cc b/apps/src/higet.cc
new file mode 100755
index 000000000..d2ef818cb
--- /dev/null
+++ b/apps/src/higet.cc
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2017 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:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <hicn/transport/http/client_connection.h>
+
+#include <fstream>
+
+typedef std::chrono::time_point<std::chrono::system_clock> Time;
+typedef std::chrono::milliseconds TimeDuration;
+
+Time t1;
+
+#define DEFAULT_BETA 0.99
+#define DEFAULT_GAMMA 0.07
+
+namespace hicnet {
+
+namespace http {
+
+typedef struct {
+ std::string file_name;
+ bool print_headers;
+ std::string producer_certificate;
+} Configuration;
+
+void processResponse(Configuration &conf, transport::http::HTTPResponse &&response) {
+
+ auto &payload = response.getPayload();
+
+ if (conf.file_name != "-") {
+ std::cerr << "Saving to: " << conf.file_name << " " << payload.size() << "kB" << std::endl;
+ }
+
+ Time t3 = std::chrono::system_clock::now();
+
+ std::streambuf *buf;
+ std::ofstream of;
+
+ if (conf.file_name != "-") {
+ of.open(conf.file_name, std::ofstream::binary);
+ buf = of.rdbuf();
+ } else {
+ buf = std::cout.rdbuf();
+ }
+
+ std::ostream out(buf);
+
+ if (conf.print_headers) {
+ auto &headers = response.getHeaders();
+ out << "HTTP/" << response.getHttpVersion() << " " << response.getStatusCode() << " " << response.getStatusString()
+ << "\n";
+ for (auto &h : headers) {
+ out << h.first << ": " << h.second << "\n";
+ }
+ out << "\n";
+ }
+
+ out.write((char *)payload.data(), payload.size());
+ of.close();
+
+ Time t2 = std::chrono::system_clock::now();;
+ TimeDuration dt = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1);
+ TimeDuration dt3 = std::chrono::duration_cast<std::chrono::milliseconds>(t3 - t1);
+ long msec = (long)dt.count();
+ long msec3 = (long)dt3.count();
+ std::cerr << "Elapsed Time: " << msec / 1000.0 << " seconds -- " << payload.size() * 8 / msec / 1000.0
+ << "[Mbps] -- " << payload.size() * 8 / msec3 / 1000.0 << "[Mbps]" << std::endl;
+
+}
+
+void usage(char *program_name) {
+ std::cerr << "USAGE:" << std::endl;
+ std::cerr << "\t" << program_name << " [OPTION]... [URL]..." << std::endl;
+ std::cerr << "OPTIONS:" << std::endl;
+ std::cerr << "\t" << "-O filename write documents to FILE" << std::endl;
+ std::cerr << "\t" << "-S print server response" << std::endl;
+ std::cerr << "EXAMPLE:" << std::endl;
+ std::cerr << "\t" << program_name << " -O - http://origin/index.html" << std::endl;
+ exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv) {
+
+#ifdef _WIN32
+ WSADATA wsaData = { 0 };
+ WSAStartup(MAKEWORD(2, 2), &wsaData);
+#endif
+
+ Configuration conf;
+ conf.file_name = "";
+ conf.print_headers = false;
+ conf.producer_certificate = "";
+
+ std::string name("http://webserver/sintel/mpd");
+
+ int opt;
+ while ((opt = getopt(argc, argv, "O:Sc:")) != -1) {
+ switch (opt) {
+ case 'O':
+ conf.file_name = optarg;
+ break;
+ case 'S':
+ conf.print_headers = true;
+ break;
+ case 'c':
+ conf.producer_certificate = optarg;
+ break;
+ case 'h':
+ default:
+ usage(argv[0]);
+ break;
+ }
+ }
+
+ if (argv[optind] == 0) {
+ std::cerr << "Using default name " << name << std::endl;
+ } else {
+ name = argv[optind];
+ }
+
+ if (conf.file_name.empty()) {
+ conf.file_name = name.substr(1 + name.find_last_of("/"));
+ }
+
+ std::map<std::string, std::string> headers = {
+ {"Host", "localhost"},
+ {"User-Agent", "higet/1.0"}
+ };
+
+ transport::http::HTTPClientConnection connection;
+ if (!conf.producer_certificate.empty()) {
+ connection.setCertificate(conf.producer_certificate);
+ }
+
+ t1 = std::chrono::system_clock::now();
+
+ connection.get(name, headers);
+ processResponse(conf, connection.response());
+
+#ifdef _WIN32
+ WSACleanup();
+#endif
+
+ return EXIT_SUCCESS;
+}
+
+} // end namespace http
+
+} // end namespace hicnet
+
+int main(int argc, char **argv) {
+ return hicnet::http::main(argc, argv);
+}
diff --git a/hicn-plugin/src/faces/face.h b/hicn-plugin/src/faces/face.h
index b24fe8648..313f8ec86 100644
--- a/hicn-plugin/src/faces/face.h
+++ b/hicn-plugin/src/faces/face.h
@@ -67,7 +67,7 @@ typedef struct __attribute__ ((packed)) hicn_face_shared_s
union
{
hicn_face_type_t face_type;
- u32 int_face_type; //To forse the face_type_t to be 4B
+ u32 int_face_type; //To force the face_type_t to be 4B
};
} hicn_face_shared_t;
diff --git a/hicn-plugin/src/faces/ip/face_ip.c b/hicn-plugin/src/faces/ip/face_ip.c
index c1e264e44..a70cb1011 100644
--- a/hicn-plugin/src/faces/ip/face_ip.c
+++ b/hicn-plugin/src/faces/ip/face_ip.c
@@ -40,17 +40,21 @@ hicn_face_ip_init (vlib_main_t * vm)
/* Default Strategy has index 0 and it always exists */
strategy_face_ip4_vlib_edge = vlib_node_add_next (vm,
hicn_dpo_get_strategy_vft
- (default_dpo.hicn_dpo_get_type
- ())->get_strategy_node_index
+ (default_dpo.
+ hicn_dpo_get_type ())->
+ get_strategy_node_index
(),
- hicn_face_ip4_output_node.index);
+ hicn_face_ip4_output_node.
+ index);
strategy_face_ip6_vlib_edge = vlib_node_add_next (vm,
hicn_dpo_get_strategy_vft
- (default_dpo.hicn_dpo_get_type
- ())->get_strategy_node_index
+ (default_dpo.
+ hicn_dpo_get_type ())->
+ get_strategy_node_index
(),
- hicn_face_ip6_output_node.index);
+ hicn_face_ip6_output_node.
+ index);
/*
* Create and edge between al the other strategy nodes
* and the ip_encap nodes.
@@ -144,7 +148,6 @@ hicn_face_ip_add (const ip46_address_t * local_addr,
fib_type = FIB_PROTOCOL_IP6;
}
-
adj = adj_nbr_add_or_lock (fib_type, link_type, remote_addr, sw_if);
hicn_face_flags_t flags = (hicn_face_flags_t) 0;
@@ -231,7 +234,8 @@ hicn_face_ip_add (const ip46_address_t * local_addr,
}
retx_t *retx = vlib_process_signal_event_data (vlib_get_main (),
- hicn_mapme_eventmgr_process_node.index,
+ hicn_mapme_eventmgr_process_node.
+ index,
HICN_MAPME_EVENT_FACE_ADD, 1,
sizeof (retx_t));
*retx = (retx_t)
diff --git a/hicn-plugin/src/hicn.api b/hicn-plugin/src/hicn.api
index a6be15a92..46ce177ea 100644
--- a/hicn-plugin/src/hicn.api
+++ b/hicn-plugin/src/hicn.api
@@ -169,7 +169,10 @@ define hicn_api_face_ip_add
u32 context;
/* IP local address */
- u64 nh_addr[2];
+ u64 local_addr[2];
+
+ /* IP remote address */
+ u64 remote_addr[2];
/* IPv4 local port number */
u32 swif;
@@ -229,7 +232,10 @@ define hicn_api_face_ip_params_get_reply
i32 retval;
/* IP local address */
- u64 nh_addr[2];
+ u64 local_addr[2];
+
+ /* IP remote address */
+ u64 remote_addr[2];
/* VPP interface (index) associated with the face */
u32 swif;
diff --git a/hicn-plugin/src/hicn_api.c b/hicn-plugin/src/hicn_api.c
index f06350959..c532118b3 100644
--- a/hicn-plugin/src/hicn_api.c
+++ b/hicn-plugin/src/hicn_api.c
@@ -106,19 +106,26 @@ vl_api_hicn_api_node_params_set_t_handler (vl_api_hicn_api_node_params_set_t *
hicn_main_t *sm = &hicn_main;
int pit_max_size = clib_net_to_host_i32 (mp->pit_max_size);
- pit_max_size = pit_max_size == -1? HICN_PARAM_PIT_ENTRIES_DFLT : pit_max_size;
+ pit_max_size =
+ pit_max_size == -1 ? HICN_PARAM_PIT_ENTRIES_DFLT : pit_max_size;
f64 pit_dflt_lifetime_sec = mp->pit_dflt_lifetime_sec;
- pit_dflt_lifetime_sec = pit_dflt_lifetime_sec == -1? HICN_PARAM_PIT_LIFETIME_DFLT_DFLT_MS : pit_dflt_lifetime_sec;
+ pit_dflt_lifetime_sec =
+ pit_dflt_lifetime_sec ==
+ -1 ? HICN_PARAM_PIT_LIFETIME_DFLT_DFLT_MS : pit_dflt_lifetime_sec;
f64 pit_min_lifetime_sec = mp->pit_min_lifetime_sec;
- pit_min_lifetime_sec = pit_min_lifetime_sec == -1? HICN_PARAM_PIT_LIFETIME_DFLT_MIN_MS : pit_min_lifetime_sec;
+ pit_min_lifetime_sec =
+ pit_min_lifetime_sec ==
+ -1 ? HICN_PARAM_PIT_LIFETIME_DFLT_MIN_MS : pit_min_lifetime_sec;
f64 pit_max_lifetime_sec = mp->pit_max_lifetime_sec;
- pit_max_lifetime_sec = pit_max_lifetime_sec == -1? HICN_PARAM_PIT_LIFETIME_DFLT_MAX_MS : pit_max_lifetime_sec;
+ pit_max_lifetime_sec =
+ pit_max_lifetime_sec ==
+ -1 ? HICN_PARAM_PIT_LIFETIME_DFLT_MAX_MS : pit_max_lifetime_sec;
int cs_max_size = clib_net_to_host_i32 (mp->cs_max_size);
- cs_max_size = cs_max_size == -1? HICN_PARAM_CS_ENTRIES_DFLT : cs_max_size;
+ cs_max_size = cs_max_size == -1 ? HICN_PARAM_CS_ENTRIES_DFLT : cs_max_size;
int cs_reserved_app = clib_net_to_host_i32 (mp->cs_reserved_app);
cs_reserved_app = cs_reserved_app >= 0
@@ -183,17 +190,27 @@ static void
vl_api_hicn_api_face_ip_add_t_handler (vl_api_hicn_api_face_ip_add_t * mp)
{
vl_api_hicn_api_face_ip_add_reply_t *rmp;
- int rv;
+ int rv = HICN_ERROR_UNSPECIFIED;
hicn_main_t *sm = &hicn_main;
+ vnet_main_t *vnm = vnet_get_main ();
hicn_face_id_t faceid = HICN_FACE_NULL;
- ip46_address_t nh_addr;
- nh_addr.as_u64[0] = clib_net_to_host_u64 (((u64 *) (&mp->nh_addr))[0]);
- nh_addr.as_u64[1] = clib_net_to_host_u64 (((u64 *) (&mp->nh_addr))[1]);
+ ip46_address_t local_addr;
+ ip46_address_t remote_addr;
+ local_addr.as_u64[0] =
+ clib_net_to_host_u64 (((u64 *) (&mp->local_addr))[0]);
+ local_addr.as_u64[1] =
+ clib_net_to_host_u64 (((u64 *) (&mp->local_addr))[1]);
+ remote_addr.as_u64[0] =
+ clib_net_to_host_u64 (((u64 *) (&mp->remote_addr))[0]);
+ remote_addr.as_u64[1] =
+ clib_net_to_host_u64 (((u64 *) (&mp->remote_addr))[1]);
u32 swif = clib_net_to_host_u32 (mp->swif);
- rv = hicn_face_ip_add (&nh_addr, NULL, swif, &faceid);
+
+ if (vnet_get_sw_interface_safe (vnm, swif) != NULL)
+ rv = hicn_face_ip_add (&local_addr, &remote_addr, swif, &faceid);
/* *INDENT-OFF* */
REPLY_MACRO2 (VL_API_HICN_API_FACE_IP_ADD_REPLY /* , rmp, mp, rv */ ,(
@@ -570,14 +587,17 @@ hicn_face_api_entry_params_serialize (hicn_face_id_t faceid,
}
hicn_face_t *face = hicn_dpoi_get_from_idx (faceid);
- ip_adjacency_t *ip_adj = adj_get (face->shared.adj);
-
- if (ip_adj != NULL)
+ if (face != NULL && face->shared.face_type == hicn_face_ip_type)
{
- reply->nh_addr[0] =
- clib_host_to_net_u64 (ip_adj->sub_type.nbr.next_hop.as_u64[0]);
- reply->nh_addr[1] =
- clib_host_to_net_u64 (ip_adj->sub_type.nbr.next_hop.as_u64[1]);
+ hicn_face_ip_t *face_ip = (hicn_face_ip_t *) face->data;
+ reply->local_addr[0] =
+ clib_host_to_net_u64 (face_ip->local_addr.as_u64[0]);
+ reply->local_addr[1] =
+ clib_host_to_net_u64 (face_ip->local_addr.as_u64[1]);
+ reply->remote_addr[0] =
+ clib_host_to_net_u64 (face_ip->remote_addr.as_u64[0]);
+ reply->remote_addr[1] =
+ clib_host_to_net_u64 (face_ip->remote_addr.as_u64[1]);
reply->swif = clib_host_to_net_u32 (face->shared.sw_if);
reply->flags = clib_host_to_net_u32 (face->shared.flags);
}
diff --git a/hicn-plugin/src/hicn_api_test.c b/hicn-plugin/src/hicn_api_test.c
index 9d4519bf4..2619803b7 100644
--- a/hicn-plugin/src/hicn_api_test.c
+++ b/hicn-plugin/src/hicn_api_test.c
@@ -322,17 +322,27 @@ static int
api_hicn_api_face_ip_add (vat_main_t * vam)
{
unformat_input_t *input = vam->input;
- ip46_address_t nh_addr;
+ ip46_address_t local_addr = { 0 };
+ ip46_address_t remote_addr = { 0 };
+ int ret = HICN_ERROR_NONE;
+ int sw_if = 0;
vl_api_hicn_api_face_ip_add_t *mp;
- int swif, ret;
/* Parse args required to build the message */
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
- if (unformat (input, "add %d %U",
- &swif, unformat_ip46_address, &nh_addr))
- {;
- }
+ if (unformat
+ (input, "local %U", unformat_ip4_address, &local_addr.ip4));
+ else
+ if (unformat
+ (input, "local %U", unformat_ip6_address, &local_addr.ip6));
+ else
+ if (unformat
+ (input, "remote %U", unformat_ip4_address, &remote_addr.ip4));
+ else
+ if (unformat
+ (input, "remote %U", unformat_ip6_address, &remote_addr.ip6));
+ else if (unformat (input, "intfc %d", &sw_if));
else
{
break;
@@ -340,16 +350,20 @@ api_hicn_api_face_ip_add (vat_main_t * vam)
}
/* Check for presence of both addresses */
- if ((nh_addr.as_u64[0] == (u64) 0) && (nh_addr.as_u64[1] == (u64) 0))
+ if ((!ip46_address_is_zero (&local_addr)
+ && ! !ip46_address_is_zero (&remote_addr)))
{
- clib_warning ("Next hop address not specified");
+ clib_warning
+ ("Incomplete IP face. Please specify local and remote address");
return (1);
}
/* Construct the API message */
M (HICN_API_FACE_IP_ADD, mp);
- mp->nh_addr[0] = clib_host_to_net_u64 (nh_addr.as_u64[0]);
- mp->nh_addr[1] = clib_host_to_net_u64 (nh_addr.as_u64[0]);
- mp->swif = clib_host_to_net_u32 (swif);
+ mp->local_addr[0] = clib_host_to_net_u64 (local_addr.as_u64[0]);
+ mp->local_addr[1] = clib_host_to_net_u64 (local_addr.as_u64[1]);
+ mp->remote_addr[0] = clib_host_to_net_u64 (remote_addr.as_u64[0]);
+ mp->remote_addr[1] = clib_host_to_net_u64 (remote_addr.as_u64[1]);
+ mp->swif = clib_host_to_net_u32 (sw_if);
/* send it... */
S (mp);
@@ -465,7 +479,8 @@ static void
vat_main_t *vam = hicn_test_main.vat_main;
i32 retval = ntohl (rmp->retval);
u8 *sbuf = 0;
- u64 nh_addr[2];
+ ip46_address_t remote_addr;
+ ip46_address_t local_addr;
if (vam->async_mode)
{
@@ -482,13 +497,16 @@ static void
return;
}
vec_reset_length (sbuf);
- nh_addr[0] = clib_net_to_host_u64 (rmp->nh_addr[0]);
- nh_addr[1] = clib_net_to_host_u64 (rmp->nh_addr[1]);
+ local_addr.as_u64[0] = clib_net_to_host_u64 (rmp->local_addr[0]);
+ local_addr.as_u64[1] = clib_net_to_host_u64 (rmp->local_addr[1]);
+ remote_addr.as_u64[0] = clib_net_to_host_u64 (rmp->remote_addr[0]);
+ remote_addr.as_u64[1] = clib_net_to_host_u64 (rmp->remote_addr[1]);
sbuf =
- format (sbuf, "%U", format_ip46_address, &nh_addr,
- 0 /* IP46_ANY_TYPE */ );
+ format (0, "local_addr %U remote_addr %U", format_ip46_address,
+ &local_addr, 0 /*IP46_ANY_TYPE */ , format_ip46_address,
+ &remote_addr, 0 /*IP46_ANY_TYPE */ );
- fformat (vam->ofp, "nh_addr %s swif %d flags %d\n",
+ fformat (vam->ofp, "%s swif %d flags %d\n",
sbuf,
clib_net_to_host_u16 (rmp->swif),
clib_net_to_host_i32 (rmp->flags));
diff --git a/libtransport/src/hicn/transport/CMakeLists.txt b/libtransport/src/hicn/transport/CMakeLists.txt
index 82d478b65..4314ef908 100644
--- a/libtransport/src/hicn/transport/CMakeLists.txt
+++ b/libtransport/src/hicn/transport/CMakeLists.txt
@@ -15,13 +15,6 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(ASIO_STANDALONE 1)
-configure_file("config.h.in" "config.h" @ONLY)
-install(
- FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
- DESTINATION include/hicn/transport
- COMPONENT lib${LIBTRANSPORT}-dev
-)
-
add_subdirectory(core)
add_subdirectory(errors)
add_subdirectory(http)
@@ -30,6 +23,13 @@ add_subdirectory(portability)
add_subdirectory(protocols)
add_subdirectory(utils)
+configure_file("config.h.in" "config.h" @ONLY)
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
+ DESTINATION include/hicn/transport
+ COMPONENT lib${LIBTRANSPORT}-dev
+)
+
set (COMPILER_DEFINITIONS "")
list(INSERT LIBTRANSPORT_INCLUDE_DIRS 0
diff --git a/libtransport/src/hicn/transport/http/facade.h b/libtransport/src/hicn/transport/http/facade.h
index 31c2d1b8d..1551ede3a 100644
--- a/libtransport/src/hicn/transport/http/facade.h
+++ b/libtransport/src/hicn/transport/http/facade.h
@@ -15,8 +15,8 @@
#pragma once
-#include <hicn/transport/http/transport_http_client_connection.h>
-#include <hicn/transport/http/transport_http_server_acceptor.h>
-#include <hicn/transport/http/transport_http_server_publisher.h>
+#include <hicn/transport/http/client_connection.h>
+#include <hicn/transport/http/server_acceptor.h>
+#include <hicn/transport/http/server_publisher.h>
namespace libl4 = transport; \ No newline at end of file
diff --git a/libtransport/src/hicn/transport/utils/CMakeLists.txt b/libtransport/src/hicn/transport/utils/CMakeLists.txt
index c6b09fc5f..4ce1e537f 100644
--- a/libtransport/src/hicn/transport/utils/CMakeLists.txt
+++ b/libtransport/src/hicn/transport/utils/CMakeLists.txt
@@ -30,6 +30,7 @@ list(APPEND HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/string_tokenizer.h
${CMAKE_CURRENT_SOURCE_DIR}/hash.h
${CMAKE_CURRENT_SOURCE_DIR}/uri.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/chrono_typedefs.h
${CMAKE_CURRENT_SOURCE_DIR}/branch_prediction.h
${CMAKE_CURRENT_SOURCE_DIR}/event_reactor.h
${CMAKE_CURRENT_SOURCE_DIR}/deadline_timer.h
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index d9dafe7ec..f7ea729a8 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -45,6 +45,7 @@ list(APPEND UTILS_SRC
if (WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4200 /wd4996")
endif ()
+
foreach(util ${UTILS_SRC})
get_filename_component(_util_name ${util} NAME)
string(REGEX REPLACE ".cc" "" util_name ${_util_name})