1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 27 /* All Rights Reserved */ 28 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 #include <stdio.h> 33 #include <stdlib.h> 34 #include <unistd.h> 35 #include <sys/types.h> 36 #include <libproc.h> 37 38 #include <ctype.h> 39 #include <string.h> 40 #include <sys/dlpi.h> 41 #include <sys/ipc.h> 42 #include <sys/ipc_impl.h> 43 #include <sys/msg.h> 44 #include <sys/sem.h> 45 #include <sys/shm.h> 46 #include <sys/fstyp.h> 47 #if defined(__i386) || defined(__amd64) 48 #include <sys/sysi86.h> 49 #endif /* __i386 */ 50 #include <sys/unistd.h> 51 #include <sys/file.h> 52 #include <sys/tiuser.h> 53 #include <sys/timod.h> 54 #include <sys/stream.h> 55 #include <sys/stropts.h> 56 #include <sys/termios.h> 57 #include <sys/termiox.h> 58 #include <sys/jioctl.h> 59 #include <sys/filio.h> 60 #include <fcntl.h> 61 #include <sys/termio.h> 62 #include <sys/stermio.h> 63 #include <sys/ttold.h> 64 #include <sys/lock.h> 65 #include <sys/mount.h> 66 #include <sys/utssys.h> 67 #include <sys/sysconfig.h> 68 #include <sys/statvfs.h> 69 #include <sys/kstat.h> 70 #include <sys/audio.h> 71 #include <sys/mixer.h> 72 #include <sys/vol.h> 73 #include <sys/cpc_impl.h> 74 #include <sys/devpoll.h> 75 #include <sys/strredir.h> 76 #include <sys/sockio.h> 77 #include <netinet/ip_mroute.h> 78 #include <net/if.h> 79 #include <net/if_arp.h> 80 #include <sys/ptyvar.h> 81 #include <sys/des.h> 82 #include <sys/prnio.h> 83 #include <sys/dtrace.h> 84 #include <sys/crypto/ioctladmin.h> 85 #include <sys/crypto/ioctl.h> 86 #include <sys/kbio.h> 87 #include <sys/ptms.h> 88 #include <sys/aggr.h> 89 #include <sys/dld.h> 90 #include <sys/fs/zfs.h> 91 #include <inet/kssl/kssl.h> 92 93 #include "ramdata.h" 94 #include "proto.h" 95 96 #define FCNTLMIN F_DUPFD 97 #define FCNTLMAX 44 /* F_SETLK64_NBMAND */ 98 const char *const FCNTLname[] = { 99 "F_DUPFD", 100 "F_GETFD", 101 "F_SETFD", 102 "F_GETFL", 103 "F_SETFL", 104 "F_O_GETLK", 105 "F_SETLK", 106 "F_SETLKW", 107 "F_CHKFL", 108 "F_DUP2FD", 109 "F_ALLOCSP", 110 "F_FREESP", 111 NULL, /* 12 */ 112 NULL, /* 13 */ 113 "F_GETLK", 114 NULL, /* 15 */ 115 NULL, /* 16 */ 116 NULL, /* 17 */ 117 NULL, /* 18 */ 118 NULL, /* 19 */ 119 NULL, /* 20 */ 120 NULL, /* 21 */ 121 NULL, /* 22 */ 122 "F_GETOWN", 123 "F_SETOWN", 124 "F_REVOKE", 125 "F_HASREMOTELOCKS", 126 "F_FREESP64", 127 NULL, /* 28 */ 128 NULL, /* 29 */ 129 NULL, /* 30 */ 130 NULL, /* 31 */ 131 NULL, /* 32 */ 132 "F_GETLK64", 133 "F_SETLK64", 134 "F_SETLKW64", 135 NULL, /* 36 */ 136 NULL, /* 37 */ 137 NULL, /* 38 */ 138 NULL, /* 39 */ 139 "F_SHARE", 140 "F_UNSHARE", 141 "F_SETLK_NBMAND", 142 "F_SHARE_NBMAND", 143 "F_SETLK64_NBMAND" 144 }; 145 146 #define SYSFSMIN GETFSIND 147 #define SYSFSMAX GETNFSTYP 148 const char *const SYSFSname[] = { 149 "GETFSIND", 150 "GETFSTYP", 151 "GETNFSTYP" 152 }; 153 154 #define PLOCKMIN UNLOCK 155 #define PLOCKMAX DATLOCK 156 const char *const PLOCKname[] = { 157 "UNLOCK", 158 "PROCLOCK", 159 "TXTLOCK", 160 NULL, 161 "DATLOCK" 162 }; 163 164 #define SCONFMIN _CONFIG_NGROUPS 165 #define SCONFMAX _CONFIG_CPUID_MAX 166 const char *const SCONFname[] = { 167 "_CONFIG_NGROUPS", /* 2 */ 168 "_CONFIG_CHILD_MAX", /* 3 */ 169 "_CONFIG_OPEN_FILES", /* 4 */ 170 "_CONFIG_POSIX_VER", /* 5 */ 171 "_CONFIG_PAGESIZE", /* 6 */ 172 "_CONFIG_CLK_TCK", /* 7 */ 173 "_CONFIG_XOPEN_VER", /* 8 */ 174 "_CONFIG_HRESCLK_TCK", /* 9 */ 175 "_CONFIG_PROF_TCK", /* 10 */ 176 "_CONFIG_NPROC_CONF", /* 11 */ 177 "_CONFIG_NPROC_ONLN", /* 12 */ 178 "_CONFIG_AIO_LISTIO_MAX", /* 13 */ 179 "_CONFIG_AIO_MAX", /* 14 */ 180 "_CONFIG_AIO_PRIO_DELTA_MAX", /* 15 */ 181 "_CONFIG_DELAYTIMER_MAX", /* 16 */ 182 "_CONFIG_MQ_OPEN_MAX", /* 17 */ 183 "_CONFIG_MQ_PRIO_MAX", /* 18 */ 184 "_CONFIG_RTSIG_MAX", /* 19 */ 185 "_CONFIG_SEM_NSEMS_MAX", /* 20 */ 186 "_CONFIG_SEM_VALUE_MAX", /* 21 */ 187 "_CONFIG_SIGQUEUE_MAX", /* 22 */ 188 "_CONFIG_SIGRT_MIN", /* 23 */ 189 "_CONFIG_SIGRT_MAX", /* 24 */ 190 "_CONFIG_TIMER_MAX", /* 25 */ 191 "_CONFIG_PHYS_PAGES", /* 26 */ 192 "_CONFIG_AVPHYS_PAGES", /* 27 */ 193 "_CONFIG_COHERENCY", /* 28 */ 194 "_CONFIG_SPLIT_CACHE", /* 29 */ 195 "_CONFIG_ICACHESZ", /* 30 */ 196 "_CONFIG_DCACHESZ", /* 31 */ 197 "_CONFIG_ICACHELINESZ", /* 32 */ 198 "_CONFIG_DCACHELINESZ", /* 33 */ 199 "_CONFIG_ICACHEBLKSZ", /* 34 */ 200 "_CONFIG_DCACHEBLKSZ", /* 35 */ 201 "_CONFIG_DCACHETBLKSZ", /* 36 */ 202 "_CONFIG_ICACHE_ASSOC", /* 37 */ 203 "_CONFIG_DCACHE_ASSOC", /* 38 */ 204 NULL, /* 39 */ 205 NULL, /* 40 */ 206 NULL, /* 41 */ 207 "_CONFIG_MAXPID", /* 42 */ 208 "_CONFIG_STACK_PROT", /* 43 */ 209 "_CONFIG_NPROC_MAX", /* 44 */ 210 "_CONFIG_CPUID_MAX" /* 45 */ 211 }; 212 213 #define PATHCONFMIN _PC_LINK_MAX 214 #define PATHCONFMAX _PC_CHOWN_RESTRICTED 215 const char *const PATHCONFname[] = { 216 "_PC_LINK_MAX", 217 "_PC_MAX_CANON", 218 "_PC_MAX_INPUT", 219 "_PC_NAME_MAX", 220 "_PC_PATH_MAX", 221 "_PC_PIPE_BUF", 222 "_PC_NO_TRUNC", 223 "_PC_VDISABLE", 224 "_PC_CHOWN_RESTRICTED" 225 }; 226 227 const struct ioc { 228 uint_t code; 229 const char *name; 230 const char *datastruct; 231 } ioc[] = { 232 { (uint_t)TCGETA, "TCGETA", NULL }, 233 { (uint_t)TCSETA, "TCSETA", NULL }, 234 { (uint_t)TCSETAW, "TCSETAW", NULL }, 235 { (uint_t)TCSETAF, "TCSETAF", NULL }, 236 { (uint_t)TCFLSH, "TCFLSH", NULL }, 237 { (uint_t)TIOCKBON, "TIOCKBON", NULL }, 238 { (uint_t)TIOCKBOF, "TIOCKBOF", NULL }, 239 { (uint_t)KBENABLED, "KBENABLED", NULL }, 240 { (uint_t)TCGETS, "TCGETS", NULL }, 241 { (uint_t)TCSETS, "TCSETS", NULL }, 242 { (uint_t)TCSETSW, "TCSETSW", NULL }, 243 { (uint_t)TCSETSF, "TCSETSF", NULL }, 244 { (uint_t)TCXONC, "TCXONC", NULL }, 245 { (uint_t)TCSBRK, "TCSBRK", NULL }, 246 { (uint_t)TCDSET, "TCDSET", NULL }, 247 { (uint_t)RTS_TOG, "RTS_TOG", NULL }, 248 { (uint_t)TIOCSWINSZ, "TIOCSWINSZ", NULL }, 249 { (uint_t)TIOCGWINSZ, "TIOCGWINSZ", NULL }, 250 { (uint_t)TIOCGETD, "TIOCGETD", NULL }, 251 { (uint_t)TIOCSETD, "TIOCSETD", NULL }, 252 { (uint_t)TIOCHPCL, "TIOCHPCL", NULL }, 253 { (uint_t)TIOCGETP, "TIOCGETP", NULL }, 254 { (uint_t)TIOCSETP, "TIOCSETP", NULL }, 255 { (uint_t)TIOCSETN, "TIOCSETN", NULL }, 256 { (uint_t)TIOCEXCL, "TIOCEXCL", NULL }, 257 { (uint_t)TIOCNXCL, "TIOCNXCL", NULL }, 258 { (uint_t)TIOCFLUSH, "TIOCFLUSH", NULL }, 259 { (uint_t)TIOCSETC, "TIOCSETC", NULL }, 260 { (uint_t)TIOCGETC, "TIOCGETC", NULL }, 261 { (uint_t)TIOCGPGRP, "TIOCGPGRP", NULL }, 262 { (uint_t)TIOCSPGRP, "TIOCSPGRP", NULL }, 263 { (uint_t)TIOCGSID, "TIOCGSID", NULL }, 264 { (uint_t)TIOCSTI, "TIOCSTI", NULL }, 265 { (uint_t)TIOCMSET, "TIOCMSET", NULL }, 266 { (uint_t)TIOCMBIS, "TIOCMBIS", NULL }, 267 { (uint_t)TIOCMBIC, "TIOCMBIC", NULL }, 268 { (uint_t)TIOCMGET, "TIOCMGET", NULL }, 269 { (uint_t)TIOCREMOTE, "TIOCREMOTE", NULL }, 270 { (uint_t)TIOCSIGNAL, "TIOCSIGNAL", NULL }, 271 { (uint_t)TIOCSTART, "TIOCSTART", NULL }, 272 { (uint_t)TIOCSTOP, "TIOCSTOP", NULL }, 273 { (uint_t)TIOCNOTTY, "TIOCNOTTY", NULL }, 274 { (uint_t)TIOCOUTQ, "TIOCOUTQ", NULL }, 275 { (uint_t)TIOCGLTC, "TIOCGLTC", NULL }, 276 { (uint_t)TIOCSLTC, "TIOCSLTC", NULL }, 277 { (uint_t)TIOCCDTR, "TIOCCDTR", NULL }, 278 { (uint_t)TIOCSDTR, "TIOCSDTR", NULL }, 279 { (uint_t)TIOCCBRK, "TIOCCBRK", NULL }, 280 { (uint_t)TIOCSBRK, "TIOCSBRK", NULL }, 281 { (uint_t)TIOCLGET, "TIOCLGET", NULL }, 282 { (uint_t)TIOCLSET, "TIOCLSET", NULL }, 283 { (uint_t)TIOCLBIC, "TIOCLBIC", NULL }, 284 { (uint_t)TIOCLBIS, "TIOCLBIS", NULL }, 285 286 { (uint_t)TIOCPKT, "TIOCPKT", NULL }, /* ptyvar.h */ 287 { (uint_t)TIOCUCNTL, "TIOCUCNTL", NULL }, 288 { (uint_t)TIOCTCNTL, "TIOCTCNTL", NULL }, 289 { (uint_t)TIOCISPACE, "TIOCISPACE", NULL }, 290 { (uint_t)TIOCISIZE, "TIOCISIZE", NULL }, 291 { (uint_t)TIOCSSIZE, "TIOCSSIZE", "ttysize" }, 292 { (uint_t)TIOCGSIZE, "TIOCGSIZE", "ttysize" }, 293 294 /* 295 * DLIOCRAW has the same ioctl number as LDCLOSE. Since the LDIOC 296 * ioctls (for xenix compatibility) are far less likely to be used, we 297 * give preference to DLIOCRAW, which is the only userland ioctl in the 298 * DLIOC family. 299 */ 300 { (uint_t)DLIOCRAW, "DLIOCRAW", NULL }, 301 302 { (uint_t)LDOPEN, "LDOPEN", NULL }, 303 { (uint_t)LDCLOSE, "LDCLOSE", NULL }, 304 { (uint_t)LDCHG, "LDCHG", NULL }, 305 { (uint_t)LDGETT, "LDGETT", NULL }, 306 { (uint_t)LDSETT, "LDSETT", NULL }, 307 { (uint_t)LDSMAP, "LDSMAP", NULL }, 308 { (uint_t)LDGMAP, "LDGMAP", NULL }, 309 { (uint_t)LDNMAP, "LDNMAP", NULL }, 310 { (uint_t)TCGETX, "TCGETX", NULL }, 311 { (uint_t)TCSETX, "TCSETX", NULL }, 312 { (uint_t)TCSETXW, "TCSETXW", NULL }, 313 { (uint_t)TCSETXF, "TCSETXF", NULL }, 314 { (uint_t)FIORDCHK, "FIORDCHK", NULL }, 315 { (uint_t)FIOCLEX, "FIOCLEX", NULL }, 316 { (uint_t)FIONCLEX, "FIONCLEX", NULL }, 317 { (uint_t)FIONREAD, "FIONREAD", NULL }, 318 { (uint_t)FIONBIO, "FIONBIO", NULL }, 319 { (uint_t)FIOASYNC, "FIOASYNC", NULL }, 320 { (uint_t)FIOSETOWN, "FIOSETOWN", NULL }, 321 { (uint_t)FIOGETOWN, "FIOGETOWN", NULL }, 322 #ifdef DIOCGETP 323 { (uint_t)DIOCGETP, "DIOCGETP", NULL }, 324 { (uint_t)DIOCSETP, "DIOCSETP", NULL }, 325 #endif 326 #ifdef DIOCGETC 327 { (uint_t)DIOCGETC, "DIOCGETC", NULL }, 328 { (uint_t)DIOCGETB, "DIOCGETB", NULL }, 329 { (uint_t)DIOCSETE, "DIOCSETE", NULL }, 330 #endif 331 #ifdef IFFORMAT 332 { (uint_t)IFFORMAT, "IFFORMAT", NULL }, 333 { (uint_t)IFBCHECK, "IFBCHECK", NULL }, 334 { (uint_t)IFCONFIRM, "IFCONFIRM", NULL }, 335 #endif 336 #ifdef LIOCGETP 337 { (uint_t)LIOCGETP, "LIOCGETP", NULL }, 338 { (uint_t)LIOCSETP, "LIOCSETP", NULL }, 339 { (uint_t)LIOCGETS, "LIOCGETS", NULL }, 340 { (uint_t)LIOCSETS, "LIOCSETS", NULL }, 341 #endif 342 #ifdef JBOOT 343 { (uint_t)JBOOT, "JBOOT", NULL }, 344 { (uint_t)JTERM, "JTERM", NULL }, 345 { (uint_t)JMPX, "JMPX", NULL }, 346 #ifdef JTIMO 347 { (uint_t)JTIMO, "JTIMO", NULL }, 348 #endif 349 { (uint_t)JWINSIZE, "JWINSIZE", NULL }, 350 { (uint_t)JTIMOM, "JTIMOM", NULL }, 351 { (uint_t)JZOMBOOT, "JZOMBOOT", NULL }, 352 { (uint_t)JAGENT, "JAGENT", NULL }, 353 { (uint_t)JTRUN, "JTRUN", NULL }, 354 { (uint_t)JXTPROTO, "JXTPROTO", NULL }, 355 #endif 356 { (uint_t)KSTAT_IOC_CHAIN_ID, "KSTAT_IOC_CHAIN_ID", NULL }, 357 { (uint_t)KSTAT_IOC_READ, "KSTAT_IOC_READ", NULL }, 358 { (uint_t)KSTAT_IOC_WRITE, "KSTAT_IOC_WRITE", NULL }, 359 { (uint_t)STGET, "STGET", NULL }, 360 { (uint_t)STSET, "STSET", NULL }, 361 { (uint_t)STTHROW, "STTHROW", NULL }, 362 { (uint_t)STWLINE, "STWLINE", NULL }, 363 { (uint_t)STTSV, "STTSV", NULL }, 364 { (uint_t)I_NREAD, "I_NREAD", NULL }, 365 { (uint_t)I_PUSH, "I_PUSH", NULL }, 366 { (uint_t)I_POP, "I_POP", NULL }, 367 { (uint_t)I_LOOK, "I_LOOK", NULL }, 368 { (uint_t)I_FLUSH, "I_FLUSH", NULL }, 369 { (uint_t)I_SRDOPT, "I_SRDOPT", NULL }, 370 { (uint_t)I_GRDOPT, "I_GRDOPT", NULL }, 371 { (uint_t)I_STR, "I_STR", NULL }, 372 { (uint_t)I_SETSIG, "I_SETSIG", NULL }, 373 { (uint_t)I_GETSIG, "I_GETSIG", NULL }, 374 { (uint_t)I_FIND, "I_FIND", NULL }, 375 { (uint_t)I_LINK, "I_LINK", NULL }, 376 { (uint_t)I_UNLINK, "I_UNLINK", NULL }, 377 { (uint_t)I_PEEK, "I_PEEK", NULL }, 378 { (uint_t)I_FDINSERT, "I_FDINSERT", NULL }, 379 { (uint_t)I_SENDFD, "I_SENDFD", NULL }, 380 { (uint_t)I_RECVFD, "I_RECVFD", NULL }, 381 { (uint_t)I_SWROPT, "I_SWROPT", NULL }, 382 { (uint_t)I_GWROPT, "I_GWROPT", NULL }, 383 { (uint_t)I_LIST, "I_LIST", NULL }, 384 { (uint_t)I_PLINK, "I_PLINK", NULL }, 385 { (uint_t)I_PUNLINK, "I_PUNLINK", NULL }, 386 { (uint_t)I_FLUSHBAND, "I_FLUSHBAND", NULL }, 387 { (uint_t)I_CKBAND, "I_CKBAND", NULL }, 388 { (uint_t)I_GETBAND, "I_GETBAND", NULL }, 389 { (uint_t)I_ATMARK, "I_ATMARK", NULL }, 390 { (uint_t)I_SETCLTIME, "I_SETCLTIME", NULL }, 391 { (uint_t)I_GETCLTIME, "I_GETCLTIME", NULL }, 392 { (uint_t)I_CANPUT, "I_CANPUT", NULL }, 393 #ifdef I_ANCHOR 394 { (uint_t)I_ANCHOR, "I_ANCHOR", NULL }, 395 #endif 396 #ifdef TI_GETINFO 397 { (uint_t)TI_GETINFO, "TI_GETINFO", NULL }, 398 { (uint_t)TI_OPTMGMT, "TI_OPTMGMT", NULL }, 399 { (uint_t)TI_BIND, "TI_BIND", NULL }, 400 { (uint_t)TI_UNBIND, "TI_UNBIND", NULL }, 401 #endif 402 #ifdef TI_CAPABILITY 403 { (uint_t)TI_CAPABILITY, "TI_CAPABILITY", NULL }, 404 #endif 405 #ifdef TI_GETMYNAME 406 { (uint_t)TI_GETMYNAME, "TI_GETMYNAME", NULL }, 407 { (uint_t)TI_GETPEERNAME, "TI_GETPEERNAME", NULL }, 408 { (uint_t)TI_SETMYNAME, "TI_SETMYNAME", NULL }, 409 { (uint_t)TI_SETPEERNAME, "TI_SETPEERNAME", NULL }, 410 #endif 411 #ifdef V_PREAD 412 { (uint_t)V_PREAD, "V_PREAD", NULL }, 413 { (uint_t)V_PWRITE, "V_PWRITE", NULL }, 414 { (uint_t)V_PDREAD, "V_PDREAD", NULL }, 415 { (uint_t)V_PDWRITE, "V_PDWRITE", NULL }, 416 #if !defined(__i386) && !defined(__amd64) 417 { (uint_t)V_GETSSZ, "V_GETSSZ", NULL }, 418 #endif /* !__i386 */ 419 #endif 420 /* audio */ 421 { (uint_t)AUDIO_GETINFO, "AUDIO_GETINFO", NULL }, 422 { (uint_t)AUDIO_SETINFO, "AUDIO_SETINFO", NULL }, 423 { (uint_t)AUDIO_DRAIN, "AUDIO_DRAIN", NULL }, 424 { (uint_t)AUDIO_GETDEV, "AUDIO_GETDEV", NULL }, 425 { (uint_t)AUDIO_DIAG_LOOPBACK, "AUDIO_DIAG_LOOPBACK", NULL }, 426 { (uint_t)AUDIO_GET_CH_NUMBER, "AUDIO_GET_CH_NUMBER", NULL }, 427 { (uint_t)AUDIO_GET_CH_TYPE, "AUDIO_GET_CH_TYPE", NULL }, 428 { (uint_t)AUDIO_GET_NUM_CHS, "AUDIO_GET_NUM_CHS", NULL }, 429 { (uint_t)AUDIO_GET_AD_DEV, "AUDIO_GET_AD_DEV", NULL }, 430 { (uint_t)AUDIO_GET_APM_DEV, "AUDIO_GET_APM_DEV", NULL }, 431 { (uint_t)AUDIO_GET_AS_DEV, "AUDIO_GET_AS_DEV", NULL }, 432 { (uint_t)AUDIO_MIXER_MULTIPLE_OPEN, "AUDIO_MIXER_MULTIPLE_OPEN", 433 NULL }, 434 { (uint_t)AUDIO_MIXER_SINGLE_OPEN, "AUDIO_MIXER_SINGLE_OPEN", 435 NULL }, 436 { (uint_t)AUDIO_MIXER_GET_SAMPLE_RATES, "AUDIO_MIXER_GET_SAMPLE_RATES", 437 NULL }, 438 { (uint_t)AUDIO_MIXERCTL_GETINFO, "AUDIO_MIXERCTL_GETINFO", 439 NULL }, 440 { (uint_t)AUDIO_MIXERCTL_SETINFO, "AUDIO_MIXERCTL_SETINFO", 441 NULL }, 442 { (uint_t)AUDIO_MIXERCTL_GET_CHINFO, "AUDIO_MIXERCTL_GET_CHINFO", 443 NULL }, 444 { (uint_t)AUDIO_MIXERCTL_SET_CHINFO, "AUDIO_MIXERCTL_SET_CHINFO", 445 NULL }, 446 { (uint_t)AUDIO_MIXERCTL_GET_MODE, "AUDIO_MIXERCTL_GET_MODE", 447 NULL }, 448 { (uint_t)AUDIO_MIXERCTL_SET_MODE, "AUDIO_MIXERCTL_SET_MODE", 449 NULL }, 450 /* volume management (control ioctls) */ 451 { (uint_t)VOLIOCMAP, "VOLIOCMAP", NULL }, 452 { (uint_t)VOLIOCUNMAP, "VOLIOCUNMAP", NULL }, 453 { (uint_t)VOLIOCEVENT, "VOLIOCEVENT", NULL }, 454 { (uint_t)VOLIOCEJECT, "VOLIOCEJECT", NULL }, 455 { (uint_t)VOLIOCDGATTR, "VOLIOCDGATTR", NULL }, 456 { (uint_t)VOLIOCDSATTR, "VOLIOCDSATTR", NULL }, 457 { (uint_t)VOLIOCDCHECK, "VOLIOCDCHECK", NULL }, 458 { (uint_t)VOLIOCDINUSE, "VOLIOCDINUSE", NULL}, 459 { (uint_t)VOLIOCDAEMON, "VOLIOCDAEMON", NULL }, 460 { (uint_t)VOLIOCFLAGS, "VOLIOCFLAGS", NULL }, 461 { (uint_t)VOLIOCDROOT, "VOLIOCDROOT", NULL }, 462 { (uint_t)VOLIOCDSYMNAME, "VOLIOCDSYMNAME", NULL }, 463 { (uint_t)VOLIOCDSYMDEV, "VOLIOCDSYMDEV", NULL }, 464 /* volume management (user ioctls) */ 465 { (uint_t)VOLIOCINUSE, "VOLIOCINUSE", NULL }, 466 { (uint_t)VOLIOCCHECK, "VOLIOCCHECK", NULL }, 467 { (uint_t)VOLIOCCANCEL, "VOLIOCCANCEL", NULL }, 468 { (uint_t)VOLIOCINFO, "VOLIOCINFO", NULL }, 469 { (uint_t)VOLIOCSATTR, "VOLIOCSATTR", NULL }, 470 { (uint_t)VOLIOCGATTR, "VOLIOCGATTR", NULL }, 471 { (uint_t)VOLIOCROOT, "VOLIOCROOT", NULL }, 472 { (uint_t)VOLIOCSYMNAME, "VOLIOCSYMNAME", NULL }, 473 { (uint_t)VOLIOCSYMDEV, "VOLIOCSYMDEV", NULL }, 474 /* STREAMS redirection ioctls */ 475 { (uint_t)SRIOCSREDIR, "SRIOCSREDIR", NULL }, 476 { (uint_t)SRIOCISREDIR, "SRIOCISREDIR", NULL }, 477 { (uint_t)CPCIO_BIND, "CPCIO_BIND", NULL }, 478 { (uint_t)CPCIO_SAMPLE, "CPCIO_SAMPLE", NULL }, 479 { (uint_t)CPCIO_RELE, "CPCIO_RELE", NULL }, 480 /* /dev/poll ioctl() control codes */ 481 { (uint_t)DP_POLL, "DP_POLL", NULL }, 482 { (uint_t)DP_ISPOLLED, "DP_ISPOLLED", NULL }, 483 /* the old /proc ioctl() control codes */ 484 #define PIOC ('q'<<8) 485 { (uint_t)(PIOC|1), "PIOCSTATUS", NULL }, 486 { (uint_t)(PIOC|2), "PIOCSTOP", NULL }, 487 { (uint_t)(PIOC|3), "PIOCWSTOP", NULL }, 488 { (uint_t)(PIOC|4), "PIOCRUN", NULL }, 489 { (uint_t)(PIOC|5), "PIOCGTRACE", NULL }, 490 { (uint_t)(PIOC|6), "PIOCSTRACE", NULL }, 491 { (uint_t)(PIOC|7), "PIOCSSIG", NULL }, 492 { (uint_t)(PIOC|8), "PIOCKILL", NULL }, 493 { (uint_t)(PIOC|9), "PIOCUNKILL", NULL }, 494 { (uint_t)(PIOC|10), "PIOCGHOLD", NULL }, 495 { (uint_t)(PIOC|11), "PIOCSHOLD", NULL }, 496 { (uint_t)(PIOC|12), "PIOCMAXSIG", NULL }, 497 { (uint_t)(PIOC|13), "PIOCACTION", NULL }, 498 { (uint_t)(PIOC|14), "PIOCGFAULT", NULL }, 499 { (uint_t)(PIOC|15), "PIOCSFAULT", NULL }, 500 { (uint_t)(PIOC|16), "PIOCCFAULT", NULL }, 501 { (uint_t)(PIOC|17), "PIOCGENTRY", NULL }, 502 { (uint_t)(PIOC|18), "PIOCSENTRY", NULL }, 503 { (uint_t)(PIOC|19), "PIOCGEXIT", NULL }, 504 { (uint_t)(PIOC|20), "PIOCSEXIT", NULL }, 505 { (uint_t)(PIOC|21), "PIOCSFORK", NULL }, 506 { (uint_t)(PIOC|22), "PIOCRFORK", NULL }, 507 { (uint_t)(PIOC|23), "PIOCSRLC", NULL }, 508 { (uint_t)(PIOC|24), "PIOCRRLC", NULL }, 509 { (uint_t)(PIOC|25), "PIOCGREG", NULL }, 510 { (uint_t)(PIOC|26), "PIOCSREG", NULL }, 511 { (uint_t)(PIOC|27), "PIOCGFPREG", NULL }, 512 { (uint_t)(PIOC|28), "PIOCSFPREG", NULL }, 513 { (uint_t)(PIOC|29), "PIOCNICE", NULL }, 514 { (uint_t)(PIOC|30), "PIOCPSINFO", NULL }, 515 { (uint_t)(PIOC|31), "PIOCNMAP", NULL }, 516 { (uint_t)(PIOC|32), "PIOCMAP", NULL }, 517 { (uint_t)(PIOC|33), "PIOCOPENM", NULL }, 518 { (uint_t)(PIOC|34), "PIOCCRED", NULL }, 519 { (uint_t)(PIOC|35), "PIOCGROUPS", NULL }, 520 { (uint_t)(PIOC|36), "PIOCGETPR", NULL }, 521 { (uint_t)(PIOC|37), "PIOCGETU", NULL }, 522 { (uint_t)(PIOC|38), "PIOCSET", NULL }, 523 { (uint_t)(PIOC|39), "PIOCRESET", NULL }, 524 { (uint_t)(PIOC|43), "PIOCUSAGE", NULL }, 525 { (uint_t)(PIOC|44), "PIOCOPENPD", NULL }, 526 { (uint_t)(PIOC|45), "PIOCLWPIDS", NULL }, 527 { (uint_t)(PIOC|46), "PIOCOPENLWP", NULL }, 528 { (uint_t)(PIOC|47), "PIOCLSTATUS", NULL }, 529 { (uint_t)(PIOC|48), "PIOCLUSAGE", NULL }, 530 { (uint_t)(PIOC|49), "PIOCNAUXV", NULL }, 531 { (uint_t)(PIOC|50), "PIOCAUXV", NULL }, 532 { (uint_t)(PIOC|51), "PIOCGXREGSIZE", NULL }, 533 { (uint_t)(PIOC|52), "PIOCGXREG", NULL }, 534 { (uint_t)(PIOC|53), "PIOCSXREG", NULL }, 535 { (uint_t)(PIOC|101), "PIOCGWIN", NULL }, 536 { (uint_t)(PIOC|103), "PIOCNLDT", NULL }, 537 { (uint_t)(PIOC|104), "PIOCLDT", NULL }, 538 539 /* ioctl's applicable on sockets */ 540 { (uint_t)SIOCSHIWAT, "SIOCSHIWAT", NULL }, 541 { (uint_t)SIOCGHIWAT, "SIOCGHIWAT", NULL }, 542 { (uint_t)SIOCSLOWAT, "SIOCSLOWAT", NULL }, 543 { (uint_t)SIOCGLOWAT, "SIOCGLOWAT", NULL }, 544 { (uint_t)SIOCATMARK, "SIOCATMARK", NULL }, 545 { (uint_t)SIOCSPGRP, "SIOCSPGRP", NULL }, 546 { (uint_t)SIOCGPGRP, "SIOCGPGRP", NULL }, 547 { (uint_t)SIOCADDRT, "SIOCADDRT", "rtentry" }, 548 { (uint_t)SIOCDELRT, "SIOCDELRT", "rtentry" }, 549 { (uint_t)SIOCGETVIFCNT, "SIOCGETVIFCNT", "sioc_vif_req" }, 550 { (uint_t)SIOCGETSGCNT, "SIOCGETSGCNT", "sioc_sg_req" }, 551 { (uint_t)SIOCGETLSGCNT, "SIOCGETLSGCNT", "sioc_lsg_req" }, 552 { (uint_t)SIOCSIFADDR, "SIOCSIFADDR", "ifreq" }, 553 { (uint_t)SIOCGIFADDR, "SIOCGIFADDR", "ifreq" }, 554 { (uint_t)SIOCSIFDSTADDR, "SIOCSIFDSTADDR", "ifreq" }, 555 { (uint_t)SIOCGIFDSTADDR, "SIOCGIFDSTADDR", "ifreq" }, 556 { (uint_t)SIOCSIFFLAGS, "SIOCSIFFLAGS", "ifreq" }, 557 { (uint_t)SIOCGIFFLAGS, "SIOCGIFFLAGS", "ifreq" }, 558 { (uint_t)SIOCSIFMEM, "SIOCSIFMEM", "ifreq" }, 559 { (uint_t)SIOCGIFMEM, "SIOCGIFMEM", "ifreq" }, 560 { (uint_t)SIOCGIFCONF, "SIOCGIFCONF", "ifconf" }, 561 { (uint_t)SIOCSIFMTU, "SIOCSIFMTU", "ifreq" }, 562 { (uint_t)SIOCGIFMTU, "SIOCGIFMTU", "ifreq" }, 563 { (uint_t)SIOCGIFBRDADDR, "SIOCGIFBRDADDR", "ifreq" }, 564 { (uint_t)SIOCSIFBRDADDR, "SIOCSIFBRDADDR", "ifreq" }, 565 { (uint_t)SIOCGIFNETMASK, "SIOCGIFNETMASK", "ifreq" }, 566 { (uint_t)SIOCSIFNETMASK, "SIOCSIFNETMASK", "ifreq" }, 567 { (uint_t)SIOCGIFMETRIC, "SIOCGIFMETRIC", "ifreq" }, 568 { (uint_t)SIOCSIFMETRIC, "SIOCSIFMETRIC", "ifreq" }, 569 { (uint_t)SIOCSARP, "SIOCSARP", "arpreq" }, 570 { (uint_t)SIOCGARP, "SIOCGARP", "arpreq" }, 571 { (uint_t)SIOCDARP, "SIOCDARP", "arpreq" }, 572 { (uint_t)SIOCUPPER, "SIOCUPPER", "ifreq" }, 573 { (uint_t)SIOCLOWER, "SIOCLOWER", "ifreq" }, 574 { (uint_t)SIOCSETSYNC, "SIOCSETSYNC", "ifreq" }, 575 { (uint_t)SIOCGETSYNC, "SIOCGETSYNC", "ifreq" }, 576 { (uint_t)SIOCSSDSTATS, "SIOCSSDSTATS", "ifreq" }, 577 { (uint_t)SIOCSSESTATS, "SIOCSSESTATS", "ifreq" }, 578 { (uint_t)SIOCSPROMISC, "SIOCSPROMISC", NULL }, 579 { (uint_t)SIOCADDMULTI, "SIOCADDMULTI", "ifreq" }, 580 { (uint_t)SIOCDELMULTI, "SIOCDELMULTI", "ifreq" }, 581 { (uint_t)SIOCGETNAME, "SIOCGETNAME", "sockaddr" }, 582 { (uint_t)SIOCGETPEER, "SIOCGETPEER", "sockaddr" }, 583 { (uint_t)IF_UNITSEL, "IF_UNITSEL", NULL }, 584 { (uint_t)SIOCXPROTO, "SIOCXPROTO", NULL }, 585 { (uint_t)SIOCIFDETACH, "SIOCIFDETACH", "ifreq" }, 586 { (uint_t)SIOCGENPSTATS, "SIOCGENPSTATS", "ifreq" }, 587 { (uint_t)SIOCX25XMT, "SIOCX25XMT", "ifreq" }, 588 { (uint_t)SIOCX25RCV, "SIOCX25RCV", "ifreq" }, 589 { (uint_t)SIOCX25TBL, "SIOCX25TBL", "ifreq" }, 590 { (uint_t)SIOCSLGETREQ, "SIOCSLGETREQ", "ifreq" }, 591 { (uint_t)SIOCSLSTAT, "SIOCSLSTAT", "ifreq" }, 592 { (uint_t)SIOCSIFNAME, "SIOCSIFNAME", "ifreq" }, 593 { (uint_t)SIOCGENADDR, "SIOCGENADDR", "ifreq" }, 594 { (uint_t)SIOCGIFNUM, "SIOCGIFNUM", NULL }, 595 { (uint_t)SIOCGIFMUXID, "SIOCGIFMUXID", "ifreq" }, 596 { (uint_t)SIOCSIFMUXID, "SIOCSIFMUXID", "ifreq" }, 597 { (uint_t)SIOCGIFINDEX, "SIOCGIFINDEX", "ifreq" }, 598 { (uint_t)SIOCSIFINDEX, "SIOCSIFINDEX", "ifreq" }, 599 { (uint_t)SIOCLIFREMOVEIF, "SIOCLIFREMOVEIF", "lifreq" }, 600 { (uint_t)SIOCLIFADDIF, "SIOCLIFADDIF", "lifreq" }, 601 { (uint_t)SIOCSLIFADDR, "SIOCSLIFADDR", "lifreq" }, 602 { (uint_t)SIOCGLIFADDR, "SIOCGLIFADDR", "lifreq" }, 603 { (uint_t)SIOCSLIFDSTADDR, "SIOCSLIFDSTADDR", "lifreq" }, 604 { (uint_t)SIOCGLIFDSTADDR, "SIOCGLIFDSTADDR", "lifreq" }, 605 { (uint_t)SIOCSLIFFLAGS, "SIOCSLIFFLAGS", "lifreq" }, 606 { (uint_t)SIOCGLIFFLAGS, "SIOCGLIFFLAGS", "lifreq" }, 607 { (uint_t)SIOCGLIFCONF, "SIOCGLIFCONF", "lifconf" }, 608 { (uint_t)SIOCSLIFMTU, "SIOCSLIFMTU", "lifreq" }, 609 { (uint_t)SIOCGLIFMTU, "SIOCGLIFMTU", "lifreq" }, 610 { (uint_t)SIOCGLIFBRDADDR, "SIOCGLIFBRDADDR", "lifreq" }, 611 { (uint_t)SIOCSLIFBRDADDR, "SIOCSLIFBRDADDR", "lifreq" }, 612 { (uint_t)SIOCGLIFNETMASK, "SIOCGLIFNETMASK", "lifreq" }, 613 { (uint_t)SIOCSLIFNETMASK, "SIOCSLIFNETMASK", "lifreq" }, 614 { (uint_t)SIOCGLIFMETRIC, "SIOCGLIFMETRIC", "lifreq" }, 615 { (uint_t)SIOCSLIFMETRIC, "SIOCSLIFMETRIC", "lifreq" }, 616 { (uint_t)SIOCSLIFNAME, "SIOCSLIFNAME", "lifreq" }, 617 { (uint_t)SIOCGLIFNUM, "SIOCGLIFNUM", "lifnum" }, 618 { (uint_t)SIOCGLIFMUXID, "SIOCGLIFMUXID", "lifreq" }, 619 { (uint_t)SIOCSLIFMUXID, "SIOCSLIFMUXID", "lifreq" }, 620 { (uint_t)SIOCGLIFINDEX, "SIOCGLIFINDEX", "lifreq" }, 621 { (uint_t)SIOCSLIFINDEX, "SIOCSLIFINDEX", "lifreq" }, 622 { (uint_t)SIOCSLIFTOKEN, "SIOCSLIFTOKEN", "lifreq" }, 623 { (uint_t)SIOCGLIFTOKEN, "SIOCGLIFTOKEN", "lifreq" }, 624 { (uint_t)SIOCSLIFSUBNET, "SIOCSLIFSUBNET", "lifreq" }, 625 { (uint_t)SIOCGLIFSUBNET, "SIOCGLIFSUBNET", "lifreq" }, 626 { (uint_t)SIOCSLIFLNKINFO, "SIOCSLIFLNKINFO", "lifreq" }, 627 { (uint_t)SIOCGLIFLNKINFO, "SIOCGLIFLNKINFO", "lifreq" }, 628 { (uint_t)SIOCLIFDELND, "SIOCLIFDELND", "lifreq" }, 629 { (uint_t)SIOCLIFGETND, "SIOCLIFGETND", "lifreq" }, 630 { (uint_t)SIOCLIFSETND, "SIOCLIFSETND", "lifreq" }, 631 { (uint_t)SIOCTMYADDR, "SIOCTMYADDR", "sioc_addrreq" }, 632 { (uint_t)SIOCTONLINK, "SIOCTONLINK", "sioc_addrreq" }, 633 { (uint_t)SIOCTMYSITE, "SIOCTMYSITE", "sioc_addrreq" }, 634 { (uint_t)SIOCGTUNPARAM, "SIOCGTUNPARAM", "iftun_req" }, 635 { (uint_t)SIOCSTUNPARAM, "SIOCSTUNPARAM", "iftun_req" }, 636 { (uint_t)SIOCFIPSECONFIG, "SIOCFIPSECONFIG", NULL }, 637 { (uint_t)SIOCSIPSECONFIG, "SIOCSIPSECONFIG", NULL }, 638 { (uint_t)SIOCDIPSECONFIG, "SIOCDIPSECONFIG", NULL }, 639 { (uint_t)SIOCLIPSECONFIG, "SIOCLIPSECONFIG", NULL }, 640 { (uint_t)SIOCLIFFAILOVER, "SIOCLIFFAILOVER", "lifreq" }, 641 { (uint_t)SIOCLIFFAILBACK, "SIOCLIFFAILBACK", "lifreq" }, 642 { (uint_t)SIOCSIPMPFAILBACK, "SIOCSIPMPFAILBACK", NULL }, 643 { (uint_t)SIOCSLIFGROUPNAME, "SIOCSLIFGROUPNAME", "lifreq" }, 644 { (uint_t)SIOCGLIFGROUPNAME, "SIOCGLIFGROUPNAME", "lifreq" }, 645 { (uint_t)SIOCGLIFOINDEX, "SIOCGLIFOINDEX", "lifreq" }, 646 { (uint_t)SIOCSLIFOINDEX, "SIOCSLIFOINDEX", "lifreq" }, 647 { (uint_t)SIOCGDSTINFO, "SIOCGDSTINFO", NULL }, 648 { (uint_t)SIOCGIP6ADDRPOLICY, "SIOCGIP6ADDRPOLICY", NULL }, 649 { (uint_t)SIOCSIP6ADDRPOLICY, "SIOCSIP6ADDRPOLICY", NULL }, 650 { (uint_t)SIOCSXARP, "SIOCSXARP", "xarpreq" }, 651 { (uint_t)SIOCGXARP, "SIOCGXARP", "xarpreq" }, 652 { (uint_t)SIOCDXARP, "SIOCDXARP", "xarpreq" }, 653 { (uint_t)SIOCGLIFZONE, "SIOCGLIFZONE", "lifreq" }, 654 { (uint_t)SIOCSLIFZONE, "SIOCSLIFZONE", "lifreq" }, 655 { (uint_t)SIOCSCTPSOPT, "SIOCSCTPSOPT", NULL }, 656 { (uint_t)SIOCSCTPGOPT, "SIOCSCTPGOPT", NULL }, 657 { (uint_t)SIOCSCTPPEELOFF, "SIOPCSCTPPEELOFF", "int" }, 658 { (uint_t)SIOCGLIFUSESRC, "SIOCGLIFUSESRC", "lifreq" }, 659 { (uint_t)SIOCSLIFUSESRC, "SIOCSLIFUSESRC", "lifreq" }, 660 { (uint_t)SIOCGLIFSRCOF, "SIOCGLIFSRCOF", "lifsrcof" }, 661 { (uint_t)SIOCGMSFILTER, "SIOCGMSFILTER", "group_filter" }, 662 { (uint_t)SIOCSMSFILTER, "SIOCSMSFILTER", "group_filter" }, 663 { (uint_t)SIOCGIPMSFILTER, "SIOCGIPMSFILTER", "ip_msfilter" }, 664 { (uint_t)SIOCSIPMSFILTER, "SIOCSIPMSFILTER", "ip_msfilter" }, 665 666 /* DES encryption */ 667 { (uint_t)DESIOCBLOCK, "DESIOCBLOCK", "desparams" }, 668 { (uint_t)DESIOCQUICK, "DESIOCQUICK", "desparams" }, 669 670 /* Printing system */ 671 { (uint_t)PRNIOC_GET_IFCAP, "PRNIOC_GET_IFCAP", NULL }, 672 { (uint_t)PRNIOC_SET_IFCAP, "PRNIOC_SET_IFCAP", NULL }, 673 { (uint_t)PRNIOC_GET_IFINFO, "PRNIOC_GET_IFINFO", 674 "prn_interface_info" }, 675 { (uint_t)PRNIOC_GET_STATUS, "PRNIOC_GET_STATUS", NULL }, 676 { (uint_t)PRNIOC_GET_1284_DEVID, "PRNIOC_GET_1284_DEVID", 677 "prn_1284_device_id" }, 678 { (uint_t)PRNIOC_GET_1284_STATUS, 679 "PRNIOC_GET_IFCANIOC_GET_1284_STATUS", NULL }, 680 { (uint_t)PRNIOC_GET_TIMEOUTS, "PRNIOC_GET_TIMEOUTS", 681 "prn_timeouts" }, 682 { (uint_t)PRNIOC_SET_TIMEOUTS, "PRNIOC_SET_TIMEOUTS", 683 "prn_timeouts" }, 684 { (uint_t)PRNIOC_RESET, "PRNIOC_RESET", NULL }, 685 686 /* DTrace */ 687 { (uint_t)DTRACEIOC_PROVIDER, "DTRACEIOC_PROVIDER", NULL }, 688 { (uint_t)DTRACEIOC_PROBES, "DTRACEIOC_PROBES", NULL }, 689 { (uint_t)DTRACEIOC_BUFSNAP, "DTRACEIOC_BUFSNAP", NULL }, 690 { (uint_t)DTRACEIOC_PROBEMATCH, "DTRACEIOC_PROBEMATCH", NULL }, 691 { (uint_t)DTRACEIOC_ENABLE, "DTRACEIOC_ENABLE", NULL }, 692 { (uint_t)DTRACEIOC_AGGSNAP, "DTRACEIOC_AGGSNAP", NULL }, 693 { (uint_t)DTRACEIOC_EPROBE, "DTRACEIOC_EPROBE", NULL }, 694 { (uint_t)DTRACEIOC_PROBEARG, "DTRACEIOC_PROBEARG", NULL }, 695 { (uint_t)DTRACEIOC_CONF, "DTRACEIOC_CONF", NULL }, 696 { (uint_t)DTRACEIOC_STATUS, "DTRACEIOC_STATUS", NULL }, 697 { (uint_t)DTRACEIOC_GO, "DTRACEIOC_GO", NULL }, 698 { (uint_t)DTRACEIOC_STOP, "DTRACEIOC_STOP", NULL }, 699 { (uint_t)DTRACEIOC_AGGDESC, "DTRACEIOC_AGGDESC", NULL }, 700 { (uint_t)DTRACEIOC_FORMAT, "DTRACEIOC_FORMAT", NULL }, 701 { (uint_t)DTRACEIOC_DOFGET, "DTRACEIOC_DOFGET", NULL }, 702 { (uint_t)DTRACEIOC_REPLICATE, "DTRACEIOC_REPLICATE", NULL }, 703 704 { (uint_t)DTRACEHIOC_ADD, "DTRACEHIOC_ADD", NULL }, 705 { (uint_t)DTRACEHIOC_REMOVE, "DTRACEHIOC_REMOVE", NULL }, 706 { (uint_t)DTRACEHIOC_ADDDOF, "DTRACEHIOC_ADDDOF", NULL }, 707 708 /* /dev/cryptoadm ioctl() control codes */ 709 { (uint_t)CRYPTO_GET_VERSION, "CRYPTO_GET_VERSION", NULL }, 710 { (uint_t)CRYPTO_GET_DEV_LIST, "CRYPTO_GET_DEV_LIST", NULL }, 711 { (uint_t)CRYPTO_GET_SOFT_LIST, "CRYPTO_GET_SOFT_LIST", NULL }, 712 { (uint_t)CRYPTO_GET_DEV_INFO, "CRYPTO_GET_DEV_INFO", NULL }, 713 { (uint_t)CRYPTO_GET_SOFT_INFO, "CRYPTO_GET_SOFT_INFO", NULL }, 714 { (uint_t)CRYPTO_LOAD_DEV_DISABLED, "CRYPTO_LOAD_DEV_DISABLED", 715 NULL }, 716 { (uint_t)CRYPTO_LOAD_SOFT_DISABLED, "CRYPTO_LOAD_SOFT_DISABLED", 717 NULL }, 718 { (uint_t)CRYPTO_UNLOAD_SOFT_MODULE, "CRYPTO_UNLOAD_SOFT_MODULE", 719 NULL }, 720 { (uint_t)CRYPTO_LOAD_SOFT_CONFIG, "CRYPTO_LOAD_SOFT_CONFIG", 721 NULL }, 722 { (uint_t)CRYPTO_POOL_CREATE, "CRYPTO_POOL_CREATE", NULL }, 723 { (uint_t)CRYPTO_POOL_WAIT, "CRYPTO_POOL_WAIT", NULL }, 724 { (uint_t)CRYPTO_POOL_RUN, "CRYPTO_POOL_RUN", NULL }, 725 { (uint_t)CRYPTO_LOAD_DOOR, "CRYPTO_LOAD_DOOR", NULL }, 726 727 /* /dev/crypto ioctl() control codes */ 728 { (uint_t)CRYPTO_GET_FUNCTION_LIST, "CRYPTO_GET_FUNCTION_LIST", 729 NULL }, 730 { (uint_t)CRYPTO_GET_MECHANISM_NUMBER, "CRYPTO_GET_MECHANISM_NUMBER", 731 NULL }, 732 { (uint_t)CRYPTO_OPEN_SESSION, "CRYPTO_OPEN_SESSION", NULL }, 733 { (uint_t)CRYPTO_CLOSE_SESSION, "CRYPTO_CLOSE_SESSION", NULL }, 734 { (uint_t)CRYPTO_CLOSE_ALL_SESSIONS, "CRYPTO_CLOSE_ALL_SESSIONS", 735 NULL }, 736 { (uint_t)CRYPTO_LOGIN, "CRYPTO_LOGIN", NULL }, 737 { (uint_t)CRYPTO_LOGOUT, "CRYPTO_LOGOUT", NULL }, 738 { (uint_t)CRYPTO_ENCRYPT, "CRYPTO_ENCRYPT", NULL }, 739 { (uint_t)CRYPTO_ENCRYPT_INIT, "CRYPTO_ENCRYPT_INIT", NULL }, 740 { (uint_t)CRYPTO_ENCRYPT_UPDATE, "CRYPTO_ENCRYPT_UPDATE", 741 NULL }, 742 { (uint_t)CRYPTO_ENCRYPT_FINAL, "CRYPTO_ENCRYPT_FINAL", NULL }, 743 { (uint_t)CRYPTO_DECRYPT, "CRYPTO_DECRYPT", NULL }, 744 { (uint_t)CRYPTO_DECRYPT_INIT, "CRYPTO_DECRYPT_INIT", NULL }, 745 { (uint_t)CRYPTO_DECRYPT_UPDATE, "CRYPTO_DECRYPT_UPDATE", 746 NULL }, 747 { (uint_t)CRYPTO_DECRYPT_FINAL, "CRYPTO_DECRYPT_FINAL", NULL }, 748 { (uint_t)CRYPTO_DIGEST, "CRYPTO_DIGEST", NULL }, 749 { (uint_t)CRYPTO_DIGEST_INIT, "CRYPTO_DIGEST_INIT", NULL }, 750 { (uint_t)CRYPTO_DIGEST_UPDATE, "CRYPTO_DIGEST_UPDATE", NULL }, 751 { (uint_t)CRYPTO_DIGEST_KEY, "CRYPTO_DIGEST_KEY", NULL }, 752 { (uint_t)CRYPTO_DIGEST_FINAL, "CRYPTO_DIGEST_FINAL", NULL }, 753 { (uint_t)CRYPTO_MAC, "CRYPTO_MAC", NULL }, 754 { (uint_t)CRYPTO_MAC_INIT, "CRYPTO_MAC_INIT", NULL }, 755 { (uint_t)CRYPTO_MAC_UPDATE, "CRYPTO_MAC_UPDATE", NULL }, 756 { (uint_t)CRYPTO_MAC_FINAL, "CRYPTO_MAC_FINAL", NULL }, 757 { (uint_t)CRYPTO_SIGN, "CRYPTO_SIGN", NULL }, 758 { (uint_t)CRYPTO_SIGN_INIT, "CRYPTO_SIGN_INIT", NULL }, 759 { (uint_t)CRYPTO_SIGN_UPDATE, "CRYPTO_SIGN_UPDATE", NULL }, 760 { (uint_t)CRYPTO_SIGN_FINAL, "CRYPTO_SIGN_FINAL", NULL }, 761 { (uint_t)CRYPTO_SIGN_RECOVER_INIT, "CRYPTO_SIGN_RECOVER_INIT", 762 NULL }, 763 { (uint_t)CRYPTO_SIGN_RECOVER, "CRYPTO_SIGN_RECOVER", NULL }, 764 { (uint_t)CRYPTO_VERIFY, "CRYPTO_VERIFY", NULL }, 765 { (uint_t)CRYPTO_VERIFY_INIT, "CRYPTO_VERIFY_INIT", NULL }, 766 { (uint_t)CRYPTO_VERIFY_UPDATE, "CRYPTO_VERIFY_UPDATE", NULL }, 767 { (uint_t)CRYPTO_VERIFY_FINAL, "CRYPTO_VERIFY_FINAL", NULL }, 768 { (uint_t)CRYPTO_VERIFY_RECOVER_INIT, "CRYPTO_VERIFY_RECOVER_INIT", 769 NULL }, 770 { (uint_t)CRYPTO_VERIFY_RECOVER, "CRYPTO_VERIFY_RECOVER", 771 NULL }, 772 { (uint_t)CRYPTO_DIGEST_ENCRYPT_UPDATE, "CRYPTO_DIGEST_ENCRYPT_UPDATE", 773 NULL }, 774 { (uint_t)CRYPTO_DECRYPT_DIGEST_UPDATE, "CRYPTO_DECRYPT_DIGEST_UPDATE", 775 NULL }, 776 { (uint_t)CRYPTO_SIGN_ENCRYPT_UPDATE, "CRYPTO_SIGN_ENCRYPT_UPDATE", 777 NULL }, 778 { (uint_t)CRYPTO_DECRYPT_VERIFY_UPDATE, "CRYPTO_DECRYPT_VERIFY_UPDATE", 779 NULL }, 780 { (uint_t)CRYPTO_SEED_RANDOM, "CRYPTO_SEED_RANDOM", NULL }, 781 { (uint_t)CRYPTO_GENERATE_RANDOM, "CRYPTO_GENERATE_RANDOM", 782 NULL }, 783 { (uint_t)CRYPTO_OBJECT_CREATE, "CRYPTO_OBJECT_CREATE", NULL }, 784 { (uint_t)CRYPTO_OBJECT_COPY, "CRYPTO_OBJECT_COPY", NULL }, 785 { (uint_t)CRYPTO_OBJECT_DESTROY, "CRYPTO_OBJECT_DESTROY", 786 NULL }, 787 { (uint_t)CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE, 788 "CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE", NULL }, 789 { (uint_t)CRYPTO_OBJECT_GET_SIZE, "CRYPTO_OBJECT_GET_SIZE", NULL }, 790 { (uint_t)CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE, 791 "CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE", NULL }, 792 { (uint_t)CRYPTO_OBJECT_FIND_INIT, "CRYPTO_OBJECT_FIND_INIT", 793 NULL }, 794 { (uint_t)CRYPTO_OBJECT_FIND_UPDATE, "CRYPTO_OBJECT_FIND_UPDATE", 795 NULL }, 796 { (uint_t)CRYPTO_OBJECT_FIND_FINAL, "CRYPTO_OBJECT_FIND_FINAL", 797 NULL }, 798 { (uint_t)CRYPTO_GENERATE_KEY, "CRYPTO_GENERATE_KEY", NULL }, 799 { (uint_t)CRYPTO_GENERATE_KEY_PAIR, "CRYPTO_GENERATE_KEY_PAIR", 800 NULL }, 801 { (uint_t)CRYPTO_WRAP_KEY, "CRYPTO_WRAP_KEY", NULL }, 802 { (uint_t)CRYPTO_UNWRAP_KEY, "CRYPTO_UNWRAP_KEY", NULL }, 803 { (uint_t)CRYPTO_DERIVE_KEY, "CRYPTO_DERIVE_KEY", NULL }, 804 { (uint_t)CRYPTO_GET_PROVIDER_LIST, "CRYPTO_GET_PROVIDER_LIST", 805 NULL }, 806 { (uint_t)CRYPTO_GET_PROVIDER_INFO, "CRYPTO_GET_PROVIDER_INFO", 807 NULL }, 808 { (uint_t)CRYPTO_GET_PROVIDER_MECHANISMS, 809 "CRYPTO_GET_PROVIDER_MECHANISMS", NULL }, 810 { (uint_t)CRYPTO_GET_PROVIDER_MECHANISM_INFO, 811 "CRYPTO_GET_PROVIDER_MECHANISM_INFO", NULL }, 812 { (uint_t)CRYPTO_INIT_TOKEN, "CRYPTO_INIT_TOKEN", NULL }, 813 { (uint_t)CRYPTO_INIT_PIN, "CRYPTO_INIT_PIN", NULL }, 814 { (uint_t)CRYPTO_SET_PIN, "CRYPTO_SET_PIN", NULL }, 815 816 /* kbio ioctls */ 817 { (uint_t)KIOCTRANS, "KIOCTRANS", NULL }, 818 { (uint_t)KIOCGTRANS, "KIOCGTRANS", NULL }, 819 { (uint_t)KIOCTRANSABLE, "KIOCTRANSABLE", NULL }, 820 { (uint_t)KIOCGTRANSABLE, "KIOCGTRANSABLE", NULL }, 821 { (uint_t)KIOCSETKEY, "KIOCSETKEY", NULL }, 822 { (uint_t)KIOCGETKEY, "KIOCGETKEY", NULL }, 823 { (uint_t)KIOCCMD, "KIOCCMD", NULL }, 824 { (uint_t)KIOCTYPE, "KIOCTYPE", NULL }, 825 { (uint_t)KIOCSDIRECT, "KIOCSDIRECT", NULL }, 826 { (uint_t)KIOCGDIRECT, "KIOCGDIRECT", NULL }, 827 { (uint_t)KIOCSKEY, "KIOCSKEY", NULL }, 828 { (uint_t)KIOCGKEY, "KIOCGKEY", NULL }, 829 { (uint_t)KIOCSLED, "KIOCSLED", NULL }, 830 { (uint_t)KIOCGLED, "KIOCGLED", NULL }, 831 { (uint_t)KIOCSCOMPAT, "KIOCSCOMPAT", NULL }, 832 { (uint_t)KIOCGCOMPAT, "KIOCGCOMPAT", NULL }, 833 { (uint_t)KIOCSLAYOUT, "KIOCSLAYOUT", NULL }, 834 { (uint_t)KIOCLAYOUT, "KIOCLAYOUT", NULL }, 835 { (uint_t)KIOCSKABORTEN, "KIOCSKABORTEN", NULL }, 836 { (uint_t)KIOCGRPTDELAY, "KIOCGRPTDELAY", NULL }, 837 { (uint_t)KIOCSRPTDELAY, "KIOCSRPTDELAY", NULL }, 838 { (uint_t)KIOCGRPTRATE, "KIOCGRPTRATE", NULL }, 839 { (uint_t)KIOCSRPTRATE, "KIOCSRPTRATE", NULL }, 840 841 /* ptm/pts driver I_STR ioctls */ 842 { (uint_t)ISPTM, "ISPTM", NULL}, 843 { (uint_t)UNLKPT, "UNLKPT", NULL}, 844 { (uint_t)PTSSTTY, "PTSSTTY", NULL}, 845 { (uint_t)ZONEPT, "ZONEPT", NULL}, 846 847 /* aggr link aggregation pseudo driver ioctls */ 848 { (uint_t)LAIOC_CREATE, "LAIOC_CREATE", "laioc_create"}, 849 { (uint_t)LAIOC_DELETE, "LAIOC_DELETE", "laioc_delete"}, 850 { (uint_t)LAIOC_INFO, "LAIOC_INFO", "laioc_info"}, 851 { (uint_t)LAIOC_ADD, "LAIOC_ADD", 852 "laioc_add_rem"}, 853 { (uint_t)LAIOC_REMOVE, "LAIOC_REMOVE", 854 "laioc_add_rem"}, 855 { (uint_t)LAIOC_MODIFY, "LAIOC_MODIFY", "laioc_modify"}, 856 857 /* dld data-link ioctls */ 858 { (uint_t)DLDIOCATTR, "DLDIOCATTR", "dld_ioc_attr"}, 859 { (uint_t)DLDIOCVLAN, "DLDIOCVLAN", "dld_ioc_vlan"}, 860 861 /* ZFS ioctls */ 862 { (uint_t)ZFS_IOC_POOL_CREATE, "ZFS_IOC_POOL_CREATE", 863 "zfs_cmd_t" }, 864 { (uint_t)ZFS_IOC_POOL_DESTROY, "ZFS_IOC_POOL_DESTROY", 865 "zfs_cmd_t" }, 866 { (uint_t)ZFS_IOC_POOL_IMPORT, "ZFS_IOC_POOL_IMPORT", 867 "zfs_cmd_t" }, 868 { (uint_t)ZFS_IOC_POOL_EXPORT, "ZFS_IOC_POOL_EXPORT", 869 "zfs_cmd_t" }, 870 { (uint_t)ZFS_IOC_POOL_CONFIGS, "ZFS_IOC_POOL_CONFIGS", 871 "zfs_cmd_t" }, 872 { (uint_t)ZFS_IOC_POOL_STATS, "ZFS_IOC_POOL_STATS", 873 "zfs_cmd_t" }, 874 { (uint_t)ZFS_IOC_POOL_TRYIMPORT, "ZFS_IOC_POOL_TRYIMPORT", 875 "zfs_cmd_t" }, 876 { (uint_t)ZFS_IOC_POOL_SCRUB, "ZFS_IOC_POOL_SCRUB", 877 "zfs_cmd_t" }, 878 { (uint_t)ZFS_IOC_POOL_FREEZE, "ZFS_IOC_POOL_FREEZE", 879 "zfs_cmd_t" }, 880 { (uint_t)ZFS_IOC_POOL_UPGRADE, "ZFS_IOC_POOL_UPGRADE", 881 "zfs_cmd_t" }, 882 { (uint_t)ZFS_IOC_VDEV_ADD, "ZFS_IOC_VDEV_ADD", 883 "zfs_cmd_t" }, 884 { (uint_t)ZFS_IOC_VDEV_REMOVE, "ZFS_IOC_VDEV_REMOVE", 885 "zfs_cmd_t" }, 886 { (uint_t)ZFS_IOC_VDEV_ONLINE, "ZFS_IOC_VDEV_ONLINE", 887 "zfs_cmd_t" }, 888 { (uint_t)ZFS_IOC_VDEV_OFFLINE, "ZFS_IOC_VDEV_OFFLINE", 889 "zfs_cmd_t" }, 890 { (uint_t)ZFS_IOC_VDEV_ATTACH, "ZFS_IOC_VDEV_ATTACH", 891 "zfs_cmd_t" }, 892 { (uint_t)ZFS_IOC_VDEV_DETACH, "ZFS_IOC_VDEV_DETACH", 893 "zfs_cmd_t" }, 894 { (uint_t)ZFS_IOC_VDEV_SETPATH, "ZFS_IOC_VDEV_SETPATH", 895 "zfs_cmd_t" }, 896 { (uint_t)ZFS_IOC_OBJSET_STATS, "ZFS_IOC_OBJSET_STATS", 897 "zfs_cmd_t" }, 898 { (uint_t)ZFS_IOC_DATASET_LIST_NEXT, "ZFS_IOC_DATASET_LIST_NEXT", 899 "zfs_cmd_t" }, 900 { (uint_t)ZFS_IOC_SNAPSHOT_LIST_NEXT, "ZFS_IOC_SNAPSHOT_LIST_NEXT", 901 "zfs_cmd_t" }, 902 { (uint_t)ZFS_IOC_SET_PROP, "ZFS_IOC_SET_PROP", 903 "zfs_cmd_t" }, 904 { (uint_t)ZFS_IOC_SET_QUOTA, "ZFS_IOC_SET_QUOTA", 905 "zfs_cmd_t" }, 906 { (uint_t)ZFS_IOC_SET_RESERVATION, "ZFS_IOC_SET_RESERVATION", 907 "zfs_cmd_t" }, 908 { (uint_t)ZFS_IOC_SET_VOLSIZE, "ZFS_IOC_SET_VOLSIZE", 909 "zfs_cmd_t" }, 910 { (uint_t)ZFS_IOC_SET_VOLBLOCKSIZE, "ZFS_IOC_SET_VOLBLOCKSIZE", 911 "zfs_cmd_t" }, 912 { (uint_t)ZFS_IOC_CREATE_MINOR, "ZFS_IOC_CREATE_MINOR", 913 "zfs_cmd_t" }, 914 { (uint_t)ZFS_IOC_REMOVE_MINOR, "ZFS_IOC_REMOVE_MINOR", 915 "zfs_cmd_t" }, 916 { (uint_t)ZFS_IOC_CREATE, "ZFS_IOC_CREATE", 917 "zfs_cmd_t" }, 918 { (uint_t)ZFS_IOC_DESTROY, "ZFS_IOC_DESTROY", 919 "zfs_cmd_t" }, 920 { (uint_t)ZFS_IOC_ROLLBACK, "ZFS_IOC_ROLLBACK", 921 "zfs_cmd_t" }, 922 { (uint_t)ZFS_IOC_RENAME, "ZFS_IOC_RENAME", 923 "zfs_cmd_t" }, 924 { (uint_t)ZFS_IOC_RECVBACKUP, "ZFS_IOC_RECVBACKUP", 925 "zfs_cmd_t" }, 926 { (uint_t)ZFS_IOC_SENDBACKUP, "ZFS_IOC_SENDBACKUP", 927 "zfs_cmd_t" }, 928 { (uint_t)ZFS_IOC_INJECT_FAULT, "ZFS_IOC_INJECT_FAULT", 929 "zfs_cmd_t" }, 930 { (uint_t)ZFS_IOC_CLEAR_FAULT, "ZFS_IOC_CLEAR_FAULT", 931 "zfs_cmd_t" }, 932 { (uint_t)ZFS_IOC_INJECT_LIST_NEXT, "ZFS_IOC_INJECT_LIST_NEXT", 933 "zfs_cmd_t" }, 934 { (uint_t)ZFS_IOC_ERROR_LOG, "ZFS_IOC_ERROR_LOG", 935 "zfs_cmd_t" }, 936 { (uint_t)ZFS_IOC_CLEAR, "ZFS_IOC_CLEAR", 937 "zfs_cmd_t" }, 938 { (uint_t)ZFS_IOC_BOOKMARK_NAME, "ZFS_IOC_BOOKMARK_NAME", 939 "zfs_cmd_t" }, 940 { (uint_t)ZFS_IOC_PROMOTE, "ZFS_IOC_PROMOTE", 941 "zfs_cmd_t" }, 942 { (uint_t)ZFS_IOC_DESTROY_SNAPS, "ZFS_IOC_DESTROY_SNAPS", 943 "zfs_cmd_t" }, 944 { (uint_t)ZFS_IOC_SNAPSHOT, "ZFS_IOC_SNAPSHOT", 945 "zfs_cmd_t" }, 946 947 /* kssl ioctls */ 948 { (uint_t)KSSL_ADD_ENTRY, "KSSL_ADD_ENTRY", 949 "kssl_params_t"}, 950 { (uint_t)KSSL_DELETE_ENTRY, "KSSL_DELETE_ENTRY", 951 "sockaddr_in"}, 952 953 { (uint_t)0, NULL, NULL } 954 }; 955 956 void 957 ioctl_ioccom(char *buf, size_t size, uint_t code, int nbytes, int x, int y) 958 { 959 const char *inoutstr; 960 961 if (code & IOC_VOID) 962 inoutstr = ""; 963 else if ((code & IOC_INOUT) == IOC_INOUT) 964 inoutstr = "WR"; 965 else 966 inoutstr = code & IOC_IN ? "W" : "R"; 967 968 if (isascii(x) && isprint(x)) 969 (void) snprintf(buf, size, "_IO%sN('%c', %d, %d)", inoutstr, 970 x, y, nbytes); 971 else 972 (void) snprintf(buf, size, "_IO%sN(0x%x, %d, %d)", inoutstr, 973 x, y, nbytes); 974 } 975 976 977 const char * 978 ioctlname(private_t *pri, uint_t code) 979 { 980 const struct ioc *ip; 981 const char *str = NULL; 982 983 for (ip = &ioc[0]; ip->name; ip++) { 984 if (code == ip->code) { 985 str = ip->name; 986 break; 987 } 988 } 989 990 /* 991 * Developers hide ascii ioctl names in the ioctl subcode; for example 992 * 0x445210 should be printed 'D'<<16|'R'<<8|10. We allow for all 993 * three high order bytes (called hi, mid and lo) to contain ascii 994 * characters. 995 */ 996 if (str == NULL) { 997 int c_hi = code >> 24; 998 int c_mid = (code >> 16) & 0xff; 999 int c_mid_nm = (code >> 16); 1000 int c_lo = (code >> 8) & 0xff; 1001 int c_lo_nm = code >> 8; 1002 1003 if (isascii(c_lo) && isprint(c_lo) && 1004 isascii(c_mid) && isprint(c_mid) && 1005 isascii(c_hi) && isprint(c_hi)) 1006 (void) sprintf(pri->code_buf, 1007 "(('%c'<<24)|('%c'<<16)|('%c'<<8)|%d)", 1008 c_hi, c_mid, c_lo, code & 0xff); 1009 else if (isascii(c_lo) && isprint(c_lo) && 1010 isascii(c_mid_nm) && isprint(c_mid_nm)) 1011 (void) sprintf(pri->code_buf, 1012 "(('%c'<<16)|('%c'<<8)|%d)", c_mid, c_lo, 1013 code & 0xff); 1014 else if (isascii(c_lo_nm) && isprint(c_lo_nm)) 1015 (void) sprintf(pri->code_buf, "(('%c'<<8)|%d)", 1016 c_lo_nm, code & 0xff); 1017 else if (code & (IOC_VOID|IOC_INOUT)) 1018 ioctl_ioccom(pri->code_buf, sizeof (pri->code_buf), 1019 code, c_mid, c_lo, code & 0xff); 1020 else 1021 (void) sprintf(pri->code_buf, "0x%.4X", code); 1022 str = (const char *)pri->code_buf; 1023 } 1024 1025 return (str); 1026 } 1027 1028 1029 const char * 1030 ioctldatastruct(uint_t code) 1031 { 1032 const struct ioc *ip; 1033 const char *str = NULL; 1034 1035 for (ip = &ioc[0]; ip->name != NULL; ip++) { 1036 if (code == ip->code) { 1037 str = ip->datastruct; 1038 break; 1039 } 1040 } 1041 return (str); 1042 } 1043 1044 1045 const char * 1046 fcntlname(int code) 1047 { 1048 const char *str = NULL; 1049 1050 if (code >= FCNTLMIN && code <= FCNTLMAX) 1051 str = FCNTLname[code-FCNTLMIN]; 1052 return (str); 1053 } 1054 1055 const char * 1056 sfsname(int code) 1057 { 1058 const char *str = NULL; 1059 1060 if (code >= SYSFSMIN && code <= SYSFSMAX) 1061 str = SYSFSname[code-SYSFSMIN]; 1062 return (str); 1063 } 1064 1065 const char * 1066 plockname(int code) 1067 { 1068 const char *str = NULL; 1069 1070 if (code >= PLOCKMIN && code <= PLOCKMAX) 1071 str = PLOCKname[code-PLOCKMIN]; 1072 return (str); 1073 } 1074 1075 /* ARGSUSED */ 1076 const char * 1077 si86name(int code) 1078 { 1079 const char *str = NULL; 1080 1081 #if defined(__i386) || defined(__amd64) 1082 switch (code) { 1083 case SI86SWPI: str = "SI86SWPI"; break; 1084 case SI86SYM: str = "SI86SYM"; break; 1085 case SI86CONF: str = "SI86CONF"; break; 1086 case SI86BOOT: str = "SI86BOOT"; break; 1087 case SI86AUTO: str = "SI86AUTO"; break; 1088 case SI86EDT: str = "SI86EDT"; break; 1089 case SI86SWAP: str = "SI86SWAP"; break; 1090 case SI86FPHW: str = "SI86FPHW"; break; 1091 case SI86FPSTART: str = "SI86FPSTART"; break; 1092 case GRNON: str = "GRNON"; break; 1093 case GRNFLASH: str = "GRNFLASH"; break; 1094 case STIME: str = "STIME"; break; 1095 case SETNAME: str = "SETNAME"; break; 1096 case RNVR: str = "RNVR"; break; 1097 case WNVR: str = "WNVR"; break; 1098 case RTODC: str = "RTODC"; break; 1099 case CHKSER: str = "CHKSER"; break; 1100 case SI86NVPRT: str = "SI86NVPRT"; break; 1101 case SANUPD: str = "SANUPD"; break; 1102 case SI86KSTR: str = "SI86KSTR"; break; 1103 case SI86MEM: str = "SI86MEM"; break; 1104 case SI86TODEMON: str = "SI86TODEMON"; break; 1105 case SI86CCDEMON: str = "SI86CCDEMON"; break; 1106 case SI86CACHE: str = "SI86CACHE"; break; 1107 case SI86DELMEM: str = "SI86DELMEM"; break; 1108 case SI86ADDMEM: str = "SI86ADDMEM"; break; 1109 /* 71 through 74 reserved for VPIX */ 1110 case SI86V86: str = "SI86V86"; break; 1111 case SI86SLTIME: str = "SI86SLTIME"; break; 1112 case SI86DSCR: str = "SI86DSCR"; break; 1113 case RDUBLK: str = "RDUBLK"; break; 1114 /* NFA entry point */ 1115 case SI86NFA: str = "SI86NFA"; break; 1116 case SI86VM86: str = "SI86VM86"; break; 1117 case SI86VMENABLE: str = "SI86VMENABLE"; break; 1118 case SI86LIMUSER: str = "SI86LIMUSER"; break; 1119 case SI86RDID: str = "SI86RDID"; break; 1120 case SI86RDBOOT: str = "SI86RDBOOT"; break; 1121 /* Merged Product defines */ 1122 case SI86SHFIL: str = "SI86SHFIL"; break; 1123 case SI86PCHRGN: str = "SI86PCHRGN"; break; 1124 case SI86BADVISE: str = "SI86BADVISE"; break; 1125 case SI86SHRGN: str = "SI86SHRGN"; break; 1126 case SI86CHIDT: str = "SI86CHIDT"; break; 1127 case SI86EMULRDA: str = "SI86EMULRDA"; break; 1128 } 1129 #endif /* __i386 */ 1130 1131 return (str); 1132 } 1133 1134 const char * 1135 utscode(int code) 1136 { 1137 const char *str = NULL; 1138 1139 switch (code) { 1140 case UTS_UNAME: str = "UNAME"; break; 1141 case UTS_USTAT: str = "USTAT"; break; 1142 case UTS_FUSERS: str = "FUSERS"; break; 1143 } 1144 1145 return (str); 1146 } 1147 1148 const char * 1149 rctlsyscode(int code) 1150 { 1151 const char *str = NULL; 1152 switch (code) { 1153 case 0: str = "GETRCTL"; break; 1154 case 1: str = "SETRCTL"; break; 1155 case 2: str = "RCTLSYS_LST"; break; 1156 case 3: str = "RCTLSYS_CTL"; break; 1157 default: str = "UNKNOWN"; break; 1158 } 1159 return (str); 1160 } 1161 1162 const char * 1163 rctl_local_action(private_t *pri, uint_t val) 1164 { 1165 uint_t action = val & (~RCTL_LOCAL_ACTION_MASK); 1166 1167 char *s = pri->code_buf; 1168 1169 *s = '\0'; 1170 1171 if (action & RCTL_LOCAL_NOACTION) { 1172 action ^= RCTL_LOCAL_NOACTION; 1173 (void) strlcat(s, "|RCTL_LOCAL_NOACTION", 1174 sizeof (pri->code_buf)); 1175 } 1176 if (action & RCTL_LOCAL_SIGNAL) { 1177 action ^= RCTL_LOCAL_SIGNAL; 1178 (void) strlcat(s, "|RCTL_LOCAL_SIGNAL", 1179 sizeof (pri->code_buf)); 1180 } 1181 if (action & RCTL_LOCAL_DENY) { 1182 action ^= RCTL_LOCAL_DENY; 1183 (void) strlcat(s, "|RCTL_LOCAL_DENY", 1184 sizeof (pri->code_buf)); 1185 } 1186 1187 if ((action & (~RCTL_LOCAL_ACTION_MASK)) != 0) 1188 return (NULL); 1189 else if (*s != '\0') 1190 return (s+1); 1191 else 1192 return (NULL); 1193 } 1194 1195 1196 const char * 1197 rctl_local_flags(private_t *pri, uint_t val) 1198 { 1199 uint_t pval = val & RCTL_LOCAL_ACTION_MASK; 1200 char *s = pri->code_buf; 1201 1202 *s = '\0'; 1203 1204 if (pval & RCTL_LOCAL_MAXIMAL) { 1205 pval ^= RCTL_LOCAL_MAXIMAL; 1206 (void) strlcat(s, "|RCTL_LOCAL_MAXIMAL", 1207 sizeof (pri->code_buf)); 1208 } 1209 1210 if ((pval & RCTL_LOCAL_ACTION_MASK) != 0) 1211 return (NULL); 1212 else if (*s != '\0') 1213 return (s+1); 1214 else 1215 return (NULL); 1216 } 1217 1218 1219 const char * 1220 sconfname(int code) 1221 { 1222 const char *str = NULL; 1223 1224 if (code >= SCONFMIN && code <= SCONFMAX) 1225 str = SCONFname[code-SCONFMIN]; 1226 return (str); 1227 } 1228 1229 const char * 1230 pathconfname(int code) 1231 { 1232 const char *str = NULL; 1233 1234 if (code >= PATHCONFMIN && code <= PATHCONFMAX) 1235 str = PATHCONFname[code-PATHCONFMIN]; 1236 return (str); 1237 } 1238 1239 const char * 1240 sigarg(private_t *pri, int arg) 1241 { 1242 char *str = NULL; 1243 int sig = (arg & SIGNO_MASK); 1244 1245 str = pri->code_buf; 1246 arg &= ~SIGNO_MASK; 1247 if (arg & ~(SIGDEFER|SIGHOLD|SIGRELSE|SIGIGNORE|SIGPAUSE)) 1248 (void) snprintf(pri->code_buf, sizeof (pri->code_buf), 1249 "%s|0x%X", signame(pri, sig), arg); 1250 else { 1251 (void) strcpy(str, signame(pri, sig)); 1252 if (arg & SIGDEFER) 1253 (void) strcat(str, "|SIGDEFER"); 1254 if (arg & SIGHOLD) 1255 (void) strcat(str, "|SIGHOLD"); 1256 if (arg & SIGRELSE) 1257 (void) strcat(str, "|SIGRELSE"); 1258 if (arg & SIGIGNORE) 1259 (void) strcat(str, "|SIGIGNORE"); 1260 if (arg & SIGPAUSE) 1261 (void) strcat(str, "|SIGPAUSE"); 1262 } 1263 1264 return ((const char *)str); 1265 } 1266 1267 #define ALL_O_FLAGS \ 1268 (O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\ 1269 |O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS) 1270 1271 const char * 1272 openarg(private_t *pri, int arg) 1273 { 1274 char *str = pri->code_buf; 1275 1276 switch (arg & ~ALL_O_FLAGS) { 1277 default: 1278 return ((char *)NULL); 1279 case O_RDONLY: 1280 (void) strcpy(str, "O_RDONLY"); 1281 break; 1282 case O_WRONLY: 1283 (void) strcpy(str, "O_WRONLY"); 1284 break; 1285 case O_RDWR: 1286 (void) strcpy(str, "O_RDWR"); 1287 break; 1288 } 1289 1290 if (arg & O_NDELAY) 1291 (void) strlcat(str, "|O_NDELAY", sizeof (pri->code_buf)); 1292 if (arg & O_APPEND) 1293 (void) strlcat(str, "|O_APPEND", sizeof (pri->code_buf)); 1294 if (arg & O_SYNC) 1295 (void) strlcat(str, "|O_SYNC", sizeof (pri->code_buf)); 1296 if (arg & O_DSYNC) 1297 (void) strlcat(str, "|O_DSYNC", sizeof (pri->code_buf)); 1298 if (arg & O_NONBLOCK) 1299 (void) strlcat(str, "|O_NONBLOCK", sizeof (pri->code_buf)); 1300 if (arg & O_CREAT) 1301 (void) strlcat(str, "|O_CREAT", sizeof (pri->code_buf)); 1302 if (arg & O_TRUNC) 1303 (void) strlcat(str, "|O_TRUNC", sizeof (pri->code_buf)); 1304 if (arg & O_EXCL) 1305 (void) strlcat(str, "|O_EXCL", sizeof (pri->code_buf)); 1306 if (arg & O_NOCTTY) 1307 (void) strlcat(str, "|O_NOCTTY", sizeof (pri->code_buf)); 1308 if (arg & O_LARGEFILE) 1309 (void) strlcat(str, "|O_LARGEFILE", sizeof (pri->code_buf)); 1310 if (arg & O_RSYNC) 1311 (void) strlcat(str, "|O_RSYNC", sizeof (pri->code_buf)); 1312 if (arg & O_XATTR) 1313 (void) strlcat(str, "|O_XATTR", sizeof (pri->code_buf)); 1314 if (arg & O_NOFOLLOW) 1315 (void) strlcat(str, "|O_NOFOLLOW", sizeof (pri->code_buf)); 1316 if (arg & O_NOLINKS) 1317 (void) strlcat(str, "|O_NOLINKS", sizeof (pri->code_buf)); 1318 1319 return ((const char *)str); 1320 } 1321 1322 const char * 1323 whencearg(int arg) 1324 { 1325 const char *str = NULL; 1326 1327 switch (arg) { 1328 case SEEK_SET: str = "SEEK_SET"; break; 1329 case SEEK_CUR: str = "SEEK_CUR"; break; 1330 case SEEK_END: str = "SEEK_END"; break; 1331 case SEEK_DATA: str = "SEEK_DATA"; break; 1332 case SEEK_HOLE: str = "SEEK_HOLE"; break; 1333 } 1334 1335 return (str); 1336 } 1337 1338 #define IPC_FLAGS (IPC_ALLOC|IPC_CREAT|IPC_EXCL|IPC_NOWAIT) 1339 1340 char * 1341 ipcflags(private_t *pri, int arg) 1342 { 1343 char *str = pri->code_buf; 1344 1345 if (arg & 0777) 1346 (void) sprintf(str, "0%.3o", arg&0777); 1347 else 1348 *str = '\0'; 1349 1350 if (arg & IPC_ALLOC) 1351 (void) strcat(str, "|IPC_ALLOC"); 1352 if (arg & IPC_CREAT) 1353 (void) strcat(str, "|IPC_CREAT"); 1354 if (arg & IPC_EXCL) 1355 (void) strcat(str, "|IPC_EXCL"); 1356 if (arg & IPC_NOWAIT) 1357 (void) strcat(str, "|IPC_NOWAIT"); 1358 1359 return (str); 1360 } 1361 1362 const char * 1363 msgflags(private_t *pri, int arg) 1364 { 1365 char *str; 1366 1367 if (arg == 0 || (arg & ~(IPC_FLAGS|MSG_NOERROR|0777)) != 0) 1368 return ((char *)NULL); 1369 1370 str = ipcflags(pri, arg); 1371 1372 if (arg & MSG_NOERROR) 1373 (void) strcat(str, "|MSG_NOERROR"); 1374 1375 if (*str == '|') 1376 str++; 1377 return ((const char *)str); 1378 } 1379 1380 const char * 1381 semflags(private_t *pri, int arg) 1382 { 1383 char *str; 1384 1385 if (arg == 0 || (arg & ~(IPC_FLAGS|SEM_UNDO|0777)) != 0) 1386 return ((char *)NULL); 1387 1388 str = ipcflags(pri, arg); 1389 1390 if (arg & SEM_UNDO) 1391 (void) strcat(str, "|SEM_UNDO"); 1392 1393 if (*str == '|') 1394 str++; 1395 return ((const char *)str); 1396 } 1397 1398 const char * 1399 shmflags(private_t *pri, int arg) 1400 { 1401 char *str; 1402 1403 if (arg == 0 || (arg & ~(IPC_FLAGS|SHM_RDONLY|SHM_RND|0777)) != 0) 1404 return ((char *)NULL); 1405 1406 str = ipcflags(pri, arg); 1407 1408 if (arg & SHM_RDONLY) 1409 (void) strcat(str, "|SHM_RDONLY"); 1410 if (arg & SHM_RND) 1411 (void) strcat(str, "|SHM_RND"); 1412 1413 if (*str == '|') 1414 str++; 1415 return ((const char *)str); 1416 } 1417 1418 #define MSGCMDMIN 0 1419 #define MSGCMDMAX IPC_STAT64 1420 const char *const MSGCMDname[MSGCMDMAX+1] = { 1421 NULL, NULL, NULL, NULL, NULL, 1422 NULL, NULL, NULL, NULL, NULL, 1423 "IPC_RMID", /* 10 */ 1424 "IPC_SET", /* 11 */ 1425 "IPC_STAT", /* 12 */ 1426 "IPC_SET64", /* 13 */ 1427 "IPC_STAT64", /* 14 */ 1428 }; 1429 1430 #define SEMCMDMIN 0 1431 #define SEMCMDMAX IPC_STAT64 1432 const char *const SEMCMDname[SEMCMDMAX+1] = { 1433 NULL, /* 0 */ 1434 NULL, /* 1 */ 1435 NULL, /* 2 */ 1436 "GETNCNT", /* 3 */ 1437 "GETPID", /* 4 */ 1438 "GETVAL", /* 5 */ 1439 "GETALL", /* 6 */ 1440 "GETZCNT", /* 7 */ 1441 "SETVAL", /* 8 */ 1442 "SETALL", /* 9 */ 1443 "IPC_RMID", /* 10 */ 1444 "IPC_SET", /* 11 */ 1445 "IPC_STAT", /* 12 */ 1446 "IPC_SET64", /* 13 */ 1447 "IPC_STAT64", /* 14 */ 1448 }; 1449 1450 #define SHMCMDMIN 0 1451 #define SHMCMDMAX IPC_STAT64 1452 const char *const SHMCMDname[SHMCMDMAX+1] = { 1453 NULL, /* 0 */ 1454 NULL, /* 1 */ 1455 NULL, /* 2 */ 1456 "SHM_LOCK", /* 3 */ 1457 "SHM_UNLOCK", /* 4 */ 1458 NULL, NULL, NULL, NULL, NULL, /* 5 NULLs */ 1459 "IPC_RMID", /* 10 */ 1460 "IPC_SET", /* 11 */ 1461 "IPC_STAT", /* 12 */ 1462 "IPC_SET64", /* 13 */ 1463 "IPC_STAT64", /* 14 */ 1464 }; 1465 1466 const char * 1467 msgcmd(int arg) 1468 { 1469 const char *str = NULL; 1470 1471 if (arg >= MSGCMDMIN && arg <= MSGCMDMAX) 1472 str = MSGCMDname[arg-MSGCMDMIN]; 1473 return (str); 1474 } 1475 1476 const char * 1477 semcmd(int arg) 1478 { 1479 const char *str = NULL; 1480 1481 if (arg >= SEMCMDMIN && arg <= SEMCMDMAX) 1482 str = SEMCMDname[arg-SEMCMDMIN]; 1483 return (str); 1484 } 1485 1486 const char * 1487 shmcmd(int arg) 1488 { 1489 const char *str = NULL; 1490 1491 if (arg >= SHMCMDMIN && arg <= SHMCMDMAX) 1492 str = SHMCMDname[arg-SHMCMDMIN]; 1493 return (str); 1494 } 1495 1496 const char * 1497 strrdopt(int arg) /* streams read option (I_SRDOPT I_GRDOPT) */ 1498 { 1499 const char *str = NULL; 1500 1501 switch (arg) { 1502 case RNORM: str = "RNORM"; break; 1503 case RMSGD: str = "RMSGD"; break; 1504 case RMSGN: str = "RMSGN"; break; 1505 } 1506 1507 return (str); 1508 } 1509 1510 /* bit map of streams events (I_SETSIG & I_GETSIG) */ 1511 const char * 1512 strevents(private_t *pri, int arg) 1513 { 1514 char *str = pri->code_buf; 1515 1516 if (arg & ~(S_INPUT|S_HIPRI|S_OUTPUT|S_MSG|S_ERROR|S_HANGUP)) 1517 return ((char *)NULL); 1518 1519 *str = '\0'; 1520 if (arg & S_INPUT) 1521 (void) strcat(str, "|S_INPUT"); 1522 if (arg & S_HIPRI) 1523 (void) strcat(str, "|S_HIPRI"); 1524 if (arg & S_OUTPUT) 1525 (void) strcat(str, "|S_OUTPUT"); 1526 if (arg & S_MSG) 1527 (void) strcat(str, "|S_MSG"); 1528 if (arg & S_ERROR) 1529 (void) strcat(str, "|S_ERROR"); 1530 if (arg & S_HANGUP) 1531 (void) strcat(str, "|S_HANGUP"); 1532 1533 return ((const char *)(str+1)); 1534 } 1535 1536 const char * 1537 tiocflush(private_t *pri, int arg) /* bit map passsed by TIOCFLUSH */ 1538 { 1539 char *str = pri->code_buf; 1540 1541 if (arg & ~(FREAD|FWRITE)) 1542 return ((char *)NULL); 1543 1544 *str = '\0'; 1545 if (arg & FREAD) 1546 (void) strcat(str, "|FREAD"); 1547 if (arg & FWRITE) 1548 (void) strcat(str, "|FWRITE"); 1549 1550 return ((const char *)(str+1)); 1551 } 1552 1553 const char * 1554 strflush(int arg) /* streams flush option (I_FLUSH) */ 1555 { 1556 const char *str = NULL; 1557 1558 switch (arg) { 1559 case FLUSHR: str = "FLUSHR"; break; 1560 case FLUSHW: str = "FLUSHW"; break; 1561 case FLUSHRW: str = "FLUSHRW"; break; 1562 } 1563 1564 return (str); 1565 } 1566 1567 #define ALL_MOUNT_FLAGS (MS_RDONLY|MS_FSS|MS_DATA|MS_NOSUID|MS_REMOUNT| \ 1568 MS_NOTRUNC|MS_OVERLAY|MS_OPTIONSTR|MS_GLOBAL|MS_FORCE|MS_NOMNTTAB) 1569 1570 const char * 1571 mountflags(private_t *pri, int arg) /* bit map of mount syscall flags */ 1572 { 1573 char *str = pri->code_buf; 1574 size_t used = 0; 1575 1576 if (arg & ~ALL_MOUNT_FLAGS) 1577 return ((char *)NULL); 1578 1579 *str = '\0'; 1580 if (arg & MS_RDONLY) 1581 used = strlcat(str, "|MS_RDONLY", sizeof (pri->code_buf)); 1582 if (arg & MS_FSS) 1583 used = strlcat(str, "|MS_FSS", sizeof (pri->code_buf)); 1584 if (arg & MS_DATA) 1585 used = strlcat(str, "|MS_DATA", sizeof (pri->code_buf)); 1586 if (arg & MS_NOSUID) 1587 used = strlcat(str, "|MS_NOSUID", sizeof (pri->code_buf)); 1588 if (arg & MS_REMOUNT) 1589 used = strlcat(str, "|MS_REMOUNT", sizeof (pri->code_buf)); 1590 if (arg & MS_NOTRUNC) 1591 used = strlcat(str, "|MS_NOTRUNC", sizeof (pri->code_buf)); 1592 if (arg & MS_OVERLAY) 1593 used = strlcat(str, "|MS_OVERLAY", sizeof (pri->code_buf)); 1594 if (arg & MS_OPTIONSTR) 1595 used = strlcat(str, "|MS_OPTIONSTR", sizeof (pri->code_buf)); 1596 if (arg & MS_GLOBAL) 1597 used = strlcat(str, "|MS_GLOBAL", sizeof (pri->code_buf)); 1598 if (arg & MS_FORCE) 1599 used = strlcat(str, "|MS_FORCE", sizeof (pri->code_buf)); 1600 if (arg & MS_NOMNTTAB) 1601 used = strlcat(str, "|MS_NOMNTTAB", sizeof (pri->code_buf)); 1602 1603 if (used == 0 || used >= sizeof (pri->code_buf)) 1604 return ((char *)NULL); /* use prt_hex() */ 1605 1606 return ((const char *)(str+1)); 1607 } 1608 1609 const char * 1610 svfsflags(private_t *pri, ulong_t arg) /* bit map of statvfs syscall flags */ 1611 { 1612 char *str = pri->code_buf; 1613 1614 if (arg & ~(ST_RDONLY|ST_NOSUID|ST_NOTRUNC)) { 1615 (void) sprintf(str, "0x%lx", arg); 1616 return (str); 1617 } 1618 *str = '\0'; 1619 if (arg & ST_RDONLY) 1620 (void) strcat(str, "|ST_RDONLY"); 1621 if (arg & ST_NOSUID) 1622 (void) strcat(str, "|ST_NOSUID"); 1623 if (arg & ST_NOTRUNC) 1624 (void) strcat(str, "|ST_NOTRUNC"); 1625 if (*str == '\0') 1626 (void) strcat(str, "|0"); 1627 return ((const char *)(str+1)); 1628 } 1629 1630 const char * 1631 fuiname(int arg) /* fusers() input argument */ 1632 { 1633 const char *str = NULL; 1634 1635 switch (arg) { 1636 case F_FILE_ONLY: str = "F_FILE_ONLY"; break; 1637 case F_CONTAINED: str = "F_CONTAINED"; break; 1638 } 1639 1640 return (str); 1641 } 1642 1643 const char * 1644 fuflags(private_t *pri, int arg) /* fusers() output flags */ 1645 { 1646 char *str = pri->code_buf; 1647 1648 if (arg & ~(F_CDIR|F_RDIR|F_TEXT|F_MAP|F_OPEN|F_TRACE|F_TTY)) { 1649 (void) sprintf(str, "0x%x", arg); 1650 return (str); 1651 } 1652 *str = '\0'; 1653 if (arg & F_CDIR) 1654 (void) strcat(str, "|F_CDIR"); 1655 if (arg & F_RDIR) 1656 (void) strcat(str, "|F_RDIR"); 1657 if (arg & F_TEXT) 1658 (void) strcat(str, "|F_TEXT"); 1659 if (arg & F_MAP) 1660 (void) strcat(str, "|F_MAP"); 1661 if (arg & F_OPEN) 1662 (void) strcat(str, "|F_OPEN"); 1663 if (arg & F_TRACE) 1664 (void) strcat(str, "|F_TRACE"); 1665 if (arg & F_TTY) 1666 (void) strcat(str, "|F_TTY"); 1667 if (*str == '\0') 1668 (void) strcat(str, "|0"); 1669 return ((const char *)(str+1)); 1670 } 1671 1672 1673 const char * 1674 ipprotos(int arg) /* IP protocols cf. netinet/in.h */ 1675 { 1676 switch (arg) { 1677 case IPPROTO_IP: return ("IPPROTO_IP"); 1678 case IPPROTO_ICMP: return ("IPPROTO_ICMP"); 1679 case IPPROTO_IGMP: return ("IPPROTO_IGMP"); 1680 case IPPROTO_GGP: return ("IPPROTO_GGP"); 1681 case IPPROTO_ENCAP: return ("IPPROTO_ENCAP"); 1682 case IPPROTO_TCP: return ("IPPROTO_TCP"); 1683 case IPPROTO_EGP: return ("IPPROTO_EGP"); 1684 case IPPROTO_PUP: return ("IPPROTO_PUP"); 1685 case IPPROTO_UDP: return ("IPPROTO_UDP"); 1686 case IPPROTO_IDP: return ("IPPROTO_IDP"); 1687 case IPPROTO_IPV6: return ("IPPROTO_IPV6"); 1688 case IPPROTO_ROUTING: return ("IPPROTO_ROUTING"); 1689 case IPPROTO_FRAGMENT: return ("IPPROTO_FRAGMENT"); 1690 case IPPROTO_RSVP: return ("IPPROTO_RSVP"); 1691 case IPPROTO_ESP: return ("IPPROTO_ESP"); 1692 case IPPROTO_AH: return ("IPPROTO_AH"); 1693 case IPPROTO_ICMPV6: return ("IPPROTO_ICMPV6"); 1694 case IPPROTO_NONE: return ("IPPROTO_NONE"); 1695 case IPPROTO_DSTOPTS: return ("IPPROTO_DSTOPTS"); 1696 case IPPROTO_HELLO: return ("IPPROTO_HELLO"); 1697 case IPPROTO_ND: return ("IPPROTO_ND"); 1698 case IPPROTO_EON: return ("IPPROTO_EON"); 1699 case IPPROTO_PIM: return ("IPPROTO_PIM"); 1700 case IPPROTO_SCTP: return ("IPPROTO_SCTP"); 1701 case IPPROTO_RAW: return ("IPPROTO_RAW"); 1702 default: return (NULL); 1703 } 1704 } 1705