xref: /csrg-svn/sys/netinet/in_local.h (revision 11562)
1*11562Ssam /*	in_local.h	4.1	83/03/13	*/
2*11562Ssam 
3*11562Ssam /*
4*11562Ssam  * Internet definitions and variables
5*11562Ssam  * specific to installation at Berkeley.
6*11562Ssam  */
7*11562Ssam 
8*11562Ssam /*
9*11562Ssam  * Local subnetwork address mapping.
10*11562Ssam  * The standard scheme is:
11*11562Ssam  *	internet address = network.local-part
12*11562Ssam  * where
13*11562Ssam  *	network is between 8 and 34 bits
14*11562Ssam  *	local-part is between 8 and 24 bits
15*11562Ssam  *
16*11562Ssam  * This is modified by interpreting network as 32 bits
17*11562Ssam  * and local-part as something between 8 and 23 bits
18*11562Ssam  * depending on the high bit in the local-part.  When
19*11562Ssam  * the high bit in the local-part is a 1, the upper byte
20*11562Ssam  * is interpreted as a local network extension, and used
21*11562Ssam  * as the high byte in the network (extending it to 32 bits).
22*11562Ssam  * The additional 8 bits of network number are administered
23*11562Ssam  * locally and are not visible outside Berkeley, since
24*11562Ssam  * they're part of the local-part.
25*11562Ssam  */
26*11562Ssam /* network mappings */
27*11562Ssam #define	CLASSA_LOCALNETMAP(n, in) \
28*11562Ssam 	(in) & 0x800000 ? (n) | (((in) & 0xef0000) << 8) : (n)
29*11562Ssam #define	CLASSB_LOCALNETMAP(n, in) \
30*11562Ssam 	(in) & 0x8000 ? (n) | (((in) & 0xef00) << 16) : (n)
31*11562Ssam #define	CLASSC_LOCALNETMAP(n, in)	(n)
32*11562Ssam 
33*11562Ssam /* local-part mappings */
34*11562Ssam #define	CLASSA_LOCALHOSTMAP(h, in) \
35*11562Ssam 	(in) & 0x800000 ? (h) & ~0xef0000 : (h)
36*11562Ssam #define	CLASSB_LOCALHOSTMAP(h, in) \
37*11562Ssam 	(in) & 0x8000 ? (n) & ~0xef00 : (h)
38*11562Ssam #define	CLASSC_LOCALHOSTMAP(h, in)	(h)
39