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