0

我找到了 DTLS SCTP 示例代码的网络档案。 http://web.archive.org/web/20150617012520/http://sctp.fh-muenster.de/dtls-samples.html

我想运行 DTLS 回显服务器和客户端。但是,我无法编译。以下是错误内容:

$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

谢谢!。

4

1 回答 1

0
  1. 尝试使用以下命令再次构建 openssl 源代码:

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

  2. 安装openssl

  3. 使用新的 openssl 库重建 dtls_sctp_echo.c

于 2018-09-01T13:52:56.057 回答