tests: Run just built nbdkit, not installed nbdkit.
[nbdkit/ericb.git] / plugins / vddk / vddk-structs.h
blob860878711071e0e0dfb1b20169bbc87bfab0669c
1 /* nbdkit
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
6 * met:
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
30 * SUCH DAMAGE.
33 /* Types and structs that we pass to or return from the VDDK API.
35 * Updated to VDDK 6.7
38 #ifndef NBDKIT_VDDK_STRUCTS_H
39 #define NBDKIT_VDDK_STRUCTS_H
41 #include <stdarg.h>
42 #include <stdint.h>
44 typedef uint64_t VixError;
45 #define VIX_OK 0
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 {
75 char *id;
76 char *datastoreMoRef;
77 char *ssId;
80 typedef struct VixDiskLibConnectParams {
81 char *vmxSpec;
82 char *serverName;
83 char *thumbPrint;
84 long reserved1;
85 enum VixDiskLibCredType credType;
86 union {
87 struct {
88 char *userName;
89 char *password;
90 } uid;
91 struct {
92 char *cookie;
93 char *userName;
94 char *key;
95 } sessionId;
96 void *reserved2;
97 } creds;
98 uint32_t port;
99 uint32_t nfcHostPort;
100 char *reserved3;
101 char reserved4[8];
102 void *reserved5;
103 union {
104 struct VixDiskLibVStorageObjectSpec vStorageObjSpec;
105 } spec;
106 enum VixDiskLibSpecType specType;
107 } VixDiskLibConnectParams;
109 struct VixDiskLibGeometry {
110 uint32_t cylinders;
111 uint32_t heads;
112 uint32_t sectors;
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;
125 uint64_t capacity;
126 enum VixDiskLibAdapterType adapterType;
127 int numLinks;
128 char *parentFileNameHint;
129 char *uuid;
130 } VixDiskLibInfo;
132 typedef struct {
133 uint64_t offset;
134 uint64_t length;
135 } VixDiskLibBlock;
137 typedef struct {
138 uint32_t numBlocks;
139 VixDiskLibBlock blocks[1];
140 } VixDiskLibBlockList;
142 #endif /* NBDKIT_VDDK_STRUCTS_H */