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