7d168f2205b544f9a7641b4442e25e2cdf57e1c8
[openafs.git] / src / libadmin / vos / vsprocs.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #include <stdio.h>
11 #include <sys/types.h>
12 #include <sys/stat.h>
13 #ifdef  AFS_AIX_ENV
14 #include <sys/statfs.h>
15 #endif
16 #ifdef AFS_NT40_ENV
17 #include <fcntl.h>
18 #include <winsock2.h>
19 #else
20 #include <sys/file.h>
21 #include <netinet/in.h>
22 #endif
23 #include <lock.h>
24 #include <afs/voldefs.h>
25 #include <rx/xdr.h>
26 #include <rx/rx.h>
27 #include <afs/vlserver.h>
28 #include <afs/nfs.h>
29 #include <afs/auth.h>
30 #include <afs/cellconfig.h>
31 #include <afs/keys.h>
32 #include <ubik.h>
33 #include <afs/afsint.h>
34 #include <afs/volser.h>
35 #include <afs/volint.h>
36 #include "../../volser/lockdata.h"
37 #include "../../vlserver/vlclient.h"
38 #include <afs/com_err.h>
39 #include <rx/rxkad.h>
40 #include <afs/kautils.h>
41 #include <afs/cmd.h>
42 #include <errno.h>
43 #include <afs/afs_Admin.h>
44 #include "../adminutil/afs_AdminInternal.h"
45
46 #define CLOCKSKEW   2                   /* not really skew, but resolution */
47
48 extern afs_int32 AFSVolPartitionInfo();
49 extern afs_int32 AFSVolTransCreate();
50 extern afs_int32 AFSVolEndTrans();
51 extern afs_int32 AFSVolSetInfo();
52 extern afs_int32 AFSVolDeleteVolume();
53 extern afs_int32 AFSVolNukeVolume();
54 extern afs_int32 AFSVolCreateVolume();
55 extern afs_int32 AFSVolSetFlags();
56 extern afs_int32 AFSVolReClone();
57 extern afs_int32 AFSVolClone();
58 extern afs_int32 AFSVolGetStatus();
59 extern afs_int32 AFSVolSetIdsTypes();
60 extern afs_int32 AFSVolSetDate();
61 extern afs_int32 AFSVolXListPartitions();
62 extern afs_int32 AFSVolListPartitions();
63 extern afs_int32 AFSVolListVolumes();
64 extern afs_int32 AFSVolMonitor();
65 extern afs_int32 AFSVolGetName();
66 extern afs_int32 AFSVolForward();
67 extern afs_int32 AFSVolSetForwarding();
68 extern afs_int32 AFSVolXListVolumes();
69 extern afs_int32 AFSVolXListOneVolume();
70 extern afs_int32 AFSVolForwardMultiple();
71 extern afs_int32 AFSVolListOneVolume();
72 extern afs_int32 StartAFSVolDump();
73 extern afs_int32 StartAFSVolRestore();
74  
75 extern int ubik_Call();
76 extern int ubik_Call_New();
77
78
79 extern int UV_NukeVolume(
80   afs_cell_handle_p cellHandle,
81   struct rx_connection *server,
82   unsigned int partition,
83   unsigned int volumeId,
84   afs_status_p st
85 );
86
87 extern int UV_CreateVolume(
88   afs_cell_handle_p cellHandle,
89   struct rx_connection *server,
90   unsigned int partition,
91   const char *volumeName,
92   unsigned int quota,
93   unsigned int *volumeId,
94   afs_status_p st
95 );
96
97 extern int UV_DeleteVolume(
98   afs_cell_handle_p cellHandle,
99   struct rx_connection *server,
100   unsigned int partition,
101   unsigned int volumeId,
102   afs_status_p st
103 );
104
105 extern int UV_MoveVolume(
106   afs_cell_handle_p cellHandle,
107   afs_int32 afromvol,
108   afs_int32 afromserver,
109   afs_int32 afrompart,
110   afs_int32 atoserver,
111   afs_int32 atopart,
112   afs_status_p st
113 );
114
115 extern int UV_BackupVolume(
116   afs_cell_handle_p cellHandle,
117   afs_int32 aserver,
118   afs_int32 apart,
119   afs_int32 avolid,
120   afs_status_p st
121 );
122
123 extern int UV_ReleaseVolume(
124   afs_cell_handle_p cellHandle,
125   afs_int32 afromvol,
126   afs_int32 afromserver,
127   afs_int32 afrompart,
128   int forceflag,
129   afs_status_p st
130 );
131
132 extern int UV_DumpVolume(
133   afs_cell_handle_p cellHandle,
134   afs_int32 afromvol,
135   afs_int32 afromserver,
136   afs_int32 afrompart,
137   afs_int32 fromdate,
138   const char *filename,
139   afs_status_p st
140 );
141
142 extern int UV_RestoreVolume(
143   afs_cell_handle_p cellHandle,
144   afs_int32 toserver,
145   afs_int32 topart,
146   afs_int32 tovolid,
147   const char *tovolname,
148   int flags,
149   const char *dumpFile,
150   afs_status_p st
151 );
152
153 extern int UV_AddSite(
154   afs_cell_handle_p cellHandle,
155   afs_int32 server,
156   afs_int32 part,
157   afs_int32 volid,
158   afs_status_p st
159 );
160
161 extern int UV_RemoveSite(
162   afs_cell_handle_p cellHandle,
163   afs_int32 server,
164   afs_int32 part,
165   afs_int32 volid,
166   afs_status_p st
167 );
168
169 extern int UV_ListPartitions(
170   struct rx_connection *server,
171   struct partList *ptrPartList,
172   afs_int32 *cntp,
173   afs_status_p st
174 );
175
176 extern int UV_XListVolumes(
177   struct rx_connection *server,
178   afs_int32 a_partID,
179   int a_all,
180   struct volintXInfo **a_resultPP,
181   afs_int32 *a_numEntsInResultP,
182   afs_status_p st
183 );
184
185 extern int UV_XListOneVolume(
186   struct rx_connection *server,
187   afs_int32 a_partID,
188   afs_int32 a_volID,
189   struct volintXInfo **a_resultPP,
190   afs_status_p st
191 );
192
193 extern int UV_SyncVldb(
194   afs_cell_handle_p cellHandle,
195   struct rx_connection *server,
196   afs_int32 apart,
197   int flags,
198   int force,
199   afs_status_p st
200 );
201
202 extern int CheckVldb(
203   afs_cell_handle_p cellHandle,
204   struct nvldbentry *entry,
205   afs_int32 *modified,
206   afs_status_p st
207 );
208
209 extern int UV_SyncServer(
210   afs_cell_handle_p cellHandle,
211   struct rx_connection *server,
212   afs_int32 apart,
213   int flags,
214   afs_status_p st
215 );
216
217
218 extern int UV_VolserStatus(
219   struct rx_connection *server,
220   transDebugInfo **rpntr,
221   afs_int32 *rcount,
222   afs_status_p st
223 );
224
225 extern int UV_VolumeZap(
226   afs_cell_handle_p cellHandle,
227   struct rx_connection *serverHandle,
228   unsigned int partition,
229   unsigned int volumeId,
230   afs_status_p st
231 );
232
233 extern int UV_SetVolume(
234   struct rx_connection *server,
235   afs_int32 partition,
236   afs_int32 volid,
237   afs_int32 transflag,
238   afs_int32 setflag,
239   unsigned int sleep,
240   afs_status_p st
241 );
242
243 extern int UV_RenameVolume(
244   afs_cell_handle_p cellHandle,
245   struct nvldbentry *entry,
246   const char *newname,
247   afs_status_p st
248 );