multi-homing and wildcards
[unix-history] / usr / src / sys / netinet / in.h
CommitLineData
1aa87517 1/* in.h 4.9 82/02/27 */
8958351e
BJ
2
3/*
4 * Constants and structures defined by the internet system,
5 * Per RFC 790, September 1981.
6 */
7
8/*
9 * Protocols
10 */
11#define IPPROTO_ICMP 1 /* control message protocol */
1aa87517 12#define IPPROTO_GGP 2 /* gateway^2 (deprecated) */
8958351e
BJ
13#define IPPROTO_TCP 6 /* tcp */
14#define IPPROTO_PUP 12 /* pup */
15#define IPPROTO_UDP 17 /* user datagram protocol */
16
13ab51b7 17#define IPPROTO_RAW 255 /* raw IP packet */
eb44bfb2
BJ
18#define IPPROTO_MAX 256
19
8958351e
BJ
20/*
21 * Port/socket numbers: network standard functions
22 */
23#define IPPORT_ECHO 7
24#define IPPORT_DISCARD 9
25#define IPPORT_SYSTAT 11
26#define IPPORT_DAYTIME 13
27#define IPPORT_NETSTAT 15
28#define IPPORT_FTP 21
29#define IPPORT_TELNET 23
30#define IPPORT_SMTP 25
31#define IPPORT_TIMESERVER 37
32#define IPPORT_NAMESERVER 42
33#define IPPORT_WHOIS 43
34#define IPPORT_MTP 57
35
36/*
37 * Port/socket numbers: host specific functions
38 */
39#define IPPORT_TFTP 69
40#define IPPORT_RJE 77
41#define IPPORT_FINGER 79
42#define IPPORT_TTYLINK 87
43#define IPPORT_SUPDUP 95
44
1aa87517
BJ
45#define IPPORT_RESERVED 1024
46
8958351e
BJ
47/*
48 * Link numbers
49 */
50#define IMPLINK_IP 155
51#define IMPLINK_LOWEXPER 156
52#define IMPLINK_HIGHEXPER 158
53
54/*
55 * Internet address (old style... should be updated)
56 */
2b4b57cd 57struct in_addr {
8958351e
BJ
58 union {
59 struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
60 struct { u_short s_w1,s_w2; } S_un_w;
1a88ef94 61 u_long S_addr;
8958351e 62 } S_un;
1a88ef94
SL
63#define s_addr S_un.S_addr /* can be used for most tcp & ip code */
64#ifdef vax
8958351e
BJ
65#define s_host S_un.S_un_b.s_b2 /* host on imp */
66#define s_net S_un.S_un_b.s_b1 /* network */
67#define s_imp S_un.S_un_w.s_w2 /* imp */
1a88ef94 68#endif
8958351e 69};
2b4b57cd 70
1aa87517
BJ
71#define INADDR_ANY 0x00000000
72
2b4b57cd
BJ
73/*
74 * Socket address, internet style.
75 */
76struct sockaddr_in {
77 short sin_family;
78 u_short sin_port;
79 struct in_addr sin_addr;
80 char sin_zero[8];
81};