Subject: How to read current value of a socket option with sctp_opt_info()

From: [email-masked]
Date: Tue, 3 Jun 2003 16:41:23 +0300

Hi,

I have a question regarding the use of sctp_opt_info(). In addition of setting socket options can it also be used to read the current value of a socket option?

For example if I want to set heartbeat interval to some value I would fill out struct sctp_paddrparams with the new value and call sctp_opt_info() with SCTP_SET_PEER_ADDR_PARAMS. But what if I'm just interested in knowing the current value of heartbeat interval? Do I again call sctp_opt_info() and pass struct sctp_paddrparams as an argument and expect that when sctp_opt_info() returns it will be filled with the current data. 

The problem I see here is that since the calls to set/get the socket option look the same, how does the system know if I want to set or get the socket option. Should I use getsockopt() instead of sctp_opt_info() when I want to read the current value of socket option.

Br,
	Kimmo

---

From: "Randall Stewart (cisco)" <[email-masked]>
Date: Tue, 03 Jun 2003 10:08:23 -0500

>The problem I see here is that since the calls to set/get the socket option look the same, how does the system know if I want to set or get the socket option. Should I use getsockopt() instead of sc…
sctp_opt_info()

is only getting options. This is due to the fact that on
some machines.. you can NOT pass a in-out variable into the
getsockopt() call.

For BSD machines you can use either getsockopt() OR sctp_opt_info()

You CAN NOT use sctp_opt_info() to set any socket option..

R

-- 
Randall R. Stewart
ITD
Cisco Systems Inc.
[email-masked] 815-342-5222(cell) or 815-477-2127(office)