.\" commit 76e21053b5bf33a07c76f99d27a74238310e3c71
.\" Author: Erich E. Hoover <ehoover@mines.edu>
.\"
-.TH IP 7 2017-09-15 "Linux" "Linux Programmer's Manual"
+.TH IP 7 2019-03-06 "Linux" "Linux Programmer's Manual"
.SH NAME
ip \- Linux IPv4 protocol implementation
.SH SYNOPSIS
.PP
socket(AF_INET, socket_type, protocol);
.PP
-Valid socket types are
+Valid socket types include
.B SOCK_STREAM
-to open a
-.BR tcp (7)
-socket,
+to open a stream socket,
.B SOCK_DGRAM
-to open a
-.BR udp (7)
-socket, or
+to open a datagram socket, and
.B SOCK_RAW
to open a
.BR raw (7)
socket to access the IP protocol directly.
+.PP
.I protocol
is the IP protocol in the IP header to be received or sent.
-The only valid values for
+Valid values for
.I protocol
-are 0 and
+include:
+.IP \(bu 2
+0 and
.B IPPROTO_TCP
-for TCP sockets, and 0 and
+for
+.BR tcp (7)
+stream sockets;
+.IP \(bu
+0 and
.B IPPROTO_UDP
-for UDP sockets.
+for
+.BR udp (7)
+datagram sockets;
+.IP \(bu
+.B IPPROTO_SCTP
+for
+.BR sctp (7)
+stream sockets; and
+.IP \(bu
+.B IPPROTO_UDPLITE
+for
+.BR udplite (7)
+datagram sockets.
+.PP
For
.B SOCK_RAW
you may specify a valid IANA IP protocol defined in
structure is similar to
.I ip_mreqn
described under
-.BR IP_ADD_MEMBERSIP .
+.BR IP_ADD_MEMBERSHIP .
The
.I imr_multiaddr
field contains the address of the multicast group the application
When this flag is set, pass a
.B IP_TTL
control message with the time-to-live
-field of the received packet as a byte.
+field of the received packet as a 32 bit integer.
Not supported for
.B SOCK_STREAM
sockets.
.B INADDR_ANY
(0.0.0.0) and
.B INADDR_BROADCAST
-(255.255.255.255) are byte-order-neutral. That means
+(255.255.255.255) are byte-order-neutral.
+ This means
.BR htonl (3)
has no effect on them.
.SS Compatibility
.BR capabilities (7),
.BR icmp (7),
.BR ipv6 (7),
+.BR netdevice (7),
.BR netlink (7),
.BR raw (7),
.BR socket (7),
.BR udp (7),
.BR ip (8)
.PP
+The kernel source file
+.IR Documentation/networking/ip-sysctl.txt .
+.PP
RFC\ 791 for the original IP specification.
RFC\ 1122 for the IPv4 host requirements.
RFC\ 1812 for the IPv4 router requirements.