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