xref: /csrg-svn/sys/netinet/in_local.h (revision 11564)
1*11564Ssam /*	in_local.h	4.2	83/03/13	*/
211562Ssam 
311562Ssam /*
411562Ssam  * Internet definitions and variables
511562Ssam  * specific to installation at Berkeley.
611562Ssam  */
711562Ssam 
811562Ssam /*
911562Ssam  * Local subnetwork address mapping.
1011562Ssam  * The standard scheme is:
1111562Ssam  *	internet address = network.local-part
1211562Ssam  * where
1311562Ssam  *	network is between 8 and 34 bits
1411562Ssam  *	local-part is between 8 and 24 bits
1511562Ssam  *
1611562Ssam  * This is modified by interpreting network as 32 bits
1711562Ssam  * and local-part as something between 8 and 23 bits
1811562Ssam  * depending on the high bit in the local-part.  When
1911562Ssam  * the high bit in the local-part is a 1, the upper byte
2011562Ssam  * is interpreted as a local network extension, and used
2111562Ssam  * as the high byte in the network (extending it to 32 bits).
2211562Ssam  * The additional 8 bits of network number are administered
2311562Ssam  * locally and are not visible outside Berkeley, since
2411562Ssam  * they're part of the local-part.
2511562Ssam  */
2611562Ssam /* network mappings */
2711562Ssam #define	CLASSA_LOCALNETMAP(n, in) \
2811562Ssam 	(in) & 0x800000 ? (n) | (((in) & 0xef0000) << 8) : (n)
2911562Ssam #define	CLASSB_LOCALNETMAP(n, in) \
3011562Ssam 	(in) & 0x8000 ? (n) | (((in) & 0xef00) << 16) : (n)
3111562Ssam #define	CLASSC_LOCALNETMAP(n, in)	(n)
3211562Ssam 
3311562Ssam /* local-part mappings */
3411562Ssam #define	CLASSA_LOCALHOSTMAP(h, in) \
3511562Ssam 	(in) & 0x800000 ? (h) & ~0xef0000 : (h)
3611562Ssam #define	CLASSB_LOCALHOSTMAP(h, in) \
37*11564Ssam 	(in) & 0x8000 ? (h) & ~0xef00 : (h)
3811562Ssam #define	CLASSC_LOCALHOSTMAP(h, in)	(h)
39