[gnutls-help] the problem about "stream usage" in dtls/sctp

Wei Cheng chengwei.clx at gmail.com
Thu May 11 17:26:30 CEST 2017


hi,guys!

i have read the rfc6083 which  describes the usage of the Datagram
Transport Layer Security (DTLS) protocol over the Stream Control
Transmission Protocol (SCTP).

"stream usage " is as follows:
4.4.  Stream Usage
   All DTLS messages of the ChangeCipherSpec, Alert, or Handshake
   protocol MUST be transported on stream 0 with unlimited reliability
   and with the ordered delivery feature.
   DTLS messages of the ApplicationData protocol SHOULD use multiple
   streams other than stream 0; they MAY use stream 0 for everything if
   they do not care about minimizing head of line blocking.


i write a push_function .like that:
static ssize_t push_func(gnutls_transport_ptr_t p, const void *data, size_t
size)
{
    priv_data_st *priv = p;
    int ret;
    //  i sent msg on stream #0
    ret = sctp_sendmsg(priv->fd, data,size ,NULL, 0,0, 0,0, 0,0);
    if (ret < 0)
         printf("fail to sent msg \n");
     else
         printf("success to sent msg in push\n");
     return ret;
}

i use gnutls_transpoet_set_push_fnuction to register my push function,
so that all message would be sent by my push_function.


i want to sent alert,handshake,changesuite on stream #0, while appilcaiton
data is sent on others streams.
in push_function,all data is already encryped,
how i can distinguish which kind of msg it is ?
how should i write my push_function?
i doubt that i am wrong in this part.

i sorry about my poor english.
thanks any advices!
thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20170511/ad29dcc0/attachment.html>


More information about the Gnutls-help mailing list