update backoff algorithm
[unix-history] / usr / src / share / man / man4 / ip.4
CommitLineData
089e2666
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
1df490e6 5.\" @(#)ip.4 6.1 (Berkeley) %G%
089e2666 6.\"
1df490e6 7.TH IP 4P ""
089e2666
KM
8.UC 5
9.SH NAME
10ip \- Internet Protocol
11.SH SYNOPSIS
12.B #include <sys/socket.h>
13.br
14.B #include <netinet/in.h>
15.PP
16.B s = socket(AF_INET, SOCK_RAW, 0);
17.SH DESCRIPTION
18IP is the transport layer protocol used
19by the Internet protocol family. It may be accessed
20through a \*(lqraw socket\*(rq when developing new protocols, or
21special purpose applications. IP sockets are connectionless,
22and are normally used with the
23.I sendto
24and
25.I recvfrom
26calls, though the
27.IR connect (2)
28call may also be used to fix the destination for future
29packets (in which case the
30.IR read (2)
31or
32.IR recv (2)
33and
34.IR write (2)
35or
36.IR send (2)
37system calls may be used).
38.PP
39Outgoing packets automatically have an IP header prepended to
40them (based on the destination address and the protocol
41number the socket is created with).
42Likewise, incoming packets have their IP header stripped
43before being sent to the user.
44.SH DIAGNOSTICS
45A socket operation may fail with one of the following errors returned:
46.TP 15
47[EISCONN]
48when trying to establish a connection on a socket which
49already has one, or when trying to send a datagram with the destination
50address specified and the socket is already connected;
51.TP 15
52[ENOTCONN]
53when trying to send a datagram, but
54no destination address is specified, and the socket hasn't been
55connected;
56.TP 15
57[ENOBUFS]
58when the system runs out of memory for
59an internal data structure;
60.TP 15
61[EADDRNOTAVAIL]
62when an attempt is made to create a
63socket with a network address for which no network interface
64exists.
65.SH SEE ALSO
66send(2), recv(2), intro(4N), inet(4F)
67.SH BUGS
68One should be able to send and receive ip options.
69.PP
70The protocol should be settable after socket creation.