1 /* in.h 4.2 81/11/08 */ 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_RAW -1 12 #define IPPROTO_ICMP 1 /* control message protocol */ 13 #define IPPROTO_GG 2 /* gateway^2 (deprecated) */ 14 #define IPPROTO_TCP 6 /* tcp */ 15 #define IPPROTO_PUP 12 /* pup */ 16 #define IPPROTO_UDP 17 /* user datagram protocol */ 17 18 /* 19 * Port/socket numbers: network standard functions 20 */ 21 #define IPPORT_ECHO 7 22 #define IPPORT_DISCARD 9 23 #define IPPORT_SYSTAT 11 24 #define IPPORT_DAYTIME 13 25 #define IPPORT_NETSTAT 15 26 #define IPPORT_FTP 21 27 #define IPPORT_TELNET 23 28 #define IPPORT_SMTP 25 29 #define IPPORT_TIMESERVER 37 30 #define IPPORT_NAMESERVER 42 31 #define IPPORT_WHOIS 43 32 #define IPPORT_MTP 57 33 34 /* 35 * Port/socket numbers: host specific functions 36 */ 37 #define IPPORT_TFTP 69 38 #define IPPORT_RJE 77 39 #define IPPORT_FINGER 79 40 #define IPPORT_TTYLINK 87 41 #define IPPORT_SUPDUP 95 42 43 /* 44 * Link numbers 45 */ 46 #define IMPLINK_IP 155 47 #define IMPLINK_LOWEXPER 156 48 #define IMPLINK_HIGHEXPER 158 49 50 /* 51 * Internet address (old style... should be updated) 52 */ 53 struct ip_addr { 54 union { 55 struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; 56 struct { u_short s_w1,s_w2; } S_un_w; 57 u_long s_l; 58 } S_un; 59 #define s_addr S_un.s_l /* can be used for most tcp & ip code */ 60 #define s_host S_un.S_un_b.s_b2 /* host on imp */ 61 #define s_net S_un.S_un_b.s_b1 /* network */ 62 #define s_imp S_un.S_un_w.s_w2 /* imp */ 63 #define s_lhost S_un.S_un_b.s_b1 /* net library format host on imp */ 64 #define s_lnet S_un.S_un_b.s_b2 /* net library format network */ 65 }; 66