Subject: [Tsvwg] SCTP stream information

From: Preethi Natarajan <[email-masked]>
Date: Wed, 17 Jan 2007 18:47:43 -0500

Hello all,

Is it possible to get advance information on the SCTP stream in which 
the next sctp_recvmsg() will return data from? I.e., the application 
gets to know the SCTP stream on which data will be received before doing 
the sctp_recvmsg().

-- 

Regards,
Preethi

---

From: "Brian F. G. Bidulock" <[email-masked]>
Date: Thu, 18 Jan 2007 03:38:55 -0700

Preethi,

MSG_PEEK ?  (Albeit costly.)

--brian

Preethi Natarajan wrote:                        (Wed, 17 Jan 2007 18:47:43)

-- 
Brian F. G. Bidulock
[email-masked]
http://www.openss7.org/

---

From: Michael Tuexen <[email-masked]>
Date: Thu, 18 Jan 2007 11:44:08 +0100

Hi,

it looks like you are looking for

5.2.3.  Extended SCTP Header Information Structure (SCTP_EXTRCV)

    This cmsghdr structure specifies SCTP options for SCTP header
    information about a received message via recvmsg().  Note that this
    structure is an extended version of SCTP_SNDRCV and will only be
    received if the user has set the socket option SCTP_USE_EXT_RCVINFO
    to true in addition to any event subscription needed to receive
    ancillary data..

    cmsg_level    cmsg_type      cmsg_data[]
    ------------  ------------   ----------------------
    IPPROTO_SCTP  SCTP_SNDRCV    struct sctp_sndrcvinfo

    Here is the definition of sctp_sndrcvinfo:

    struct sctp_extrcvinfo {
       uint16_t sinfo_stream;
       uint16_t sinfo_ssn;
       uint16_t sinfo_flags;
       uint32_t sinfo_ppid;
       uint32_t sinfo_context;
       uint32_t sinfo_timetolive;
       uint32_t sinfo_tsn;
       uint32_t sinfo_cumtsn;
       sctp_assoc_t sinfo_assoc_id;
       uint16_t next_flags;
       uint16_t next_stream;
       uint32_t next_asocid;
       uint32_t next_length;
       uint32_t next_ppid;
    };

from http://www.ietf.org/internet-drafts/draft-ietf-tsvwg- 
sctpsocket-14.txt

Best regards
Michael

On Jan 18, 2007, at 12:47 AM, Preethi Natarajan wrote:

> Hello all,
>
> Is it possible to get advance information on the SCTP stream in  
> which the next sctp_recvmsg() will return data from? I.e., the  
> application gets to know the SCTP stream on which data will be  
> received before doing the sctp_recvmsg().
>
> -- 
>
> Regards,
> Preethi
>
>
>

---

From: Randall Stewart <[email-masked]>
Date: Thu, 18 Jan 2007 07:37:33 -0500

Hmm... that works only for the next message
after the one you are currently reading.

Thats great once you get past the first sctp_recvmsg() with
the SCTP_EXTRCV option set...

Brian points out an expensive alternative.. i.e. read 1 byte
with MSG_PEEK.

Seems to me we could probably do a socket option pretty easily
that would return the next sinfo to be read..

Something like

getsockopt(sd, IPPROT_SCTP, SCTP_NEXT_SINFO, &sinfo, &sinfo_len);

It should be pretty easy to implement.. but is it really something
we want to do to get beyond the first message problem (instead
of a MSG_PEEK)...

R

Michael Tuexen wrote:
> from http://www.ietf.org/internet-drafts/draft-ietf-tsvwg-sctpsocket-14.txt
> 
> Best regards
> Michael
> 
>> gets to know the SCTP stream on which data will be received before 
>> doing the sctp_recvmsg().
>>
>> -- 
>> Regards,
>> Preethi
>>
>>
>>
> 
> 
> 

-- 
Randall Stewart
803-345-0369 <or> 815-342-5222(cell)