Handle more RPC service names
[openafs.git] / src / WINNT / afsd / cm_volstat.h
1 /* 
2  * Copyright (c) 2007 Secure Endpoints Inc.
3  *
4  * All rights reserved.
5  * 
6  * Redistribution and use in source and binary forms, with or without 
7  * modification, are permitted provided that the following conditions 
8  * are met:
9  * 
10  *     * Redistributions of source code must retain the above copyright 
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Neither the name of the Secure Endpoints Inc. nor the names of its 
13  *       contributors may be used to endorse or promote products derived 
14  *       from this software without specific prior written permission.
15  * 
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 /* This header file provides the definitions and prototypes 
30  * which specify the AFS Cache Manager Volume Status Event
31  * Notification API
32  */
33
34 enum volstatus {vl_online, vl_busy, vl_offline, vl_alldown, vl_unknown};
35
36 extern long cm_VolStatus_Initialization(void);
37
38 extern long cm_VolStatus_Finalize(void);
39
40 extern long cm_VolStatus_Service_Started(void);
41
42 extern long cm_VolStatus_Service_Stopped(void);
43
44 #ifdef _WIN64
45 extern long cm_VolStatus_Network_Started(const char * netbios32,
46                                          const char * netbios64);
47
48 extern long cm_VolStatus_Network_Stopped(const char * netbios32,
49                                          const char * netbios64);
50 #else /* _WIN64 */
51 extern long cm_VolStatus_Network_Started(const char * netbios);
52
53 extern long cm_VolStatus_Network_Stopped(const char * netbios);
54 #endif /* _WIN64 */
55
56 extern long cm_VolStatus_Network_Addr_Change(void);
57
58 extern long cm_VolStatus_Change_Notification(afs_uint32 cellID, afs_uint32 volID, enum volstatus status);
59
60 extern long __fastcall cm_VolStatus_Path_To_ID(const char * share,
61                                                const char * path,
62                                                afs_uint32 * cellID, afs_uint32 * volID,
63                                                enum volstatus *pstatus);
64
65 extern long __fastcall cm_VolStatus_Path_To_DFSlink(const char * share,
66                                                     const char * path,
67                                                     afs_uint32 *pBufSize,
68                                                     char *pBuffer);
69
70 extern long cm_VolStatus_Notify_DFS_Mapping(cm_scache_t *scp,
71                                             const clientchar_t *tidPathp,
72                                             const clientchar_t *pathp);
73
74 extern long cm_VolStatus_Invalidate_DFS_Mapping(cm_scache_t *scp);
75
76 #define DLL_VOLSTATUS_FUNCS_VERSION 2
77 typedef struct dll_VolStatus_Funcs {
78     afs_uint32          version;
79     /* version 1 */
80     long (__fastcall * dll_VolStatus_Service_Started)(void);
81     long (__fastcall * dll_VolStatus_Service_Stopped)(void);
82     long (__fastcall * dll_VolStatus_Network_Started)(const char *netbios32, const char *netbios64);
83     long (__fastcall * dll_VolStatus_Network_Stopped)(const char *netbios32, const char *netbios64);
84     long (__fastcall * dll_VolStatus_Network_Addr_Change)(void);
85     long (__fastcall * dll_VolStatus_Change_Notification)(afs_uint32 cellID, afs_uint32 volID, enum volstatus status);
86     /* version 2 */
87     long (__fastcall * dll_VolStatus_Notify_DFS_Mapping)(afs_uint32 cellID, afs_uint32 volID, 
88                                                          afs_uint32 vnodeID, afs_uint32 uniqID,
89                                                          char *src, char *target);
90     long (__fastcall * dll_VolStatus_Invalidate_DFS_Mapping)(afs_uint32 cellID, afs_uint32 volID, 
91                                                              afs_uint32 vnodeID, afs_uint32 uniqID);
92 } dll_VolStatus_Funcs_t;
93
94 #define CM_VOLSTATUS_FUNCS_VERSION 1
95 typedef struct cm_VolStatus_Funcs {
96     afs_uint32          version;
97     long (__fastcall * cm_VolStatus_Path_To_ID)(const char * share, const char * path, afs_uint32 * cellID, afs_uint32 * volID, enum volstatus *pstatus);
98     long (__fastcall * cm_VolStatus_Path_To_DFSlink)(const char * share, const char * path, afs_uint32 *pBufSize, char *pBuffer);
99 } cm_VolStatus_Funcs_t;
100
101 /* pioctl */
102 struct VolStatTest {
103     afs_uint32  flags;
104     cm_fid_t    fid;
105     char cellname[CELL_MAXNAMELEN];
106     char volname[VL_MAXNAMELEN];
107     enum volstatus state;
108 };
109
110 #define VOLSTAT_TEST_APPLY_TO_SERVER 1
111 #define VOLSTAT_TEST_CHECK_VOLUME    2
112 #define VOLSTAT_TEST_NETWORK_UP      4
113 #define VOLSTAT_TEST_NETWORK_DOWN    8
114