Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Documentation for using setsockopt() / getsockopt()

7 views
Skip to first unread message

A. McKenney

unread,
Oct 23, 2010, 11:20:17 AM10/23/10
to
Can anyone suggest a place to find good documentation
for the various socket options, such as those accessed
by setsockopt()? Or even just a semi-complete list?
(I'm using C++ on Solaris 10, if that matters.)

I've studied the usual setsockopt man page, but that
only documents SOL_SOCKET options, and even
for those, it does not explicitly indicate the expected
data types and values. It also doesn't indicate what
other "levels" are defined, or even how to tell if
some #define name I find in an include file is a valid "level".

As for other options, such as multicast options, I've
only ever been able to find out about them by finding a text
or web page that mentions them in passing while
describing how to do X, Y, or Z. It's like you have
to already know about the option in order to find out
about it, or else just stumble on it.

I've rooted through various #include files, but
(on Solaris) those don't say where you can actually
use any of the values.

It would be nice to have a book or website or something
that actually lists them all, or at least most of them,
along with what they do and what arguments they take.

Richard Kettlewell

unread,
Oct 23, 2010, 11:43:47 AM10/23/10
to
"A. McKenney" <alan_mc...@yahoo.com> writes:

> Can anyone suggest a place to find good documentation
> for the various socket options, such as those accessed
> by setsockopt()? Or even just a semi-complete list?
> (I'm using C++ on Solaris 10, if that matters.)

They are in the man pages for the specific types of socket,
e.g. 'man ip' and 'man ip6'.

--
http://www.greenend.org.uk/rjk/

Barry Margolin

unread,
Oct 23, 2010, 12:01:10 PM10/23/10
to
In article <87tykca...@araminta.anjou.terraraq.org.uk>,
Richard Kettlewell <r...@greenend.org.uk> wrote:

Right. Setsockopt() is an open-ended API, like ioctl(), that allows
access to arbitrary, device-specific features. It's not possible to
have a comprehensive list of options, because every device or network
driver can implement its own options.

On the other hand, it probably wouldn't be too hard for someone to
compile a list of the options provided by the common drivers on most
well known operating systems, and put that up on a web page. If it's a
wiki, people could easily add new drivers and OSes to it.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Ersek, Laszlo

unread,
Oct 23, 2010, 7:58:32 PM10/23/10
to
On Sat, 23 Oct 2010, A. McKenney wrote:

> Can anyone suggest a place to find good documentation
> for the various socket options, such as those accessed
> by setsockopt()? Or even just a semi-complete list?

http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_10_16

And/or follow the links under
http://www.kernel.org/doc/man-pages/online/pages/man7/socket.7.html#SEE_ALSO

For example,

> As for other options, such as multicast options

http://www.kernel.org/doc/man-pages/online/pages/man7/ip.7.html#DESCRIPTION


> (I'm using C++ on Solaris 10, if that matters.)

http://docs.sun.com/app/docs/doc/816-5177/ip-7p?l=en&a=view
http://docs.sun.com/app/docs/doc/816-5177/ip6-7p?l=en&a=view
http://docs.sun.com/app/docs/doc/816-5177/tcp-7p?l=en&a=view

lacos

0 new messages