xref: /csrg-svn/sys/netinet/in.h (revision 6229)
1*6229Sroot /* in.h 4.11 82/03/15 */
24793Swnj 
34793Swnj /*
44793Swnj  * Constants and structures defined by the internet system,
54793Swnj  * Per RFC 790, September 1981.
64793Swnj  */
74793Swnj 
84793Swnj /*
94793Swnj  * Protocols
104793Swnj  */
114793Swnj #define	IPPROTO_ICMP		1		/* control message protocol */
125994Swnj #define	IPPROTO_GGP		2		/* gateway^2 (deprecated) */
134793Swnj #define	IPPROTO_TCP		6		/* tcp */
144793Swnj #define	IPPROTO_PUP		12		/* pup */
154793Swnj #define	IPPROTO_UDP		17		/* user datagram protocol */
164793Swnj 
175611Swnj #define	IPPROTO_RAW		255		/* raw IP packet */
184897Swnj #define	IPPROTO_MAX		256
194897Swnj 
204793Swnj /*
214793Swnj  * Port/socket numbers: network standard functions
224793Swnj  */
234793Swnj #define	IPPORT_ECHO		7
244793Swnj #define	IPPORT_DISCARD		9
254793Swnj #define	IPPORT_SYSTAT		11
264793Swnj #define	IPPORT_DAYTIME		13
274793Swnj #define	IPPORT_NETSTAT		15
284793Swnj #define	IPPORT_FTP		21
294793Swnj #define	IPPORT_TELNET		23
304793Swnj #define	IPPORT_SMTP		25
314793Swnj #define	IPPORT_TIMESERVER	37
324793Swnj #define	IPPORT_NAMESERVER	42
334793Swnj #define	IPPORT_WHOIS		43
344793Swnj #define	IPPORT_MTP		57
354793Swnj 
364793Swnj /*
374793Swnj  * Port/socket numbers: host specific functions
384793Swnj  */
394793Swnj #define	IPPORT_TFTP		69
404793Swnj #define	IPPORT_RJE		77
414793Swnj #define	IPPORT_FINGER		79
424793Swnj #define	IPPORT_TTYLINK		87
434793Swnj #define	IPPORT_SUPDUP		95
444793Swnj 
45*6229Sroot /*
46*6229Sroot  * UNIX TCP sockets
47*6229Sroot  */
48*6229Sroot #define	IPPORT_EXECSERVER	512
49*6229Sroot #define	IPPORT_LOGINSERVER	513
50*6229Sroot #define	IPPORT_CMDSERVER	514
51*6229Sroot 
52*6229Sroot /*
53*6229Sroot  * UNIX UDP sockets
54*6229Sroot  */
55*6229Sroot #define	IPPORT_BIFFUDP		512
56*6229Sroot #define	IPPORT_WHOSERVER	513
57*6229Sroot 
58*6229Sroot /*
59*6229Sroot  * Ports < IPPORT_RESERVED are reserved for
60*6229Sroot  * privileged processes (e.g. root).
61*6229Sroot  */
625994Swnj #define	IPPORT_RESERVED		1024
635994Swnj 
644793Swnj /*
654793Swnj  * Link numbers
664793Swnj  */
674793Swnj #define	IMPLINK_IP		155
684793Swnj #define	IMPLINK_LOWEXPER	156
694793Swnj #define	IMPLINK_HIGHEXPER	158
704793Swnj 
714793Swnj /*
724793Swnj  * Internet address (old style... should be updated)
734793Swnj  */
744922Swnj struct in_addr {
754793Swnj 	union {
764793Swnj 		struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
774793Swnj 		struct { u_short s_w1,s_w2; } S_un_w;
785683Ssam 		u_long S_addr;
794793Swnj 	} S_un;
805683Ssam #define	s_addr	S_un.S_addr	/* can be used for most tcp & ip code */
815683Ssam #ifdef vax
824793Swnj #define	s_host	S_un.S_un_b.s_b2	/* host on imp */
834793Swnj #define	s_net	S_un.S_un_b.s_b1	/* network */
844793Swnj #define	s_imp	S_un.S_un_w.s_w2	/* imp */
856045Swnj #define	s_impno	S_un.S_un_b.s_b4	/* imp # */
866045Swnj #define	s_lh	S_un.S_un_b.s_b3	/* logical host */
875683Ssam #endif
884793Swnj };
894922Swnj 
905994Swnj #define	INADDR_ANY	0x00000000
915994Swnj 
924922Swnj /*
934922Swnj  * Socket address, internet style.
944922Swnj  */
954922Swnj struct sockaddr_in {
964922Swnj 	short	sin_family;
974922Swnj 	u_short	sin_port;
984922Swnj 	struct	in_addr sin_addr;
994922Swnj 	char	sin_zero[8];
1004922Swnj };
101