0

I found the web archives of DTLS SCTP sample code. http://web.archive.org/web/20150617012520/http://sctp.fh-muenster.de/dtls-samples.html

I want to run the DTLS echo server and client. However, I`m unable to compile. Here is error contents:

$gcc dtls-over-sctp-echo.c -o main -I /usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto -lpthread -Wall
         dtls-over-sctp-echo.c: In function ‘connection_handle’:
        dtls-over-sctp-echo.c:219:32: error: storage size of ‘rinfo’ isn’t known
          struct bio_dgram_sctp_rcvinfo rinfo;
                                        ^
        dtls-over-sctp-echo.c:228:8: warning: implicit declaration of function ‘BIO_new_dgram_sctp’ [-Wimplicit-function-declaration]
          bio = BIO_new_dgram_sctp(pinfo->fd, BIO_NOCLOSE);
                ^
        dtls-over-sctp-echo.c:228:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
          bio = BIO_new_dgram_sctp(pinfo->fd, BIO_NOCLOSE);
              ^
        dtls-over-sctp-echo.c:232:3: warning: implicit declaration of function ‘BIO_dgram_sctp_notification_cb’ [-Wimplicit-function-declaration]
           BIO_dgram_sctp_notification_cb(bio, &handle_notifications, (void*) ssl);
           ^
        dtls-over-sctp-echo.c:291:21: error: ‘BIO_CTRL_DGRAM_SCTP_GET_RCVINFO’ undeclared (first use in this function)
               BIO_ctrl(bio, BIO_CTRL_DGRAM_SCTP_GET_RCVINFO, sizeof(struct bio_dgram_sctp_rcvinfo), &rinf
                             ^
        dtls-over-sctp-echo.c:291:21: note: each undeclared identifier is reported only once for each function it appears in
        dtls-over-sctp-echo.c:291:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct bio_dgram_sctp_rcvinfo’
               BIO_ctrl(bio, BIO_CTRL_DGRAM_SCTP_GET_RCVINFO, sizeof(struct bio_dgram_sctp_rcvinfo), &rinf

Thanks!.

SJ Lee
  • 1
  • 1
  • Sounds like you're missing a `#include `. Alternatively, is the OpenSSL package you have installed from a significantly different version than the sample code expects? – lockcmpxchg8b Nov 30 '17 at 05:26
  • 1. refer to [1] https://stackoverflow.com/questions/20068706/dtls-over-sctp-using-openssl#new-answer -- sysctl -w net.sctp.auth_enable=1 – prime5711 Sep 01 '18 at 15:26

1 Answers1

0
  1. try build openssl source code again using:

    ./config --prefix=/usr --openssldir=/usr/lib/ssl --libdir=lib shared sctp

  2. install openssl

  3. rebuild dtls_sctp_echo.c with new openssl library

Inder
  • 3,711
  • 9
  • 27
  • 42
  • 1. and then refer to https://stackoverflow.com/questions/20068706/dtls-over-sctp-using-openssl#new-answer sysctl -w net.sctp.auth_enable = 1 – prime5711 Sep 01 '18 at 15:27