Commit | Line | Data |
---|---|---|
97ee408e 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 | .\" | |
5 | .\" @(#)inet.4 5.1 (Berkeley) %G% | |
6 | .\" | |
7 | .TH INET 4F "19 March 1982" | |
8 | .UC 5 | |
9 | .SH NAME | |
10 | inet \- Internet protocol family | |
11 | .SH SYNOPSIS | |
12 | .B #include <sys/types.h> | |
13 | .br | |
14 | .B #include <netinet/in.h> | |
15 | .SH DESCRIPTION | |
16 | .de _d | |
17 | .if t .ta .6i 2.1i 2.6i | |
18 | .\" 2.94 went to 2.6, 3.64 to 3.30 | |
19 | .if n .ta .84i 2.6i 3.30i | |
20 | .. | |
21 | .de _f | |
22 | .if t .ta .5i 1.25i 2.5i | |
23 | .\" 3.5i went to 3.8i | |
24 | .if n .ta .7i 1.75i 3.8i | |
25 | .. | |
26 | The Internet protocol family is a collection of protocols | |
27 | layered atop the | |
28 | .I Internet Protocol | |
29 | (IP) transport layer, and utilizing the Internet address format. | |
30 | The Internet family provides protocol support for the | |
31 | SOCK_STREAM, SOCK_DGRAM, and SOCK_RAW socket types; the | |
32 | SOCK_RAW interface provides access to the IP protocol. | |
33 | .SH ADDRESSING | |
34 | Internet addresses are four byte quantities, stored in | |
35 | network standard format (on the VAX these are word and byte | |
36 | reversed). The include file | |
37 | .RI < netinet/in.h > | |
38 | defines this address | |
39 | as a discriminated union. | |
40 | .PP | |
41 | Sockets bound to the Internet protocol family utilize | |
42 | the following addressing structure, | |
43 | .sp 1 | |
44 | .nf | |
45 | ._f | |
46 | struct sockaddr_in { | |
47 | short sin_family; | |
48 | u_short sin_port; | |
49 | struct in_addr sin_addr; | |
50 | char sin_zero[8]; | |
51 | }; | |
52 | .sp 1 | |
53 | .fi | |
54 | Sockets may be created with the address INADDR_ANY | |
55 | to effect \*(lqwildcard\*(rq matching on incoming messages. | |
56 | .SH PROTOCOLS | |
57 | The Internet protocol family is comprised of | |
58 | the IP transport protocol, Internet Control | |
59 | Message Protocol (ICMP), Transmission Control | |
60 | Protocol (TCP), and User Datagram Protocol (UDP). | |
61 | TCP is used to support the SOCK_STREAM | |
62 | abstraction while UDP is used to support the SOCK_DGRAM | |
63 | abstraction. A raw interface to IP is available | |
64 | by creating an Internet socket of type SOCK_RAW. | |
65 | The ICMP message protocol is not directly accessible. | |
66 | .SH SEE ALSO | |
67 | tcp(4P), udp(4P), ip(4P) | |
68 | .SH CAVEAT | |
69 | The Internet protocol support is subject to change as | |
70 | the Internet protocols develop. Users should not depend | |
71 | on details of the current implementation, but rather | |
72 | the services exported. |