Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
getsockopt(2) OSS System Calls Reference Manual
NAME
getsockopt - Gets socket options
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/socket.h>
[#include <netinet/in.h>] Required for IP protocol level
[#include <netinet/tcp.h>] Required for TCP protocol level
int getsockopt(
int socket,
int level,
int option_name,
void *option_value,
socklen_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
Return IP protocol-level options defined for an Internet Protocol
version 6 (IPv6) socket
IPPROTO_IP Return IP protocol-level options defined for an Internet Protocol
version 4 (IPv4) socket
IPPROTO_TCP
Return TCP protocol-level options defined for a socket
SOL_SOCKET
Return socket-level protocol options defined for a socket
To retrieve options at other levels, supply the appropriate protocol number for
the protocol controlling the option. Supported protocol numbers are listed in
/etc/protocols.
option_name Specifies a single option to be retrieved.
The getsockopt() function retrieves information about the following
IPPROTO_IPV6 (IP protocol-level IPv6) options:
IPV6_MULTICAST_IF
Indicates the interface (subnet) used for outbound multicast
UDP datagrams. The interface value is an unsigned int.
IPV6_MULTICAST_HOPS
Indicates the hop limit for outbound multicast UDP datagrams.
The limit is an int that is either:
• Between 0 and 255 to indicate the maximum number of
hops allowed.
3−88 Hewlett-Packard Company 527186-023