guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

doc getsockopt, setsockopt


From: Kevin Ryde
Subject: doc getsockopt, setsockopt
Date: Thu, 29 Sep 2005 07:31:38 +1000
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

I'm looking to combine the getsockopt and setsockopt descriptions and
add the available constants, including the new IP_ADD_MEMBERSHIP and
IP_DROP_MEMBERSHIP, especially since you need to know to pass a pair
for those (and for SO_LINGER).

I'm not sure if SOL_IP is meant to be used directly.  You'd think so
from the name, but the getsockopt man page refers to getprotoent().  I
think I'll change socket.c from IPPROTO_IP to SOL_IP.  The two are the
same value, but best to ensure the code matches the docs.


 -- Scheme Procedure: getsockopt sock level optname
 -- Scheme Procedure: setsockopt sock level optname value
 -- C Function: scm_getsockopt (sock, level, optname)
 -- C Function: scm_setsockopt (sock, level, optname, value)
     Get or set an option on socket port SOCK.  `getsockopt' returns
     the current value.  `setsockopt' sets a value and the return is
     unspecified.

     LEVEL is an integer specifying a protocol layer.  The following
     values are defined (when provided by the system),

      -- Variable: SOL_SOCKET
      -- Variable: SOL_IP
      -- Variable: SOL_TCP
      -- Variable: SOL_UDP

     OPTNAME is an integer specifying an option within the protocol
     layer.

     For `SOL_SOCK' level the following OPTNAMEs are defined (when
     provided by the system).  For what they mean see *note
     Socket-Level Options: (libc)Socket-Level Options, or `man 7
     socket'.

      -- Variable: SO_DEBUG
      -- Variable: SO_REUSEADDR
      -- Variable: SO_STYLE
      -- Variable: SO_TYPE
      -- Variable: SO_ERROR
      -- Variable: SO_DONTROUTE
      -- Variable: SO_BROADCAST
      -- Variable: SO_SNDBUF
      -- Variable: SO_RCVBUF
      -- Variable: SO_KEEPALIVE
      -- Variable: SO_OOBINLINE
      -- Variable: SO_NO_CHECK
      -- Variable: SO_PRIORITY
          The VALUE taken or returned is an integer.

      -- Variable: SO_LINGER
          The VALUE taken or returned is a pair of integers `(ENABLE .
          TIMEOUT)'.  On old systems without timeout support (ie.
          without `struct linger'), only ENABLE has an effect, but the
          value in Guile is still a pair.

     For `SOL_IP' level the following options are defined (when
     provided by the system).  See `man 7 ip' for what they mean.

      -- Variable: IP_ADD_MEMBERSHIP
      -- Variable: IP_DROP_MEMBERSHIP
          These can be used only with `setsockopt', not `getsockopt'.
          VALUE is a pair of integer IPv4 addresses `(MULTIADDR .
          INTERFACEADDR)' (*note Network Address Conversion::).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]