|
|
1.1 ! root 1: .\" Copyright (c) 1983 The Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted provided ! 5: .\" that: (1) source distributions retain this entire copyright notice and ! 6: .\" comment, and (2) distributions including binaries display the following ! 7: .\" acknowledgement: ``This product includes software developed by the ! 8: .\" University of California, Berkeley and its contributors'' in the ! 9: .\" documentation or other materials provided with the distribution and in ! 10: .\" all advertising materials mentioning features or use of this software. ! 11: .\" Neither the name of the University nor the names of its contributors may ! 12: .\" be used to endorse or promote products derived from this software without ! 13: .\" specific prior written permission. ! 14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: .\" ! 18: .\" @(#)inet.4 6.5 (Berkeley) 6/23/90 ! 19: .\" ! 20: .TH INET 4 "June 23, 1990" ! 21: .UC 5 ! 22: .SH NAME ! 23: inet \- Internet protocol family ! 24: .SH SYNOPSIS ! 25: .B #include <sys/types.h> ! 26: .br ! 27: .B #include <netinet/in.h> ! 28: .SH DESCRIPTION ! 29: .de _d ! 30: .if t .ta .6i 2.1i 2.6i ! 31: .\" 2.94 went to 2.6, 3.64 to 3.30 ! 32: .if n .ta .84i 2.6i 3.30i ! 33: .. ! 34: .de _f ! 35: .if t .ta .5i 1.25i 2.5i ! 36: .\" 3.5i went to 3.8i ! 37: .if n .ta .7i 1.75i 3.8i ! 38: .. ! 39: The Internet protocol family is a collection of protocols ! 40: layered atop the ! 41: .I Internet Protocol ! 42: (IP) transport layer, and utilizing the Internet address format. ! 43: The Internet family provides protocol support for the ! 44: SOCK_STREAM, SOCK_DGRAM, and SOCK_RAW socket types; the ! 45: SOCK_RAW interface provides access to the IP protocol. ! 46: .SH ADDRESSING ! 47: Internet addresses are four byte quantities, stored in ! 48: network standard format (on the VAX these are word and byte ! 49: reversed). The include file ! 50: .RI < netinet/in.h > ! 51: defines this address ! 52: as a discriminated union. ! 53: .PP ! 54: Sockets bound to the Internet protocol family utilize ! 55: the following addressing structure, ! 56: .sp 1 ! 57: .nf ! 58: ._f ! 59: struct sockaddr_in { ! 60: short sin_family; ! 61: u_short sin_port; ! 62: struct in_addr sin_addr; ! 63: char sin_zero[8]; ! 64: }; ! 65: .sp 1 ! 66: .fi ! 67: Sockets may be created with the local address INADDR_ANY ! 68: to effect \*(lqwildcard\*(rq matching on incoming messages. ! 69: The address in a ! 70: .IR connect (2) ! 71: or ! 72: .IR sendto (2) ! 73: call may be given as INADDR_ANY to mean ``this host.'' ! 74: The distinguished address INADDR_BROADCAST ! 75: is allowed as a shorthand for the broadcast address on the primary ! 76: network if the first network configured supports broadcast. ! 77: .SH PROTOCOLS ! 78: The Internet protocol family is comprised of ! 79: the IP transport protocol, Internet Control ! 80: Message Protocol (ICMP), Transmission Control ! 81: Protocol (TCP), and User Datagram Protocol (UDP). ! 82: TCP is used to support the SOCK_STREAM ! 83: abstraction while UDP is used to support the SOCK_DGRAM ! 84: abstraction. A raw interface to IP is available ! 85: by creating an Internet socket of type SOCK_RAW. ! 86: The ICMP message protocol is accessible from a raw socket. ! 87: .PP ! 88: The 32-bit Internet address contains both network and host parts. ! 89: It is frequency-encoded; the most-significant bit is clear ! 90: in Class A addresses, in which the high-order 8 bits are the network ! 91: number. ! 92: Class B addresses use the high-order 16 bits as the network field, ! 93: and Class C addresses have a 24-bit network part. ! 94: Sites with a cluster of local networks and a connection to the DARPA ! 95: Internet may chose to use a single network number for the cluster; ! 96: this is done by using subnet addressing. ! 97: The local (host) portion of the address is further subdivided ! 98: into subnet and host parts. ! 99: Within a subnet, each subnet appears to be an individual network; ! 100: externally, the entire cluster appears to be a single, uniform ! 101: network requiring only a single routing entry. ! 102: Subnet addressing is enabled and examined by the following ! 103: .IR ioctl (2) ! 104: commands on a datagram socket in the Internet domain; ! 105: they have the same form as the ! 106: SIOCIFADDR command (see ! 107: .IR intro (4)). ! 108: .PP ! 109: .TP 20 ! 110: SIOCSIFNETMASK ! 111: Set interface network mask. ! 112: The network mask defines the network part of the address; ! 113: if it contains more of the address than the address type would indicate, ! 114: then subnets are in use. ! 115: .TP 20 ! 116: SIOCGIFNETMASK ! 117: Get interface network mask. ! 118: .SH SEE ALSO ! 119: ioctl(2), socket(2), intro(4), tcp(4), udp(4), ip(4), icmp(4) ! 120: .PP ! 121: An Introductory 4.3BSD Interprocess Communication Tutorial (PS1:7). ! 122: .PP ! 123: An Advanced 4.3BSD Interprocess Communication Tutorial (PS1:8). ! 124: .SH CAVEAT ! 125: The Internet protocol support is subject to change as ! 126: the Internet protocols develop. Users should not depend ! 127: on details of the current implementation, but rather ! 128: the services exported.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.