/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2015, Joyent, Inc. All rights reserved.
* Copyright (c) 2014, OmniTI Computer Consulting, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <libproc.h>
#include <ctype.h>
#include <string.h>
#include <sys/ipc_impl.h>
#endif /* __i386 */
#include <fcntl.h>
#include <sys/sysconfig.h>
#include <sys/cpc_impl.h>
#include <sys/strredir.h>
#include <netinet/ip_mroute.h>
#include <sys/devinfo_impl.h>
#include <sys/soundcard.h>
#include "ramdata.h"
#include "proto.h"
const char *const FCNTLname[] = {
"F_DUPFD",
"F_GETFD",
"F_SETFD",
"F_GETFL",
"F_SETFL",
"F_O_GETLK",
"F_SETLK",
"F_SETLKW",
"F_CHKFL",
"F_DUP2FD",
"F_ALLOCSP",
"F_FREESP",
NULL, /* 12 */
NULL, /* 13 */
"F_GETLK",
NULL, /* 15 */
NULL, /* 16 */
NULL, /* 17 */
NULL, /* 18 */
NULL, /* 19 */
NULL, /* 20 */
NULL, /* 21 */
NULL, /* 22 */
"F_GETOWN",
"F_SETOWN",
"F_REVOKE",
"F_HASREMOTELOCKS",
"F_FREESP64",
NULL, /* 28 */
NULL, /* 29 */
NULL, /* 30 */
NULL, /* 31 */
NULL, /* 32 */
"F_GETLK64",
"F_SETLK64",
"F_SETLKW64",
"F_DUP2FD_CLOEXEC",
"F_DUPFD_CLOEXEC",
NULL, /* 38 */
NULL, /* 39 */
"F_SHARE",
"F_UNSHARE",
"F_SETLK_NBMAND",
"F_SHARE_NBMAND",
"F_SETLK64_NBMAND",
NULL, /* 45 */
"F_BADFD",
"F_OFD_GETLK",
"F_OFD_SETLK",
"F_OFD_SETLKW",
NULL, /* 50 */
NULL, /* 51 */
NULL, /* 52 */
"F_FLOCK",
"F_FLOCKW"
};
const char *const SYSFSname[] = {
"GETFSIND",
"GETFSTYP",
"GETNFSTYP"
};
const char *const SCONFname[] = {
"_CONFIG_NGROUPS", /* 2 */
"_CONFIG_CHILD_MAX", /* 3 */
"_CONFIG_OPEN_FILES", /* 4 */
"_CONFIG_POSIX_VER", /* 5 */
"_CONFIG_PAGESIZE", /* 6 */
"_CONFIG_CLK_TCK", /* 7 */
"_CONFIG_XOPEN_VER", /* 8 */
"_CONFIG_HRESCLK_TCK", /* 9 */
"_CONFIG_PROF_TCK", /* 10 */
"_CONFIG_NPROC_CONF", /* 11 */
"_CONFIG_NPROC_ONLN", /* 12 */
"_CONFIG_AIO_LISTIO_MAX", /* 13 */
"_CONFIG_AIO_MAX", /* 14 */
"_CONFIG_AIO_PRIO_DELTA_MAX", /* 15 */
"_CONFIG_DELAYTIMER_MAX", /* 16 */
"_CONFIG_MQ_OPEN_MAX", /* 17 */
"_CONFIG_MQ_PRIO_MAX", /* 18 */
"_CONFIG_RTSIG_MAX", /* 19 */
"_CONFIG_SEM_NSEMS_MAX", /* 20 */
"_CONFIG_SEM_VALUE_MAX", /* 21 */
"_CONFIG_SIGQUEUE_MAX", /* 22 */
"_CONFIG_SIGRT_MIN", /* 23 */
"_CONFIG_SIGRT_MAX", /* 24 */
"_CONFIG_TIMER_MAX", /* 25 */
"_CONFIG_PHYS_PAGES", /* 26 */
"_CONFIG_AVPHYS_PAGES", /* 27 */
"_CONFIG_COHERENCY", /* 28 */
"_CONFIG_SPLIT_CACHE", /* 29 */
"_CONFIG_ICACHESZ", /* 30 */
"_CONFIG_DCACHESZ", /* 31 */
"_CONFIG_ICACHELINESZ", /* 32 */
"_CONFIG_DCACHELINESZ", /* 33 */
"_CONFIG_ICACHEBLKSZ", /* 34 */
"_CONFIG_DCACHEBLKSZ", /* 35 */
"_CONFIG_DCACHETBLKSZ", /* 36 */
"_CONFIG_ICACHE_ASSOC", /* 37 */
"_CONFIG_DCACHE_ASSOC", /* 38 */
NULL, /* 39 */
NULL, /* 40 */
NULL, /* 41 */
"_CONFIG_MAXPID", /* 42 */
"_CONFIG_STACK_PROT", /* 43 */
"_CONFIG_NPROC_MAX", /* 44 */
"_CONFIG_CPUID_MAX", /* 45 */
"_CONFIG_SYMLOOP_MAX", /* 46 */
"_CONFIG_EPHID_MAX", /* 47 */
};
const char *const PATHCONFname[] = {
"_PC_LINK_MAX", /* 1 */
"_PC_MAX_CANON", /* 2 */
"_PC_MAX_INPUT", /* 3 */
"_PC_NAME_MAX", /* 4 */
"_PC_PATH_MAX", /* 5 */
"_PC_PIPE_BUF", /* 6 */
"_PC_NO_TRUNC", /* 7 */
"_PC_VDISABLE", /* 8 */
"_PC_CHOWN_RESTRICTED", /* 9 */
"_PC_ASYNC_IO", /* 10 */
"_PC_PRIO_IO", /* 11 */
"_PC_SYNC_IO", /* 12 */
"_PC_ALLOC_SIZE_MIN", /* 13 */
"_PC_REC_INCR_XFER_SIZE", /* 14 */
"_PC_REC_MAX_XFER_SIZE", /* 15 */
"_PC_REC_MIN_XFER_SIZE", /* 16 */
"_PC_REC_XFER_ALIGN", /* 17 */
"_PC_SYMLINK_MAX", /* 18 */
"_PC_2_SYMLINKS", /* 19 */
"_PC_ACL_ENABLED", /* 20 */
"_PC_MIN_HOLE_SIZE", /* 21 */
"_PC_CASE_BEHAVIOR", /* 22 */
"_PC_SATTR_ENABLED", /* 23 */
"_PC_SATTR_EXISTS", /* 24 */
"_PC_ACCESS_FILTERING", /* 25 */
"_PC_TIMESTAMP_RESOLUTION", /* 26 */
NULL, /* 27 */
NULL, /* 28 */
NULL, /* 29 */
NULL, /* 30 */
NULL, /* 31 */
NULL, /* 32 */
NULL, /* 33 */
NULL, /* 34 */
NULL, /* 35 */
NULL, /* 36 */
NULL, /* 37 */
NULL, /* 38 */
NULL, /* 39 */
NULL, /* 40 */
NULL, /* 41 */
NULL, /* 42 */
NULL, /* 43 */
NULL, /* 44 */
NULL, /* 45 */
NULL, /* 46 */
NULL, /* 47 */
NULL, /* 48 */
NULL, /* 49 */
NULL, /* 50 */
NULL, /* 51 */
NULL, /* 52 */
NULL, /* 53 */
NULL, /* 54 */
NULL, /* 55 */
NULL, /* 56 */
NULL, /* 57 */
NULL, /* 58 */
NULL, /* 59 */
NULL, /* 60 */
NULL, /* 61 */
NULL, /* 62 */
NULL, /* 63 */
NULL, /* 64 */
NULL, /* 65 */
NULL, /* 66 */
"_PC_FILESIZEBITS", /* 67 */
NULL, /* 68 */
NULL, /* 69 */
NULL, /* 70 */
NULL, /* 71 */
NULL, /* 72 */
NULL, /* 73 */
NULL, /* 74 */
NULL, /* 75 */
NULL, /* 76 */
NULL, /* 77 */
NULL, /* 78 */
NULL, /* 79 */
NULL, /* 80 */
NULL, /* 81 */
NULL, /* 82 */
NULL, /* 83 */
NULL, /* 84 */
NULL, /* 85 */
NULL, /* 86 */
NULL, /* 87 */
NULL, /* 88 */
NULL, /* 89 */
NULL, /* 90 */
NULL, /* 91 */
NULL, /* 92 */
NULL, /* 93 */
NULL, /* 94 */
NULL, /* 95 */
NULL, /* 96 */
NULL, /* 97 */
NULL, /* 98 */
NULL, /* 99 */
"_PC_XATTR_ENABLED", /* 100 */
"_PC_XATTR_EXISTS", /* 101, _PC_LAST */
};
const struct ioc {
const char *name;
const char *datastruct;
} ioc[] = {
/*
* Unfortunately, the DLIOC and LDIOC codes overlap. Since the LDIOC
* ioctls (for xenix compatibility) are far less likely to be used, we
* give preference to DLIOC.
*/
#ifdef DIOCGETP
#endif
#ifdef DIOCGETC
#endif
#ifdef IFFORMAT
#endif
#ifdef LIOCGETP
#endif
#ifdef JBOOT
#ifdef JTIMO
#endif
#endif
#ifdef TI_GETINFO
#endif
#ifdef TI_CAPABILITY
#endif
#ifdef TI_GETMYNAME
#endif
#ifdef V_PREAD
#endif /* !__i386 */
#endif
/* audio */
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
/* new style Boomer (OSS) ioctls */
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
/* STREAMS redirection ioctls */
/* the old /proc ioctl() control codes */
/* ioctl's applicable on sockets */
/* DES encryption */
/* Printing system */
"prn_interface_info" },
"prn_1284_device_id" },
"PRNIOC_GET_IFCANIOC_GET_1284_STATUS", NULL },
"prn_timeouts" },
"prn_timeouts" },
/* DTrace */
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
"CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE", NULL },
"CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE", NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
"CRYPTO_GET_PROVIDER_MECHANISMS", NULL },
"CRYPTO_GET_PROVIDER_MECHANISM_INFO", NULL },
"CRYPTO_NOSTORE_GENERATE_KEY", NULL },
"CRYPTO_NOSTORE_GENERATE_KEY_PAIR", NULL },
"CRYPTO_NOSTORE_DERIVE_KEY", NULL },
/* kbio ioctls */
/* aggr link aggregation pseudo driver ioctls */
"laioc_add_rem"},
"laioc_add_rem"},
/* dld data-link ioctls */
"dld_ioc_phys_attr"},
"dld_ioc_secobj_get"},
"dld_ioc_secobj_set"},
"dld_ioc_secobj_unset"},
"dld_ioc_macaddrget"},
"dld_ioc_macprop_s"},
"dld_ioc_macprop_s"},
"dld_ioc_addflow"},
"dld_ioc_removeflow"},
"dld_ioc_modifyflow"},
"dld_ioc_walkflow"},
"dld_ioc_usagelog"},
/* simnet ioctls */
"simnet_ioc_create"},
"simnet_ioc_delete"},
"simnet_ioc_info"},
"simnet_ioc_info"},
/* vnic ioctls */
"vnic_ioc_create"},
"vnic_ioc_delete"},
"vnic_ioc_info"},
/* ZFS ioctls */
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
"zfs_cmd_t" },
/* kssl ioctls */
"kssl_params_t"},
"sockaddr_in"},
/* disk ioctls - (0x04 << 8) - dkio.h */
"struct dk_geom"},
"struct dk_info"},
NULL},
"struct vtoc"},
"struct vtoc"},
"struct extvtoc"},
"struct extvtoc"},
NULL},
NULL},
NULL},
"struct dk_geom"},
"struct dk_allmap"},
"struct dk_allmap"},
"struct dk_geom"},
"struct dk_geom"},
NULL},
NULL},
NULL},
NULL},
NULL},
NULL},
NULL},
"struct part_info"},
"struct extpart_info"},
"struct dk_minfo"},
NULL},
NULL},
"struct dk_efi"},
"struct dk_efi"},
"struct partition64"},
"struct volcap_t"},
"struct volcap_t"},
"struct vol_directed_rd"},
NULL},
NULL},
NULL},
/* disk ioctls - (0x04 << 8) - fdio.h */
"struct fd_char"},
"struct fd_char"},
NULL},
NULL},
"struct fd_drive"},
"struct fd_drive"},
NULL},
NULL},
"struct fd_cmd"},
"struct fd_raw"},
NULL},
/* disk ioctls - (0x04 << 8) - cdio.h */
NULL},
NULL},
"struct cdrom_msf"},
"struct cdrom_ti"},
"struct cdrom_tochdr"},
"struct cdrom_tocentry"},
NULL},
NULL},
NULL},
"struct cdrom_volctrl"},
"struct cdrom_subchnl"},
"struct cdrom_read"},
"struct cdrom_read"},
NULL},
NULL},
NULL},
"struct cdrom_cdda"},
"struct cdrom_cdxa"},
"struct cdrom_subcode"},
NULL},
NULL},
NULL},
/* disk ioctls - (0x04 << 8) - uscsi.h */
"struct uscsi_cmd"},
/* dumpadm ioctls - (0xdd << 8) */
NULL},
/* mntio ioctls - ('m' << 8) */
NULL},
NULL},
"struct mnttagdesc"},
"struct mnttagdesc"},
NULL},
"struct mnttab"},
"struct extmnttab"},
"struct mnttab"},
/* devinfo ioctls - ('df' << 8) - devinfo_impl.h */
NULL},
NULL},
NULL},
/* zcons ioctls */
/* hid ioctls - ('h' << 8) - hid.h */
/* pm ioctls */
NULL },
"PM_GET_DEFAULT_SYSTEM_THRESHOLD", NULL },
NULL },
NULL },
NULL },
NULL },
NULL },
#ifdef _SYSCALL32
"pm_state_change32_t" },
"pm_state_change32_t" },
"pm_state_change32_t" },
"pm_state_change32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"PM_GET_DEVICE_THRESHOLD_BASIS", "pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_req32_t" },
"pm_searchargs32_t" },
#else /* _SYSCALL32 */
"pm_state_change_t" },
"pm_state_change_t" },
"pm_state_change_t" },
"pm_state_change_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"PM_GET_DEVICE_THRESHOLD_BASIS", "pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_req_t" },
"pm_searchargs_t" },
#endif /* _SYSCALL */
};
void
{
const char *inoutstr;
inoutstr = "";
inoutstr = "WR";
else
x, y, nbytes);
else
x, y, nbytes);
}
const char *
{
break;
}
}
/*
* Developers hide ascii ioctl names in the ioctl subcode; for example
* 0x445210 should be printed 'D'<<16|'R'<<8|10. We allow for all
* three high order bytes (called hi, mid and lo) to contain ascii
* characters.
*/
"(('%c'<<24)|('%c'<<16)|('%c'<<8)|%d)",
code & 0xff);
else
}
return (str);
}
const char *
{
break;
}
}
return (str);
}
const char *
{
return (str);
}
const char *
{
return (str);
}
/* ARGSUSED */
const char *
{
switch (code) {
/* 71 through 74 reserved for VPIX */
/* NFA entry point */
/* Merged Product defines */
/* RTC commands */
}
#endif /* __i386 */
return (str);
}
const char *
{
switch (code) {
}
return (str);
}
const char *
{
switch (code) {
case 0: str = "GETRCTL"; break;
default: str = "UNKNOWN"; break;
}
return (str);
}
const char *
{
*s = '\0';
if (action & RCTL_LOCAL_NOACTION) {
(void) strlcat(s, "|RCTL_LOCAL_NOACTION",
}
if (action & RCTL_LOCAL_SIGNAL) {
(void) strlcat(s, "|RCTL_LOCAL_SIGNAL",
}
if (action & RCTL_LOCAL_DENY) {
(void) strlcat(s, "|RCTL_LOCAL_DENY",
}
if ((action & (~RCTL_LOCAL_ACTION_MASK)) != 0)
return (NULL);
else if (*s != '\0')
return (s+1);
else
return (NULL);
}
const char *
{
*s = '\0';
if (pval & RCTL_LOCAL_MAXIMAL) {
(void) strlcat(s, "|RCTL_LOCAL_MAXIMAL",
}
if ((pval & RCTL_LOCAL_ACTION_MASK) != 0)
return (NULL);
else if (*s != '\0')
return (s+1);
else
return (NULL);
}
const char *
{
return (str);
}
const char *
{
return (str);
}
#define ALL_O_FLAGS \
const char *
{
return (NULL);
default:
return (NULL);
case O_RDONLY:
break;
case O_WRONLY:
break;
case O_RDWR:
break;
case O_SEARCH:
break;
case O_EXEC:
break;
}
if (arg & O_NONBLOCK)
if (arg & O_LARGEFILE)
if (arg & O_NOFOLLOW)
if (arg & FXATTRDIROPEN)
return ((const char *)str);
}
const char *
{
switch (arg) {
}
return (str);
}
char *
{
if (arg & 0777)
else
*str = '\0';
if (arg & IPC_NOWAIT)
return (str);
}
const char *
{
char *str;
return ((char *)NULL);
if (arg & MSG_NOERROR)
if (*str == '|')
str++;
return ((const char *)str);
}
const char *
{
char *str;
return ((char *)NULL);
if (*str == '|')
str++;
return ((const char *)str);
}
const char *
{
char *str;
return ((char *)NULL);
if (arg & SHM_RDONLY)
if (*str == '|')
str++;
return ((const char *)str);
}
#define MSGCMDMIN 0
"IPC_RMID", /* 10 */
"IPC_SET", /* 11 */
"IPC_STAT", /* 12 */
"IPC_SET64", /* 13 */
"IPC_STAT64", /* 14 */
};
#define SEMCMDMIN 0
NULL, /* 0 */
NULL, /* 1 */
NULL, /* 2 */
"GETNCNT", /* 3 */
"GETPID", /* 4 */
"GETVAL", /* 5 */
"GETALL", /* 6 */
"GETZCNT", /* 7 */
"SETVAL", /* 8 */
"SETALL", /* 9 */
"IPC_RMID", /* 10 */
"IPC_SET", /* 11 */
"IPC_STAT", /* 12 */
"IPC_SET64", /* 13 */
"IPC_STAT64", /* 14 */
};
#define SHMCMDMIN 0
NULL, /* 0 */
NULL, /* 1 */
NULL, /* 2 */
"SHM_LOCK", /* 3 */
"SHM_UNLOCK", /* 4 */
"IPC_RMID", /* 10 */
"IPC_SET", /* 11 */
"IPC_STAT", /* 12 */
"IPC_SET64", /* 13 */
"IPC_STAT64", /* 14 */
};
const char *
{
return (str);
}
const char *
{
return (str);
}
const char *
{
return (str);
}
const char *
{
switch (arg) {
}
return (str);
}
/* bit map of streams events (I_SETSIG & I_GETSIG) */
const char *
{
return ((char *)NULL);
*str = '\0';
return ((const char *)(str+1));
}
const char *
{
return ((char *)NULL);
*str = '\0';
return ((const char *)(str+1));
}
const char *
{
switch (arg) {
}
return (str);
}
const char *
{
if (arg & ~ALL_MOUNT_FLAGS)
return ((char *)NULL);
*str = '\0';
if (arg & MS_REMOUNT)
if (arg & MS_NOTRUNC)
if (arg & MS_OVERLAY)
if (arg & MS_OPTIONSTR)
if (arg & MS_NOMNTTAB)
return ((char *)NULL); /* use prt_hex() */
return ((const char *)(str+1));
}
const char *
{
return (str);
}
*str = '\0';
if (arg & ST_NOTRUNC)
if (*str == '\0')
return ((const char *)(str+1));
}
const char *
{
switch (arg) {
}
return (str);
}
const char *
{
return (str);
}
*str = '\0';
if (*str == '\0')
return ((const char *)(str+1));
}
const char *
{
switch (arg) {
case IPPROTO_IP: return ("IPPROTO_IP");
case IPPROTO_ICMP: return ("IPPROTO_ICMP");
case IPPROTO_IGMP: return ("IPPROTO_IGMP");
case IPPROTO_GGP: return ("IPPROTO_GGP");
case IPPROTO_ENCAP: return ("IPPROTO_ENCAP");
case IPPROTO_TCP: return ("IPPROTO_TCP");
case IPPROTO_EGP: return ("IPPROTO_EGP");
case IPPROTO_PUP: return ("IPPROTO_PUP");
case IPPROTO_UDP: return ("IPPROTO_UDP");
case IPPROTO_IDP: return ("IPPROTO_IDP");
case IPPROTO_IPV6: return ("IPPROTO_IPV6");
case IPPROTO_ROUTING: return ("IPPROTO_ROUTING");
case IPPROTO_FRAGMENT: return ("IPPROTO_FRAGMENT");
case IPPROTO_RSVP: return ("IPPROTO_RSVP");
case IPPROTO_ESP: return ("IPPROTO_ESP");
case IPPROTO_AH: return ("IPPROTO_AH");
case IPPROTO_ICMPV6: return ("IPPROTO_ICMPV6");
case IPPROTO_NONE: return ("IPPROTO_NONE");
case IPPROTO_DSTOPTS: return ("IPPROTO_DSTOPTS");
case IPPROTO_HELLO: return ("IPPROTO_HELLO");
case IPPROTO_ND: return ("IPPROTO_ND");
case IPPROTO_EON: return ("IPPROTO_EON");
case IPPROTO_PIM: return ("IPPROTO_PIM");
case IPPROTO_SCTP: return ("IPPROTO_SCTP");
case IPPROTO_RAW: return ("IPPROTO_RAW");
default: return (NULL);
}
}