blob: d5406a2daa7b741649116cf4d8e6a478cd6c176a [file] [log] [blame]
Guido van Rossume5e73b91994-10-09 23:03:12 +00001# Generated by h2py from /usr/include/netinet/in.h
Guido van Rossum725a67e1997-05-13 17:45:56 +00002
3# Included from sys/stream.h
4
5# Included from sys/vnode.h
6
7# Included from sys/types.h
8
9# Included from sys/feature_tests.h
10_POSIX_C_SOURCE = 1
11
12# Included from sys/isa_defs.h
13_CHAR_ALIGNMENT = 1
14_SHORT_ALIGNMENT = 2
15_INT_ALIGNMENT = 4
16_LONG_ALIGNMENT = 4
17_LONG_LONG_ALIGNMENT = 4
18_DOUBLE_ALIGNMENT = 4
19_LONG_DOUBLE_ALIGNMENT = 4
20_POINTER_ALIGNMENT = 4
21_MAX_ALIGNMENT = 4
22_ALIGNMENT_REQUIRED = 0
23_CHAR_ALIGNMENT = 1
24_SHORT_ALIGNMENT = 2
25_INT_ALIGNMENT = 4
26_LONG_ALIGNMENT = 4
27_LONG_LONG_ALIGNMENT = 8
28_DOUBLE_ALIGNMENT = 8
29_LONG_DOUBLE_ALIGNMENT = 16
30_POINTER_ALIGNMENT = 4
31_MAX_ALIGNMENT = 16
32_ALIGNMENT_REQUIRED = 1
33_CHAR_ALIGNMENT = 1
34_SHORT_ALIGNMENT = 2
35_INT_ALIGNMENT = 4
36_LONG_ALIGNMENT = 4
37_LONG_LONG_ALIGNMENT = 8
38_DOUBLE_ALIGNMENT = 8
39_LONG_DOUBLE_ALIGNMENT = 8
40_POINTER_ALIGNMENT = 4
41_MAX_ALIGNMENT = 8
42_ALIGNMENT_REQUIRED = 1
43
44# Included from sys/machtypes.h
45SHRT_MIN = -32768
46SHRT_MAX = 32767
47INT_MIN = (-2147483647-1)
48INT_MAX = 2147483647
49LONG_MIN = (-2147483647-1)
50LONG_MAX = 2147483647
51P_MYID = (-1)
52
53# Included from sys/select.h
54
55# Included from sys/time.h
56DST_NONE = 0
57DST_USA = 1
58DST_AUST = 2
59DST_WET = 3
60DST_MET = 4
61DST_EET = 5
62DST_CAN = 6
63DST_GB = 7
64DST_RUM = 8
65DST_TUR = 9
66DST_AUSTALT = 10
67ITIMER_REAL = 0
68ITIMER_VIRTUAL = 1
69ITIMER_PROF = 2
70ITIMER_REALPROF = 3
71SEC = 1
72MILLISEC = 1000
73MICROSEC = 1000000
74NANOSEC = 1000000000
75__CLOCK_REALTIME0 = 0
76CLOCK_VIRTUAL = 1
77CLOCK_PROF = 2
78__CLOCK_REALTIME3 = 3
79CLOCK_REALTIME = __CLOCK_REALTIME3
80CLOCK_REALTIME = __CLOCK_REALTIME0
81TIMER_RELTIME = 0x0
82TIMER_ABSTIME = 0x1
83
84# Included from sys/mutex.h
85
86# Included from sys/dki_lkinfo.h
87
88# Included from sys/dl.h
89NOSTATS = 1
90LSB_NLKDS = 91
91def MUTEX_HELD(x): return (mutex_owned(x))
92
93
94# Included from time.h
95NULL = 0
96CLOCKS_PER_SEC = 1000000
97
98# Included from sys/siginfo.h
99SIGEV_NONE = 1
100SIGEV_SIGNAL = 2
101SIGEV_THREAD = 3
102SI_NOINFO = 32767
103SI_USER = 0
104SI_LWP = (-1)
105SI_QUEUE = (-2)
106SI_TIMER = (-3)
107SI_ASYNCIO = (-4)
108SI_MESGQ = (-5)
109
110# Included from sys/machsig.h
111ILL_ILLOPC = 1
112ILL_ILLOPN = 2
113ILL_ILLADR = 3
114ILL_ILLTRP = 4
115ILL_PRVOPC = 5
116ILL_PRVREG = 6
117ILL_COPROC = 7
118ILL_BADSTK = 8
119NSIGILL = 8
120EMT_TAGOVF = 1
121NSIGEMT = 1
122FPE_INTDIV = 1
123FPE_INTOVF = 2
124FPE_FLTDIV = 3
125FPE_FLTOVF = 4
126FPE_FLTUND = 5
127FPE_FLTRES = 6
128FPE_FLTINV = 7
129FPE_FLTSUB = 8
130NSIGFPE = 8
131SEGV_MAPERR = 1
132SEGV_ACCERR = 2
133NSIGSEGV = 2
134BUS_ADRALN = 1
135BUS_ADRERR = 2
136BUS_OBJERR = 3
137NSIGBUS = 3
138TRAP_BRKPT = 1
139TRAP_TRACE = 2
140NSIGTRAP = 2
141CLD_EXITED = 1
142CLD_KILLED = 2
143CLD_DUMPED = 3
144CLD_TRAPPED = 4
145CLD_STOPPED = 5
146CLD_CONTINUED = 6
147NSIGCLD = 6
148POLL_IN = 1
149POLL_OUT = 2
150POLL_MSG = 3
151POLL_ERR = 4
152POLL_PRI = 5
153POLL_HUP = 6
154NSIGPOLL = 6
155PROF_SIG = 1
156NSIGPROF = 1
157SI_MAXSZ = 128
158def SI_CANQUEUE(c): return ((c) <= SI_QUEUE)
159
160FD_SETSIZE = 1024
161NBBY = 8
162
163# Included from sys/t_lock.h
164
165# Included from sys/machlock.h
166LOCK_HELD_VALUE = 0xff
167def SPIN_LOCK(pl): return ((pl) > ipltospl(LOCK_LEVEL))
168
169def LOCK_SAMPLE_INTERVAL(i): return (((i) & 0xff) == 0)
170
171LOCK_LEVEL = 10
172CLOCK_LEVEL = 10
173PTR24_LSB = 5
174PTR24_MSB = (PTR24_LSB + 24)
175PTR24_ALIGN = 32
176PTR24_BASE = 0xe0000000
177
178# Included from sys/sleepq.h
179NSLEEPQ = 512
180
181# Included from sys/turnstile.h
182
183# Included from sys/param.h
184_POSIX_VDISABLE = 0
185MAX_INPUT = 512
186MAX_CANON = 256
187UID_NOBODY = 60001
188GID_NOBODY = UID_NOBODY
189UID_NOACCESS = 60002
190MAXPID = 30000
191MAXUID = 2147483647
192MAXLINK = 32767
193NMOUNT = 40
194CANBSIZ = 256
195NOFILE = 20
196NGROUPS_UMIN = 0
197NGROUPS_UMAX = 32
198NGROUPS_MAX_DEFAULT = 16
199PMASK = 0177
200PCATCH = 0400
201PNOSTOP = 01000
202PSWP = 0
203PINOD = 10
204PSNDD = PINOD
205PAMAP = PINOD
206PPMAP = PAMAP
207PRIBIO = 20
208PZERO = 25
209PMEM = 0
210NZERO = 20
211PPIPE = 26
212PVFS = 27
213PWAIT = 30
214PLOCK = 35
215PSLEP = 39
216PUSER = 60
217PIDLE = 127
218NULL = 0
219CMASK = 0
220CDLIMIT = (1L<<11)
221NBPS = 0x20000
222NBPSCTR = 512
223UBSIZE = 512
224SCTRSHFT = 9
225SYSNAME = 9
226PREMOTE = 39
227MAXPATHLEN = 1024
228MAXSYMLINKS = 20
229MAXNAMELEN = 256
230NADDR = 13
231PIPE_BUF = 5120
232PIPE_MAX = 5120
233NBBY = 8
234MAXBSIZE = 8192
235DEV_BSIZE = 512
236DEV_BSHIFT = 9
237MAXFRAG = 8
238def btodb(bytes): return \
239
240def dbtob(db): return \
241
242def lbtodb(bytes): return \
243
244def ldbtob(db): return \
245
246NCARGS = 0x100000
247FSHIFT = 8
248FSCALE = (1<<FSHIFT)
249def DELAY(n): return drv_usecwait(n)
250
251def mmu_ptob(x): return ((x) << MMU_PAGESHIFT)
252
253def mmu_btop(x): return (((unsigned)(x)) >> MMU_PAGESHIFT)
254
255def mmu_btopr(x): return ((((unsigned)(x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT))
256
257def mmu_ptod(x): return ((x) << (MMU_PAGESHIFT - DEV_BSHIFT))
258
259def ptod(x): return ((x) << (PAGESHIFT - DEV_BSHIFT))
260
261def ptob(x): return ((x) << PAGESHIFT)
262
263def btop(x): return (((unsigned)(x)) >> PAGESHIFT)
264
265def btopr(x): return ((((unsigned)(x) + PAGEOFFSET) >> PAGESHIFT))
266
267def dtop(DD): return (((DD) + NDPP - 1) >> (PAGESHIFT - DEV_BSHIFT))
268
269def dtopt(DD): return ((DD) >> (PAGESHIFT - DEV_BSHIFT))
270
271def PAGOFF(x): return (((uint)(x)) & PAGEOFFSET)
272
273
274# Included from sys/unistd.h
275_SC_ARG_MAX = 1
276_SC_CHILD_MAX = 2
277_SC_CLK_TCK = 3
278_SC_NGROUPS_MAX = 4
279_SC_OPEN_MAX = 5
280_SC_JOB_CONTROL = 6
281_SC_SAVED_IDS = 7
282_SC_VERSION = 8
283_SC_PASS_MAX = 9
284_SC_LOGNAME_MAX = 10
285_SC_PAGESIZE = 11
286_SC_XOPEN_VERSION = 12
287_SC_NPROCESSORS_CONF = 14
288_SC_NPROCESSORS_ONLN = 15
289_SC_STREAM_MAX = 16
290_SC_TZNAME_MAX = 17
291_SC_AIO_LISTIO_MAX = 18
292_SC_AIO_MAX = 19
293_SC_AIO_PRIO_DELTA_MAX = 20
294_SC_ASYNCHRONOUS_IO = 21
295_SC_DELAYTIMER_MAX = 22
296_SC_FSYNC = 23
297_SC_MAPPED_FILES = 24
298_SC_MEMLOCK = 25
299_SC_MEMLOCK_RANGE = 26
300_SC_MEMORY_PROTECTION = 27
301_SC_MESSAGE_PASSING = 28
302_SC_MQ_OPEN_MAX = 29
303_SC_MQ_PRIO_MAX = 30
304_SC_PRIORITIZED_IO = 31
305_SC_PRIORITY_SCHEDULING = 32
306_SC_REALTIME_SIGNALS = 33
307_SC_RTSIG_MAX = 34
308_SC_SEMAPHORES = 35
309_SC_SEM_NSEMS_MAX = 36
310_SC_SEM_VALUE_MAX = 37
311_SC_SHARED_MEMORY_OBJECTS = 38
312_SC_SIGQUEUE_MAX = 39
313_SC_SIGRT_MIN = 40
314_SC_SIGRT_MAX = 41
315_SC_SYNCHRONIZED_IO = 42
316_SC_TIMERS = 43
317_SC_TIMER_MAX = 44
318_SC_2_C_BIND = 45
319_SC_2_C_DEV = 46
320_SC_2_C_VERSION = 47
321_SC_2_FORT_DEV = 48
322_SC_2_FORT_RUN = 49
323_SC_2_LOCALEDEF = 50
324_SC_2_SW_DEV = 51
325_SC_2_UPE = 52
326_SC_2_VERSION = 53
327_SC_BC_BASE_MAX = 54
328_SC_BC_DIM_MAX = 55
329_SC_BC_SCALE_MAX = 56
330_SC_BC_STRING_MAX = 57
331_SC_COLL_WEIGHTS_MAX = 58
332_SC_EXPR_NEST_MAX = 59
333_SC_LINE_MAX = 60
334_SC_RE_DUP_MAX = 61
335_SC_XOPEN_CRYPT = 62
336_SC_XOPEN_ENH_I18N = 63
337_SC_XOPEN_SHM = 64
338_CS_PATH = 65
339_SC_2_CHAR_TERM = 66
340_SC_XOPEN_XCU_VERSION = 67
341_SC_PHYS_PAGES = 500
342_SC_AVPHYS_PAGES = 501
343_SC_COHER_BLKSZ = 503
344_SC_SPLIT_CACHE = 504
345_SC_ICACHE_SZ = 505
346_SC_DCACHE_SZ = 506
347_SC_ICACHE_LINESZ = 507
348_SC_DCACHE_LINESZ = 508
349_SC_ICACHE_BLKSZ = 509
350_SC_DCACHE_BLKSZ = 510
351_SC_DCACHE_TBLKSZ = 511
352_SC_ICACHE_ASSOC = 512
353_SC_DCACHE_ASSOC = 513
354_SC_THREAD_DESTRUCTOR_ITERATIONS = 568
355_SC_GETGR_R_SIZE_MAX = 569
356_SC_GETPW_R_SIZE_MAX = 570
357_SC_LOGIN_NAME_MAX = 571
358_SC_THREAD_KEYS_MAX = 572
359_SC_THREAD_STACK_MIN = 573
360_SC_THREAD_THREADS_MAX = 574
361_SC_TTY_NAME_MAX = 575
362_SC_THREADS = 576
363_SC_THREAD_ATTR_STACKADDR = 577
364_SC_THREAD_ATTR_STACKSIZE = 578
365_SC_THREAD_PRIORITY_SCHEDULING = 579
366_SC_THREAD_PRIO_INHERIT = 580
367_SC_THREAD_PRIO_PROTECT = 581
368_SC_THREAD_PROCESS_SHARED = 582
369_SC_THREAD_SAFE_FUNCTIONS = 583
370_SC_PPC_GRANULE_SZ = 601
371_SC_PPC_TB_TICKSPSECH = 602
372_SC_PPC_TB_TICKSPSECL = 603
373_PC_LINK_MAX = 1
374_PC_MAX_CANON = 2
375_PC_MAX_INPUT = 3
376_PC_NAME_MAX = 4
377_PC_PATH_MAX = 5
378_PC_PIPE_BUF = 6
379_PC_NO_TRUNC = 7
380_PC_VDISABLE = 8
381_PC_CHOWN_RESTRICTED = 9
382_PC_ASYNC_IO = 10
383_PC_PRIO_IO = 11
384_PC_SYNC_IO = 12
385_PC_LAST = 12
386_POSIX_VERSION = 199506L
387_POSIX2_VERSION = 199209L
388_POSIX2_C_VERSION = 199209L
389_XOPEN_VERSION = 3
390_XOPEN_XCU_VERSION = 4
391_POSIX2_C_BIND = 1
392_POSIX2_CHAR_TERM = 1
393_POSIX2_LOCALEDEF = 1
394_POSIX2_C_DEV = 1
395_POSIX2_SW_DEV = 1
396_POSIX2_UPE = 1
397
398# Included from sys/pirec.h
399NTSTILE_SQ = 2
400TSTILE_FREE = 0
401TSTILE_ACTIVE = 1
402TS_ROWSZ = 512
403TS_COLSZ = 128
404TS_ROWBITS = 9
405TS_COLBITS = 7
406TS_ROWMASK = ((1 << TS_ROWBITS) - 1)
407def TS_COL(ts_id): return ((ts_id) >> TS_ROWBITS)
408
409def TS_ROW(ts_id): return ((ts_id) & TS_ROWMASK)
410
411def TSTILE_PRIO_INVERTED(ts): return \
412
413
414# Included from sys/rwlock.h
415def RW_READ_HELD(x): return (rw_read_held((x)))
416
417def RW_WRITE_HELD(x): return (rw_write_held((x)))
418
419def RW_LOCK_HELD(x): return (rw_lock_held((x)))
420
421def RW_ISWRITER(x): return (rw_iswriter(x))
422
423
424# Included from sys/semaphore.h
425
426# Included from sys/thread.h
427
428# Included from sys/class.h
429
430# Included from sys/klwp.h
431
432# Included from sys/condvar.h
433
434# Included from sys/signal.h
435SIGHUP = 1
436SIGINT = 2
437SIGQUIT = 3
438SIGILL = 4
439SIGTRAP = 5
440SIGIOT = 6
441SIGABRT = 6
442SIGEMT = 7
443SIGFPE = 8
444SIGKILL = 9
445SIGBUS = 10
446SIGSEGV = 11
447SIGSYS = 12
448SIGPIPE = 13
449SIGALRM = 14
450SIGTERM = 15
451SIGUSR1 = 16
452SIGUSR2 = 17
453SIGCLD = 18
454SIGCHLD = 18
455SIGPWR = 19
456SIGWINCH = 20
457SIGURG = 21
458SIGPOLL = 22
459SIGIO = SIGPOLL
460SIGSTOP = 23
461SIGTSTP = 24
462SIGCONT = 25
463SIGTTIN = 26
464SIGTTOU = 27
465SIGVTALRM = 28
466SIGPROF = 29
467SIGXCPU = 30
468SIGXFSZ = 31
469SIGWAITING = 32
470SIGLWP = 33
471SIGFREEZE = 34
472SIGTHAW = 35
473SIGCANCEL = 36
474_SIGRTMIN = 37
475_SIGRTMAX = 44
476SIG_BLOCK = 1
477SIG_UNBLOCK = 2
478SIG_SETMASK = 3
479SIGNO_MASK = 0xFF
480SIGDEFER = 0x100
481SIGHOLD = 0x200
482SIGRELSE = 0x400
483SIGIGNORE = 0x800
484SIGPAUSE = 0x1000
485SA_NOCLDSTOP = 0x00020000
486SA_ONSTACK = 0x00000001
487SA_RESETHAND = 0x00000002
488SA_RESTART = 0x00000004
489SA_SIGINFO = 0x00000008
490SA_NODEFER = 0x00000010
491SA_NOCLDWAIT = 0x00010000
492SA_WAITSIG = 0x00010000
493NSIG = 45
494MAXSIG = 44
495S_SIGNAL = 1
496S_SIGSET = 2
497S_SIGACTION = 3
498S_NONE = 4
499MINSIGSTKSZ = 2048
500SIGSTKSZ = 8192
501SS_ONSTACK = 0x00000001
502SS_DISABLE = 0x00000002
503_SIGQUEUE_MAX = 32
504
505# Included from sys/pcb.h
506
507# Included from sys/regset.h
508REG_PSR = (0)
509REG_PC = (1)
510REG_nPC = (2)
511REG_Y = (3)
512REG_G1 = (4)
513REG_G2 = (5)
514REG_G3 = (6)
515REG_G4 = (7)
516REG_G5 = (8)
517REG_G6 = (9)
518REG_G7 = (10)
519REG_O0 = (11)
520REG_O1 = (12)
521REG_O2 = (13)
522REG_O3 = (14)
523REG_O4 = (15)
524REG_O5 = (16)
525REG_O6 = (17)
526REG_O7 = (18)
527REG_PS = REG_PSR
528REG_SP = REG_O6
529REG_R0 = REG_O0
530REG_R1 = REG_O1
531NGREG = 19
532SPARC_MAXREGWINDOW = 31
533MAXFPQ = 16
534XRS_ID = 0x78727300
535
536# Included from v7/sys/privregs.h
537
538# Included from v7/sys/psr.h
539PSR_CWP = 0x0000001F
540PSR_ET = 0x00000020
541PSR_PS = 0x00000040
542PSR_S = 0x00000080
543PSR_PIL = 0x00000F00
544PSR_EF = 0x00001000
545PSR_EC = 0x00002000
546PSR_RSV = 0x000FC000
547PSR_ICC = 0x00F00000
548PSR_C = 0x00100000
549PSR_V = 0x00200000
550PSR_Z = 0x00400000
551PSR_N = 0x00800000
552PSR_VER = 0x0F000000
553PSR_IMPL = 0xF0000000
554PSL_ALLCC = PSR_ICC
555PSL_USER = (PSR_S)
556PSL_USERMASK = (PSR_ICC)
557PSL_UBITS = (PSR_ICC|PSR_EF)
558def USERMODE(ps): return (((ps) & PSR_PS) == 0)
559
560
561# Included from sys/fsr.h
562FSR_CEXC = 0x0000001f
563FSR_AEXC = 0x000003e0
564FSR_FCC = 0x00000c00
565FSR_PR = 0x00001000
566FSR_QNE = 0x00002000
567FSR_FTT = 0x0001c000
568FSR_VER = 0x000e0000
569FSR_TEM = 0x0f800000
570FSR_RP = 0x30000000
571FSR_RD = 0xc0000000
572FSR_VER_SHIFT = 17
573FSR_FCC1 = 0x00000003
574FSR_FCC2 = 0x0000000C
575FSR_FCC3 = 0x00000030
576FSR_CEXC_NX = 0x00000001
577FSR_CEXC_DZ = 0x00000002
578FSR_CEXC_UF = 0x00000004
579FSR_CEXC_OF = 0x00000008
580FSR_CEXC_NV = 0x00000010
581FSR_AEXC_NX = (0x1 << 5)
582FSR_AEXC_DZ = (0x2 << 5)
583FSR_AEXC_UF = (0x4 << 5)
584FSR_AEXC_OF = (0x8 << 5)
585FSR_AEXC_NV = (0x10 << 5)
586FTT_NONE = 0
587FTT_IEEE = 1
588FTT_UNFIN = 2
589FTT_UNIMP = 3
590FTT_SEQ = 4
591FTT_ALIGN = 5
592FTT_DFAULT = 6
593FSR_FTT_SHIFT = 14
594FSR_FTT_IEEE = (FTT_IEEE << FSR_FTT_SHIFT)
595FSR_FTT_UNFIN = (FTT_UNFIN << FSR_FTT_SHIFT)
596FSR_FTT_UNIMP = (FTT_UNIMP << FSR_FTT_SHIFT)
597FSR_FTT_SEQ = (FTT_SEQ << FSR_FTT_SHIFT)
598FSR_FTT_ALIGN = (FTT_ALIGN << FSR_FTT_SHIFT)
599FSR_FTT_DFAULT = (FTT_DFAULT << FSR_FTT_SHIFT)
600FSR_TEM_NX = (0x1 << 23)
601FSR_TEM_DZ = (0x2 << 23)
602FSR_TEM_UF = (0x4 << 23)
603FSR_TEM_OF = (0x8 << 23)
604FSR_TEM_NV = (0x10 << 23)
605RP_DBLEXT = 0
606RP_SINGLE = 1
607RP_DOUBLE = 2
608RP_RESERVED = 3
609RD_NEAR = 0
610RD_ZER0 = 1
611RD_POSINF = 2
612RD_NEGINF = 3
613FPRS_DL = 0x1
614FPRS_DU = 0x2
615FPRS_FEF = 0x4
616def SAVE_GLOBALS(RP): return \
617
618def RESTORE_GLOBALS(RP): return \
619
620def SAVE_OUTS(RP): return \
621
622def RESTORE_OUTS(RP): return \
623
624def SAVE_WINDOW(SBP): return \
625
626def RESTORE_WINDOW(SBP): return \
627
628def STORE_FPREGS(FP): return \
629
630def LOAD_FPREGS(FP): return \
631
632FIX_ALIGNMENT = 0x01
633INSTR_VALID = 0x02
634
635# Included from sys/msacct.h
636LMS_USER = 0
637LMS_SYSTEM = 1
638LMS_TRAP = 2
639LMS_TFAULT = 3
640LMS_DFAULT = 4
641LMS_KFAULT = 5
642LMS_USER_LOCK = 6
643LMS_SLEEP = 7
644LMS_WAIT_CPU = 8
645LMS_STOPPED = 9
646NMSTATES = 10
647
648# Included from sys/ucontext.h
649GETCONTEXT = 0
650SETCONTEXT = 1
651UC_SIGMASK = 001
652UC_STACK = 002
653UC_CPU = 004
654UC_MAU = 010
655UC_FPU = UC_MAU
656UC_INTR = 020
657UC_MCONTEXT = (UC_CPU|UC_FPU)
658UC_ALL = (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
659
660# Included from sys/lwp.h
661
662# Included from sys/synch.h
663USYNC_THREAD = 0
664USYNC_PROCESS = 1
665TRACE_TYPE = 2
666LWP_DETACHED = 0x00000040
667LWP_SUSPENDED = 0x00000080
668__LWP_ASLWP = 0x00000100
669MAXSYSARGS = 8
670NORMALRETURN = 0
671JUSTRETURN = 1
672RESTARTSYS = 2
673LWP_USER = 0x01
674LWP_SYS = 0x02
675TS_FREE = 0x00
676TS_SLEEP = 0x01
677TS_RUN = 0x02
678TS_ONPROC = 0x04
679TS_ZOMB = 0x08
680TS_STOPPED = 0x10
681T_INTR_THREAD = 0x0001
682T_WAKEABLE = 0x0002
683T_TOMASK = 0x0004
684T_TALLOCSTK = 0x0008
685T_LWPZOMB = 0x0010
686T_WOULDBLOCK = 0x0020
687T_DONTBLOCK = 0x0040
688T_DONTPEND = 0x0080
689T_SYS_PROF = 0x0100
690T_WAITCVSEM = 0x0200
691TP_WAITFOR = 0x01
692TP_HOLDLWP = 0x02
693TP_TWAIT = 0x04
694TP_LWPEXIT = 0x08
695TP_PRSTOP = 0x10
696TP_CHKPT = 0x20
697TP_EXITLWP = 0x40
698TP_PRVSTOP = 0x80
699TP_MSACCT = 0x100
700TP_STOPPING = 0x200
701TS_LOAD = 0x01
702TS_CSTART = 0x02
703TS_XSTART = 0x04
704TS_PSTART = 0x08
705TS_DONT_SWAP = 0x10
706TS_RESUME = 0x20
707TS_SWAPENQ = 0x40
708TS_ON_SWAPQ = 0x80
709TS_ALLSTART = (TS_CSTART | TS_XSTART | TS_PSTART | TS_RESUME)
710def CPR_VSTOPPED(t): return \
711
712def THREAD_TRANSITION(tp): return thread_transition(tp);
713
714def THREAD_STOP(tp): return \
715
716def THREAD_ZOMB(tp): return THREAD_SET_STATE(tp, TS_ZOMB, NULL)
717
718def SEMA_HELD(x): return (sema_held((x)))
719
720LOCK_NAME_LEN = 18
721NO_LOCKS_HELD = 1
722NO_COMPETING_THREADS = 1
723
724# Included from sys/cred.h
725
726# Included from sys/uio.h
727
728# Included from vm/seg_enum.h
729
730# Included from sys/buf.h
731
732# Included from sys/kstat.h
733KSTAT_IOC_BASE = (ord('K') << 8)
734KSTAT_IOC_CHAIN_ID = KSTAT_IOC_BASE | 0x01
735KSTAT_IOC_READ = KSTAT_IOC_BASE | 0x02
736KSTAT_IOC_WRITE = KSTAT_IOC_BASE | 0x03
737KSTAT_STRLEN = 31
738def KSTAT_ENTER(k): return \
739
740def KSTAT_EXIT(k): return \
741
742KSTAT_TYPE_RAW = 0
743KSTAT_TYPE_NAMED = 1
744KSTAT_TYPE_INTR = 2
745KSTAT_TYPE_IO = 3
746KSTAT_TYPE_TIMER = 4
747KSTAT_NUM_TYPES = 5
748KSTAT_FLAG_VIRTUAL = 0x01
749KSTAT_FLAG_VAR_SIZE = 0x02
750KSTAT_FLAG_WRITABLE = 0x04
751KSTAT_FLAG_PERSISTENT = 0x08
752KSTAT_FLAG_DORMANT = 0x10
753KSTAT_FLAG_INVALID = 0x20
754KSTAT_READ = 0
755KSTAT_WRITE = 1
756KSTAT_DATA_CHAR = 0
757KSTAT_DATA_LONG = 1
758KSTAT_DATA_ULONG = 2
759KSTAT_DATA_LONGLONG = 3
760KSTAT_DATA_ULONGLONG = 4
761KSTAT_DATA_FLOAT = 5
762KSTAT_DATA_DOUBLE = 6
763KSTAT_INTR_HARD = 0
764KSTAT_INTR_SOFT = 1
765KSTAT_INTR_WATCHDOG = 2
766KSTAT_INTR_SPURIOUS = 3
767KSTAT_INTR_MULTSVC = 4
768KSTAT_NUM_INTRS = 5
769B_BUSY = 0x0001
770B_DONE = 0x0002
771B_ERROR = 0x0004
772B_KERNBUF = 0x0008
773B_PAGEIO = 0x0010
774B_PHYS = 0x0020
775B_READ = 0x0040
776B_WANTED = 0x0080
777B_WRITE = 0x0100
778B_AGE = 0x000200
779B_ASYNC = 0x000400
780B_DELWRI = 0x000800
781B_STALE = 0x001000
782B_DONTNEED = 0x002000
783B_REMAPPED = 0x004000
784B_FREE = 0x008000
785B_INVAL = 0x010000
786B_FORCE = 0x020000
787B_HEAD = 0x040000
788B_NOCACHE = 0x080000
789B_TRUNC = 0x100000
790def notavail(bp): return \
791
792VROOT = 0x01
793VNOCACHE = 0x02
794VNOMAP = 0x04
795VDUP = 0x08
796VNOSWAP = 0x10
797VNOMOUNT = 0x20
798VISSWAP = 0x40
799VSWAPLIKE = 0x80
800VVFSLOCK = 0x100
801VVFSWAIT = 0x200
802VVMLOCK = 0x400
803AT_TYPE = 0x0001
804AT_MODE = 0x0002
805AT_UID = 0x0004
806AT_GID = 0x0008
807AT_FSID = 0x0010
808AT_NODEID = 0x0020
809AT_NLINK = 0x0040
810AT_SIZE = 0x0080
811AT_ATIME = 0x0100
812AT_MTIME = 0x0200
813AT_CTIME = 0x0400
814AT_RDEV = 0x0800
815AT_BLKSIZE = 0x1000
816AT_NBLOCKS = 0x2000
817AT_VCODE = 0x4000
818AT_ALL = (AT_TYPE|AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|\
819 AT_NLINK|AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|\
820 AT_RDEV|AT_BLKSIZE|AT_NBLOCKS|AT_VCODE)
821AT_STAT = (AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|AT_NLINK|\
822 AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|AT_RDEV)
823AT_TIMES = (AT_ATIME|AT_MTIME|AT_CTIME)
824AT_NOSET = (AT_NLINK|AT_RDEV|AT_FSID|AT_NODEID|AT_TYPE|\
825 AT_BLKSIZE|AT_NBLOCKS|AT_VCODE)
826VSUID = 04000
827VSGID = 02000
828VSVTX = 01000
829VREAD = 00400
830VWRITE = 00200
831VEXEC = 00100
832MODEMASK = 07777
833PERMMASK = 00777
834def MANDMODE(mode): return (((mode) & (VSGID|(VEXEC>>3))) == VSGID)
835
836VSA_ACL = 0x0001
837VSA_ACLCNT = 0x0002
838VSA_DFACL = 0x0004
839VSA_DFACLCNT = 0x0008
840LOOKUP_DIR = 0x01
841ATTR_UTIME = 0x01
842ATTR_EXEC = 0x02
843ATTR_COMM = 0x04
844ATTR_HINT = 0x08
845
846# Included from sys/poll.h
847POLLIN = 0x0001
848POLLPRI = 0x0002
849POLLOUT = 0x0004
850POLLRDNORM = 0x0040
851POLLWRNORM = POLLOUT
852POLLRDBAND = 0x0080
853POLLWRBAND = 0x0100
854POLLNORM = POLLRDNORM
855POLLERR = 0x0008
856POLLHUP = 0x0010
857POLLNVAL = 0x0020
858T_POLLTIME = 0x01
859T_POLLWAKE = 0x02
860
861# Included from sys/strmdep.h
862def str_aligned(X): return (((uint)(X) & (sizeof (int) - 1)) == 0)
863
864QENAB = 0x001
865QWANTR = 0x002
866QWANTW = 0x004
867QFULL = 0x008
868QREADR = 0x010
869QUSE = 0x020
870QNOENB = 0x040
871QOLD = 0x080
872QBACK = 0x100
873QHLIST = 0x200
874QUNSAFE = 0x400
875QPAIR = 0x800
876QPERQ = 0x1000
877QPERMOD = 0x2000
878QMTSAFE = 0x4000
879QMTOUTPERIM = 0x8000
880QMT_TYPEMASK = (QUNSAFE|QPAIR|QPERQ|QPERMOD|QMTSAFE|QMTOUTPERIM)
881QINSERVICE = 0x10000
882QWCLOSE = 0x20000
883QEND = 0x40000
884QWANTWSYNC = 0x80000
885QSYNCSTR = 0x100000
886QISDRV = 0x200000
887QB_FULL = 0x01
888QB_WANTW = 0x02
889QB_BACK = 0x04
890NBAND = 256
891STRUIOT_NONE = -1
892STRUIOT_DONTCARE = 0
893STRUIOT_STANDARD = 1
894STRUIOT_IP = 2
895STRUIO_SPEC = 0x01
896STRUIO_DONE = 0x02
897STRUIO_IP = 0x04
898MSGMARK = 0x01
899MSGNOLOOP = 0x02
900MSGDELIM = 0x04
901MSGNOGET = 0x08
902M_DATA = 0x00
903M_PROTO = 0x01
904M_BREAK = 0x08
905M_PASSFP = 0x09
906M_EVENT = 0x0a
907M_SIG = 0x0b
908M_DELAY = 0x0c
909M_CTL = 0x0d
910M_IOCTL = 0x0e
911M_SETOPTS = 0x10
912M_RSE = 0x11
913M_VPIXINT = 0x12
914M_IOCACK = 0x81
915M_IOCNAK = 0x82
916M_PCPROTO = 0x83
917M_PCSIG = 0x84
918M_READ = 0x85
919M_FLUSH = 0x86
920M_STOP = 0x87
921M_START = 0x88
922M_HANGUP = 0x89
923M_ERROR = 0x8a
924M_COPYIN = 0x8b
925M_COPYOUT = 0x8c
926M_IOCDATA = 0x8d
927M_PCRSE = 0x8e
928M_STOPI = 0x8f
929M_STARTI = 0x90
930M_PCEVENT = 0x91
931M_UNHANGUP = 0x92
932QNORM = 0x00
933QPCTL = 0x80
934STRCANON = 0x01
935RECOPY = 0x02
936SO_ALL = 0x003f
937SO_READOPT = 0x0001
938SO_WROFF = 0x0002
939SO_MINPSZ = 0x0004
940SO_MAXPSZ = 0x0008
941SO_HIWAT = 0x0010
942SO_LOWAT = 0x0020
943SO_MREADON = 0x0040
944SO_MREADOFF = 0x0080
945SO_NDELON = 0x0100
946SO_NDELOFF = 0x0200
947SO_ISTTY = 0x0400
948SO_ISNTTY = 0x0800
949SO_TOSTOP = 0x1000
950SO_TONSTOP = 0x2000
951SO_BAND = 0x4000
952SO_DELIM = 0x8000
953SO_NODELIM = 0x010000
954SO_STRHOLD = 0x020000
955SO_ERROPT = 0x040000
956DEF_IOV_MAX = 16
957INFOD_FIRSTBYTES = 0x02
958INFOD_BYTES = 0x04
959INFOD_COUNT = 0x08
960INFOD_COPYOUT = 0x10
961MODOPEN = 0x1
962CLONEOPEN = 0x2
963OPENFAIL = -1
964BPRI_LO = 1
965BPRI_MED = 2
966BPRI_HI = 3
967INFPSZ = -1
968FLUSHALL = 1
969FLUSHDATA = 0
970STIPRI = PZERO+3
971STOPRI = PZERO+3
972STRHIGH = 5120
973STRLOW = 1024
974MAXIOCBSZ = 1024
975PERIM_INNER = 1
976PERIM_OUTER = 2
977def datamsg(type): return \
978
979def straln(a): return (caddr_t)((long)(a) & ~(sizeof (int)-1))
980
981
982# Included from sys/byteorder.h
983def ntohl(x): return (x)
984
985def ntohs(x): return (x)
986
987def htonl(x): return (x)
988
989def htons(x): return (x)
990
Guido van Rossume5e73b91994-10-09 23:03:12 +0000991IPPROTO_IP = 0
992IPPROTO_ICMP = 1
993IPPROTO_IGMP = 2
994IPPROTO_GGP = 3
995IPPROTO_ENCAP = 4
996IPPROTO_TCP = 6
997IPPROTO_EGP = 8
998IPPROTO_PUP = 12
999IPPROTO_UDP = 17
1000IPPROTO_IDP = 22
1001IPPROTO_HELLO = 63
1002IPPROTO_ND = 77
1003IPPROTO_EON = 80
1004IPPROTO_RAW = 255
1005IPPROTO_MAX = 256
1006IPPORT_ECHO = 7
1007IPPORT_DISCARD = 9
1008IPPORT_SYSTAT = 11
1009IPPORT_DAYTIME = 13
1010IPPORT_NETSTAT = 15
1011IPPORT_FTP = 21
1012IPPORT_TELNET = 23
1013IPPORT_SMTP = 25
1014IPPORT_TIMESERVER = 37
1015IPPORT_NAMESERVER = 42
1016IPPORT_WHOIS = 43
1017IPPORT_MTP = 57
1018IPPORT_TFTP = 69
1019IPPORT_RJE = 77
1020IPPORT_FINGER = 79
1021IPPORT_TTYLINK = 87
1022IPPORT_SUPDUP = 95
1023IPPORT_EXECSERVER = 512
1024IPPORT_LOGINSERVER = 513
1025IPPORT_CMDSERVER = 514
1026IPPORT_EFSSERVER = 520
1027IPPORT_BIFFUDP = 512
1028IPPORT_WHOSERVER = 513
1029IPPORT_ROUTESERVER = 520
1030IPPORT_RESERVED = 1024
1031IPPORT_USERRESERVED = 5000
1032IMPLINK_IP = 155
1033IMPLINK_LOWEXPER = 156
1034IMPLINK_HIGHEXPER = 158
Guido van Rossum725a67e1997-05-13 17:45:56 +00001035def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0)
1036
Guido van Rossume5e73b91994-10-09 23:03:12 +00001037IN_CLASSA_NET = 0xff000000
1038IN_CLASSA_NSHIFT = 24
1039IN_CLASSA_HOST = 0x00ffffff
1040IN_CLASSA_MAX = 128
Guido van Rossum725a67e1997-05-13 17:45:56 +00001041def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000)
1042
Guido van Rossume5e73b91994-10-09 23:03:12 +00001043IN_CLASSB_NET = 0xffff0000
1044IN_CLASSB_NSHIFT = 16
1045IN_CLASSB_HOST = 0x0000ffff
1046IN_CLASSB_MAX = 65536
Guido van Rossum725a67e1997-05-13 17:45:56 +00001047def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000)
1048
Guido van Rossume5e73b91994-10-09 23:03:12 +00001049IN_CLASSC_NET = 0xffffff00
1050IN_CLASSC_NSHIFT = 8
1051IN_CLASSC_HOST = 0x000000ff
Guido van Rossum725a67e1997-05-13 17:45:56 +00001052def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000)
1053
Guido van Rossume5e73b91994-10-09 23:03:12 +00001054IN_CLASSD_NET = 0xf0000000
1055IN_CLASSD_NSHIFT = 28
1056IN_CLASSD_HOST = 0x0fffffff
Guido van Rossum725a67e1997-05-13 17:45:56 +00001057def IN_MULTICAST(i): return IN_CLASSD(i)
1058
1059def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000)
1060
1061def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000)
1062
Guido van Rossume5e73b91994-10-09 23:03:12 +00001063INADDR_ANY = 0x00000000
1064INADDR_LOOPBACK = 0x7F000001
1065INADDR_BROADCAST = 0xffffffff
1066INADDR_UNSPEC_GROUP = 0xe0000000
1067INADDR_ALLHOSTS_GROUP = 0xe0000001
1068INADDR_MAX_LOCAL_GROUP = 0xe00000ff
1069IN_LOOPBACKNET = 127
Guido van Rossum725a67e1997-05-13 17:45:56 +00001070def IN_SET_LOOPBACK_ADDR(a): return \
1071
Guido van Rossume5e73b91994-10-09 23:03:12 +00001072IP_OPTIONS = 1
1073IP_HDRINCL = 2
1074IP_TOS = 3
1075IP_TTL = 4
1076IP_RECVOPTS = 5
1077IP_RECVRETOPTS = 6
1078IP_RECVDSTADDR = 7
1079IP_RETOPTS = 8
1080IP_MULTICAST_IF = 0x10
1081IP_MULTICAST_TTL = 0x11
1082IP_MULTICAST_LOOP = 0x12
1083IP_ADD_MEMBERSHIP = 0x13
1084IP_DROP_MEMBERSHIP = 0x14
1085IP_DEFAULT_MULTICAST_TTL = 1
1086IP_DEFAULT_MULTICAST_LOOP = 1