ip.7p (2010 09)

i
IP(7P) IP(7P)
NAME
IP - Internet Protocol
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
s = socket(AF_INET, SOCK_DGRAM, 0);
DESCRIPTION
IP is the network-layer protocol used by the Internet protocol family. It encapsulates TCP and UDP mes-
sages into datagrams to be transmitted by the network interface. Normally, applications do not need to
interface directly to IP. However, certain multicast socket options are controlled by passing options to the
IPPROTO_IP protocol level through a UDP socket, and IP Type of Service is controlled by passing an
option to the IPPROTO_IP protocol level through either a TCP or UDP socket. (See the getsockopt (2)
manual page.)
The following socket options are defined in the include file
<netinet/in.h>
. The type of the variable
pointed to by the optval parameter is indicated in parentheses. The data types
struct ip_mreq,
struct ip_mreq_source
, struct group_req, struct group_source_req
, and struct
in_addr are defined in <netinet/in.h>
.
IP_TOS (unsigned int) Sets the IP Type of Service. Allowable values for
optval are 4 for high reliability, 8 for high throughput, and 16 for low
delay. Other values will not return an error, but may have unpredict-
able results. Default: zero.
IP_ADD_MEMBERSHIP
(struct ip_mreq) Requests that the system join a multicast group in
"exclude" mode.
MCAST_JOIN_GROUP (
struct group_req) Requests that the system join a multicast group
in "exclude" mode.
IP_DROP_MEMBERSHIP
(struct ip_mreq) Allows the system to leave a multicast group.
MCAST_LEAVE_GROUP
(struct group_req) Allows the system to leave a multicast group.
IP_BLOCK_SOURCE (
struct ip_mreq_source) Adds a source address to the list of
blocked sources for a multicast group in "exclude" mode.
MCAST_BLOCK_SOURCE
(struct group_source_req) Adds a source address to the list of
blocked sources for a multicast group in "exclude" mode.
IP_UNBLOCK_SOURCE
(struct ip_mreq_source) Removes a source address from the list of
blocked sources for a multicast group in "exclude" mode.
MCAST_UNBLOCK_SOURCE
(struct group_source_req
) Removes a source address from the list
of blocked sources for a multicast group in "exclude" mode.
IP_ADD_SOURCE_MEMBERSHIP
(struct ip_mreq_source) Adds a source address to the list of
allowed sources for a multicast group in "include" mode, joining the
group in "include" mode if not already joined.
MCAST_JOIN_SOURCE_GROUP
(struct group_source_req) Adds a source address to the list of
allowed sources for a multicast group in "include" mode, joining the
group in "include" mode if not already joined.
IP_DROP_SOURCE_MEMBERSHIP
(struct ip_mreq_source) Removes a source address from the list of
allowed sources for a multicast group in "include" mode, leaving the
group when the last source is removed.
MCAST_LEAVE_SOURCE_GROUP
(struct group_source_req) Removes a source address from the list
of allowed sources for a multicast group in "include" mode, leaving the
group when the last source is removed.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (6 pages)