2 * (C) Copyright Transarc Corporation 1989
3 * Licensed Materials - Property of Transarc
10 /*------------------------------------------------------------------------
13 * Interface to the AFS FileServer probe facility. With the routines
14 * defined here, the importer can gather statistics from the given set
15 * of FileServers at regular intervals, or force immediate collection.
17 *------------------------------------------------------------------------*/
19 #include <sys/types.h> /*Basic system types*/
20 #include <netinet/in.h> /*Internet definitions*/
21 #include <netdb.h> /*Network database library*/
22 #include <sys/socket.h> /*Socket definitions*/
23 #include <rx/rx.h> /*Rx definitions*/
24 #include <afs/afsint.h> /*AFS FileServer interface*/
25 #include <afs/volser.h>
26 #include <afs/volint.h>
28 struct ProbeViceStatistics {
29 afs_uint32 CurrentMsgNumber;
30 afs_uint32 OldestMsgNumber;
31 afs_uint32 CurrentTime;
34 afs_int32 CurrentConnections;
35 afs_uint32 TotalViceCalls;
36 afs_uint32 TotalFetchs;
37 afs_uint32 FetchDatas;
38 afs_uint32 FetchedBytes;
39 afs_int32 FetchDataRate;
40 afs_uint32 TotalStores;
41 afs_uint32 StoreDatas;
42 afs_uint32 StoredBytes;
43 afs_int32 StoreDataRate;
44 afs_uint32 TotalRPCBytesSent;
45 afs_uint32 TotalRPCBytesReceived;
46 afs_uint32 TotalRPCPacketsSent;
47 afs_uint32 TotalRPCPacketsReceived;
48 afs_uint32 TotalRPCPacketsLost;
49 afs_uint32 TotalRPCBogusPackets;
57 afs_int32 EtherNetTotalErrors;
58 afs_int32 EtherNetTotalWrites;
59 afs_int32 EtherNetTotalInterupts;
60 afs_int32 EtherNetGoodReads;
61 afs_int32 EtherNetTotalBytesWritten;
62 afs_int32 EtherNetTotalBytesRead;
63 afs_int32 ProcessSize;
64 afs_int32 WorkStations;
65 afs_int32 ActiveWorkStations;
74 ViceDisk Disk[VOLMAXPARTS];
79 * Connection information per FileServer host being probed.
81 struct fsprobe_ConnectionInfo {
82 struct sockaddr_in skt; /*Socket info*/
83 struct rx_connection *rxconn; /*Rx connection*/
84 struct rx_connection *rxVolconn; /*Rx connection to Vol server*/
85 struct partList partList; /*Server part list*/
86 afs_int32 partCnt; /*# of parts */
87 char hostName[256]; /*Computed hostname*/
91 * The results of a probe of the given set of FileServers. The ith
92 * entry in the stats array corresponds to the ith connected server.
94 struct fsprobe_ProbeResults {
95 int probeNum; /*Probe number*/
96 afs_int32 probeTime; /*Time probe initiated*/
97 struct ProbeViceStatistics *stats; /*Ptr to stats array for servers*/
98 int *probeOK; /*Array: was latest probe successful?*/
101 extern int fsprobe_numServers; /*# servers connected*/
102 extern struct fsprobe_ConnectionInfo *fsprobe_ConnInfo; /*Ptr to connections*/
103 extern int numCollections; /*Num data collections*/
104 extern struct fsprobe_ProbeResults fsprobe_Results; /*Latest probe results*/
106 extern int fsprobe_Init();
109 * Initialize the fsprobe module: set up Rx connections to the
110 * given set of servers, start up the probe and callback LWPs,
111 * and associate the routine to be called when a probe completes.
114 * int a_numServers : Num. servers to connect to.
115 * struct sockaddr_in *a_socketArray : Array of server sockets.
116 * int a_ProbeFreqInSecs : Probe frequency in seconds.
117 * int (*a_ProbeHandler)() : Ptr to probe handler fcn.
118 * int a_debug : Turn debugging output on?
122 * Error value otherwise.
125 extern int fsprobe_ForceProbeNow();
128 * Force an immediate probe to the connected FileServers.
135 * Error value otherwise.
138 extern int fsprobe_Cleanup();
141 * Clean up our memory and connection state.
144 * int a_releaseMem : Should we free up malloc'ed areas?
147 * 0 on total success,
148 * -1 if the module was never initialized, or there was a problem
149 * with the fsprobe connection array.
152 #endif /* __fsprobe_h */