VirtualBox

source: vbox/trunk/include/VBox/VRDPAuth.h@ 17058

Last change on this file since 17058 was 11961, checked in by vboxsync, 16 years ago

VRDPAuth.h: explain binary UUID representation in comment

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.9 KB
Line 
1/** @file
2 * VBox Remote Desktop Protocol:
3 * External Authentication Library Interface.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 (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.
16 *
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.
22 *
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.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31#ifndef ___VBox_vrdpauth_h
32#define ___VBox_vrdpauth_h
33
34/* The following 2 enums are 32 bits values.*/
35typedef enum _VRDPAuthResult
36{
37 VRDPAuthAccessDenied = 0,
38 VRDPAuthAccessGranted = 1,
39 VRDPAuthDelegateToGuest = 2,
40 VRDPAuthSizeHack = 0x7fffffff
41} VRDPAuthResult;
42
43typedef enum _VRDPAuthGuestJudgement
44{
45 VRDPAuthGuestNotAsked = 0,
46 VRDPAuthGuestAccessDenied = 1,
47 VRDPAuthGuestNoJudgement = 2,
48 VRDPAuthGuestAccessGranted = 3,
49 VRDPAuthGuestNotReacted = 4,
50 VRDPAuthGuestSizeHack = 0x7fffffff
51} VRDPAuthGuestJudgement;
52
53/* UUID memory representation. Array of 16 bytes. */
54typedef unsigned char VRDPAUTHUUID[16];
55typedef VRDPAUTHUUID *PVRDPAUTHUUID;
56/*
57Note: VirtualBox uses a consistent binary representation of UUIDs on all platforms. For this reason
58the integer fields comprising the UUID are stored as little endian values. If you want to pass such
59UUIDs to code which assumes that the integer fields are big endian (often also called network byte
60order), you need to adjust the contents of the UUID to e.g. achieve the same string representation.
61The required changes are:
62 * reverse the order of byte 0, 1, 2 and 3
63 * reverse the order of byte 4 and 5
64 * reverse the order of byte 6 and 7.
65Using this conversion you will get identical results when converting the binary UUID to the string
66representation.
67*/
68
69/* The library entry point calling convention. */
70#ifdef _MSC_VER
71# define VRDPAUTHCALL __cdecl
72#elif defined(__GNUC__)
73# define VRDPAUTHCALL
74#else
75# error "Unsupported compiler"
76#endif
77
78
79/**
80 * Authentication library entry point. Decides whether to allow
81 * a client connection.
82 *
83 * Parameters:
84 *
85 * pUuid Pointer to the UUID of the virtual machine
86 * which the client connected to.
87 * guestJudgement Result of the guest authentication.
88 * szUser User name passed in by the client (UTF8).
89 * szPassword Password passed in by the client (UTF8).
90 * szDomain Domain passed in by the client (UTF8).
91 *
92 * Return code:
93 *
94 * VRDPAuthAccessDenied Client access has been denied.
95 * VRDPAuthAccessGranted Client has the right to use the
96 * virtual machine.
97 * VRDPAuthDelegateToGuest Guest operating system must
98 * authenticate the client and the
99 * library must be called again with
100 * the result of the guest
101 * authentication.
102 */
103typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY(PVRDPAUTHUUID pUuid,
104 VRDPAuthGuestJudgement guestJudgement,
105 const char *szUser,
106 const char *szPassword,
107 const char *szDomain);
108
109
110typedef VRDPAUTHENTRY *PVRDPAUTHENTRY;
111
112/**
113 * Authentication library entry point version 2. Decides whether to allow
114 * a client connection.
115 *
116 * Parameters:
117 *
118 * pUuid Pointer to the UUID of the virtual machine
119 * which the client connected to.
120 * guestJudgement Result of the guest authentication.
121 * szUser User name passed in by the client (UTF8).
122 * szPassword Password passed in by the client (UTF8).
123 * szDomain Domain passed in by the client (UTF8).
124 * fLogon Boolean flag. Indicates whether the entry point is called
125 * for a client logon or the client disconnect.
126 * clientId Server side unique identifier of the client.
127 *
128 * Return code:
129 *
130 * VRDPAuthAccessDenied Client access has been denied.
131 * VRDPAuthAccessGranted Client has the right to use the
132 * virtual machine.
133 * VRDPAuthDelegateToGuest Guest operating system must
134 * authenticate the client and the
135 * library must be called again with
136 * the result of the guest
137 * authentication.
138 *
139 * Note: When 'fLogon' is 0, only pUuid and clientId are valid and the return
140 * code is ignored.
141 */
142typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY2(PVRDPAUTHUUID pUuid,
143 VRDPAuthGuestJudgement guestJudgement,
144 const char *szUser,
145 const char *szPassword,
146 const char *szDomain,
147 int fLogon,
148 unsigned clientId);
149
150
151typedef VRDPAUTHENTRY2 *PVRDPAUTHENTRY2;
152
153#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette