/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR CDDL-1.0) */ /* * Virtual Device for Guest <-> VMM/Host communication, type definitions * which are also used for the vboxguest ioctl interface / by vboxsf * * Copyright (C) 2006-2016 Oracle Corporation */ #ifndef __UAPI_VBOX_VMMDEV_TYPES_H__ #define __UAPI_VBOX_VMMDEV_TYPES_H__ #include <asm/bitsperlong.h> #include <linux/types.h> /* * We cannot use linux' compiletime_assert here because it expects to be used * inside a function only. Use a typedef to a char array with a negative size. */ #define VMMDEV_ASSERT_SIZE(type, size) … /** enum vmmdev_request_type - VMMDev request types. */ enum vmmdev_request_type { … }; #if __BITS_PER_LONG == 64 #define VMMDEVREQ_HGCM_CALL … #else #define VMMDEVREQ_HGCM_CALL … #endif /* vmmdev_request_header.requestor defines */ /* Requestor user not given. */ #define VMMDEV_REQUESTOR_USR_NOT_GIVEN … /* The kernel driver (vboxguest) is the requestor. */ #define VMMDEV_REQUESTOR_USR_DRV … /* Some other kernel driver is the requestor. */ #define VMMDEV_REQUESTOR_USR_DRV_OTHER … /* The root or a admin user is the requestor. */ #define VMMDEV_REQUESTOR_USR_ROOT … /* Regular joe user is making the request. */ #define VMMDEV_REQUESTOR_USR_USER … /* User classification mask. */ #define VMMDEV_REQUESTOR_USR_MASK … /* Kernel mode request. Note this is 0, check for !USERMODE instead. */ #define VMMDEV_REQUESTOR_KERNEL … /* User mode request. */ #define VMMDEV_REQUESTOR_USERMODE … /* User or kernel mode classification mask. */ #define VMMDEV_REQUESTOR_MODE_MASK … /* Don't know the physical console association of the requestor. */ #define VMMDEV_REQUESTOR_CON_DONT_KNOW … /* * The request originates with a process that is NOT associated with the * physical console. */ #define VMMDEV_REQUESTOR_CON_NO … /* Requestor process is associated with the physical console. */ #define VMMDEV_REQUESTOR_CON_YES … /* Console classification mask. */ #define VMMDEV_REQUESTOR_CON_MASK … /* Requestor is member of special VirtualBox user group. */ #define VMMDEV_REQUESTOR_GRP_VBOX … /* Note: trust level is for windows guests only, linux always uses not-given */ /* Requestor trust level: Unspecified */ #define VMMDEV_REQUESTOR_TRUST_NOT_GIVEN … /* Requestor trust level: Untrusted (SID S-1-16-0) */ #define VMMDEV_REQUESTOR_TRUST_UNTRUSTED … /* Requestor trust level: Untrusted (SID S-1-16-4096) */ #define VMMDEV_REQUESTOR_TRUST_LOW … /* Requestor trust level: Medium (SID S-1-16-8192) */ #define VMMDEV_REQUESTOR_TRUST_MEDIUM … /* Requestor trust level: Medium plus (SID S-1-16-8448) */ #define VMMDEV_REQUESTOR_TRUST_MEDIUM_PLUS … /* Requestor trust level: High (SID S-1-16-12288) */ #define VMMDEV_REQUESTOR_TRUST_HIGH … /* Requestor trust level: System (SID S-1-16-16384) */ #define VMMDEV_REQUESTOR_TRUST_SYSTEM … /* Requestor trust level >= Protected (SID S-1-16-20480, S-1-16-28672) */ #define VMMDEV_REQUESTOR_TRUST_PROTECTED … /* Requestor trust level mask */ #define VMMDEV_REQUESTOR_TRUST_MASK … /* Requestor is using the less trusted user device node (/dev/vboxuser) */ #define VMMDEV_REQUESTOR_USER_DEVICE … /** HGCM service location types. */ enum vmmdev_hgcm_service_location_type { … }; /** HGCM host service location. */ struct vmmdev_hgcm_service_location_localhost { … }; VMMDEV_ASSERT_SIZE(…); /** HGCM service location. */ struct vmmdev_hgcm_service_location { … }; VMMDEV_ASSERT_SIZE(…); /** HGCM function parameter type. */ enum vmmdev_hgcm_function_parameter_type { … }; /** HGCM function parameter, 32-bit client. */ struct vmmdev_hgcm_function_parameter32 { … } __packed; VMMDEV_ASSERT_SIZE(…); /** HGCM function parameter, 64-bit client. */ struct vmmdev_hgcm_function_parameter64 { … } __packed; VMMDEV_ASSERT_SIZE(…); #if __BITS_PER_LONG == 64 #define vmmdev_hgcm_function_parameter … #else #define vmmdev_hgcm_function_parameter … #endif #define VMMDEV_HGCM_F_PARM_DIRECTION_NONE … #define VMMDEV_HGCM_F_PARM_DIRECTION_TO_HOST … #define VMMDEV_HGCM_F_PARM_DIRECTION_FROM_HOST … #define VMMDEV_HGCM_F_PARM_DIRECTION_BOTH … /** * struct vmmdev_hgcm_pagelist - VMMDEV_HGCM_PARM_TYPE_PAGELIST parameters * point to this structure to actually describe the buffer. */ struct vmmdev_hgcm_pagelist { … }; VMMDEV_ASSERT_SIZE(…); #endif