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