diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 000000000..92d3ffe5c --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,9 @@ +2017-09-26 + + - Add support for Mac OS + - Add support for Raspberry Pi + - Fix BoringSSL compilation: include explicitly + +2017-09-22 + + - Initial release diff --git a/CMakeLists.txt b/CMakeLists.txt index 205c116cf..984a6a7b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ MESSAGE(STATUS "DEVEL_MODE: ${DEVEL_MODE}") SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Wall -Wextra -Wno-unused-parameter") SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -fno-omit-frame-pointer") -IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) +IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.3) SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Wno-missing-field-initializers") ENDIF() IF(DEVEL_MODE EQUAL 1) @@ -58,12 +58,15 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_CMAKE_FLAGS} $ENV{EXTRA_CFLAGS}") MESSAGE(STATUS "Compiler flags: ${CMAKE_C_FLAGS}") +IF(NOT DEFINED BORINGSSL_INCLUDE) + include_directories( /usr/local/lib ) +ENDIF() +IF(NOT DEFINED BORINGSSL_LIB) + link_directories( /usr/local/include ) +ENDIF() SET(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories( include ) -include_directories( ${BORINGSSL_INCLUDE} ) - -link_directories( ${BORINGSSL_LIB} ) IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") # Find libevent on FreeBSD: @@ -73,7 +76,7 @@ ENDIF() add_executable(http_client test/http_client.c test/prog.c test/test_common.c test/test_cert.c) -target_link_libraries(http_client lsquic event pthread libssl.a libcrypto.a libdecrepit.a ${FIULIB} z m) +target_link_libraries(http_client lsquic event pthread libssl.a libcrypto.a ${FIULIB} z m) add_subdirectory(src) diff --git a/EXAMPLES.txt b/EXAMPLES.txt index 656f32eeb..55f33776c 100644 --- a/EXAMPLES.txt +++ b/EXAMPLES.txt @@ -11,6 +11,10 @@ Fetch Google's home page: ./http_client -H www.google.com -s 74.125.22.106:443 -p / + or even + + ./http_client -H www.google.co.uk -s 2a00:1450:4009:80c::2003:443 -p / + In the example above, -H specifies the domain; it is also used as the value of SNI paramater in the handshake. diff --git a/README.md b/README.md index 8a73414fc..6704eddb4 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,100 @@ Documentation The documentation for this module is admittedly sparse. The API is documented in include/lsquic.h. If you have doxygen, you can run -`doxygen dox.cfg' or `make docs'. The example program is +`doxygen dox.cfg` or `make docs`. The example program is test/http_client.c: a bare-bones, but working, QUIC client. Have a look in EXAMPLES.txt to see how it can be used. -Building --------- +Requirements +------------ -To build LSQUIC, you need CMake and BoringSSL. The example program -uses libevent to provide the event loop. In short: +To build LSQUIC, you need CMake, zlib, and BoringSSL. The example program +uses libevent to provide the event loop. - cmake -DBORINGSSL_INCLUDE=/some/dir -DBORINGSSL_LIB=/some/other/dir . +Building BoringSSL +------------------ + +BoringSSL is not packaged; you have to build it yourself. The process is +straightforward. You will need `go` installed. + +1. Clone BoringSSL by issuing the following command: + +``` +git clone https://boringssl.googlesource.com/boringssl +cd boringssl +``` + +2. Check out stable branch: + +``` +git co chromium-stable +``` + +3. Compile the library + +``` +cmake . && make +``` + +If you want to turn on optimizations, do + +``` +cmake -DCMAKE_BUILD_TYPE=Release . && make +``` + +4. Install the library + +This is the manual step. You will need to copy library files manually. +LSQUIC client library needs two: `ssl/libssl.a` and `crypto/libcrypto.a`. +To install these in `/usr/local/lib`, you should do the following: + +``` +BORINGSSL_SOURCE=$PWD +cd /usr/local/lib +sudo cp $BORINGSSL_SOURCE/ssl/libssl.a +sudo cp $BORINGSSL_SOURCE/crypto/libcrypto.a +``` + +If you do not want to install the library (or do not have root), you +can do this instead: + +``` +BORINGSSL_SOURCE=$PWD +mkdir -p $HOME/tmp/boringssl-libs +cd $HOME/tmp/boringssl-libs +ln -s $BORINGSSL_SOURCE/ssl/libssl.a +ln -s $BORINGSSL_SOURCE/crypto/libcrypto.a +``` + +Building LSQUIC Client Library +------------------------------ + +LSQUIC's `http_client` and the tests link BoringSSL libraries statically. +Following previous section, you can build LSQUIC as follows: + +``` +cmake -DBORINGSSL_INCLUDE=$BORINGSSL_SOURCE/include \ + -DBORINGSSL_LIB=$HOME/tmp/boringssl-libs . +make +``` + +Run tests: + +``` +make test +``` + +Platforms +--------- + +The client library has been tested on the following platforms: +- Linux + - x86_64 + - ARM (Raspberry Pi 3) +- FreeBSD + - i386 +- MacOS + - x86_64 Have fun, diff --git a/src/liblsquic/lsquic_crypto.c b/src/liblsquic/lsquic_crypto.c index ffd4f3d39..4d6eb5be6 100644 --- a/src/liblsquic/lsquic_crypto.c +++ b/src/liblsquic/lsquic_crypto.c @@ -8,6 +8,7 @@ #include #include #include +#include #include diff --git a/src/liblsquic/lsquic_full_conn.c b/src/liblsquic/lsquic_full_conn.c index 8a983b2fc..7d206bccf 100644 --- a/src/liblsquic/lsquic_full_conn.c +++ b/src/liblsquic/lsquic_full_conn.c @@ -1907,12 +1907,6 @@ process_stream_ready_to_send (struct full_conn *conn, lsquic_stream_t *stream, { if (LSQUIC_STREAM_HANDSHAKE == stream->id) { -#if LSQUIC_STREAM_HANDSHAKE - /* Full connection implies that the server has completed the - * handshake: - */ - assert(0 == (conn->fc_flags & FC_SERVER)); -#endif /* Handshake messages are sent in brand-new packets. If handshake * is not complete, the packet is zero-padded. */ diff --git a/src/liblsquic/lsquic_parse_gquic_be.h b/src/liblsquic/lsquic_parse_gquic_be.h index 6ba149dd9..abac51f96 100644 --- a/src/liblsquic/lsquic_parse_gquic_be.h +++ b/src/liblsquic/lsquic_parse_gquic_be.h @@ -13,6 +13,11 @@ #define bswap_16 bswap16 #define bswap_32 bswap32 #define bswap_64 bswap64 +#elif defined(__APPLE__) +#include +#define bswap_16 OSSwapInt16 +#define bswap_32 OSSwapInt32 +#define bswap_64 OSSwapInt64 #else #include #endif diff --git a/src/liblsquic/lsquic_stream.c b/src/liblsquic/lsquic_stream.c index 10e903c3f..88690e3ea 100644 --- a/src/liblsquic/lsquic_stream.c +++ b/src/liblsquic/lsquic_stream.c @@ -498,13 +498,13 @@ lsquic_stream_write_avail (const lsquic_stream_t *stream) conn_avail = lsquic_conn_cap_avail(&stream->conn_pub->conn_cap); if (conn_avail < stream_avail) { - LSQ_DEBUG("stream %u write buffer is limited by connection: %jd", - stream->id, conn_avail); + LSQ_DEBUG("stream %u write buffer is limited by connection: " + "%"PRIu64, stream->id, conn_avail); return conn_avail; } } - LSQ_DEBUG("stream %u write buffer is limited by stream: %jd", + LSQ_DEBUG("stream %u write buffer is limited by stream: %"PRIu64, stream->id, stream_avail); return stream_avail; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 443afb24c..0d07bf249 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,22 @@ # Copyright (c) 2017 LiteSpeed Technologies Inc. See LICENSE. +INCLUDE(CheckSymbolExists) + +CHECK_SYMBOL_EXISTS( + IP_MTU_DISCOVER + "netinet/in.h" + HAVE_IP_MTU_DISCOVER +) + +CHECK_SYMBOL_EXISTS( + IP_DONTFRAG + "netinet/in.h" + HAVE_IP_DONTFRAG +) + + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/test_config.h) + add_subdirectory(unittests) diff --git a/test/prog.c b/test/prog.c index 94b48d789..775a0b4bf 100644 --- a/test/prog.c +++ b/test/prog.c @@ -15,6 +15,7 @@ #include "../src/liblsquic/lsquic_hash.h" #include "../src/liblsquic/lsquic_logger.h" +#include "test_config.h" #include "test_cert.h" #include "test_common.h" #include "prog.h" @@ -86,7 +87,9 @@ prog_print_common_options (const struct prog *prog, FILE *out) " is used.\n" " -i USEC Library will `tick' every USEC microseconds. The default\n" " is %u\n" +#if LSQUIC_DONTFRAG_SUPPORTED " -D Set `do not fragment' flag on outgoing UDP packets\n" +#endif " -z BYTES Maximum size of outgoing UDP packets. The default is 1370\n" " bytes for IPv4 socket and 1350 bytes for IPv6 socket\n" " -L LEVEL Log level for all modules. Possible values are `debug',\n" @@ -142,6 +145,7 @@ prog_set_opt (struct prog *prog, int opt, const char *arg) case 'i': prog->prog_period_usec = atoi(arg); return 0; +#if LSQUIC_DONTFRAG_SUPPORTED case 'D': { struct service_port *sport = TAILQ_LAST(prog->prog_sports, sport_head); @@ -150,6 +154,7 @@ prog_set_opt (struct prog *prog, int opt, const char *arg) sport->sp_flags |= SPORT_DONT_FRAGMENT; } return 0; +#endif case 'm': prog->prog_packout_max = atoi(arg); return 0; diff --git a/test/prog.h b/test/prog.h index 20236d9b1..d8b86dbf0 100644 --- a/test/prog.h +++ b/test/prog.h @@ -42,7 +42,13 @@ prog_init (struct prog *, unsigned lsquic_engine_flags, struct sport_head *, # define SENDMMSG_FLAG "" #endif -#define PROG_OPTS "i:Dm:c:y:L:l:o:H:s:S:z:" SENDMMSG_FLAG +#if LSQUIC_DONTFRAG_SUPPORTED +# define IP_DONTFRAG_FLAG "D" +#else +# define IP_DONTFRAG_FLAG "" +#endif + +#define PROG_OPTS "i:m:c:y:L:l:o:H:s:S:z:" SENDMMSG_FLAG IP_DONTFRAG_FLAG /* Returns: * 0 Applied diff --git a/test/test_common.c b/test/test_common.c index 9c6ee0f95..388e071dc 100644 --- a/test/test_common.c +++ b/test/test_common.c @@ -5,6 +5,9 @@ #include #include #include +#if defined(__APPLE__) +# define __APPLE_USE_RFC_3542 1 +#endif #include #include #include @@ -447,8 +450,7 @@ sport_init_server (struct service_port *sport, struct lsquic_engine *engine, return -1; } -#if __linux__ -#if !defined(IP_RECVORIGDSTADDR) +#if (__linux__ && !defined(IP_RECVORIGDSTADDR)) || __APPLE__ /* Need to set IP_PKTINFO for sending */ if (AF_INET == sa_local->sa_family) { @@ -462,7 +464,6 @@ sport_init_server (struct service_port *sport, struct lsquic_engine *engine, return -1; } } -#endif #elif IP_RECVDSTADDR != IP_SENDSRCADDR /* On FreeBSD, IP_RECVDSTADDR is the same as IP_SENDSRCADDR, but I do not * know about other BSD systems. @@ -505,6 +506,7 @@ sport_init_server (struct service_port *sport, struct lsquic_engine *engine, } #endif +#if LSQUIC_DONTFRAG_SUPPORTED if (sport->sp_flags & SPORT_DONT_FRAGMENT) { if (AF_INET == sa_local->sa_family) @@ -526,6 +528,7 @@ sport_init_server (struct service_port *sport, struct lsquic_engine *engine, } } } +#endif if (sport->sp_flags & SPORT_SET_SNDBUF) { @@ -592,7 +595,7 @@ sport_init_client (struct service_port *sport, struct lsquic_engine *engine, struct event_base *eb) { const struct sockaddr *sa_peer = (struct sockaddr *) &sport->sas; - int sockfd, saved_errno, flags, on, s; + int sockfd, saved_errno, flags, s; socklen_t socklen; union { struct sockaddr_in sin; @@ -646,10 +649,12 @@ sport_init_client (struct service_port *sport, struct lsquic_engine *engine, return -1; } +#if LSQUIC_DONTFRAG_SUPPORTED if (sport->sp_flags & SPORT_DONT_FRAGMENT) { if (AF_INET == sa_local->sa_family) { + int on; #if __linux__ on = IP_PMTUDISC_DO; s = setsockopt(sockfd, IPPROTO_IP, IP_MTU_DISCOVER, &on, @@ -667,6 +672,7 @@ sport_init_client (struct service_port *sport, struct lsquic_engine *engine, } } } +#endif if (sport->sp_flags & SPORT_SET_SNDBUF) { @@ -733,7 +739,7 @@ setup_control_msg (struct msghdr *msg, const struct lsquic_out_spec *spec, struct cmsghdr *cmsg; struct sockaddr_in *local_sa; struct sockaddr_in6 *local_sa6; -#if __linux__ +#if __linux__ || __APPLE__ struct in_pktinfo info; #endif struct in6_pktinfo info6; @@ -745,7 +751,7 @@ setup_control_msg (struct msghdr *msg, const struct lsquic_out_spec *spec, if (AF_INET == spec->dest_sa->sa_family) { local_sa = (struct sockaddr_in *) spec->local_sa; -#if __linux__ +#if __linux__ || __APPLE__ memset(&info, 0, sizeof(info)); info.ipi_spec_dst = local_sa->sin_addr; cmsg->cmsg_level = IPPROTO_IP; diff --git a/test/test_common.h b/test/test_common.h index 59441ff27..f1c066fe0 100644 --- a/test/test_common.h +++ b/test/test_common.h @@ -21,7 +21,9 @@ struct prog; enum sport_flags { +#if LSQUIC_DONTFRAG_SUPPORTED SPORT_DONT_FRAGMENT = (1 << 0), +#endif SPORT_SET_SNDBUF = (1 << 1), /* SO_SNDBUF */ SPORT_SET_RCVBUF = (1 << 2), /* SO_RCVBUF */ SPORT_SERVER = (1 << 3), diff --git a/test/test_config.h.in b/test/test_config.h.in new file mode 100644 index 000000000..1dba138af --- /dev/null +++ b/test/test_config.h.in @@ -0,0 +1,9 @@ +#ifndef LSQUIC_CONFIG_H +#define LSQUIC_CONFIG_H + +#cmakedefine HAVE_IP_DONTFRAG 1 +#cmakedefine HAVE_IP_MTU_DISCOVER 1 + +#define LSQUIC_DONTFRAG_SUPPORTED (HAVE_IP_DONTFRAG || HAVE_IP_MTU_DISCOVER) + +#endif diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index ff1552bfa..6d8dd01c7 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -9,11 +9,11 @@ enable_testing() add_executable(test_rechist test_rechist.c) -target_link_libraries(test_rechist lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_rechist lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(rechist test_rechist) add_executable(test_senhist test_senhist.c) -target_link_libraries(test_senhist lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_senhist lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(senhist test_senhist) add_executable(test_rtt test_rtt.c) @@ -26,12 +26,12 @@ add_test(set test_set) add_executable(test_engine_ctor test_engine_ctor.c) -target_link_libraries(test_engine_ctor lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_engine_ctor lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(engine_ctor test_engine_ctor) add_executable(test_stream test_stream.c) -target_link_libraries(test_stream lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_stream lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(stream test_stream) add_test(stream_hash test_stream -h) add_test(stream_write_file test_stream -w Makefile) @@ -42,7 +42,7 @@ add_test(stream_write_file_A test_stream -A -w Makefile) add_test(stream_hash_write_file_A test_stream -A -h -w Makefile) add_executable(test_spi test_spi.c) -target_link_libraries(test_spi lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_spi lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(spi test_spi) add_executable(test_malo test_malo.c) @@ -58,71 +58,71 @@ target_link_libraries(test_lsquic_hash lsquic m ${FIULIB}) add_test(lsquic_hash test_lsquic_hash) add_executable(test_blocked_gquic_le test_blocked_gquic_le.c) -target_link_libraries(test_blocked_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_blocked_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(blocked_gquic_le test_blocked_gquic_le) add_executable(test_blocked_gquic_be test_blocked_gquic_be.c) -target_link_libraries(test_blocked_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_blocked_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(blocked_gquic_be test_blocked_gquic_be) add_executable(test_rst_stream_gquic_le test_rst_stream_gquic_le.c) -target_link_libraries(test_rst_stream_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_rst_stream_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(rst_stream_gquic_le test_rst_stream_gquic_le) add_executable(test_rst_stream_gquic_be test_rst_stream_gquic_be.c) -target_link_libraries(test_rst_stream_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_rst_stream_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(rst_stream_gquic_be test_rst_stream_gquic_be) add_executable(test_rst_stream_ietf test_rst_stream_ietf.c) -target_link_libraries(test_rst_stream_ietf lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_rst_stream_ietf lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(rst_stream_ietf test_rst_stream_ietf) add_executable(test_conn_close_gquic_le test_conn_close_gquic_le.c) -target_link_libraries(test_conn_close_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_conn_close_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(conn_close_gquic_le test_conn_close_gquic_le) add_executable(test_conn_close_gquic_be test_conn_close_gquic_be.c) -target_link_libraries(test_conn_close_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_conn_close_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(conn_close_gquic_be test_conn_close_gquic_be) add_executable(test_goaway_gquic_le test_goaway_gquic_le.c) -target_link_libraries(test_goaway_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_goaway_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(goaway_gquic_le test_goaway_gquic_le) add_executable(test_goaway_gquic_be test_goaway_gquic_be.c) -target_link_libraries(test_goaway_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_goaway_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(goaway_gquic_be test_goaway_gquic_be) add_executable(test_wuf_gquic_le test_wuf_gquic_le.c) -target_link_libraries(test_wuf_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_wuf_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(wuf_gquic_le test_wuf_gquic_le) add_executable(test_wuf_gquic_be test_wuf_gquic_be.c) -target_link_libraries(test_wuf_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_wuf_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(wuf_gquic_be test_wuf_gquic_be) add_executable(test_ackparse_gquic_le test_ackparse_gquic_le.c) -target_link_libraries(test_ackparse_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_ackparse_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(ackparse_gquic_le test_ackparse_gquic_le) add_executable(test_ackparse_gquic_be test_ackparse_gquic_be.c) -target_link_libraries(test_ackparse_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_ackparse_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(ackparse_gquic_be test_ackparse_gquic_be) add_executable(test_ackparse_gquic_ietf test_ackparse_gquic_ietf.c) -target_link_libraries(test_ackparse_gquic_ietf lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_ackparse_gquic_ietf lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(ackparse_gquic_ietf test_ackparse_gquic_ietf) add_executable(test_ackgen_gquic_le test_ackgen_gquic_le.c) -target_link_libraries(test_ackgen_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_ackgen_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(ackgen_gquic_le test_ackgen_gquic_le) add_executable(test_ackgen_gquic_be test_ackgen_gquic_be.c) -target_link_libraries(test_ackgen_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_ackgen_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(ackgen_gquic_be test_ackgen_gquic_be) add_executable(test_ackgen_gquic_ietf test_ackgen_gquic_ietf.c) -target_link_libraries(test_ackgen_gquic_ietf lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_ackgen_gquic_ietf lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(ackgen_gquic_ietf test_ackgen_gquic_ietf) add_executable(test_sfcw test_sfcw.c) @@ -138,100 +138,102 @@ target_link_libraries(graph_cubic lsquic m ${FIULIB}) add_executable(test_streamparse test_streamparse.c) -target_link_libraries(test_streamparse lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_streamparse lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(streamparse test_streamparse) add_executable(test_packet_out test_packet_out.c) -target_link_libraries(test_packet_out lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_packet_out lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(packet_out test_packet_out) add_executable(test_reg_pkt_headergen test_reg_pkt_headergen.c) -target_link_libraries(test_reg_pkt_headergen lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_reg_pkt_headergen lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(reg_pkt_headergen test_reg_pkt_headergen) add_executable(test_ver_nego test_ver_nego.c) -target_link_libraries(test_ver_nego lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_ver_nego lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(ver_nego test_ver_nego) add_executable(test_packno_len test_packno_len.c) -target_link_libraries(test_packno_len lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_packno_len lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(packno_len test_packno_len) add_executable(test_streamgen test_streamgen.c) -target_link_libraries(test_streamgen lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_streamgen lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(streamgen test_streamgen) add_executable(test_some_packets test_some_packets.c) -target_link_libraries(test_some_packets lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_some_packets lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(some_packets test_some_packets) add_executable(test_elision test_elision.c) -target_link_libraries(test_elision lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_elision lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(elision test_elision) add_executable(test_stop_waiting_gquic_le test_stop_waiting_gquic_le.c) -target_link_libraries(test_stop_waiting_gquic_le lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_stop_waiting_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(stop_waiting_gquic_le test_stop_waiting_gquic_le) add_executable(test_stop_waiting_gquic_be test_stop_waiting_gquic_be.c) -target_link_libraries(test_stop_waiting_gquic_be lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_stop_waiting_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(stop_waiting_gquic_be test_stop_waiting_gquic_be) add_executable(test_parse_packet_in test_parse_packet_in.c) -target_link_libraries(test_parse_packet_in lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_parse_packet_in lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(parse_packet_in test_parse_packet_in) add_executable(test_quic_le_floats test_quic_le_floats.c) -target_link_libraries(test_quic_le_floats lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_quic_le_floats lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(quic_le_floats test_quic_le_floats) add_executable(test_quic_be_floats test_quic_be_floats.c) -target_link_libraries(test_quic_be_floats lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_quic_be_floats lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(quic_be_floats test_quic_be_floats) add_executable(test_export_key test_export_key.c) -target_link_libraries(test_export_key lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_export_key lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(export_key test_export_key) add_executable(test_frame_reader test_frame_reader.c) -target_link_libraries(test_frame_reader lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_frame_reader lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(frame_reader test_frame_reader) add_executable(test_frame_writer test_frame_writer.c) -target_link_libraries(test_frame_writer lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_frame_writer lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(frame_writer test_frame_writer) add_executable(test_frame_chop test_frame_chop.c) -target_link_libraries(test_frame_chop lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) +target_link_libraries(test_frame_chop lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) add_test(frame_chop test_frame_chop) -add_executable(test_frame_rw test_frame_rw.c) -target_link_libraries(test_frame_rw lsquic pthread libssl.a libcrypto.a libdecrepit.a z m ${FIULIB}) -add_test(frame_rw test_frame_rw) +IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + add_executable(test_frame_rw test_frame_rw.c) + target_link_libraries(test_frame_rw lsquic pthread libssl.a libcrypto.a z m ${FIULIB}) + add_test(frame_rw test_frame_rw) +ENDIF() add_executable(test_hpack test_hpack.c) target_link_libraries(test_hpack lsquic m ${FIULIB}) add_test(hpack test_hpack) add_executable(test_hkdf test_hkdf.c) -target_link_libraries(test_hkdf lsquic pthread libssl.a libcrypto.a libdecrepit.a m ${FIULIB}) +target_link_libraries(test_hkdf lsquic pthread libssl.a libcrypto.a m ${FIULIB}) add_test(hkdf test_hkdf) add_executable(test_attq test_attq.c) -target_link_libraries(test_attq lsquic pthread libssl.a libcrypto.a libdecrepit.a m ${FIULIB}) +target_link_libraries(test_attq lsquic pthread libssl.a libcrypto.a m ${FIULIB}) add_test(attq test_attq) add_executable(test_arr test_arr.c) -target_link_libraries(test_arr lsquic pthread libssl.a libcrypto.a libdecrepit.a m ${FIULIB}) +target_link_libraries(test_arr lsquic pthread libssl.a libcrypto.a m ${FIULIB}) add_test(arr test_arr) add_executable(test_buf test_buf.c) -target_link_libraries(test_buf lsquic pthread libssl.a libcrypto.a libdecrepit.a m ${FIULIB}) +target_link_libraries(test_buf lsquic pthread libssl.a libcrypto.a m ${FIULIB}) add_test(buf test_buf) add_executable(test_dec test_dec.c) -target_link_libraries(test_dec libssl.a libcrypto.a libdecrepit.a z m pthread ${FIULIB}) +target_link_libraries(test_dec libssl.a libcrypto.a z m pthread ${FIULIB}) diff --git a/test/unittests/test_packno_len.c b/test/unittests/test_packno_len.c index 133ac7dcc..6c5f34f3d 100644 --- a/test/unittests/test_packno_len.c +++ b/test/unittests/test_packno_len.c @@ -191,7 +191,7 @@ static const struct packno_bits_test pb_tests[] = { { .pbt_lineno = __LINE__, .pbt_packno = 2, .pbt_least_unacked = 1, - .pbt_n_in_flight = 3181457256, + .pbt_n_in_flight = 3181457256ULL, .pbt_packno_bits = PACKNO_LEN_6, },