~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to include/VBox/VRDPAuth.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/** @file
2
 
 * VBox Remote Desktop Protocol - External Authentication Library Interface.
3
 
 * (VRDP)
4
 
 */
5
 
 
6
 
/*
7
 
 * Copyright (C) 2006-2007 Oracle Corporation
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
 
 
27
 
#ifndef ___VBox_vrdpauth_h
28
 
#define ___VBox_vrdpauth_h
29
 
 
30
 
/* The following 2 enums are 32 bits values.*/
31
 
typedef enum _VRDPAuthResult
32
 
{
33
 
    VRDPAuthAccessDenied    = 0,
34
 
    VRDPAuthAccessGranted   = 1,
35
 
    VRDPAuthDelegateToGuest = 2,
36
 
    VRDPAuthSizeHack        = 0x7fffffff
37
 
} VRDPAuthResult;
38
 
 
39
 
typedef enum _VRDPAuthGuestJudgement
40
 
{
41
 
    VRDPAuthGuestNotAsked      = 0,
42
 
    VRDPAuthGuestAccessDenied  = 1,
43
 
    VRDPAuthGuestNoJudgement   = 2,
44
 
    VRDPAuthGuestAccessGranted = 3,
45
 
    VRDPAuthGuestNotReacted    = 4,
46
 
    VRDPAuthGuestSizeHack      = 0x7fffffff
47
 
} VRDPAuthGuestJudgement;
48
 
 
49
 
/* UUID memory representation. Array of 16 bytes. */
50
 
typedef unsigned char VRDPAUTHUUID[16];
51
 
typedef VRDPAUTHUUID *PVRDPAUTHUUID;
52
 
/*
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
62
 
representation.
63
 
*/
64
 
 
65
 
/* The library entry point calling convention. */
66
 
#ifdef _MSC_VER
67
 
# define VRDPAUTHCALL __cdecl
68
 
#elif defined(__GNUC__)
69
 
# define VRDPAUTHCALL
70
 
#else
71
 
# error "Unsupported compiler"
72
 
#endif
73
 
 
74
 
 
75
 
/**
76
 
 * Authentication library entry point. Decides whether to allow
77
 
 * a client connection.
78
 
 *
79
 
 * Parameters:
80
 
 *
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).
87
 
 *
88
 
 * Return code:
89
 
 *
90
 
 *   VRDPAuthAccessDenied    Client access has been denied.
91
 
 *   VRDPAuthAccessGranted   Client has the right to use the
92
 
 *                           virtual machine.
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
97
 
 *                           authentication.
98
 
 */
99
 
typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY(PVRDPAUTHUUID pUuid,
100
 
                                                  VRDPAuthGuestJudgement guestJudgement,
101
 
                                                  const char *szUser,
102
 
                                                  const char *szPassword,
103
 
                                                  const char *szDomain);
104
 
 
105
 
 
106
 
typedef VRDPAUTHENTRY *PVRDPAUTHENTRY;
107
 
 
108
 
/**
109
 
 * Authentication library entry point version 2. Decides whether to allow
110
 
 * a client connection.
111
 
 *
112
 
 * Parameters:
113
 
 *
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.
123
 
 *
124
 
 * Return code:
125
 
 *
126
 
 *   VRDPAuthAccessDenied    Client access has been denied.
127
 
 *   VRDPAuthAccessGranted   Client has the right to use the
128
 
 *                           virtual machine.
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
133
 
 *                           authentication.
134
 
 *
135
 
 * Note: When 'fLogon' is 0, only pUuid and clientId are valid and the return
136
 
 *       code is ignored.
137
 
 */
138
 
typedef VRDPAuthResult VRDPAUTHCALL VRDPAUTHENTRY2(PVRDPAUTHUUID pUuid,
139
 
                                                   VRDPAuthGuestJudgement guestJudgement,
140
 
                                                   const char *szUser,
141
 
                                                   const char *szPassword,
142
 
                                                   const char *szDomain,
143
 
                                                   int fLogon,
144
 
                                                   unsigned clientId);
145
 
 
146
 
 
147
 
typedef VRDPAUTHENTRY2 *PVRDPAUTHENTRY2;
148
 
 
149
 
#endif