Linux Standard Base Specification 2.1 | ||
---|---|---|
<<< Previous | Next >>> |
In addition to the setsockopt() options specified in SUSv3, setsockopt() also supports the options specified here.
The following setsockopt() operations are provided for
level
IPPROTO_IP:
Set or reads the time-to-live value of outgoing multicast packets for this socket. optval is a pointer to an integer which contains the new TTL value.
Sets a boolean flag indicating whether multicast packets originating locally should be looped back to the local sockets. optval is a pointer to an integer which contains the new flag value.
Join a multicast group.
optval is a pointer to a
ip_mreq structure. Before calling, the
caller should fill in the imr_multiaddr
field with the multicast group address and the
imr_address
field with the address of the local
interface. If imr_address
is set to INADDR_ANY,
then an appropriate interface is chosen by the system.
Leave a multicast group. optval is a pointer to a ip_mreq structure containing the same values as were used with IP_ADD_MEMBERSHIP.
Set the local device for a multicast socket. optval is a pointer to a ip_mreq structure initialized in the same manner as with IP_ADD_MEMBERSHIP.
The ip_mreq structure contains two
struct in_addr fields:
imr_multiaddr
and
imr_address
.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
<<< Previous | Home | Next >>> |
sethostname | Up | setutent |