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