1 .\" $NetBSD: inet.4,v 1.3 1994/11/30 16:22:18 jtc Exp $
3 .\" Copyright (c) 1983, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed by the University of
17 .\" California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)inet.4 8.1 (Berkeley) 6/5/93
41 .Nd Internet protocol family
43 .Fd #include <sys/types.h>
44 .Fd #include <netinet/in.h>
46 The Internet protocol family is a collection of protocols
50 transport layer, and utilizing the Internet address format.
51 The Internet family provides protocol support for the
52 .Dv SOCK_STREAM , SOCK_DGRAM ,
57 interface provides access to the
61 Internet addresses are four byte quantities, stored in
62 network standard format (on the
64 these are word and byte
65 reversed). The include file
68 as a discriminated union.
70 Sockets bound to the Internet protocol family utilize
71 the following addressing structure,
72 .Bd -literal -offset indent
76 struct in_addr sin_addr;
81 Sockets may be created with the local address
85 matching on incoming messages.
94 The distinguished address
96 is allowed as a shorthand for the broadcast address on the primary
97 network if the first network configured supports broadcast.
99 The Internet protocol family is comprised of
102 transport protocol, Internet Control
108 and User Datagram Protocol
111 is used to support the
115 is used to support the
117 abstraction. A raw interface to
120 by creating an Internet socket of type
124 message protocol is accessible from a raw socket.
126 The 32-bit Internet address contains both network and host parts.
127 It is frequency-encoded; the most-significant bit is clear
128 in Class A addresses, in which the high-order 8 bits are the network
130 Class B addresses use the high-order 16 bits as the network field,
131 and Class C addresses have a 24-bit network part.
132 Sites with a cluster of local networks and a connection to the
133 Internet may chose to use a single network number for the cluster;
134 this is done by using subnet addressing.
135 The local (host) portion of the address is further subdivided
136 into subnet and host parts.
137 Within a subnet, each subnet appears to be an individual network;
138 externally, the entire cluster appears to be a single, uniform
139 network requiring only a single routing entry.
140 Subnet addressing is enabled and examined by the following
142 commands on a datagram socket in the Internet domain;
143 they have the same form as the
148 .Bl -tag -width SIOCSIFNETMASK
149 .It Dv SIOCSIFNETMASK
150 Set interface network mask.
151 The network mask defines the network part of the address;
152 if it contains more of the address than the address type would indicate,
153 then subnets are in use.
154 .It Dv SIOCGIFNETMASK
155 Get interface network mask.
166 .%T "An Introductory 4.3 BSD Interprocess Communication Tutorial"
171 .%T "An Advanced 4.3 BSD Interprocess Communication Tutorial"
176 The Internet protocol support is subject to change as
177 the Internet protocols develop. Users should not depend
178 on details of the current implementation, but rather
179 the services exported.
183 protocol interface appeared in