2
* VBox Remote Desktop Protocol - External Authentication Library Interface.
7
* Copyright (C) 2006-2007 Oracle Corporation
9
* This file is part of VirtualBox Open Source Edition (OSE), as
10
* available from http://www.virtualbox.org. This file is free software;
11
* you can redistribute it and/or modify it under the terms of the GNU
12
* General Public License (GPL) as published by the Free Software
13
* Foundation, in version 2 as it comes in the "COPYING" file of the
14
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17
* The contents of this file may alternatively be used under the terms
18
* of the Common Development and Distribution License Version 1.0
19
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20
* VirtualBox OSE distribution, in which case the provisions of the
21
* CDDL are applicable instead of those of the GPL.
23
* You may elect to license modified versions of this file under the
24
* terms and conditions of either the GPL or the CDDL or both.
27
#ifndef ___VBox_vrdpauth_h
28
#define ___VBox_vrdpauth_h
30
/* The following 2 enums are 32 bits values.*/
31
typedef enum _VRDPAuthResult
33
VRDPAuthAccessDenied = 0,
34
VRDPAuthAccessGranted = 1,
35
VRDPAuthDelegateToGuest = 2,
36
VRDPAuthSizeHack = 0x7fffffff
39
typedef enum _VRDPAuthGuestJudgement
41
VRDPAuthGuestNotAsked = 0,
42
VRDPAuthGuestAccessDenied = 1,
43
VRDPAuthGuestNoJudgement = 2,
44
VRDPAuthGuestAccessGranted = 3,
45
VRDPAuthGuestNotReacted = 4,
46
VRDPAuthGuestSizeHack = 0x7fffffff
47
} VRDPAuthGuestJudgement;
49
/* UUID memory representation. Array of 16 bytes. */
50
typedef unsigned char VRDPAUTHUUID[16];
51
typedef VRDPAUTHUUID *PVRDPAUTHUUID;
53
Note: VirtualBox uses a consistent binary representation of UUIDs on all platforms. For this reason
54
the integer fields comprising the UUID are stored as little endian values. If you want to pass such
55
UUIDs to code which assumes that the integer fields are big endian (often also called network byte
56
order), you need to adjust the contents of the UUID to e.g. achieve the same string representation.
57
The required changes are:
58
* reverse the order of byte 0, 1, 2 and 3
59
* reverse the order of byte 4 and 5
60
* reverse the order of byte 6 and 7.
61
Using this conversion you will get identical results when converting the binary UUID to the string
65
/* The library entry point calling convention. */
67
# define VRDPAUTHCALL __cdecl
68
#elif defined(__GNUC__)
71
# error "Unsupported compiler"
76
* Authentication library entry point. Decides whether to allow
77
* a client connection.
81
* pUuid Pointer to the UUID of the virtual machine
82
* which the client connected to.
83
* guestJudgement Result of the guest authentication.
84
* szUser User name passed in by the client (UTF8).
85
* szPassword Password passed in by the client (UTF8).
86
* szDomain Domain passed in by the client (UTF8).
90
* VRDPAuthAccessDenied Client access has been denied.
91
* VRDPAuthAccessGranted Client has the right to use the
93
* VRDPAuthDelegateToGuest Guest operating system must
94
* authenticate the client and the
95
* library must be called again with
96
* the result of the guest
99
typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY(PVRDPAUTHUUID pUuid,
100
VRDPAuthGuestJudgement guestJudgement,
102
const char *szPassword,
103
const char *szDomain);
106
typedef VRDPAUTHENTRY *PVRDPAUTHENTRY;
109
* Authentication library entry point version 2. Decides whether to allow
110
* a client connection.
114
* pUuid Pointer to the UUID of the virtual machine
115
* which the client connected to.
116
* guestJudgement Result of the guest authentication.
117
* szUser User name passed in by the client (UTF8).
118
* szPassword Password passed in by the client (UTF8).
119
* szDomain Domain passed in by the client (UTF8).
120
* fLogon Boolean flag. Indicates whether the entry point is called
121
* for a client logon or the client disconnect.
122
* clientId Server side unique identifier of the client.
126
* VRDPAuthAccessDenied Client access has been denied.
127
* VRDPAuthAccessGranted Client has the right to use the
129
* VRDPAuthDelegateToGuest Guest operating system must
130
* authenticate the client and the
131
* library must be called again with
132
* the result of the guest
135
* Note: When 'fLogon' is 0, only pUuid and clientId are valid and the return
138
typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY2(PVRDPAUTHUUID pUuid,
139
VRDPAuthGuestJudgement guestJudgement,
141
const char *szPassword,
142
const char *szDomain,
147
typedef VRDPAUTHENTRY2 *PVRDPAUTHENTRY2;