diff options
-rwxr-xr-x | apps/src/higet.cc | 23 | ||||
-rw-r--r-- | cmake/Modules/Packager.cmake | 22 | ||||
-rw-r--r-- | hicn-plugin/cmake/Modules/Packaging.cmake | 4 | ||||
-rw-r--r-- | hicn-plugin/src/faces/udp/dpo_udp.c | 9 | ||||
-rw-r--r-- | hicn-plugin/src/faces/udp/dpo_udp.h | 7 | ||||
-rw-r--r-- | hicn-plugin/src/faces/udp/face_udp.c | 20 | ||||
-rw-r--r-- | hicn-plugin/src/faces/udp/iface_udp_node.c | 35 | ||||
-rw-r--r-- | libtransport/cmake/Modules/Packaging.cmake | 8 | ||||
-rw-r--r-- | libtransport/src/hicn/transport/core/portal.h | 3 | ||||
-rw-r--r-- | scripts/build-packages.sh | 5 |
10 files changed, 88 insertions, 48 deletions
diff --git a/apps/src/higet.cc b/apps/src/higet.cc index 78891de98..d2ef818cb 100755 --- a/apps/src/higet.cc +++ b/apps/src/higet.cc @@ -59,7 +59,6 @@ void processResponse(Configuration &conf, transport::http::HTTPResponse &&respon if (conf.print_headers) { auto &headers = response.getHeaders(); - out << "HTTP/" << response.getHttpVersion() << " " << response.getStatusCode() << " " << response.getStatusString() << "\n"; for (auto &h : headers) { @@ -68,14 +67,14 @@ void processResponse(Configuration &conf, transport::http::HTTPResponse &&respon out << "\n"; } - out.write((char *) payload.data(), payload.size()); + 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 = dt.count(); - long msec3 = dt3.count(); + 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; @@ -94,9 +93,15 @@ void usage(char *program_name) { int main(int argc, char **argv) { - Configuration conf { - .file_name = "", .print_headers = false, .producer_certificate = "" - }; +#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"); @@ -144,6 +149,10 @@ int main(int argc, char **argv) { connection.get(name, headers); processResponse(conf, connection.response()); +#ifdef _WIN32 + WSACleanup(); +#endif + return EXIT_SUCCESS; } diff --git a/cmake/Modules/Packager.cmake b/cmake/Modules/Packager.cmake index b19145025..b4849963d 100644 --- a/cmake/Modules/Packager.cmake +++ b/cmake/Modules/Packager.cmake @@ -19,7 +19,23 @@ set(CONTACT "hicn-dev@lists.fd.io" CACHE STRING "Contact") set(PACKAGE_MAINTAINER "ICN Team" CACHE STRING "Maintainer") set(PACKAGE_VENDOR "fd.io" CACHE STRING "Vendor") -# macro(set) +function(get_next_version VERSION NEXT_VERSION) + string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1;\\2" VER_NUMBERS ${VERSION}) + + # Increment version for getting next version value + list(GET VER_NUMBERS 0 major) + list(GET VER_NUMBERS 1 minor) + + math(EXPR minor "${minor} + 3") + + if (minor GREATER 12) + set(minor "1") + math(EXPR major "${major} + 1") + endif() + + set(minor "0${minor}") + set(${NEXT_VERSION} "${major}.${minor}" PARENT_SCOPE) +endfunction() macro(make_packages) if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") @@ -68,6 +84,8 @@ macro(make_packages) set(rpm_ver "${tag}-${commit_num}-release") endif() + get_next_version(${tag}, next_version) + get_cmake_property(components COMPONENTS) if(OS_ID_LIKE MATCHES "debian") @@ -92,6 +110,7 @@ macro(make_packages) set(DEB_DEPS) if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "") string(REPLACE "stable_version" ${tag} DEB_DEPS ${${lc}_DEB_DEPENDENCIES}) + string(REPLACE "next_version" ${next_version} DEB_DEPS ${DEB_DEPS}) endif() set(CPACK_${type}_${uc}_PACKAGE_DEPENDS "${DEB_DEPS}") @@ -120,6 +139,7 @@ macro(make_packages) set(RPM_DEPS) if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "") string(REPLACE "stable_version" ${tag} RPM_DEPS ${${lc}_RPM_DEPENDENCIES}) + string(REPLACE "next_version" ${next_version} RPM_DEPS ${RPM_DEPS}) endif() set(CPACK_${type}_${uc}_PACKAGE_REQUIRES "${RPM_DEPS}") diff --git a/hicn-plugin/cmake/Modules/Packaging.cmake b/hicn-plugin/cmake/Modules/Packaging.cmake index 9ba34aeca..98996981f 100644 --- a/hicn-plugin/cmake/Modules/Packaging.cmake +++ b/hicn-plugin/cmake/Modules/Packaging.cmake @@ -21,11 +21,11 @@ set(${HICN_PLUGIN}_DESCRIPTION ) set(${HICN_PLUGIN}_DEB_DEPENDENCIES - "vpp (= stable_version-release), vpp-plugins (= stable_version-release)" + "vpp (>= stable_version-release), vpp (< next_version-release), vpp-plugins (>= stable_version-release), vpp-plugins (< next_version-release)" CACHE STRING "Dependencies for deb/rpm package." ) set(${HICN_PLUGIN}_RPM_DEPENDENCIES - "vpp = stable_version-release, vpp-plugins = stable_version-release" + "vpp >= stable_version-release, vpp < next_version-release, vpp-plugins >= stable_version-release, vpp-plugins < next_version-release" CACHE STRING "Dependencies for deb/rpm package." ) diff --git a/hicn-plugin/src/faces/udp/dpo_udp.c b/hicn-plugin/src/faces/udp/dpo_udp.c index eadcb6abd..987d52bb7 100644 --- a/hicn-plugin/src/faces/udp/dpo_udp.c +++ b/hicn-plugin/src/faces/udp/dpo_udp.c @@ -77,7 +77,8 @@ hicn_dpo_udp4_create (dpo_id_t * dpo, { u16 net_src_port = clib_host_to_net_u16 (src_port); u16 net_dst_port = clib_host_to_net_u16 (dst_port); - hicn_face_t *face = hicn_face_udp4_get (src_ip, dst_ip, src_port, dst_port); + hicn_face_t *face = + hicn_face_udp4_get (src_ip, dst_ip, net_src_port, net_dst_port); u8 hicnb_flags; /* ip_csum_t sum0; */ @@ -86,7 +87,7 @@ hicn_dpo_udp4_create (dpo_id_t * dpo, return HICN_ERROR_FACE_ALREADY_CREATED; hicn_dpo_udp4_add_and_lock (dpo, src_ip, dst_ip, net_src_port, net_dst_port, - node_index, &hicnb_flags); + node_index, &hicnb_flags, sw_if); face = hicn_dpoi_get_from_idx (dpo->dpoi_index); @@ -97,7 +98,6 @@ hicn_dpo_udp4_create (dpo_id_t * dpo, face->shared.flags = flags; face->shared.adj = ip_adj; - face->shared.sw_if = sw_if; *face_id = hicn_dpoi_get_index (face); return HICN_ERROR_NONE; @@ -124,13 +124,12 @@ hicn_dpo_udp6_create (dpo_id_t * dpo, return HICN_ERROR_FACE_ALREADY_CREATED; hicn_dpo_udp6_add_and_lock (dpo, src_ip, dst_ip, net_src_port, net_dst_port, - node_index, &hicnb_flags); + node_index, &hicnb_flags, sw_if); face = hicn_dpoi_get_from_idx (dpo->dpoi_index); face->shared.flags = flags; face->shared.adj = ip_adj; - face->shared.sw_if = sw_if; *face_id = hicn_dpoi_get_index (face); return HICN_ERROR_NONE; diff --git a/hicn-plugin/src/faces/udp/dpo_udp.h b/hicn-plugin/src/faces/udp/dpo_udp.h index cc71a8d44..3d74a1884 100644 --- a/hicn-plugin/src/faces/udp/dpo_udp.h +++ b/hicn-plugin/src/faces/udp/dpo_udp.h @@ -115,7 +115,7 @@ hicn_dpo_udp4_add_and_lock (dpo_id_t * dpo, const ip4_address_t * local_addr, const ip4_address_t * remote_addr, u16 local_port, u16 remote_port, - u32 node_index, u8 * hicnb_flags) + u32 node_index, u8 * hicnb_flags, u32 sw_if) { dpo->dpoi_type = DPO_FIRST; dpo->dpoi_proto = DPO_PROTO_NONE; @@ -146,6 +146,7 @@ hicn_dpo_udp4_add_and_lock (dpo_id_t * dpo, face->shared.face_type = hicn_face_udp_type; face->shared.flags = HICN_FACE_FLAGS_IFACE; face->shared.locks = 0; + face->shared.sw_if = sw_if; hicn_face_udp_key_t key; hicn_face_udp4_get_key (local_addr, remote_addr, local_port, @@ -153,7 +154,6 @@ hicn_dpo_udp4_add_and_lock (dpo_id_t * dpo, hicn_face_id_t dpoi_index = hicn_dpoi_get_index (face); mhash_set_mem (&hicn_face_udp_hashtb, &key, (uword *) & dpoi_index, 0); - face = face; *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT; dpo_set (dpo, hicn_face_udp_type, DPO_PROTO_IP4, dpoi_index); @@ -257,7 +257,7 @@ hicn_dpo_udp6_add_and_lock (dpo_id_t * dpo, const ip6_address_t * local_addr, const ip6_address_t * remote_addr, u16 local_port, u16 remote_port, - u32 node_index, u8 * hicnb_flags) + u32 node_index, u8 * hicnb_flags, u32 sw_if) { dpo->dpoi_type = DPO_FIRST; dpo->dpoi_proto = DPO_PROTO_NONE; @@ -288,6 +288,7 @@ hicn_dpo_udp6_add_and_lock (dpo_id_t * dpo, face->shared.face_type = hicn_face_udp_type; face->shared.flags = HICN_FACE_FLAGS_IFACE; face->shared.locks = 0; + face->shared.sw_if = sw_if; hicn_face_udp_key_t key; hicn_face_udp6_get_key (local_addr, remote_addr, local_port, diff --git a/hicn-plugin/src/faces/udp/face_udp.c b/hicn-plugin/src/faces/udp/face_udp.c index ea16c85fe..924c79a91 100644 --- a/hicn-plugin/src/faces/udp/face_udp.c +++ b/hicn-plugin/src/faces/udp/face_udp.c @@ -79,15 +79,17 @@ hicn_face_udp_init (vlib_main_t * vm) /* Default Strategy has index 0 and it always exists */ strategy_face_udp4_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_udp4_output_node.index); + hicn_face_udp4_output_node. + index); strategy_face_udp6_vlib_edge = vlib_node_add_next (vm, - hicn_dpo_get_strategy_vft - (default_dpo.hicn_dpo_get_type - ())->get_strategy_node_index (), + hicn_dpo_get_strategy_vft (default_dpo. + hicn_dpo_get_type ())-> + get_strategy_node_index (), hicn_face_udp6_output_node.index); /* @@ -264,7 +266,8 @@ hicn_face_udp_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) @@ -313,7 +316,6 @@ format_hicn_face_udp (u8 * s, va_list * args) s = format (s, "remote %U|%u ", format_ip4_address, &udp_face->hdrs.ip4.ip.dst_address, - clib_net_to_host_u16 (udp_face->hdrs.ip4.udp.dst_port)); s = format (s, "%U", format_vnet_link, adj->ia_link); s = format (s, " dev %U", format_vnet_sw_interface_name, vnm, @@ -339,7 +341,7 @@ format_hicn_face_udp (u8 * s, va_list * args) } else { - s = format (s, "IFace %d: ", format_white_space, indent, face_id); + s = format (s, "%U iFace %d: ", format_white_space, indent, face_id); if (udp_face->hdrs.ip4.ip.ip_version_and_header_length == ipv) { s = format (s, "type UDP local %U|%u", diff --git a/hicn-plugin/src/faces/udp/iface_udp_node.c b/hicn-plugin/src/faces/udp/iface_udp_node.c index c71616b77..9558ebfce 100644 --- a/hicn-plugin/src/faces/udp/iface_udp_node.c +++ b/hicn-plugin/src/faces/udp/iface_udp_node.c @@ -39,11 +39,13 @@ hicn_iface_udp_init (vlib_main_t * vm) { data_fwd_face_udp4_vlib_edge = vlib_node_add_next (vm, hicn_data_fwd_node.index, - hicn_iface_udp4_output_node.index); + hicn_iface_udp4_output_node. + index); data_fwd_face_udp6_vlib_edge = vlib_node_add_next (vm, hicn_data_fwd_node.index, - hicn_iface_udp6_output_node.index); + hicn_iface_udp6_output_node. + index); u32 temp_index4 = vlib_node_add_next (vm, hicn_interest_hitcs_node.index, @@ -185,7 +187,8 @@ typedef enum udp_hdr->src_port, \ GET_FACE_UDP##ipv \ (), \ - &hicnb0->flags); \ + &hicnb0->flags, \ + vnet_buffer(b0)->sw_if_index[VLIB_RX]); \ \ vlib_buffer_advance(b0, sizeof(IP_HEADER_##ipv) + \ sizeof(udp_header_t)); \ @@ -275,7 +278,8 @@ typedef enum udp_hdr0->src_port, \ GET_FACE_UDP##ipv \ (), \ - &hicnb0->flags); \ + &hicnb0->flags, \ + vnet_buffer(b0)->sw_if_index[VLIB_RX]); \ \ \ HICN_IFACE_UDP_ADD_LOCK_IP##ipv \ @@ -286,7 +290,8 @@ typedef enum udp_hdr1->src_port, \ GET_FACE_UDP##ipv \ (), \ - &hicnb1->flags); \ + &hicnb1->flags, \ + vnet_buffer(b1)->sw_if_index[VLIB_RX]); \ \ vlib_buffer_advance(b0, sizeof(IP_HEADER_##ipv) + \ sizeof(udp_header_t)); \ @@ -379,8 +384,9 @@ hicn_iface_udp4_input_format_trace (u8 * s, va_list * args) s = format (s, "IFACE_UDP4_INPUT: pkt: %d, sw_if_index %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } @@ -460,8 +466,9 @@ hicn_iface_udp6_input_format_trace (u8 * s, va_list * args) s = format (s, "IFACE_UDP6_INPUT: pkt: %d, sw_if_index %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } @@ -819,8 +826,9 @@ hicn_iface_udp4_output_format_trace (u8 * s, va_list * args) format (s, "IFACE_UDP4_OUTPUT: pkt: %d, out face %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } @@ -899,8 +907,9 @@ hicn_iface_udp6_output_format_trace (u8 * s, va_list * args) format (s, "IFACE_UDP6_OUTPUT: pkt: %d, out face %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } diff --git a/libtransport/cmake/Modules/Packaging.cmake b/libtransport/cmake/Modules/Packaging.cmake index 4112d3844..99dccbec4 100644 --- a/libtransport/cmake/Modules/Packaging.cmake +++ b/libtransport/cmake/Modules/Packaging.cmake @@ -32,22 +32,22 @@ set(lib${LIBTRANSPORT}-devel_DESCRIPTION ${lib${LIBTRANSPORT}_DESCRIPTION} if ((BUILD_MEMIF_CONNECTOR OR BUILD_HICNPLUGIN) AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(lib${LIBTRANSPORT}_DEB_DEPENDENCIES - "lib${LIBHICN} (>= stable_version), libparc (>= 1.0), vpp-lib (= stable_version-release)" + "lib${LIBHICN} (>= stable_version), libparc (>= 1.0), vpp-lib (>= stable_version-release), vpp-lib (< next_version-release)" CACHE STRING "Dependencies for deb/rpm package." ) set(lib${LIBTRANSPORT}_RPM_DEPENDENCIES - "lib${LIBHICN} >= stable_version, libparc >= 1.0, vpp-lib = stable_version-release" + "lib${LIBHICN} >= stable_version, libparc >= 1.0, vpp-lib >= stable_version-release, vpp-lib < next_version-release" CACHE STRING "Dependencies for deb/rpm package." ) set(lib${LIBTRANSPORT}-dev_DEB_DEPENDENCIES - "lib${LIBTRANSPORT} (>= stable_version), libasio-dev (>= 1.10), libhicn-dev (>= stable_version), libparc-dev (>= 1.0), vpp-dev (= stable_version-release)" + "lib${LIBTRANSPORT} (>= stable_version), libasio-dev (>= 1.10), libhicn-dev (>= stable_version), libparc-dev (>= 1.0), vpp-dev (>= stable_version-release), vpp-dev (< next_version-release)" CACHE STRING "Dependencies for deb/rpm package." ) set(lib${LIBTRANSPORT}-dev_RPM_DEPENDENCIES - "lib${LIBTRANSPORT} >= stable_version, asio-devel >= 1.10, lib${LIBHICN}-devel >= stable_version, libparc-devel >= 1.0, vpp-devel = stable_version-release" + "lib${LIBTRANSPORT} >= stable_version, asio-devel >= 1.10, lib${LIBHICN}-devel >= stable_version, libparc-devel >= 1.0, vpp-devel >= stable_version-release, vpp-devel < next_version-release" CACHE STRING "Dependencies for deb/rpm package." ) diff --git a/libtransport/src/hicn/transport/core/portal.h b/libtransport/src/hicn/transport/core/portal.h index d9051c23c..a88bac964 100644 --- a/libtransport/src/hicn/transport/core/portal.h +++ b/libtransport/src/hicn/transport/core/portal.h @@ -407,7 +407,8 @@ class Portal { } } - TRANSPORT_ALWAYS_INLINE void killConnection() { connector_.close(); } + + TRANSPORT_ALWAYS_INLINE void killConnection() { forwarder_interface_.closeConnection(); } TRANSPORT_ALWAYS_INLINE void clear() { for (auto &pend_interest : pending_interest_hash_table_) { diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 67adb39e9..d628ea0e9 100644 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -24,8 +24,8 @@ PACKAGECLOUD_RELEASE_REPO_RPM="https://packagecloud.io/install/repositories/fdio VPP_GIT_REPO="https://git.fd.io/vpp" VPP_BRANCH="stable/1901" -VPP_VERSION_DEB="19.01-release" -VPP_VERSION_RPM="19.01-release.x86_64" +VPP_VERSION_DEB="19.01.1-release" +VPP_VERSION_RPM="19.01.1-release.x86_64" BUILD_TOOLS_UBUNTU="build-essential doxygen" LIBSSL_LIBEVENT_UBUNTU="libevent-dev libssl-dev" @@ -112,7 +112,6 @@ setup() { # echo ${BUILD_TOOLS_GROUP_CENTOS} | xargs sudo yum groupinstall -y --nogpgcheck echo ${DEPS_CENTOS} | xargs sudo yum install -y --nogpgcheck sudo yum install devtoolset-7 - scl enable devtoolset-7 bash c++ --version |