xref: /csrg-svn/sys/netinet/in_systm.h (revision 5084)
1*5084Swnj /* in_systm.h 4.6 81/11/26 */
24806Swnj 
34806Swnj /*
44806Swnj  * Miscellaneous internetwork
54806Swnj  * definitions for kernel.
64806Swnj  */
74806Swnj 
84806Swnj /*
94806Swnj  * Network types.
104806Swnj  *
114806Swnj  * Internally the system keeps counters in the headers with the bytes
124806Swnj  * swapped so that VAX instructions will work on them.  It reverses
134806Swnj  * the bytes before transmission at each protocol level.  The n_ types
144806Swnj  * represent the types with the bytes in ``high-ender'' order.
154806Swnj  */
164806Swnj typedef u_short n_short;		/* short as received from the net */
174806Swnj typedef u_long	n_long;			/* long as received from the net */
184806Swnj 
194806Swnj typedef	u_long	n_time;			/* ms since 00:00 GMT, byte rev */
204806Swnj 
214806Swnj /*
22*5084Swnj  * The internet code runs off software interrupts.
23*5084Swnj  * There is one software interrupt level for each IP layer protocol
24*5084Swnj  * (e.g. IP, PUP, etc), and each such interrupt traps to the lowest
25*5084Swnj  * level routine for that protocol.
26*5084Swnj  *
274806Swnj  * You can switch into the network by doing splnet() and return by splx().
284806Swnj  * The software interrupt level for the network is higher than the software
294806Swnj  * level for the clock (so you can enter the network in routines called
304806Swnj  * at timeout time).  Splimp is an ipl high enough to block all imps.
314923Swnj  * While manipulating the mbuf buffer pool you have to block imps.
324806Swnj  */
334806Swnj #define	splimp		spl5
34*5084Swnj #define	setipintr()	mtpr(SIRR, 12)
354806Swnj /* splnet is defined in ../sys/asm.sed */
364806Swnj 
374806Swnj #ifdef	KERNEL
384923Swnj n_time	iptime();
394806Swnj #endif
404806Swnj 
414806Swnj #ifdef KPROF
424806Swnj #include "../inet/count.h"
434806Swnj #define	COUNT(i)	nrcount[i]++
444806Swnj int	nrcount[NCOUNTERS+1];
454806Swnj #else
464806Swnj #define	COUNT(i)
474806Swnj #endif
48