Home | History | Annotate | Line # | Download | only in rump
      1 /*	$NetBSD: rumpdefs.h,v 1.38 2018/08/21 11:47:37 christos Exp $	*/
      2 
      3 /*
      4  *	AUTOMATICALLY GENERATED.  DO NOT EDIT.
      5  */
      6 
      7 #ifndef _RUMP_RUMPDEFS_H_
      8 #define _RUMP_RUMPDEFS_H_
      9 
     10 #include <rump/rump_namei.h>
     11 
     12 /*	NetBSD: fcntl.h,v 1.50 2018/02/20 18:20:05 kamil Exp 	*/
     13 #define	RUMP_O_RDONLY	0x00000000	/* open for reading only */
     14 #define	RUMP_O_WRONLY	0x00000001	/* open for writing only */
     15 #define	RUMP_O_RDWR		0x00000002	/* open for reading and writing */
     16 #define	RUMP_O_ACCMODE	0x00000003	/* mask for above modes */
     17 #define	RUMP_O_NONBLOCK	0x00000004	/* no delay */
     18 #define	RUMP_O_APPEND	0x00000008	/* set append mode */
     19 #define	RUMP_O_SHLOCK	0x00000010	/* open with shared file lock */
     20 #define	RUMP_O_EXLOCK	0x00000020	/* open with exclusive file lock */
     21 #define	RUMP_O_ASYNC		0x00000040	/* signal pgrp when data ready */
     22 #define	RUMP_O_SYNC		0x00000080	/* synchronous writes */
     23 #define	RUMP_O_NOFOLLOW	0x00000100	/* don't follow symlinks on the last */
     24 #define	RUMP_O_CREAT		0x00000200	/* create if nonexistent */
     25 #define	RUMP_O_TRUNC		0x00000400	/* truncate to zero length */
     26 #define	RUMP_O_EXCL		0x00000800	/* error if already exists */
     27 #define	RUMP_O_NOCTTY	0x00008000	/* don't assign controlling terminal */
     28 #define	RUMP_O_DSYNC		0x00010000	/* write: I/O data completion */
     29 #define	RUMP_O_RSYNC		0x00020000	/* read: I/O completion as for write */
     30 #define	RUMP_O_DIRECT	0x00080000	/* direct I/O hint */
     31 #define	RUMP_O_DIRECTORY	0x00200000	/* fail if not a directory */
     32 #define	RUMP_O_CLOEXEC	0x00400000	/* set close on exec */
     33 #define	RUMP_O_SEARCH	0x00800000	/* skip search permission checks */
     34 #define	RUMP_O_NOSIGPIPE	0x01000000	/* don't deliver sigpipe */
     35 #define	RUMP_O_REGULAR	0x02000000	/* fail if not a regular file */
     36 #define	RUMP_F_WAIT		0x010		/* Wait until lock is granted */
     37 #define	RUMP_F_FLOCK		0x020	 	/* Use flock(2) semantics for lock */
     38 #define	RUMP_F_POSIX		0x040	 	/* Use POSIX semantics for lock */
     39 #define	RUMP_F_PARAM_MASK	0xfff
     40 #define	RUMP_F_PARAM_LEN(x)	(((x) >> 16) & RUMP_F_PARAM_MASK)
     41 #define	RUMP_F_FSCTL		(int)0x80000000	/* This fcntl goes to the fs */
     42 #define	RUMP_F_FSVOID	(int)0x40000000	/* no parameters */
     43 #define	RUMP_F_FSOUT		(int)0x20000000	/* copy out parameter */
     44 #define	RUMP_F_FSIN		(int)0x10000000	/* copy in parameter */
     45 #define	RUMP_F_FSINOUT	(RUMP_F_FSIN | RUMP_F_FSOUT)
     46 #define	RUMP_F_FSDIRMASK	(int)0x70000000	/* mask for IN/OUT/VOID */
     47 #define	RUMP_F_FSPRIV	(int)0x00008000	/* command is fs-specific */
     48 #define	RUMP__FCN(inout, num, len) \
     49 		(RUMP_F_FSCTL | inout | ((len & RUMP_F_PARAM_MASK) << 16) | (num))
     50 #define	RUMP__FCNO(c)	RUMP__FCN(RUMP_F_FSVOID,	(c), 0)
     51 #define	RUMP__FCNR(c, t)	RUMP__FCN(RUMP_F_FSIN,	(c), (int)sizeof(t))
     52 #define	RUMP__FCNW(c, t)	RUMP__FCN(RUMP_F_FSOUT,	(c), (int)sizeof(t))
     53 #define	RUMP__FCNRW(c, t)	RUMP__FCN(RUMP_F_FSINOUT,	(c), (int)sizeof(t))
     54 #define	RUMP__FCN_FSPRIV(inout, fs, num, len) \
     55 	(RUMP_F_FSCTL | RUMP_F_FSPRIV | inout | ((len & RUMP_F_PARAM_MASK) << 16) |	\
     56 	 (fs) << 8 | (num))
     57 #define	RUMP__FCNO_FSPRIV(f, c)	RUMP__FCN_FSPRIV(RUMP_F_FSVOID,  (f), (c), 0)
     58 #define	RUMP__FCNR_FSPRIV(f, c, t)	RUMP__FCN_FSPRIV(RUMP_F_FSIN,    (f), (c), (int)sizeof(t))
     59 #define	RUMP__FCNW_FSPRIV(f, c, t)	RUMP__FCN_FSPRIV(RUMP_F_FSOUT,   (f), (c), (int)sizeof(t))
     60 #define	RUMP__FCNRW_FSPRIV(f, c, t)	RUMP__FCN_FSPRIV(RUMP_F_FSINOUT, (f), (c), (int)sizeof(t))
     61 
     62 /*	NetBSD: vnode.h,v 1.280 2018/04/19 21:19:07 christos Exp 	*/
     63 enum rump_vtype	{ RUMP_VNON, RUMP_VREG, RUMP_VDIR, RUMP_VBLK, RUMP_VCHR, RUMP_VLNK, RUMP_VSOCK, RUMP_VFIFO, RUMP_VBAD };
     64 #define	RUMP_LK_SHARED	0x00000001
     65 #define	RUMP_LK_EXCLUSIVE	0x00000002
     66 #define	RUMP_LK_NOWAIT	0x00000010
     67 #define	RUMP_LK_RETRY	0x00020000
     68 
     69 /*	NetBSD: errno.h,v 1.40 2013/01/02 18:51:53 dsl Exp 	*/
     70 #define	RUMP_EPERM		1		/* Operation not permitted */
     71 #define	RUMP_ENOENT		2		/* No such file or directory */
     72 #define	RUMP_ESRCH		3		/* No such process */
     73 #define	RUMP_EINTR		4		/* Interrupted system call */
     74 #define	RUMP_EIO		5		/* Input/output error */
     75 #define	RUMP_ENXIO		6		/* Device not configured */
     76 #define	RUMP_E2BIG		7		/* Argument list too long */
     77 #define	RUMP_ENOEXEC		8		/* Exec format error */
     78 #define	RUMP_EBADF		9		/* Bad file descriptor */
     79 #define	RUMP_ECHILD		10		/* No child processes */
     80 #define	RUMP_EDEADLK		11		/* Resource deadlock avoided */
     81 #define	RUMP_ENOMEM		12		/* Cannot allocate memory */
     82 #define	RUMP_EACCES		13		/* Permission denied */
     83 #define	RUMP_EFAULT		14		/* Bad address */
     84 #define	RUMP_ENOTBLK		15		/* Block device required */
     85 #define	RUMP_EBUSY		16		/* Device busy */
     86 #define	RUMP_EEXIST		17		/* File exists */
     87 #define	RUMP_EXDEV		18		/* Cross-device link */
     88 #define	RUMP_ENODEV		19		/* Operation not supported by device */
     89 #define	RUMP_ENOTDIR		20		/* Not a directory */
     90 #define	RUMP_EISDIR		21		/* Is a directory */
     91 #define	RUMP_EINVAL		22		/* Invalid argument */
     92 #define	RUMP_ENFILE		23		/* Too many open files in system */
     93 #define	RUMP_EMFILE		24		/* Too many open files */
     94 #define	RUMP_ENOTTY		25		/* Inappropriate ioctl for device */
     95 #define	RUMP_ETXTBSY		26		/* Text file busy */
     96 #define	RUMP_EFBIG		27		/* File too large */
     97 #define	RUMP_ENOSPC		28		/* No space left on device */
     98 #define	RUMP_ESPIPE		29		/* Illegal seek */
     99 #define	RUMP_EROFS		30		/* Read-only file system */
    100 #define	RUMP_EMLINK		31		/* Too many links */
    101 #define	RUMP_EPIPE		32		/* Broken pipe */
    102 #define	RUMP_EDOM		33		/* Numerical argument out of domain */
    103 #define	RUMP_ERANGE		34		/* Result too large or too small */
    104 #define	RUMP_EAGAIN		35		/* Resource temporarily unavailable */
    105 #define	RUMP_EWOULDBLOCK	RUMP_EAGAIN		/* Operation would block */
    106 #define	RUMP_EINPROGRESS	36		/* Operation now in progress */
    107 #define	RUMP_EALREADY	37		/* Operation already in progress */
    108 #define	RUMP_ENOTSOCK	38		/* Socket operation on non-socket */
    109 #define	RUMP_EDESTADDRREQ	39		/* Destination address required */
    110 #define	RUMP_EMSGSIZE	40		/* Message too long */
    111 #define	RUMP_EPROTOTYPE	41		/* Protocol wrong type for socket */
    112 #define	RUMP_ENOPROTOOPT	42		/* Protocol option not available */
    113 #define	RUMP_EPROTONOSUPPORT	43		/* Protocol not supported */
    114 #define	RUMP_ESOCKTNOSUPPORT	44		/* Socket type not supported */
    115 #define	RUMP_EOPNOTSUPP	45		/* Operation not supported */
    116 #define	RUMP_EPFNOSUPPORT	46		/* Protocol family not supported */
    117 #define	RUMP_EAFNOSUPPORT	47		/* Address family not supported by protocol family */
    118 #define	RUMP_EADDRINUSE	48		/* Address already in use */
    119 #define	RUMP_EADDRNOTAVAIL	49		/* Can't assign requested address */
    120 #define	RUMP_ENETDOWN	50		/* Network is down */
    121 #define	RUMP_ENETUNREACH	51		/* Network is unreachable */
    122 #define	RUMP_ENETRESET	52		/* Network dropped connection on reset */
    123 #define	RUMP_ECONNABORTED	53		/* Software caused connection abort */
    124 #define	RUMP_ECONNRESET	54		/* Connection reset by peer */
    125 #define	RUMP_ENOBUFS		55		/* No buffer space available */
    126 #define	RUMP_EISCONN		56		/* Socket is already connected */
    127 #define	RUMP_ENOTCONN	57		/* Socket is not connected */
    128 #define	RUMP_ESHUTDOWN	58		/* Can't send after socket shutdown */
    129 #define	RUMP_ETOOMANYREFS	59		/* Too many references: can't splice */
    130 #define	RUMP_ETIMEDOUT	60		/* Operation timed out */
    131 #define	RUMP_ECONNREFUSED	61		/* Connection refused */
    132 #define	RUMP_ELOOP		62		/* Too many levels of symbolic links */
    133 #define	RUMP_ENAMETOOLONG	63		/* File name too long */
    134 #define	RUMP_EHOSTDOWN	64		/* Host is down */
    135 #define	RUMP_EHOSTUNREACH	65		/* No route to host */
    136 #define	RUMP_ENOTEMPTY	66		/* Directory not empty */
    137 #define	RUMP_EPROCLIM	67		/* Too many processes */
    138 #define	RUMP_EUSERS		68		/* Too many users */
    139 #define	RUMP_EDQUOT		69		/* Disc quota exceeded */
    140 #define	RUMP_ESTALE		70		/* Stale NFS file handle */
    141 #define	RUMP_EREMOTE		71		/* Too many levels of remote in path */
    142 #define	RUMP_EBADRPC		72		/* RPC struct is bad */
    143 #define	RUMP_ERPCMISMATCH	73		/* RPC version wrong */
    144 #define	RUMP_EPROGUNAVAIL	74		/* RPC prog. not avail */
    145 #define	RUMP_EPROGMISMATCH	75		/* Program version wrong */
    146 #define	RUMP_EPROCUNAVAIL	76		/* Bad procedure for program */
    147 #define	RUMP_ENOLCK		77		/* No locks available */
    148 #define	RUMP_ENOSYS		78		/* Function not implemented */
    149 #define	RUMP_EFTYPE		79		/* Inappropriate file type or format */
    150 #define	RUMP_EAUTH		80		/* Authentication error */
    151 #define	RUMP_ENEEDAUTH	81		/* Need authenticator */
    152 #define	RUMP_EIDRM		82		/* Identifier removed */
    153 #define	RUMP_ENOMSG		83		/* No message of desired type */
    154 #define	RUMP_EOVERFLOW	84		/* Value too large to be stored in data type */
    155 #define	RUMP_EILSEQ		85		/* Illegal byte sequence */
    156 #define RUMP_ENOTSUP		86		/* Not supported */
    157 #define RUMP_ECANCELED	87		/* Operation canceled */
    158 #define RUMP_EBADMSG		88		/* Bad or Corrupt message */
    159 #define RUMP_ENODATA		89		/* No message available */
    160 #define RUMP_ENOSR		90		/* No STREAM resources */
    161 #define RUMP_ENOSTR		91		/* Not a STREAM */
    162 #define RUMP_ETIME		92		/* STREAM ioctl timeout */
    163 #define	RUMP_ENOATTR		93		/* Attribute not found */
    164 #define	RUMP_EMULTIHOP	94		/* Multihop attempted */
    165 #define	RUMP_ENOLINK		95		/* Link has been severed */
    166 #define	RUMP_EPROTO		96		/* Protocol error */
    167 #define	RUMP_ELAST		96		/* Must equal largest errno */
    168 #define	RUMP_EJUSTRETURN	-2		/* don't modify regs, just return */
    169 #define	RUMP_ERESTART	-3		/* restart syscall */
    170 #define	RUMP_EPASSTHROUGH	-4		/* ioctl not handled by this layer */
    171 #define	RUMP_EDUPFD		-5		/* Dup given fd */
    172 #define	RUMP_EMOVEFD		-6		/* Move given fd */
    173 
    174 /*	NetBSD: reboot.h,v 1.25 2007/12/25 18:33:48 perry Exp 	*/
    175 #define	RUMP_RB_AUTOBOOT	0
    176 #define	RUMP_RB_ASKNAME	0x00000001
    177 #define	RUMP_RB_SINGLE	0x00000002
    178 #define	RUMP_RB_NOSYNC	0x00000004
    179 #define	RUMP_RB_HALT		0x00000008
    180 #define	RUMP_RB_INITNAME	0x00000010
    181 #define	__RUMP_RB_UNUSED1	0x00000020
    182 #define	RUMP_RB_KDB		0x00000040
    183 #define	RUMP_RB_RDONLY	0x00000080
    184 #define	RUMP_RB_DUMP		0x00000100
    185 #define	RUMP_RB_MINIROOT	0x00000200
    186 #define	RUMP_RB_STRING	0x00000400
    187 #define	RUMP_RB_POWERDOWN	(RUMP_RB_HALT|0x800)
    188 #define RUMP_RB_USERCONF	0x00001000
    189 #define	RUMP_RB_MD1		0x10000000
    190 #define	RUMP_RB_MD2		0x20000000
    191 #define	RUMP_RB_MD3		0x40000000
    192 #define	RUMP_RB_MD4		0x80000000
    193 #define	RUMP_AB_NORMAL	0x00000000
    194 #define	RUMP_AB_QUIET	0x00010000
    195 #define	RUMP_AB_VERBOSE	0x00020000
    196 #define	RUMP_AB_SILENT	0x00040000
    197 #define	RUMP_AB_DEBUG	0x00080000
    198 
    199 /*	NetBSD: socket.h,v 1.126 2018/07/31 13:20:34 rjs Exp 	*/
    200 #define	RUMP_SOCK_STREAM	1
    201 #define	RUMP_SOCK_DGRAM	2
    202 #define	RUMP_SOCK_RAW	3
    203 #define	RUMP_SOCK_RDM	4
    204 #define	RUMP_SOCK_SEQPACKET	5
    205 #define	RUMP_SOCK_CONN_DGRAM	6
    206 #define	RUMP_SOCK_DCCP	RUMP_SOCK_CONN_DGRAM
    207 #define	RUMP_SOCK_CLOEXEC	0x10000000
    208 #define	RUMP_SOCK_NONBLOCK	0x20000000
    209 #define	RUMP_SOCK_NOSIGPIPE	0x40000000
    210 #define	RUMP_SOCK_FLAGS_MASK	0xf0000000
    211 #define	RUMP_AF_UNSPEC	0
    212 #define	RUMP_AF_LOCAL	1
    213 #define	RUMP_AF_UNIX		RUMP_AF_LOCAL
    214 #define	RUMP_AF_INET		2
    215 #define	RUMP_AF_IMPLINK	3
    216 #define	RUMP_AF_PUP		4
    217 #define	RUMP_AF_CHAOS	5
    218 #define	RUMP_AF_NS		6
    219 #define	RUMP_AF_ISO		7
    220 #define	RUMP_AF_OSI		RUMP_AF_ISO
    221 #define	RUMP_AF_ECMA		8
    222 #define	RUMP_AF_DATAKIT	9
    223 #define	RUMP_AF_CCITT	10
    224 #define	RUMP_AF_SNA		11
    225 #define RUMP_AF_DECnet	12
    226 #define RUMP_AF_DLI		13
    227 #define RUMP_AF_LAT		14
    228 #define	RUMP_AF_HYLINK	15
    229 #define	RUMP_AF_APPLETALK	16
    230 #define	RUMP_AF_OROUTE	17
    231 #define	RUMP_AF_LINK		18
    232 #define	RUMP_AF_COIP		20
    233 #define	RUMP_AF_CNT		21
    234 #define	RUMP_AF_IPX		23
    235 #define	RUMP_AF_INET6	24
    236 #define RUMP_AF_ISDN		26
    237 #define RUMP_AF_E164		RUMP_AF_ISDN
    238 #define RUMP_AF_NATM		27
    239 #define RUMP_AF_ARP		28
    240 #define RUMP_AF_BLUETOOTH	31
    241 #define	RUMP_AF_IEEE80211	32
    242 #define	RUMP_AF_MPLS		33
    243 #define	RUMP_AF_ROUTE	34
    244 #define	RUMP_AF_CAN		35
    245 #define	RUMP_AF_ETHER	36
    246 #define	RUMP_AF_MAX		37
    247 #define	RUMP_PF_UNSPEC	RUMP_AF_UNSPEC
    248 #define	RUMP_PF_LOCAL	RUMP_AF_LOCAL
    249 #define	RUMP_PF_UNIX		RUMP_PF_LOCAL
    250 #define	RUMP_PF_INET		RUMP_AF_INET
    251 #define	RUMP_PF_IMPLINK	RUMP_AF_IMPLINK
    252 #define	RUMP_PF_PUP		RUMP_AF_PUP
    253 #define	RUMP_PF_CHAOS	RUMP_AF_CHAOS
    254 #define	RUMP_PF_NS		RUMP_AF_NS
    255 #define	RUMP_PF_ISO		RUMP_AF_ISO
    256 #define	RUMP_PF_OSI		RUMP_AF_ISO
    257 #define	RUMP_PF_ECMA		RUMP_AF_ECMA
    258 #define	RUMP_PF_DATAKIT	RUMP_AF_DATAKIT
    259 #define	RUMP_PF_CCITT	RUMP_AF_CCITT
    260 #define	RUMP_PF_SNA		RUMP_AF_SNA
    261 #define RUMP_PF_DECnet	RUMP_AF_DECnet
    262 #define RUMP_PF_DLI		RUMP_AF_DLI
    263 #define RUMP_PF_LAT		RUMP_AF_LAT
    264 #define	RUMP_PF_HYLINK	RUMP_AF_HYLINK
    265 #define	RUMP_PF_APPLETALK	RUMP_AF_APPLETALK
    266 #define	RUMP_PF_OROUTE	RUMP_AF_OROUTE
    267 #define	RUMP_PF_LINK		RUMP_AF_LINK
    268 #define	RUMP_PF_XTP		pseudo_RUMP_AF_XTP
    269 #define	RUMP_PF_COIP		RUMP_AF_COIP
    270 #define	RUMP_PF_CNT		RUMP_AF_CNT
    271 #define	RUMP_PF_INET6	RUMP_AF_INET6
    272 #define	RUMP_PF_IPX		RUMP_AF_IPX
    273 #define RUMP_PF_RTIP		pseudo_RUMP_AF_RTIP
    274 #define RUMP_PF_PIP		pseudo_RUMP_AF_PIP
    275 #define RUMP_PF_ISDN		RUMP_AF_ISDN
    276 #define RUMP_PF_E164		RUMP_AF_E164
    277 #define RUMP_PF_NATM		RUMP_AF_NATM
    278 #define RUMP_PF_ARP		RUMP_AF_ARP
    279 #define RUMP_PF_KEY 		pseudo_RUMP_AF_KEY
    280 #define RUMP_PF_BLUETOOTH	RUMP_AF_BLUETOOTH
    281 #define	RUMP_PF_MPLS		RUMP_AF_MPLS
    282 #define	RUMP_PF_ROUTE	RUMP_AF_ROUTE
    283 #define	RUMP_PF_CAN		RUMP_AF_CAN
    284 #define	RUMP_PF_ETHER	RUMP_AF_ETHER
    285 #define	RUMP_PF_MAX		RUMP_AF_MAX
    286 #define	RUMP_SO_DEBUG	0x0001
    287 #define	RUMP_SO_ACCEPTCONN	0x0002
    288 #define	RUMP_SO_REUSEADDR	0x0004
    289 #define	RUMP_SO_KEEPALIVE	0x0008
    290 #define	RUMP_SO_DONTROUTE	0x0010
    291 #define	RUMP_SO_BROADCAST	0x0020
    292 #define	RUMP_SO_USELOOPBACK	0x0040
    293 #define	RUMP_SO_LINGER	0x0080
    294 #define	RUMP_SO_OOBINLINE	0x0100
    295 #define	RUMP_SO_REUSEPORT	0x0200
    296 #define	RUMP_SO_NOSIGPIPE	0x0800
    297 #define	RUMP_SO_ACCEPTFILTER	0x1000
    298 #define	RUMP_SO_TIMESTAMP	0x2000
    299 #define RUMP_SO_SNDBUF	0x1001
    300 #define RUMP_SO_RCVBUF	0x1002
    301 #define RUMP_SO_SNDLOWAT	0x1003
    302 #define RUMP_SO_RCVLOWAT	0x1004
    303 #define	RUMP_SO_ERROR	0x1007
    304 #define	RUMP_SO_TYPE		0x1008
    305 #define	RUMP_SO_OVERFLOWED	0x1009
    306 #define	RUMP_SO_NOHEADER	0x100a
    307 #define RUMP_SO_SNDTIMEO	0x100b
    308 #define RUMP_SO_RCVTIMEO	0x100c
    309 #define	RUMP_SOL_SOCKET	0xffff
    310 #define	RUMP_MSG_OOB		0x0001
    311 #define	RUMP_MSG_PEEK	0x0002
    312 #define	RUMP_MSG_DONTROUTE	0x0004
    313 #define	RUMP_MSG_EOR		0x0008
    314 #define	RUMP_MSG_TRUNC	0x0010
    315 #define	RUMP_MSG_CTRUNC	0x0020
    316 #define	RUMP_MSG_WAITALL	0x0040
    317 #define	RUMP_MSG_DONTWAIT	0x0080
    318 #define	RUMP_MSG_BCAST	0x0100
    319 #define	RUMP_MSG_MCAST	0x0200
    320 #define	RUMP_MSG_NOSIGNAL	0x0400
    321 #define	RUMP_MSG_CRUMP_MSG_CLOEXEC 0x0800
    322 #define	RUMP_MSG_NBIO	0x1000
    323 #define	RUMP_MSG_WAITFORONE	0x2000
    324 #define	RUMP_MSG_NOTIFICATION 0x4000
    325 #define	RUMP_MSG_USERFLAGS	0x0ffffff
    326 #define RUMP_MSG_NAMEMBUF	0x1000000
    327 #define RUMP_MSG_CONTROLMBUF	0x2000000
    328 #define RUMP_MSG_IOVUSRSPACE	0x4000000
    329 #define RUMP_MSG_LENUSRSPACE	0x8000000
    330 
    331 /*	NetBSD: in.h,v 1.106 2018/07/11 05:25:45 maxv Exp 	*/
    332 #define	RUMP_IP_OPTIONS		1
    333 #define	RUMP_IP_HDRINCL		2
    334 #define	RUMP_IP_TOS			3
    335 #define	RUMP_IP_TTL			4
    336 #define	RUMP_IP_RECVOPTS		5
    337 #define	RUMP_IP_RECVRETOPTS		6
    338 #define	RUMP_IP_RECVDSTADDR		7
    339 #define	RUMP_IP_RETOPTS		8
    340 #define	RUMP_IP_MULTICAST_IF		9
    341 #define	RUMP_IP_MULTICAST_TTL	10
    342 #define	RUMP_IP_MULTICAST_LOOP	11
    343 #define	RUMP_IP_ADD_MEMBERSHIP	12
    344 #define	RUMP_IP_DROP_MEMBERSHIP	13
    345 #define	RUMP_IP_PORTALGO		18
    346 #define	RUMP_IP_PORTRANGE		19
    347 #define	RUMP_IP_RECVIF		20
    348 #define	RUMP_IP_ERRORMTU		21
    349 #define	RUMP_IP_IPSEC_POLICY		22
    350 #define	RUMP_IP_RECVTTL		23
    351 #define	RUMP_IP_MINTTL		24
    352 #define	RUMP_IP_PKTINFO		25
    353 #define	RUMP_IP_RECVPKTINFO		26
    354 #define RUMP_IP_SENDSRCADDR RUMP_IP_RECVDSTADDR
    355 #define	RUMP_IP_DEFAULT_MULTICAST_TTL  1
    356 #define	RUMP_IP_DEFAULT_MULTICAST_LOOP 1
    357 #define	RUMP_IP_MAX_MEMBERSHIPS	20
    358 #define	RUMP_IP_PORTRANGE_DEFAULT	0
    359 #define	RUMP_IP_PORTRANGE_HIGH	1
    360 #define	RUMP_IP_PORTRANGE_LOW	2
    361 #define	RUMP_IPPROTO_IP		0
    362 #define	RUMP_IPPROTO_HOPOPTS		0
    363 #define	RUMP_IPPROTO_ICMP		1
    364 #define	RUMP_IPPROTO_IGMP		2
    365 #define	RUMP_IPPROTO_GGP		3
    366 #define	RUMP_IPPROTO_IPV4		4
    367 #define	RUMP_IPPROTO_IPIP		4
    368 #define	RUMP_IPPROTO_TCP		6
    369 #define	RUMP_IPPROTO_EGP		8
    370 #define	RUMP_IPPROTO_PUP		12
    371 #define	RUMP_IPPROTO_UDP		17
    372 #define	RUMP_IPPROTO_IDP		22
    373 #define	RUMP_IPPROTO_TP		29
    374 #define	RUMP_IPPROTO_DCCP		33
    375 #define	RUMP_IPPROTO_IPV6		41
    376 #define	RUMP_IPPROTO_ROUTING		43
    377 #define	RUMP_IPPROTO_FRAGMENT	44
    378 #define	RUMP_IPPROTO_RSVP		46
    379 #define	RUMP_IPPROTO_GRE		47
    380 #define	RUMP_IPPROTO_ESP		50
    381 #define	RUMP_IPPROTO_AH		51
    382 #define	RUMP_IPPROTO_MOBILE		55
    383 #define	RUMP_IPPROTO_IPV6_ICMP	58
    384 #define	RUMP_IPPROTO_ICMPV6		58
    385 #define	RUMP_IPPROTO_NONE		59
    386 #define	RUMP_IPPROTO_DSTOPTS		60
    387 #define	RUMP_IPPROTO_EON		80
    388 #define	RUMP_IPPROTO_ETHERIP		97
    389 #define	RUMP_IPPROTO_ENCAP		98
    390 #define	RUMP_IPPROTO_PIM		103
    391 #define	RUMP_IPPROTO_IPCOMP		108
    392 #define	RUMP_IPPROTO_VRRP		112
    393 #define	RUMP_IPPROTO_CARP		112
    394 #define	RUMP_IPPROTO_L2TP		115
    395 #define	RUMP_IPPROTO_SCTP		132
    396 #define RUMP_IPPROTO_PFSYNC      240
    397 #define	RUMP_IPPROTO_RAW		255
    398 #define	RUMP_IPPROTO_MAX		256
    399 #define	RUMP_IPPROTO_DONE		257
    400 #define	RUMP_IPPROTO_MAXID	(RUMP_IPPROTO_AH + 1)
    401 
    402 /*	NetBSD: tcp.h,v 1.33 2017/01/10 20:32:27 christos Exp 	*/
    403 #define	RUMP_TCP_MSS		536
    404 #define	RUMP_TCP_MINMSS	216
    405 #define	RUMP_TCP_MAXWIN	65535
    406 #define	RUMP_TCP_MAX_WINSHIFT	14
    407 #define	RUMP_TCP_MAXBURST	4
    408 #define	RUMP_TCP_NODELAY	1
    409 #define	RUMP_TCP_MAXSEG	2
    410 #define	RUMP_TCP_KEEPIDLE	3
    411 #define	RUMP_TCP_NOPUSH	4
    412 #define	RUMP_TCP_KEEPINTVL	5
    413 #define	RUMP_TCP_KEEPCNT	6
    414 #define	RUMP_TCP_KEEPINIT	7
    415 #define	RUMP_TCP_NOOPT	8
    416 #define	RUMP_TCP_INFO	9
    417 #define	RUMP_TCP_MD5SIG	0x10
    418 #define	RUMP_TCP_CONGCTL	0x20
    419 
    420 /*	NetBSD: mount.h,v 1.230 2018/01/09 03:31:13 christos Exp 	*/
    421 #define	RUMP_MOUNT_FFS	"ffs"
    422 #define	RUMP_MOUNT_UFS	RUMP_MOUNT_FFS
    423 #define	RUMP_MOUNT_NFS	"nfs"
    424 #define	RUMP_MOUNT_MFS	"mfs"
    425 #define	RUMP_MOUNT_MSDOS	"msdos"
    426 #define	RUMP_MOUNT_LFS	"lfs"
    427 #define	RUMP_MOUNT_FDESC	"fdesc"
    428 #define	RUMP_MOUNT_NULL	"null"
    429 #define	RUMP_MOUNT_OVERLAY	"overlay"
    430 #define	RUMP_MOUNT_UMAP	"umap"
    431 #define	RUMP_MOUNT_KERNFS	"kernfs"
    432 #define	RUMP_MOUNT_PROCFS	"procfs"
    433 #define	RUMP_MOUNT_AFS	"afs"
    434 #define	RUMP_MOUNT_CD9660	"cd9660"
    435 #define	RUMP_MOUNT_UNION	"union"
    436 #define	RUMP_MOUNT_ADOSFS	"adosfs"
    437 #define	RUMP_MOUNT_EXT2FS	"ext2fs"
    438 #define	RUMP_MOUNT_CFS	"coda"
    439 #define	RUMP_MOUNT_CODA	RUMP_MOUNT_CFS
    440 #define	RUMP_MOUNT_FILECORE	"filecore"
    441 #define	RUMP_MOUNT_NTFS	"ntfs"
    442 #define	RUMP_MOUNT_SMBFS	"smbfs"
    443 #define	RUMP_MOUNT_PTYFS	"ptyfs"
    444 #define	RUMP_MOUNT_TMPFS	"tmpfs"
    445 #define RUMP_MOUNT_UDF	"udf"
    446 #define	RUMP_MOUNT_SYSVBFS	"sysvbfs"
    447 #define RUMP_MOUNT_PUFFS	"puffs"
    448 #define RUMP_MOUNT_HFS	"hfs"
    449 #define RUMP_MOUNT_EFS	"efs"
    450 #define RUMP_MOUNT_ZFS	"zfs"
    451 #define RUMP_MOUNT_NILFS	"nilfs"
    452 #define RUMP_MOUNT_RUMPFS	"rumpfs"
    453 #define RUMP_MOUNT_V7FS	"v7fs"
    454 #define RUMP_MOUNT_AUTOFS	"autofs"
    455 
    456 /*	NetBSD: fstypes.h,v 1.36 2018/01/09 03:31:13 christos Exp 	*/
    457 #define	RUMP_MNT_RDONLY	0x00000001
    458 #define	RUMP_MNT_SYNCHRONOUS	0x00000002
    459 #define	RUMP_MNT_NOEXEC	0x00000004
    460 #define	RUMP_MNT_NOSUID	0x00000008
    461 #define	RUMP_MNT_NODEV	0x00000010
    462 #define	RUMP_MNT_UNION	0x00000020
    463 #define	RUMP_MNT_ASYNC	0x00000040
    464 #define	RUMP_MNT_NOCOREDUMP	0x00008000
    465 #define	RUMP_MNT_RELATIME	0x00020000
    466 #define	RUMP_MNT_IGNORE	0x00100000
    467 #define	RUMP_MNT_DISCARD	0x00800000
    468 #define	RUMP_MNT_EXTATTR	0x01000000
    469 #define	RUMP_MNT_LOG		0x02000000
    470 #define	RUMP_MNT_NOATIME	0x04000000
    471 #define	RUMP_MNT_AUTOMOUNTED 0x10000000
    472 #define	RUMP_MNT_SYMPERM	0x20000000
    473 #define	RUMP_MNT_NODEVMTIME	0x40000000
    474 #define	RUMP_MNT_SOFTDEP	0x80000000
    475 #define	RUMP_MNT_EXRDONLY	0x00000080
    476 #define	RUMP_MNT_EXPORTED	0x00000100
    477 #define	RUMP_MNT_DEFEXPORTED	0x00000200
    478 #define	RUMP_MNT_EXPORTANON	0x00000400
    479 #define	RUMP_MNT_EXKERB	0x00000800
    480 #define	RUMP_MNT_EXNORESPORT	0x08000000
    481 #define	RUMP_MNT_EXPUBLIC	0x10000000
    482 #define	RUMP_MNT_LOCAL	0x00001000
    483 #define	RUMP_MNT_QUOTA	0x00002000
    484 #define	RUMP_MNT_ROOTFS	0x00004000
    485 #define	RUMP_MNT_UPDATE	0x00010000
    486 #define	RUMP_MNT_RELOAD	0x00040000
    487 #define	RUMP_MNT_FORCE	0x00080000
    488 #define	RUMP_MNT_GETARGS	0x00400000
    489 #define	RUMP_MNT_OP_FLAGS	(RUMP_MNT_UPDATE|RUMP_MNT_RELOAD|RUMP_MNT_FORCE|RUMP_MNT_GETARGS)
    490 #define	RUMP_MNT_WAIT	1
    491 #define	RUMP_MNT_NOWAIT	2
    492 #define	RUMP_MNT_LAZY 	3
    493 
    494 /*	NetBSD: ioccom.h,v 1.12 2014/12/10 00:16:05 christos Exp 	*/
    495 #define	RUMP_IOCPARM_MASK	0x1fff
    496 #define	RUMP_IOCPARM_SHIFT	16
    497 #define	RUMP_IOCGROUP_SHIFT	8
    498 #define	RUMP_IOCPARM_LEN(x)	(((x) >> RUMP_IOCPARM_SHIFT) & RUMP_IOCPARM_MASK)
    499 #define	RUMP_IOCBASECMD(x)	((x) & ~(RUMP_IOCPARM_MASK << RUMP_IOCPARM_SHIFT))
    500 #define	RUMP_IOCGROUP(x)	(((x) >> RUMP_IOCGROUP_SHIFT) & 0xff)
    501 #define	RUMP_IOCPARM_MAX	NBPG
    502 #define	RUMP_IOC_VOID	(unsigned long)0x20000000
    503 #define	RUMP_IOC_OUT		(unsigned long)0x40000000
    504 #define	RUMP_IOC_IN		(unsigned long)0x80000000
    505 #define	RUMP_IOC_INOUT	(RUMP_IOC_IN|RUMP_IOC_OUT)
    506 #define	RUMP_IOC_DIRMASK	(unsigned long)0xe0000000
    507 #define	_RUMP_IOC(inout, group, num, len) \
    508     ((inout) | (((len) & RUMP_IOCPARM_MASK) << RUMP_IOCPARM_SHIFT) | \
    509     ((group) << RUMP_IOCGROUP_SHIFT) | (num))
    510 #define	_RUMP_IO(g,n)	_RUMP_IOC(RUMP_IOC_VOID,	(g), (n), 0)
    511 #define	_RUMP_IOR(g,n,t)	_RUMP_IOC(RUMP_IOC_OUT,	(g), (n), sizeof(t))
    512 #define	_RUMP_IOW(g,n,t)	_RUMP_IOC(RUMP_IOC_IN,	(g), (n), sizeof(t))
    513 #define	_RUMP_IOWR(g,n,t)	_RUMP_IOC(RUMP_IOC_INOUT,	(g), (n), sizeof(t))
    514 
    515 /*	NetBSD: ktrace.h,v 1.66 2018/04/19 21:19:07 christos Exp 	*/
    516 #define RUMP_KTROP_SET		0
    517 #define RUMP_KTROP_CLEAR		1
    518 #define RUMP_KTROP_CLEARFILE		2
    519 #define	RUMP_KTROP_MASK		0x3
    520 #define	RUMP_KTR_SHIMLEN	offsetof(struct ktr_header, ktr_pid)
    521 #define RUMP_KTR_SYSCALL	1
    522 #define RUMP_KTR_SYSRET	2
    523 #define RUMP_KTR_NAMEI	3
    524 #define RUMP_KTR_GENIO	4
    525 #define	RUMP_KTR_PSIG	5
    526 #define RUMP_KTR_CSW		6
    527 #define RUMP_KTR_EMUL	7
    528 #define	RUMP_KTR_USER	8
    529 #define RUMP_KTR_USER_MAXIDLEN	20
    530 #define RUMP_KTR_USER_MAXLEN		2048
    531 #define RUMP_KTR_EXEC_ARG		10
    532 #define RUMP_KTR_EXEC_ENV		11
    533 #define	RUMP_KTR_SAUPCALL	13
    534 #define RUMP_KTR_MIB		14
    535 #define RUMP_KTR_EXEC_FD		15
    536 #define RUMP_KTRFAC_MASK	0x00ffffff
    537 #define RUMP_KTRFAC_SYSCALL	(1<<RUMP_KTR_SYSCALL)
    538 #define RUMP_KTRFAC_SYSRET	(1<<RUMP_KTR_SYSRET)
    539 #define RUMP_KTRFAC_NAMEI	(1<<RUMP_KTR_NAMEI)
    540 #define RUMP_KTRFAC_GENIO	(1<<RUMP_KTR_GENIO)
    541 #define	RUMP_KTRFAC_PSIG	(1<<RUMP_KTR_PSIG)
    542 #define RUMP_KTRFAC_CSW	(1<<RUMP_KTR_CSW)
    543 #define RUMP_KTRFAC_EMUL	(1<<RUMP_KTR_EMUL)
    544 #define	RUMP_KTRFAC_USER	(1<<RUMP_KTR_USER)
    545 #define RUMP_KTRFAC_EXEC_ARG	(1<<RUMP_KTR_EXEC_ARG)
    546 #define RUMP_KTRFAC_EXEC_ENV	(1<<RUMP_KTR_EXEC_ENV)
    547 #define	RUMP_KTRFAC_MIB	(1<<RUMP_KTR_MIB)
    548 #define	RUMP_KTRFAC_EXEC_FD	(1<<RUMP_KTR_EXEC_FD)
    549 #define RUMP_KTRFAC_PERSISTENT	0x80000000
    550 #define RUMP_KTRFAC_INHERIT	0x40000000
    551 #define RUMP_KTRFAC_TRC_EMUL	0x10000000
    552 #define	RUMP_KTRFAC_VER_MASK	0x0f000000
    553 #define	RUMP_KTRFAC_VER_SHIFT	24
    554 #define	RUMP_KTRFAC_VERSION(tf)	(((tf) & RUMP_KTRFAC_VER_MASK) >> RUMP_KTRFAC_VER_SHIFT)
    555 #define	RUMP_KTRFACv0	(0 << RUMP_KTRFAC_VER_SHIFT)
    556 #define	RUMP_KTRFACv1	(1 << RUMP_KTRFAC_VER_SHIFT)
    557 #define	RUMP_KTRFACv2	(2 << RUMP_KTRFAC_VER_SHIFT)
    558 
    559 /*	NetBSD: module.h,v 1.42 2018/05/28 21:04:40 chs Exp 	*/
    560 struct rump_modctl_load {
    561 	const char *ml_filename;
    562 
    563 	int ml_flags;
    564 
    565 	const char *ml_props;
    566 	size_t ml_propslen;
    567 };
    568 enum rump_modctl {
    569 	RUMP_MODCTL_LOAD,		/* modctl_load_t *ml */
    570 	RUMP_MODCTL_UNLOAD,		/* char *name */
    571 	RUMP_MODCTL_STAT,		/* struct iovec *buffer */
    572 	RUMP_MODCTL_EXISTS		/* enum: 0: load, 1: autoload */
    573 };
    574 
    575 /*	NetBSD: ufsmount.h,v 1.43 2015/03/27 17:27:56 riastradh Exp 	*/
    576 struct rump_ufs_args {
    577 	char	*fspec;			/* block special device to mount */
    578 };
    579 
    580 /*	NetBSD: sysvbfs_args.h,v 1.1 2008/09/04 12:07:30 pooka Exp 	*/
    581 struct rump_sysvbfs_args {
    582 	char	*fspec;		/* blocks special holding the fs to mount */
    583 };
    584 
    585 /*	NetBSD: dirent.h,v 1.30 2016/01/22 23:31:30 dholland Exp 	*/
    586 struct rump_dirent {
    587 	uint64_t d_fileno;			/* file number of entry */
    588 	uint16_t d_reclen;		/* length of this record */
    589 	uint16_t d_namlen;		/* length of string in d_name */
    590 	uint8_t  d_type; 		/* file type, see below */
    591 	char	d_name[511 + 1];	/* name must be no longer than this */
    592 };
    593 
    594 #endif /* _RUMP_RUMPDEFS_H_ */
    595