6fcc9faedee74159537b4a2d6275b1e37f559007
[openafs.git] / src / tests / afscp_callback.c
1 #include <afs/param.h>
2 #include <afs/afscbint.h>       /*Callback interface defs */
3 int afs_cb_inited = 0;
4 struct interfaceAddr afs_cb_interface;
5 static int
6 init_afs_cb()
7 {
8     int count;
9
10     afs_uuid_create(&afs_cb_interface.uuid);
11     count = rx_getAllAddr(&afs_cb_interface.addr_in, AFS_MAX_INTERFACE_ADDR);
12     if (count <= 0)
13         afs_cb_interface.numberOfInterfaces = 0;
14     else
15         afs_cb_interface.numberOfInterfaces = count;
16     afs_cb_inited = 1;
17     return 0;
18 }
19
20 afs_int32
21 SRXAFSCB_CallBack(rxcall, Fids_Array, CallBack_Array)
22      struct rx_call *rxcall;
23      AFSCBFids *Fids_Array;
24      AFSCBs *CallBack_Array;
25
26 {                               /*SRXAFSCB_CallBack */
27     return (0);
28
29 }                               /*SRXAFSCB_CallBack */
30
31
32 afs_int32
33 SRXAFSCB_InitCallBackState(rxcall)
34      struct rx_call *rxcall;
35
36 {                               /*SRXAFSCB_InitCallBackState */
37     return (0);
38
39 }                               /*SRXAFSCB_InitCallBackState */
40
41 afs_int32
42 SRXAFSCB_Probe(rxcall)
43      struct rx_call *rxcall;
44
45 {                               /*SRXAFSCB_Probe */
46     return (0);
47
48 }                               /*SRXAFSCB_Probe */
49
50
51 afs_int32
52 SRXAFSCB_GetCE(rxcall, index, ce)
53      struct rx_call *rxcall;
54      afs_int32 index;
55      AFSDBCacheEntry * ce;
56 {                               /*SRXAFSCB_GetCE */
57     return (0);
58 }                               /*SRXAFSCB_GetCE */
59
60
61 afs_int32
62 SRXAFSCB_GetCE64(rxcall, index, ce)
63      struct rx_call *rxcall;
64      afs_int32 index;
65      AFSDBCacheEntry64 *ce;
66 {                               /*SRXAFSCB_GetCE64 */
67     return (0);
68 }                               /*SRXAFSCB_GetCE64 */
69
70
71 afs_int32
72 SRXAFSCB_GetLock(rxcall, index, lock)
73      struct rx_call *rxcall;
74      afs_int32 index;
75      AFSDBLock *lock;
76 {                               /*SRXAFSCB_GetLock */
77     return (0);
78
79 }                               /*SRXAFSCB_GetLock */
80
81 afs_int32
82 SRXAFSCB_XStatsVersion(rxcall, v)
83      struct rx_call *rxcall;
84      afs_int32 *v;
85 {                               /*SRXAFSCB_XStatsVersion */
86     return (0);
87
88 }                               /*SRXAFSCB_XStatsVersion */
89
90 afs_int32
91 SRXAFSCB_GetXStats(rxcall, clientVersionNumber, collectionNumber, srvVersionNumberP, timeP, dataP)
92      struct rx_call *rxcall;
93      afs_int32 clientVersionNumber;
94      afs_int32 collectionNumber;
95      afs_int32 * srvVersionNumberP;
96      afs_int32 * timeP;
97      AFSCB_CollData * dataP;
98 {                               /*SRXAFSCB_GetXStats */
99     return (0);
100 }                               /*SRXAFSCB_GetXStats */
101
102 int
103 SRXAFSCB_InitCallBackState2(rxcall, addr)
104      struct rx_call *rxcall;
105      struct interfaceAddr *addr;
106 {
107     return RXGEN_OPCODE;
108 }
109
110 int
111 SRXAFSCB_WhoAreYou(rxcall, addr)
112      struct rx_call *rxcall;
113      struct interfaceAddr *addr;
114 {
115     if (rxcall && addr) {
116         if (!afs_cb_inited)
117             init_afs_cb();
118         *addr = afs_cb_interface;
119     }
120     return (0);
121 }
122
123 int
124 SRXAFSCB_InitCallBackState3(rxcall, uuidp)
125      struct rx_call *rxcall;
126      afsUUID *uuidp;
127 {
128     return (0);
129 }
130
131 int
132 SRXAFSCB_ProbeUuid(rxcall, uuidp)
133      struct rx_call *rxcall;
134      afsUUID *uuidp;
135 {
136     int code = 0;
137     if (!afs_cb_inited)
138         init_afs_cb();
139     if (!afs_uuid_equal(uuidp, &afs_cb_interface.uuid))
140         code = 1;               /* failure */
141     return code;
142 }
143
144 afs_int32
145 SRXAFSCB_GetServerPrefs(rxcall, serverIndex, srvrAddr, srvrRank)
146      struct rx_call *rxcall;
147      afs_int32 serverIndex;
148      afs_int32 *srvrAddr;
149      afs_int32 *srvrRank;
150 {
151     return RXGEN_OPCODE;
152 }
153
154
155 afs_int32
156 SRXAFSCB_GetCellServDB(rxcall, cellIndex, cellName, cellHosts)
157      struct rx_call *rxcall;
158      afs_int32 cellIndex;
159      char **cellName;
160      serverList *cellHosts;
161 {
162     return RXGEN_OPCODE;
163 }
164
165
166 afs_int32
167 SRXAFSCB_GetLocalCell(rxcall, cellName)
168      struct rx_call *rxcall;
169      char **cellName;
170 {
171     return RXGEN_OPCODE;
172 }
173
174
175 afs_int32
176 SRXAFSCB_GetCacheConfig(rxcall, callerVersion, serverVersion, configCount,
177                         config)
178      struct rx_call *rxcall;
179      afs_uint32 callerVersion;
180      afs_uint32 *serverVersion;
181      afs_uint32 *configCount;
182      cacheConfig *config;
183 {
184     return RXGEN_OPCODE;
185 }
186
187 afs_int32
188 SRXAFSCB_GetCellByNum(rxcall, cellnum, cellname, cellhosts)
189      struct rx_call *rxcall;
190      afs_int32 cellnum;
191      char **cellname;
192      serverList *cellhosts;
193 {
194      return RXGEN_OPCODE;
195 }
196
197 afs_int32
198 SRXAFSCB_TellMeAboutYourself(rxcall, addr, cap)
199      struct rx_call *rxcall;
200      struct interfaceAddr *addr;
201      Capabilities *cap;
202 {
203      return RXGEN_OPCODE;
204 }