From: Vlad Y. <vla...@hp...> - 2005-05-25 12:54:43
|
On Tue, 2005-05-24 at 18:06 -0500, sur...@ou... wrote: > Thanks for the details. Now I am getting the association id from the notification message by typecasting the buffer into sctp_assoc_change. > > Is there any way I can get the ID from the "data" message being received? > > Also, I can see two methods to retreive the association id, > 1. From the sendrecv structure in the sctp_recvmsg. > 2. From typecasting the buffer of the sctp_recvmsg into "sctp_assoc_change" and getting the id. > > Should these two values be the same? sort of. if you have more then one association, sctp_sndrcvinfo will contain the association id for the association that received this message. It must however match one of the association ids you got from sctp_assoc_change. > Becuase I am always getting zero if I try the first one (sendrecv structure) Did you enable SCTP_SNDRCV notification? Are you providing the control buffer and is it large enough? > and some 9 digit number if i print it with %d for the second one(sctp_assoc_id). That would be the association id. It's really an opaque type that just happens to be a 32 bit integer on linux. I'd recommend printing it with %x. -vlad > > Thanks > > ----- Original Message ----- > From: Vlad Yasevich <vla...@hp...> > Date: Tuesday, May 24, 2005 8:38 am > Subject: Re: [Lksctp-developers] Re: Different ways of getting assoc_id! > > > No, you don't need to send the notification explicitly. You also > > don'thave to use sctp_sendmsg(). > > > > The notifications are generated by the local system whenever an event > > happens that an application may want to know about. I recommend > > readinghttp://www.ietf.org/internet-drafts/draft-ietf-tsvwg- > > sctpsocket-10.txt > > > > > > -vlad > > > > On Mon, 2005-05-23 at 18:52 -0500, sur...@ou... wrote: > > > Do I need a corresponding sctp_sendmsg for the sctp_recvmsg in > > another end? How do I send notification via sctp_sendmsg, is that > > automatically sent if there is any change in the association or we > > need to manually send the notificatin via sctp_sendmsg. If I need > > to send manually, do I need to give id, stream number etc..? > > > > > > I am just confused between the notification message and the data > > message! > > > > > > > > > Thanks > > > Surendra > > > ----- Original Message ----- > > > From: Sridhar Samudrala <sr...@us...> > > > Date: Monday, May 23, 2005 1:14 pm > > > Subject: Re: Different ways of getting assoc_id! > > > > > > > sur...@ou... wrote: > > > > > > > > >Hey all, > > > > > Wat are all the different ways of getting association > > id > > > > (assoc_id) after the association has been made? > > > > > > > > > >I have set the socket options for SCTP_EVENTS and trying to > > get > > > > the socket id as follows, > > > > > > > > > >struct sctp_assoc_change *sac; > > > > >sac = (struct sctp_assoc_change *)buf; //here "buf" the > > buffer i > > > > am using it in recv (i have tried it with recvmsg also). > > > > >sctp_assoc_t associoation_id = sac->sac_assoc_id; > > > > > > > > > >Is this correct? I am using SCTP_SEQPACKET (one to many style > > > > socket type). > > > > > > > > > > > > > > This will work only if you are sure that the received mesage > > is a > > > > notification, not data. > > > > With recv()/recvfrom(), there is no way you can distinguish > > > > between > > > > notification or data. > > > > You should either use recvmsg() or sctp_recvmsg() when you > > have > > > > enabled > > > > notifications. > > > > You can find a no. of examples on how to use these API in > > lksctp- > > > > tools > > > > package. > > > > See under src/func_tests and src/apps. > > > > - Sridhar > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by Oracle Space Sweepstakes > > > Want to be the first software developer in space? > > > Enter now for the Oracle Space Sweepstakes! > > > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > > > _______________________________________________ > > > Lksctp-developers mailing list > > > Lks...@li... > > > https://lists.sourceforge.net/lists/listinfo/lksctp-developers > > > > > > > > |