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 Specifies the file descriptor for the socket.
level Specifies the protocol level at which the option resides. The following values
can be specified for the level parameter in an OSS application program:
IPPROTO_IPV6
Set IP protocol-level options defined for an Internet Protocol
version 6 (IPv6) socket
IPPROTO_IP Set IP protocol-level options defined for an Internet Protocol
version 4 (IPv4) socket
IPPROTO_TCP
Set TCP protocol-level options defined for a socket
SOL_SOCKET
Set socket-level protocol options defined 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 Specifies the option to set. The option_name parameter and any specified
options are passed uninterpreted to the appropriate protocol module for interpre-
tation.
The sys/socket.h header file defines the socket-level options. Additional header
files 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 specified interface.
527186-003 Hewlett-Packard Company 7−37