1 | /** @file
|
---|
2 | * VBox Remote Desktop Protocol:
|
---|
3 | * External Authentication Library Interface.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
8 | *
|
---|
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 as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___VBox_vrdpauth_h
|
---|
19 | #define ___VBox_vrdpauth_h
|
---|
20 |
|
---|
21 | /* The following 2 enums are 32 bits values.*/
|
---|
22 | typedef enum _VRDPAuthResult
|
---|
23 | {
|
---|
24 | VRDPAuthAccessDenied = 0,
|
---|
25 | VRDPAuthAccessGranted = 1,
|
---|
26 | VRDPAuthDelegateToGuest = 2,
|
---|
27 | VRDPAuthSizeHack = 0x7fffffff
|
---|
28 | } VRDPAuthResult;
|
---|
29 |
|
---|
30 | typedef enum _VRDPAuthGuestJudgement
|
---|
31 | {
|
---|
32 | VRDPAuthGuestNotAsked = 0,
|
---|
33 | VRDPAuthGuestAccessDenied = 1,
|
---|
34 | VRDPAuthGuestNoJudgement = 2,
|
---|
35 | VRDPAuthGuestAccessGranted = 3,
|
---|
36 | VRDPAuthGuestNotReacted = 4,
|
---|
37 | VRDPAuthGuestSizeHack = 0x7fffffff
|
---|
38 | } VRDPAuthGuestJudgement;
|
---|
39 |
|
---|
40 | /* UUID memory representation. Array of 16 bytes. */
|
---|
41 | typedef unsigned char VRDPAUTHUUID[16];
|
---|
42 | typedef VRDPAUTHUUID *PVRDPAUTHUUID;
|
---|
43 |
|
---|
44 |
|
---|
45 | /* The library entry point calling convention. */
|
---|
46 | #ifdef _MSC_VER
|
---|
47 | # define VRDPAUTHCALL __cdecl
|
---|
48 | #elif defined(__GNUC__)
|
---|
49 | # define VRDPAUTHCALL
|
---|
50 | #else
|
---|
51 | # error "Unsupported compiler"
|
---|
52 | #endif
|
---|
53 |
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * Authentication library entry point. Decides whether to allow
|
---|
57 | * a client connection.
|
---|
58 | *
|
---|
59 | * Parameters:
|
---|
60 | *
|
---|
61 | * pUuid Pointer to the UUID of the virtual machine
|
---|
62 | * which the client connected to.
|
---|
63 | * guestJudgement Result of the guest authentication.
|
---|
64 | * szUser User name passed in by the client (UTF8).
|
---|
65 | * szPassword Password passed in by the client (UTF8).
|
---|
66 | * szDomain Domain passed in by the client (UTF8).
|
---|
67 | *
|
---|
68 | * Return code:
|
---|
69 | *
|
---|
70 | * VRDPAuthAccessDenied Client access has been denied.
|
---|
71 | * VRDPAuthAccessGranted Client has the right to use the
|
---|
72 | * virtual machine.
|
---|
73 | * VRDPAuthDelegateToGuest Guest operating system must
|
---|
74 | * authenticate the client and the
|
---|
75 | * library must be called again with
|
---|
76 | * the result of the guest
|
---|
77 | * authentication.
|
---|
78 | */
|
---|
79 | typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY(PVRDPAUTHUUID pUuid,
|
---|
80 | VRDPAuthGuestJudgement guestJudgement,
|
---|
81 | const char *szUser,
|
---|
82 | const char *szPassword,
|
---|
83 | const char *szDomain);
|
---|
84 |
|
---|
85 |
|
---|
86 | typedef VRDPAUTHENTRY *PVRDPAUTHENTRY;
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * Authentication library entry point version 2. Decides whether to allow
|
---|
90 | * a client connection.
|
---|
91 | *
|
---|
92 | * Parameters:
|
---|
93 | *
|
---|
94 | * pUuid Pointer to the UUID of the virtual machine
|
---|
95 | * which the client connected to.
|
---|
96 | * guestJudgement Result of the guest authentication.
|
---|
97 | * szUser User name passed in by the client (UTF8).
|
---|
98 | * szPassword Password passed in by the client (UTF8).
|
---|
99 | * szDomain Domain passed in by the client (UTF8).
|
---|
100 | * fLogon Boolean flag. Indicates whether the entry point is called
|
---|
101 | * for a client logon or the client disconnect.
|
---|
102 | * clientId Server side unique identifier of the client.
|
---|
103 | *
|
---|
104 | * Return code:
|
---|
105 | *
|
---|
106 | * VRDPAuthAccessDenied Client access has been denied.
|
---|
107 | * VRDPAuthAccessGranted Client has the right to use the
|
---|
108 | * virtual machine.
|
---|
109 | * VRDPAuthDelegateToGuest Guest operating system must
|
---|
110 | * authenticate the client and the
|
---|
111 | * library must be called again with
|
---|
112 | * the result of the guest
|
---|
113 | * authentication.
|
---|
114 | *
|
---|
115 | * Note: When 'fLogon' is 0, only pUuid and clientId are valid and the return
|
---|
116 | * code is ignored.
|
---|
117 | */
|
---|
118 | typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY2(PVRDPAUTHUUID pUuid,
|
---|
119 | VRDPAuthGuestJudgement guestJudgement,
|
---|
120 | const char *szUser,
|
---|
121 | const char *szPassword,
|
---|
122 | const char *szDomain,
|
---|
123 | int fLogon,
|
---|
124 | unsigned clientId);
|
---|
125 |
|
---|
126 |
|
---|
127 | typedef VRDPAUTHENTRY2 *PVRDPAUTHENTRY2;
|
---|
128 |
|
---|
129 | #endif
|
---|