User friendly error message when OpenSSL is built w/o SCTP support.
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/dtls-merge@2440 aef3b71b-58ee-0310-9ba9-8811b9f0742fmaster
parent
d00ced829e
commit
8cdea4d968
|
@ -342,6 +342,15 @@ ENDIF(SUPPORT_DTLS)
|
|||
OPTION(SUPPORT_DTLS_OVER_SCTP "Enables/Disables DTLS on SCTP streams." OFF)
|
||||
IF (SUPPORT_DTLS_OVER_SCTP)
|
||||
IF (SUPPORT_SCTP AND SUPPORT_DTLS)
|
||||
# Make sure OpenSSL was compiled with SCTP support enabled
|
||||
INCLUDE(CheckSymbolExists)
|
||||
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
# OpenSSL #defines OPENSSL_SCTP if it supports SCTP
|
||||
CHECK_SYMBOL_EXISTS(OPENSSL_SCTP "openssl/ssl.h" OPENSSL_SUPPORTS_SCTP)
|
||||
SET(CMAKE_REQUIRED_INCLUDES)
|
||||
IF (NOT OPENSSL_SUPPORTS_SCTP)
|
||||
MESSAGE(FATAL_ERROR "OpenSSL built without SCTP support. Rebuild OpenSSL with SCTP support or turn off SUPPORT_DTLS_OVER_SCTP")
|
||||
ENDIF (NOT OPENSSL_SUPPORTS_SCTP)
|
||||
ADD_DEFINITIONS(-DSUPPORT_DTLS_OVER_SCTP)
|
||||
ELSE (SUPPORT_SCTP AND SUPPORT_DTLS)
|
||||
MESSAGE(FATAL_ERROR "SUPPORT_DTLS_OVER_SCTP can only be enabled together with SUPPORT_SCTP and SUPPORT_DTLS")
|
||||
|
|
|
@ -55,6 +55,10 @@ extern "C" {
|
|||
|
||||
#define bit_set(data, bits) ((data & bits) == bits)
|
||||
|
||||
#if defined(SUPPORT_DTLS_OVER_SCTP) && !defined(OPENSSL_SCTP)
|
||||
# error OpenSSL built without SCTP support. Rebuild OpenSSL with SCTP support or turn off SUPPORT_DTLS_OVER_SCTP
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_DTLS
|
||||
static int ensure_exporter_set_up_for_dtls(ipfix_exporter *exporter);
|
||||
static void deinit_openssl_ctx(ipfix_exporter *exporter);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/sctp.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
|
|
|
@ -33,6 +33,10 @@
|
|||
#include "IpfixReceiver.hpp"
|
||||
#include "IpfixPacketProcessor.hpp"
|
||||
|
||||
#if defined(SUPPORT_DTLS_OVER_SCTP) && !defined(OPENSSL_SCTP)
|
||||
# error OpenSSL built without SCTP support. Rebuild OpenSSL with SCTP support or turn off SUPPORT_DTLS_OVER_SCTP
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_DTLS
|
||||
|
||||
#include "common/openssl/SSLCTXWrapper.hpp"
|
||||
|
|
Loading…
Reference in New Issue