diff options
Diffstat (limited to 'apps/http-proxy')
5 files changed, 20 insertions, 18 deletions
diff --git a/apps/http-proxy/CMakeLists.txt b/apps/http-proxy/CMakeLists.txt index dbe9bc51c..5acf09c19 100644 --- a/apps/http-proxy/CMakeLists.txt +++ b/apps/http-proxy/CMakeLists.txt @@ -15,7 +15,7 @@ # Compiler options ############################################################## set(COMPILER_OPTIONS - ${DEFAULT_COMPILER_OPTIONS} + PRIVATE ${DEFAULT_COMPILER_OPTIONS} ) # -Wno-c99-designator issue @@ -94,5 +94,6 @@ if (NOT DISABLE_EXECUTABLES) DEPENDS ${LIBHTTP_PROXY_STATIC} COMPONENT ${HICN_APPS} LINK_FLAGS ${LINK_FLAGS} + COMPILE_OPTIONS ${COMPILER_OPTIONS} ) endif () diff --git a/apps/http-proxy/includes/hicn/http-proxy/forwarder_interface.h b/apps/http-proxy/includes/hicn/http-proxy/forwarder_interface.h index 0741099df..c60e26c63 100644 --- a/apps/http-proxy/includes/hicn/http-proxy/forwarder_interface.h +++ b/apps/http-proxy/includes/hicn/http-proxy/forwarder_interface.h @@ -28,8 +28,7 @@ extern "C" { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wshorten-64-to-32" #endif -#include <asio.hpp> -#include <asio/steady_timer.hpp> +#include <hicn/transport/core/asio_wrapper.h> #ifdef __APPLE__ #pragma clang diagnostic pop #endif diff --git a/apps/http-proxy/includes/hicn/http-proxy/http_session.h b/apps/http-proxy/includes/hicn/http-proxy/http_session.h index 43d10e156..1563431dc 100644 --- a/apps/http-proxy/includes/hicn/http-proxy/http_session.h +++ b/apps/http-proxy/includes/hicn/http-proxy/http_session.h @@ -21,7 +21,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wshorten-64-to-32" #endif -#include <asio.hpp> +#include <hicn/transport/core/asio_wrapper.h> #ifdef __APPLE__ #pragma clang diagnostic pop #endif diff --git a/apps/http-proxy/includes/hicn/http-proxy/icn_receiver.h b/apps/http-proxy/includes/hicn/http-proxy/icn_receiver.h index ab90fab07..a402d44cf 100644 --- a/apps/http-proxy/includes/hicn/http-proxy/icn_receiver.h +++ b/apps/http-proxy/includes/hicn/http-proxy/icn_receiver.h @@ -14,12 +14,12 @@ */ #include <hicn/http-proxy/http_session.h> +#include <hicn/transport/core/asio_wrapper.h> #include <hicn/transport/core/prefix.h> #include <hicn/transport/interfaces/publication_options.h> #include <hicn/transport/interfaces/socket_producer.h> #include <hicn/transport/utils/spinlock.h> -#include <asio.hpp> #include <cassert> #include <cstring> #include <queue> diff --git a/apps/http-proxy/src/forwarder_interface.cc b/apps/http-proxy/src/forwarder_interface.cc index 1c034f60f..5566eb6ff 100644 --- a/apps/http-proxy/src/forwarder_interface.cc +++ b/apps/http-proxy/src/forwarder_interface.cc @@ -27,7 +27,7 @@ namespace transport { ForwarderInterface::~ForwarderInterface() {} int ForwarderInterface::connectToForwarder() { - sock_ = hc_sock_create(); + sock_ = hc_sock_create(FORWARDER_TYPE_HICNLIGHT, NULL); if (!sock_) return -1; if (hc_sock_connect(sock_) < 0) { @@ -96,7 +96,8 @@ void ForwarderInterface::internalRemoveConnectedUser(uint32_t route_id) { std::vector<hc_route_t *> routes_to_remove; foreach_route(r, data) { char remote_addr[INET6_ADDRSTRLEN]; - int ret = ip_address_ntop(&r->remote_addr, remote_addr, r->len, r->family); + int ret = + hicn_ip_address_ntop(&r->remote_addr, remote_addr, r->len, r->family); if (ret < 0) continue; std::string route_addr(remote_addr); @@ -201,8 +202,9 @@ int ForwarderInterface::tryToCreateFaceAndRoute(route_info_t *route_info) { if (interface.compare("lo") != 0) { found = true; - ip_address_t remote_ip; - if (ip_address_pton(route_info->remote_addr.c_str(), &remote_ip) < 0) { + hicn_ip_address_t remote_ip; + if (hicn_ip_address_pton(route_info->remote_addr.c_str(), &remote_ip) < + 0) { hc_data_free(data); return -1; } @@ -210,14 +212,14 @@ int ForwarderInterface::tryToCreateFaceAndRoute(route_info_t *route_info) { hc_face_t face; memset(&face, 0, sizeof(hc_face_t)); - face.face.type = FACE_TYPE_UDP; - face.face.family = route_info->family; - face.face.local_addr = l->local_addr; - face.face.remote_addr = remote_ip; - face.face.local_port = l->local_port; - face.face.remote_port = route_info->remote_port; + face.type = FACE_TYPE_UDP; + face.family = route_info->family; + face.local_addr = l->local_addr; + face.remote_addr = remote_ip; + face.local_port = l->local_port; + face.remote_port = route_info->remote_port; - if (netdevice_set_name(&face.face.netdevice, l->interface_name) < 0) { + if (netdevice_set_name(&face.netdevice, l->interface_name) < 0) { hc_data_free(data); return -1; } @@ -237,10 +239,10 @@ int ForwarderInterface::tryToCreateFaceAndRoute(route_info_t *route_info) { return -1; } - ip_address_t route_ip; + hicn_ip_address_t route_ip; hc_route_t route; - if (ip_address_pton(route_info->route_addr.c_str(), &route_ip) < 0) { + if (hicn_ip_address_pton(route_info->route_addr.c_str(), &route_ip) < 0) { hc_data_free(data); return -1; } |