2 * Copyright (C) 2013-2019 Red Hat Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * * Neither the name of Red Hat nor the names of its contributors may be
16 * used to endorse or promote products derived from this software without
17 * specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 /* Types and structs that we pass to or return from the VDDK API.
38 #ifndef NBDKIT_VDDK_STRUCTS_H
39 #define NBDKIT_VDDK_STRUCTS_H
44 typedef uint64_t VixError
;
47 #define VIXDISKLIB_FLAG_OPEN_UNBUFFERED 1
48 #define VIXDISKLIB_FLAG_OPEN_SINGLE_LINK 2
49 #define VIXDISKLIB_FLAG_OPEN_READ_ONLY 4
50 #define VIXDISKLIB_SECTOR_SIZE 512
52 #define VIXDISKLIB_MIN_CHUNK_SIZE 128
53 #define VIXDISKLIB_MAX_CHUNK_NUMBER (512*1024)
55 typedef void *VixDiskLibConnection
;
56 typedef void *VixDiskLibHandle
;
58 typedef void VixDiskLibGenericLogFunc (const char *fmt
, va_list args
);
60 enum VixDiskLibCredType
{
61 VIXDISKLIB_CRED_UID
= 1,
62 VIXDISKLIB_CRED_SESSIONID
= 2,
63 VIXDISKLIB_CRED_TICKETID
= 3,
64 VIXDISKLIB_CRED_SSPI
= 4,
65 VIXDISKLIB_CRED_UNKNOWN
= 256
68 enum VixDiskLibSpecType
{
69 VIXDISKLIB_SPEC_VMX
= 0,
70 VIXDISKLIB_SPEC_VSTORAGE_OBJECT
= 1,
71 VIXDISKLIB_SPEC_UNKNOWN
= 2
74 struct VixDiskLibVStorageObjectSpec
{
80 typedef struct VixDiskLibConnectParams
{
85 enum VixDiskLibCredType credType
;
104 struct VixDiskLibVStorageObjectSpec vStorageObjSpec
;
106 enum VixDiskLibSpecType specType
;
107 } VixDiskLibConnectParams
;
109 struct VixDiskLibGeometry
{
115 enum VixDiskLibAdapterType
{
116 VIXDISKLIB_ADAPTER_IDE
= 1,
117 VIXDISKLIB_ADAPTER_SCSI_BUSLOGIC
= 2,
118 VIXDISKLIB_ADAPTER_SCSI_LSILOGIC
= 3,
119 VIXDISKLIB_ADAPTER_UNKNOWN
= 256
122 typedef struct VixDiskLibInfo
{
123 struct VixDiskLibGeometry biosGeo
;
124 struct VixDiskLibGeometry physGeo
;
126 enum VixDiskLibAdapterType adapterType
;
128 char *parentFileNameHint
;
139 VixDiskLibBlock blocks
[1];
140 } VixDiskLibBlockList
;
142 #endif /* NBDKIT_VDDK_STRUCTS_H */