Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (s and S) setsockopt(2)
NAME
setsockopt - Sets socket options
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/socket.h>
[#include <netinet/in.h> ]
[#include <netinet/in6.h> ]
[#include <netdb.h> ]
[#include <netinet/tcp.h>] Required for TCP protocol level
int setsockopt(
int socket,
int level,
int option_name,
const void *option_value,
size_t option_len
);
PARAMETERS
socket Species the le descriptor for the socket.
level Species the protocol level at which the option resides. The following values
can be specied for the level parameter in an OSS application program:
IPPROTO_IPV6
Set IP protocol-level options dened for an Internet Protocol
version 6 (IPv6) socket
IPPROTO_IP Set IP protocol-level options dened for an Internet Protocol
version 4 (IPv4) socket
IPPROTO_TCP
Set TCP protocol-level options dened for a socket
SOL_SOCKET
Set socket-level protocol options dened for a socket
To set options at other levels, supply the appropriate protocol number for the pro-
tocol controlling the option. Valid protocol numbers can be found in
/etc/protocols.
option_name Species the option to set. The option_name parameter and any specied
options are passed uninterpreted to the appropriate protocol module for interpre-
tation.
The sys/socket.h header le denes the socket-level options. Additional header
les are required for options at other levels.
The socket-level options can be enabled or disabled.
The IPPROTO_IPV6 (IP protocol-level IPv6) options are:
IPV6_JOIN_GROUP
Enables IPv6 multicast UDP datagrams on a specied interface.
527186-003 Hewlett-Packard Company 737