Update webrtc

This commit is contained in:
Ali 2022-01-14 22:34:50 +04:00
parent b102311660
commit d6f2d959a0
226 changed files with 7846 additions and 9779 deletions

View file

@ -55,6 +55,7 @@ objc_library(
"-DRTC_ENABLE_VP9",
"-DTGVOIP_NAMESPACE=tgvoip_webrtc",
"-std=c++14",
"-DWEBRTC_DISABLE_H265",
],
includes = [
"PublicHeaders",

@ -1 +1 @@
Subproject commit 48851770349761f89c969e1c9cde34b7fae5cf67
Subproject commit 731818cea9bce6eb7f4ee36f28d62f2ee03bd2b7

View file

@ -10,9 +10,9 @@ config_setting(
optimization_flags = select({
":debug_build": [
#"-O2",
"-O2",
#"-DNDEBUG",
"-DRTC_DCHECK_IS_ON",
#"-DRTC_DCHECK_IS_ON",
],
"//conditions:default": ["-DNDEBUG"],
})
@ -749,7 +749,6 @@ webrtc_sources = [
"pc/webrtc_session_description_factory.cc",
"media/base/adapted_video_track_source.cc",
"media/base/codec.cc",
"media/base/h264_profile_level_id.cc",
"media/base/media_channel.cc",
"media/base/media_constants.cc",
"media/base/media_engine.cc",
@ -1072,23 +1071,18 @@ webrtc_sources = [
"modules/audio_processing/agc/legacy/digital_agc.cc",
"modules/audio_processing/agc/loudness_histogram.cc",
"modules/audio_processing/agc/utility.cc",
"modules/audio_processing/agc2/adaptive_agc.cc",
"modules/audio_processing/agc2/adaptive_digital_gain_applier.cc",
"modules/audio_processing/agc2/adaptive_mode_level_estimator.cc",
"modules/audio_processing/agc2/agc2_testing_common.cc",
"modules/audio_processing/agc2/biquad_filter.cc",
"modules/audio_processing/agc2/compute_interpolated_gain_curve.cc",
"modules/audio_processing/agc2/down_sampler.cc",
"modules/audio_processing/agc2/fixed_digital_level_estimator.cc",
"modules/audio_processing/agc2/gain_applier.cc",
"modules/audio_processing/agc2/interpolated_gain_curve.cc",
"modules/audio_processing/agc2/limiter.cc",
"modules/audio_processing/agc2/limiter_db_gain_curve.cc",
"modules/audio_processing/agc2/noise_level_estimator.cc",
"modules/audio_processing/agc2/noise_spectrum_estimator.cc",
"modules/audio_processing/agc2/saturation_protector.cc",
"modules/audio_processing/agc2/signal_classifier.cc",
"modules/audio_processing/agc2/vad_with_level.cc",
"modules/audio_processing/agc2/vector_float_frame.cc",
"modules/audio_processing/agc2/rnn_vad/auto_correlation.cc",
"modules/audio_processing/agc2/rnn_vad/features_extraction.cc",
@ -1115,8 +1109,6 @@ webrtc_sources = [
"modules/audio_processing/include/audio_frame_proxies.cc",
"modules/audio_processing/include/audio_processing.cc",
"modules/audio_processing/include/audio_processing_statistics.cc",
"modules/audio_processing/include/config.cc",
"modules/audio_processing/level_estimator.cc",
"modules/audio_processing/logging/apm_data_dumper.cc",
"modules/audio_processing/ns/fast_math.cc",
"modules/audio_processing/ns/histograms.cc",
@ -1322,7 +1314,6 @@ webrtc_sources = [
"modules/video_coding/unique_timestamp_counter.cc",
"modules/video_coding/utility/decoded_frames_history.cc",
"modules/video_coding/utility/frame_dropper.cc",
"modules/video_coding/utility/framerate_controller.cc",
"modules/video_coding/utility/ivf_file_reader.cc",
"modules/video_coding/utility/ivf_file_writer.cc",
"modules/video_coding/utility/quality_scaler.cc",
@ -1780,7 +1771,6 @@ webrtc_sources = [
"logging/rtc_event_log/rtc_event_log_impl.h",
"logging/rtc_event_log/rtc_stream_config.h",
"media/base/codec.h",
"media/base/h264_profile_level_id.h",
"media/base/media_channel.h",
"media/base/media_constants.h",
"media/base/media_engine.h",
@ -1792,7 +1782,6 @@ webrtc_sources = [
"media/base/video_broadcaster.h",
"media/base/video_common.h",
"media/base/video_source_base.h",
"media/base/vp9_profile.h",
"media/engine/adm_helpers.h",
"media/engine/encoder_simulcast_proxy.h",
"media/engine/internal_decoder_factory.h",
@ -1997,21 +1986,18 @@ webrtc_sources = [
"modules/audio_processing/agc/legacy/digital_agc.h",
"modules/audio_processing/agc/loudness_histogram.h",
"modules/audio_processing/agc/utility.h",
"modules/audio_processing/agc2/adaptive_agc.h",
"modules/audio_processing/agc2/adaptive_digital_gain_applier.h",
"modules/audio_processing/agc2/adaptive_mode_level_estimator.h",
"modules/audio_processing/agc2/agc2_common.h",
"modules/audio_processing/agc2/agc2_testing_common.h",
"modules/audio_processing/agc2/biquad_filter.h",
"modules/audio_processing/agc2/compute_interpolated_gain_curve.h",
"modules/audio_processing/agc2/down_sampler.h",
"modules/audio_processing/agc2/fixed_digital_level_estimator.h",
"modules/audio_processing/agc2/gain_applier.h",
"modules/audio_processing/agc2/interpolated_gain_curve.h",
"modules/audio_processing/agc2/limiter.h",
"modules/audio_processing/agc2/limiter_db_gain_curve.h",
"modules/audio_processing/agc2/noise_level_estimator.h",
"modules/audio_processing/agc2/noise_spectrum_estimator.h",
"modules/audio_processing/agc2/rnn_vad/auto_correlation.h",
"modules/audio_processing/agc2/rnn_vad/common.h",
"modules/audio_processing/agc2/rnn_vad/features_extraction.h",
@ -2022,8 +2008,6 @@ webrtc_sources = [
"modules/audio_processing/agc2/rnn_vad/spectral_features.h",
"modules/audio_processing/agc2/rnn_vad/spectral_features_internal.h",
"modules/audio_processing/agc2/saturation_protector.h",
"modules/audio_processing/agc2/signal_classifier.h",
"modules/audio_processing/agc2/vad_with_level.h",
"modules/audio_processing/agc2/vector_float_frame.h",
"modules/audio_processing/audio_buffer.h",
"modules/audio_processing/audio_processing_impl.h",
@ -2039,8 +2023,6 @@ webrtc_sources = [
"modules/audio_processing/include/audio_frame_proxies.h",
"modules/audio_processing/include/audio_processing.h",
"modules/audio_processing/include/audio_processing_statistics.h",
"modules/audio_processing/include/config.h",
"modules/audio_processing/level_estimator.h",
"modules/audio_processing/logging/apm_data_dumper.h",
"modules/audio_processing/ns/fast_math.h",
"modules/audio_processing/ns/histograms.h",
@ -2265,7 +2247,6 @@ webrtc_sources = [
"modules/video_coding/unique_timestamp_counter.h",
"modules/video_coding/utility/decoded_frames_history.h",
"modules/video_coding/utility/frame_dropper.h",
"modules/video_coding/utility/framerate_controller.h",
"modules/video_coding/utility/ivf_file_reader.h",
"modules/video_coding/utility/ivf_file_writer.h",
"modules/video_coding/utility/quality_scaler.h",
@ -2926,27 +2907,23 @@ webrtc_sources = [
"modules/audio_processing/agc/clipping_predictor_evaluator.cc",
"modules/audio_processing/agc/clipping_predictor_level_buffer.h",
"modules/audio_processing/agc/clipping_predictor_level_buffer.cc",
"modules/rtp_rtcp/source/rtp_format_h265.cc",
"modules/rtp_rtcp/source/video_rtp_depacketizer_h265.cc",
"modules/video_coding/h265_vps_sps_pps_tracker.cc",
"common_video/h265/h265_bitstream_parser.cc",
"common_video/h265/h265_common.cc",
"common_video/h265/h265_pps_parser.cc",
"common_video/h265/h265_sps_parser.cc",
"common_video/h265/h265_vps_parser.cc",
"common_video/h265/h265_bitstream_parser.h",
"common_video/h265/h265_common.h",
"common_video/h265/h265_pps_parser.h",
"modules/rtp_rtcp/source/video_rtp_depacketizer_h265.h",
"modules/video_coding/h265_vps_sps_pps_tracker.h",
"common_video/h265/h265_sps_parser.h",
"common_video/h265/h265_vps_parser.h",
"modules/rtp_rtcp/source/rtp_format_h265.h",
"modules/video_coding/codecs/h265/include/h265_globals.h",
"media/sctp/sctp_transport_factory.h",
"media/sctp/sctp_transport_factory.cc",
"media/sctp/usrsctp_transport.h",
"media/sctp/usrsctp_transport.cc",
"rtc_base/bitstream_reader.cc",
"modules/audio_coding/neteq/reorder_optimizer.cc",
"modules/audio_coding/neteq/underrun_optimizer.cc",
"common_video/framerate_controller.cc",
"modules/audio_processing/agc/analog_gain_stats_reporter.cc",
"modules/audio_coding/neteq/relative_arrival_delay_tracker.cc",
"modules/audio_processing/agc2/vad_wrapper.cc",
"modules/audio_processing/agc2/adaptive_digital_gain_controller.cc",
"modules/video_coding/utility/framerate_controller_deprecated.cc",
"video/adaptation/bandwidth_quality_scaler_resource.cc",
"api/wrapping_async_dns_resolver.cc",
"modules/video_coding/utility/bandwidth_quality_scaler.cc",
"rtc_base/experiments/bandwidth_quality_scaler_settings.cc",
]
ios_objc_sources = [
@ -2972,15 +2949,6 @@ ios_objc_sources = [
"objc/components/video_codec/RTCVideoEncoderFactoryH264.m",
"objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
"objc/components/video_codec/RTCVideoDecoderFactoryH264.m",
"objc/components/video_codec/RTCCodecSpecificInfoH265.h",
"objc/components/video_codec/RTCCodecSpecificInfoH265.mm",
"objc/components/video_codec/RTCH265ProfileLevelId.h",
"objc/components/video_codec/RTCH265ProfileLevelId.mm",
"objc/components/video_codec/RTCVideoDecoderH265.h",
"objc/components/video_codec/RTCVideoDecoderH265.mm",
"objc/components/video_codec/RTCVideoEncoderH265.h",
"objc/components/video_codec/RTCVideoEncoderH265.mm",
"objc/components/video_codec/RTCCodecSpecificInfoH265+Private.h",
]
ios_sources = [
@ -3290,6 +3258,9 @@ common_flags = [
"-DWEBRTC_ENABLE_PROTOBUF=0",
"-DWEBRTC_ENABLE_AVX2",
"-DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0",
"-Wno-shorten-64-to-32",
"-Wno-macro-redefined",
"-D__APPLE__",
]
arm_specific_flags = [

View file

@ -38,6 +38,8 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "DEBUG")
endif ()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CheckStructHasMember)
include(CheckIncludeFile)
include(CheckIncludeFiles)
@ -69,7 +71,7 @@ endif ()
option(sctp_werror "Treat warning as error" 1)
option(sctp_link_programs_static "Link example programs static" 0)
option(sctp_build_shared_lib "Build USRSCTP as shared library" 0)
option(sctp_build_programs "Build example programs" 1)
@ -83,12 +85,6 @@ if (sctp_sanitizer_address AND sctp_sanitizer_memory)
message(FATAL_ERROR "Can not compile with both sanitizer options")
endif ()
if (sctp_link_programs_static OR WIN32)
set(programs_link_library "usrsctp-static")
else ()
set(programs_link_library "usrsctp")
endif ()
#################################################
# CHECK FOR TYPES AND FUNCTIONS
@ -114,6 +110,11 @@ if (have_netinet_ip_icmp_h)
add_definitions(-DHAVE_NETINET_IP_ICMP_H)
endif ()
check_include_files("sys/types.h;sys/socket.h;net/route.h" have_net_route_h)
if (have_net_route_h)
add_definitions(-DHAVE_NET_ROUTE_H)
endif ()
check_include_files("stdatomic.h" have_stdatomic_h)
if (have_stdatomic_h)
add_definitions(-DHAVE_STDATOMIC_H)
@ -259,6 +260,7 @@ elseif (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Appl
endif ()
if (sctp_build_fuzzer)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
add_definitions(-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=fuzzer-no-link")
endif ()

View file

@ -7,7 +7,7 @@ Like TCP, SCTP provides reliable, connection oriented data delivery with congest
In this manual the socket API for the SCTP User-land implementation will be described. It is based on [RFC 6458](https://tools.ietf.org/html/rfc6458). The main focus of this document is on pointing out the differences to the SCTP Sockets API. For all aspects of the sockets API that are not mentioned in this document, please refer to [RFC 6458](https://tools.ietf.org/html/rfc6458). Questions about SCTP itself can hopefully be answered by [RFC 4960](https://tools.ietf.org/html/rfc4960).
## Getting Started
The user-land stack has been tested on FreeBSD 10.0, Ubuntu 11.10, Windows 7, Mac OS X 10.6, and Mac OS X 10.7. The current version of the user-land stack is provided on [github](https://github.com/sctplab/usrsctp). Download the tarball and untar it in a folder of your choice. The tarball contains all the sources to build the libusrsctp, which has to be linked to the object file of an example program. In addition there are two applications in the folder `programs` that can be built and run.
The user-land stack has been tested on FreeBSD 10.0, OpenBSD 7.0, Ubuntu 11.10, Windows 7, Mac OS X 10.6, and Mac OS X 10.7. The current version of the user-land stack is provided on [github](https://github.com/sctplab/usrsctp). Download the tarball and untar it in a folder of your choice. The tarball contains all the sources to build the libusrsctp, which has to be linked to the object file of an example program. In addition there are two applications in the folder `programs` that can be built and run.
### Building the Library and the Applications
#### Unix-like Operating Systems
@ -128,7 +128,8 @@ usrsctp_socket(int domain,
int flags,
void *ulp_info),
int (*send_cb)(struct socket *sock,
uint32_t sb_free),
uint32_t sb_free,
void *ulp_info),
uint32_t sb_threshold,
void *ulp_info)
```
@ -363,7 +364,7 @@ SCTP_RECVRCVINFO | int | r/w
SCTP_RECVNXTINFO | int | r/w
SCTP_DEFAULT_SNDINFO | struct sctp_sndinfo | r/w
SCTP_DEFAULT_PRINFO | struct sctp_default_prinfo | r/w
SCTP_REMOTE_UDP_ENCAPS_PORT | int | r/w
SCTP_REMOTE_UDP_ENCAPS_PORT | struct sctp_udpencaps | r/w
SCTP_ENABLE_STREAM_RESET | struct sctp_assoc_value | r/w
SCTP_STATUS | struct sctp_status | r
SCTP_GET_PEER_ADDR_INFO | struct sctp_paddrinfo | r

View file

@ -205,7 +205,8 @@ usrsctp_socket(int domain,
int flags,
void *ulp_info),
int (*send_cb)(struct socket *sock,
uint32_t sb_free),
uint32_t sb_free,
void *ulp_info),
uint32_t sb_threshold,
void *ulp_info).
\end{verbatim}
@ -970,7 +971,7 @@ SCTP\_DEBUG has to be set as a compile flag.
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#if !defined(__Userspace_os_Windows)
#if !defined(_WIN32)
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
@ -1098,7 +1099,7 @@ main(int argc, char *argv[])
}
while (1) {
if (use_cb) {
#if defined (__Userspace_os_Windows)
#if defined(_WIN32)
Sleep(1*1000);
#else
sleep(1);
@ -1133,7 +1134,7 @@ main(int argc, char *argv[])
}
usrsctp_close(sock);
while (usrsctp_finish() != 0) {
#if defined (__Userspace_os_Windows)
#if defined(_WIN32)
Sleep(1000);
#else
sleep(1);
@ -1183,11 +1184,11 @@ main(int argc, char *argv[])
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if !defined(__Userspace_os_Windows)
#if !defined(_WIN32)
#include <unistd.h>
#endif
#include <sys/types.h>
#if !defined(__Userspace_os_Windows)
#if !defined(_WIN32)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@ -1242,7 +1243,7 @@ main(int argc, char *argv[])
}
memset((void *)&addr4, 0, sizeof(struct sockaddr_in));
memset((void *)&addr6, 0, sizeof(struct sockaddr_in6));
#if !defined(__Userspace_os_Linux) && !defined(__Userspace_os_Windows)
#if !defined(__linux__) && !defined(_WIN32)
addr4.sin_len = sizeof(struct sockaddr_in);
addr6.sin6_len = sizeof(struct sockaddr_in6);
#endif
@ -1271,14 +1272,14 @@ main(int argc, char *argv[])
usrsctp_shutdown(sock, SHUT_WR);
}
while (!done) {
#if defined (__Userspace_os_Windows)
#if defined(_WIN32)
Sleep(1*1000);
#else
sleep(1);
#endif
}
while (usrsctp_finish() != 0) {
#if defined (__Userspace_os_Windows)
#if defined(_WIN32)
Sleep(1000);
#else
sleep(1);

View file

@ -1,7 +1,9 @@
# usrsctp
[![Coverity Scan Build Status](https://scan.coverity.com/projects/13430/badge.svg)](https://scan.coverity.com/projects/usrsctp)
This is a userland SCTP stack supporting FreeBSD, Linux, Mac OS X and Windows.
![GitHub Actions Build Status (CMake-based build only)](https://github.com/sctplab/usrsctp/workflows/Build%20with%20CMake/badge.svg)
This is a userland SCTP stack supporting FreeBSD, OpenBSD, Linux, Mac OS X and Windows.
See [manual](Manual.md) for more information.

View file

@ -0,0 +1,38 @@
find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h)
find_library(MBEDTLS_LIBRARY mbedtls)
find_library(MBEDX509_LIBRARY mbedx509)
find_library(MBEDCRYPTO_LIBRARY mbedcrypto)
set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MbedTLS DEFAULT_MSG
MBEDTLS_LIBRARY MBEDTLS_INCLUDE_DIRS MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
if(NOT TARGET MbedTLS)
message("in mbedtls ${MBEDTLS_LIBRARY}")
add_library(MbedTLS UNKNOWN IMPORTED)
set_target_properties(MbedTLS PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${MBEDTLS_LIBRARY}")
endif()
if(NOT TARGET MbedCrypto)
add_library(MbedCrypto UNKNOWN IMPORTED)
set_target_properties(MbedCrypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${MBEDCRYPTO_LIBRARY}")
endif()
if(NOT TARGET MbedX509)
add_library(MbedX509 UNKNOWN IMPORTED)
set_target_properties(MbedX509 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${MBEDX509_LIBRARY}")
endif()

View file

@ -28,7 +28,7 @@ dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dnl SUCH DAMAGE.
dnl
AC_INIT([libusrsctp], [0.9.3.0])
AC_INIT([libusrsctp], [0.9.5.0])
AM_INIT_AUTOMAKE([foreign])
AC_PROG_CC
@ -46,11 +46,9 @@ APPCFLAGS=""
case $host_os in
darwin*)
CFLAGS="$CFLAGS -std=c99 -Wno-deprecated-declarations -D__APPLE_USE_RFC_2292"
LIBCFLAGS="$LIBCFLAGS -U__APPLE__ -D__Userspace_os_Darwin"
;;
dragonfly*)
CFLAGS="$CFLAGS -std=c99 -pthread"
LIBCFLAGS="$LIBCFLAGS -U__DragonFly__ -D__Userspace_os_DragonFly"
;;
freebsd*)
CFLAGS="$CFLAGS -std=c99 -pthread"
@ -58,19 +56,15 @@ freebsd*)
CFLAGS="$CFLAGS -Wno-unknown-warning-option"
LDFLAGS="$LDFLAGS -Qunused-arguments"
fi
LIBCFLAGS="$LIBCFLAGS -U__FreeBSD__ -D__Userspace_os_FreeBSD"
;;
linux*)
CFLAGS="$CFLAGS -std=c99 -pthread -D_GNU_SOURCE -Wno-address-of-packed-member"
LIBCFLAGS="$LIBCFLAGS -D__Userspace_os_Linux"
;;
netbsd*)
CFLAGS="$CFLAGS -std=c99 -pthread"
LIBCFLAGS="$LIBCFLAGS -U__NetBSD__ -D__Userspace_os_NetBSD"
;;
openbsd*)
CFLAGS="$CFLAGS -std=c99 -pthread"
LIBCFLAGS="$LIBCFLAGS -U__OpenBSD__ -D__Userspace_os_OpenBSD"
;;
solaris*)
CFLAGS="$CFLAGS -D_XPG4_2"
@ -149,6 +143,12 @@ AC_CHECK_HEADERS(sys/queue.h)
AC_CHECK_HEADERS(linux/if_addr.h, [], [], [#include <sys/socket.h>])
AC_CHECK_HEADERS(linux/rtnetlink.h, [], [], [#include <sys/socket.h>])
AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], [#include <netinet/ip.h>])
AC_CHECK_HEADERS(net/route.h, [], [],
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/socket.h>])
AC_CHECK_MEMBER(struct sockaddr.sa_len,
AC_DEFINE(HAVE_SA_LEN, 1, [Define this if your stack has sa_len in sockaddr struct.]),,

View file

@ -1,108 +0,0 @@
#
# Copyright (C) 2015-2019 Felix Weinrank
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the project nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#project(usrsctp-fuzzer C)
#################################################
# INCLUDE MODULES
#################################################
include(CheckIncludeFile)
#################################################
# CHECK INCLUDES
#################################################
include_directories(${CMAKE_SOURCE_DIR}/usrsctplib)
#################################################
# OS DEPENDENT
#################################################
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions(-D_GNU_SOURCE)
endif ()
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_definitions(-D__APPLE_USE_RFC_2292)
endif ()
#################################################
# COMPILER FLAGS
#################################################
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-variable")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=fuzzer")
#################################################
# PROGRAMS
#################################################
# FUZZING_STAGE LEVELS
# 0 - MULTI - based on input
# 1 - COOKIE_WAIT
# 2 - COOKIE_ECHO
# 3 - ESTABLISHED
# 4 - DATA SENT
# 5 - DATA RECEIVED
add_executable(fuzzer_listen fuzzer_listen.c ../programs/programs_helper.c)
target_link_libraries(fuzzer_listen usrsctp-static)
add_executable(fuzzer_connect_multi fuzzer_connect.c ../programs/programs_helper.c)
target_compile_definitions(fuzzer_connect_multi PRIVATE FUZZING_STAGE=0)
target_link_libraries(fuzzer_connect_multi usrsctp-static)
add_executable(fuzzer_connect_multi_verbose fuzzer_connect.c ../programs/programs_helper.c)
target_compile_definitions(fuzzer_connect_multi_verbose PRIVATE FUZZING_STAGE=0 FUZZ_VERBOSE)
target_link_libraries(fuzzer_connect_multi_verbose usrsctp-static)
# add_executable(fuzzer_connect_cookie_wait fuzzer_connect.c)
# target_compile_definitions(fuzzer_connect_cookie_wait PRIVATE FUZZING_STAGE=1)
# target_link_libraries(fuzzer_connect_cookie_wait usrsctp-static)
# add_executable(fuzzer_connect_cookie_echoed fuzzer_connect.c)
# target_compile_definitions(fuzzer_connect_cookie_echoed PRIVATE FUZZING_STAGE=2)
# target_link_libraries(fuzzer_connect_cookie_echoed usrsctp-static)
# add_executable(fuzzer_connect_established fuzzer_connect.c)
# target_compile_definitions(fuzzer_connect_established PRIVATE FUZZING_STAGE=3)
# target_link_libraries(fuzzer_connect_established usrsctp-static)
# add_executable(fuzzer_connect_data_sent fuzzer_connect.c)
# target_compile_definitions(fuzzer_connect_data_sent PRIVATE FUZZING_STAGE=4)
# target_link_libraries(fuzzer_connect_data_sent usrsctp-static)
# add_executable(fuzzer_connect_data_received fuzzer_connect.c)
# target_compile_definitions(fuzzer_connect_data_received PRIVATE FUZZING_STAGE=5)
# target_link_libraries(fuzzer_connect_data_received usrsctp-static)

Some files were not shown because too many files have changed in this diff Show more