1

I am very new to SCTP programming and while troubleshooting and referring to a book (Unix Network Programming, by W.Richard Stevens) I came across something ambiguous. They have used the level name as SOL_SOCKET here and here for option name (optname) values SCTP_INITMSG and SCTP_EVENTS which are supposed to be used with IPPROTO_SCTP, according to the book. Both the codes work fine, so I must be missing something and I feel I am missing something pivotal. What is it? Please help me through this. Thank You.

Community
  • 1
  • 1
Sukhmeet Singh
  • 29
  • 1
  • 11
  • 1
    They must have the same numerical values. IPPROTO_SCTP is only for use in socket() IIRC. The book could be wrong, although in over twenty years I've never found a bug in it. I would have thought you should use SOL_SCTP for SCTP_* options in setsockopt(). – user207421 Jul 10 '14 at 09:57
  • I know I am sticking to the book a little too much, but there is no level named SOL_SOCKET, the SCTP_* options are given in a table against IPPROTO_SCTP level. Moreover I just found out that this page ---> http://www.opensourceforu.com/2011/12/socket-api-part-5-sctp/ also states that "To manipulate sockets at sockets API level, the level is specified as SOL_SOCKET". If you could explain that statement, that would help me alot. – Sukhmeet Singh Jul 10 '14 at 10:23
  • Also the book might be outdated, its the Volume 1, Third Edition, that I have here. – Sukhmeet Singh Jul 10 '14 at 11:14

0 Answers0