#include <afs/xstat_fs.h>
#include <afs/xstat_cm.h>
+#include "afsmonitor.h"
/* Extern Variables */
extern FILE *debugFD; /* debug file FD */
extern char errMsg[256]; /* error message buffer */
-extern int afsmon_Exit(); /* exit routine */
-
static FILE *fs_outFD; /* fs output file descriptor */
static FILE *cm_outFD; /* cm output file descriptor */
*------------------------------------------------------------------------*/
void
-Print_fs_OverallPerfInfo(a_ovP)
- struct afs_PerfStats *a_ovP;
-
+Print_fs_OverallPerfInfo(struct afs_PerfStats *a_ovP)
{ /*Print_fs_OverallPerfInfo */
fprintf(fs_outFD, "\t%10d numPerfCalls\n\n", a_ovP->numPerfCalls);
*------------------------------------------------------------------------*/
void
-Print_fs_OpTiming(a_opIdx, a_opTimeP)
- int a_opIdx;
- struct fs_stats_opTimingData *a_opTimeP;
-
+Print_fs_OpTiming(int a_opIdx, struct fs_stats_opTimingData *a_opTimeP)
{ /*Print_fs_OpTiming */
fprintf(fs_outFD,
*------------------------------------------------------------------------*/
void
-Print_fs_XferTiming(a_opIdx, a_xferP)
- int a_opIdx;
- struct fs_stats_xferData *a_xferP;
-
+Print_fs_XferTiming(int a_opIdx, struct fs_stats_xferData *a_xferP)
{ /*Print_fs_XferTiming */
fprintf(fs_outFD,
*------------------------------------------------------------------------*/
void
-Print_fs_DetailedPerfInfo(a_detP)
- struct fs_stats_DetailedStats *a_detP;
-
+Print_fs_DetailedPerfInfo(struct fs_stats_DetailedStats *a_detP)
{ /*Print_fs_DetailedPerfInfo */
int currIdx; /*Loop variable */
*------------------------------------------------------------------------*/
void
-Print_fs_FullPerfInfo(a_fs_Results)
- struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */
+Print_fs_FullPerfInfo(struct xstat_fs_ProbeResults *a_fs_Results)
{ /*Print_fs_FullPerfInfo */
-
- static char rn[] = "Print_fs_FullPerfInfo"; /*Routine name */
static afs_int32 fullPerfLongs = (sizeof(struct fs_stats_FullPerfStats) >> 2); /*Correct # longs to rcv */
afs_int32 numLongs; /*# longwords received */
struct fs_stats_FullPerfStats *fullPerfP; /*Ptr to full perf stats */
* As advertised.
*------------------------------------------------------------------------*/
int
-afsmon_fsOutput(a_outfile, a_detOutput)
- char *a_outfile; /* ptr to output file name */
- int a_detOutput; /* detailed output ? */
+afsmon_fsOutput(char *a_outfile, /* ptr to output file name */
+ int a_detOutput) /* detailed output ? */
{
static char rn[] = "afsmon_fsOutput"; /* routine name */
*------------------------------------------------------------------------*/
void
-Print_cm_UpDownStats(a_upDownP)
- struct afs_stats_SrvUpDownInfo *a_upDownP; /*Ptr to server up/down info */
-
+Print_cm_UpDownStats(struct afs_stats_SrvUpDownInfo *a_upDownP) /*Ptr to server up/down info */
{ /*Print_cm_UpDownStats */
/*
*------------------------------------------------------------------------*/
void
-Print_cm_OverallPerfInfo(a_ovP)
- struct afs_stats_CMPerf *a_ovP;
-
+Print_cm_OverallPerfInfo(struct afs_stats_CMPerf *a_ovP)
{ /*Print_cm_OverallPerfInfo */
fprintf(cm_outFD, "\t%10d numPerfCalls\n", a_ovP->numPerfCalls);
*------------------------------------------------------------------------*/
void
-Print_cm_PerfInfo()
+Print_cm_PerfInfo(void)
{ /*Print_cm_PerfInfo */
-
- static char rn[] = "Print_cm_PerfInfo"; /*Routine name */
static afs_int32 perfLongs = (sizeof(struct afs_stats_CMPerf) >> 2); /*Correct # longs to rcv */
afs_int32 numLongs; /*# longwords received */
struct afs_stats_CMPerf *perfP; /*Ptr to performance stats */
*------------------------------------------------------------------------*/
void
-Print_cm_OpTiming(a_opIdx, a_opNames, a_opTimeP)
- int a_opIdx;
- char *a_opNames[];
- struct afs_stats_opTimingData *a_opTimeP;
-
+Print_cm_OpTiming(int a_opIdx, char *a_opNames[],
+ struct afs_stats_opTimingData *a_opTimeP)
{ /*Print_cm_OpTiming */
fprintf(cm_outFD,
*------------------------------------------------------------------------*/
void
-Print_cm_XferTiming(a_opIdx, a_opNames, a_xferP)
- int a_opIdx;
- char *a_opNames[];
- struct afs_stats_xferData *a_xferP;
-
+Print_cm_XferTiming(int a_opIdx, char *a_opNames[],
+ struct afs_stats_xferData *a_xferP)
{ /*Print_cm_XferTiming */
fprintf(cm_outFD,
*------------------------------------------------------------------------*/
void
-Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP)
- int a_opIdx;
- char *a_opNames[];
- struct afs_stats_RPCErrors *a_opErrP;
-
+Print_cm_ErrInfo(int a_opIdx, char *a_opNames[],
+ struct afs_stats_RPCErrors *a_opErrP)
{ /*Print_cm_ErrInfo */
fprintf(cm_outFD,
*------------------------------------------------------------------------*/
void
-Print_cm_RPCPerfInfo(a_rpcP)
- struct afs_stats_RPCOpInfo *a_rpcP;
-
+Print_cm_RPCPerfInfo(struct afs_stats_RPCOpInfo *a_rpcP)
{ /*Print_cm_RPCPerfInfo */
int currIdx; /*Loop variable */
*------------------------------------------------------------------------*/
void
-Print_cm_FullPerfInfo()
+Print_cm_FullPerfInfo(void)
{ /*Print_cm_FullPerfInfo */
- static char rn[] = "Print_cm_FullPerfInfo"; /* routine name */
struct afs_stats_AuthentInfo *authentP; /*Ptr to authentication stats */
struct afs_stats_AccessInfo *accessinfP; /*Ptr to access stats */
static afs_int32 fullPerfLongs = (sizeof(struct afs_stats_CMFullPerf) >> 2); /*Correct #longs */
* As advertised.
*------------------------------------------------------------------------*/
int
-afsmon_cmOutput(a_outfile, a_detOutput)
- char *a_outfile; /* ptr to output file name */
- int a_detOutput; /* detailed output ? */
+afsmon_cmOutput(char *a_outfile, /* ptr to output file name */
+ int a_detOutput) /* detailed output ? */
{
static char rn[] = "afsmon_cmOutput"; /* routine name */
#include <gtxwindows.h> /*Generic window package */
#include <gtxobjects.h> /*Object definitions */
+#include <gtxkeymap.h>
#if 0
#include <gtxtextcb.h> /*Text object circular buffer interface */
#include <gtxtextobj.h> /*Text object interface */
*------------------------------------------------------------------------*/
static struct onode *
-initLightObject(a_name, a_x, a_y, a_width, a_win)
- char *a_name;
- int a_x;
- int a_y;
- int a_width;
- struct gwin *a_win;
-
+initLightObject(char *a_name, int a_x, int a_y, int a_width,
+ struct gwin *a_win)
{ /*initLightObject */
-
- static char rn[] = "initLightObject"; /*Routine name */
struct onode *newlightp; /*Ptr to new light onode */
struct gator_light_crparams light_crparams; /*Light creation params */
char *truncname; /*Truncated name, if needed */
*------------------------------------------------------------------------*/
int
-justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc)
- char *a_srcbuff;
- char *a_dstbuff;
- int a_dstwidth;
- int a_justification;
- int a_rightTrunc;
-
+justify_light(char *a_srcbuff, char *a_dstbuff, int a_dstwidth,
+ int a_justification, int a_rightTrunc)
{ /*justify_light */
static char rn[] = "justify_light"; /*Routine name */
*----------------------------------------------------------------------*/
int
-afsmonExit_gtx()
+afsmonExit_gtx(void *d1, void *d2)
{
static char rn[] = "afsmonExit_gtx";
*----------------------------------------------------------------------*/
int
-ovw_refresh(a_pageNum, a_updateType)
- int a_pageNum; /* page to refresh overview display */
- int a_updateType; /* OVW_UPDATE_FS = update fs column only,
+ovw_refresh(int a_pageNum, /* page to refresh overview display */
+ int a_updateType) /* OVW_UPDATE_FS = update fs column only,
* OVW_UPDATE_CM = update cm column only,
* OVW_UPDATE_BOTH = update fs & cm columns. Note that
* we do not want to update a column until the
struct cm_Display_Data *cmDataP; /* ptr to CM display data array */
int fsIdx; /* for counting # of CM hosts */
int cmIdx; /* for counting # of CM hosts */
- int next_page = 0; /* is there a next ovw page ? */
- int prev_page = 0; /* is there a previous ovw page */
char cmdLine[80]; /* buffer for command line */
char printBuf[256]; /* buffer to print to screen */
int i;
strcat(cmdLine, "]? ");
-
-
-
/* display the command line */
tmp_lightobj = (struct gator_lightobj *)ovw_cmd_o->o_data;
sprintf(printBuf, "%s", cmdLine);
RIGHT_JUSTIFY, 1);
gator_light_set(ovw_probeNum_o, 1);
-
-
/* update the file server names column if we are asked to */
if (numFS && (a_updateType & OVW_UPDATE_FS)) {
* Switch from the overview screen to the FS screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_2_fs()
+Switch_ovw_2_fs(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_2_fs";
* Switch from the overview screen to the CM screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_2_cm()
+Switch_ovw_2_cm(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_2_cm";
* Switch to the next page in overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_next()
+Switch_ovw_next(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_next";
* Switch to the last page in the overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_last()
+Switch_ovw_last(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_last";
* Switch to the previous page in the overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_prev()
+Switch_ovw_prev(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_prev";
* Switch to the first page in the overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_first()
+Switch_ovw_first(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_first";
*----------------------------------------------------------------------*/
int
-create_ovwFrame_objects()
+create_ovwFrame_objects(void)
{ /* create_ovwFrame_objects */
static char rn[] = "create_ovwFrame_objects";
*----------------------------------------------------------------------*/
int
-resolve_CmdLine(a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
- a_curr_LCol, a_cols_perPage, a_Data_Available)
- char *a_buffer; /* buffer to copy command line */
- int a_currFrame; /* current frame ovw, fs or cm? */
- int a_currPage; /* current page number */
- int a_numPages; /* number of pages of data */
- int a_numCols; /* number of columns of data to display */
- int a_curr_LCol; /* current number of leftmost column */
- int a_cols_perPage; /* number of columns per page */
-
+resolve_CmdLine(char *a_buffer, /* buffer to copy command line */
+ int a_currFrame, /* current frame ovw, fs or cm? */
+ int a_currPage, /* current page number */
+ int a_numPages, /* number of pages of data */
+ int a_numCols, /* number of columns of data to display */
+ int a_curr_LCol, /* current number of leftmost column */
+ int a_cols_perPage, /* number of columns per page */
+ int a_Data_Available)
{ /* resolve_CmdLine */
static char rn[] = "resolve_CmdLine";
int pageType;
if (afsmon_debug) {
fprintf(debugFD,
- "[ %s ] Called, a_buffer= %d, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n",
+ "[ %s ] Called, a_buffer= %p, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n",
rn, a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
a_curr_LCol, a_cols_perPage);
fflush(debugFD);
* 0 always
*----------------------------------------------------------------------*/
int
-display_Server_datum(a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, a_just,
- a_highlight)
-
- char *a_srcBuf; /* source buffer */
- struct onode *a_firstObj_o; /* first object */
- struct onode *a_secondObj_o; /* second object */
- int a_probeOK; /* probe OK ? */
- int a_just; /* justification */
- int a_highlight; /* highlight object ? */
-
+display_Server_datum(char *a_srcBuf, /* source buffer */
+ struct onode *a_firstObj_o, /* first object */
+ struct onode *a_secondObj_o, /* second object */
+ int a_probeOK, /* probe OK ? */
+ int a_just, /* justification */
+ int a_highlight) /* highlight object ? */
{ /* display_Server_datum */
static char rn[] = "display_Server_datum";
if (afsmon_debug) {
if (a_highlight)
fprintf(debugFD,
- "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %d, a_secondObj_o= %d, a_probeOK= %d, a_just= %d, a_highlight= %d\n",
+ "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %p, a_secondObj_o= %p, a_probeOK= %d, a_just= %d, a_highlight= %d\n",
rn, a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK,
a_just, a_highlight);
fflush(debugFD);
*----------------------------------------------------------------------*/
int
-display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o)
- char *a_srcBuf;
- struct onode *a_firstObj_o; /* first object */
- struct onode *a_secondObj_o; /* second object */
- struct onode *a_thirdObj_o; /* third object */
-
+display_Server_label(char *a_srcBuf,
+ struct onode *a_firstObj_o, /* first object */
+ struct onode *a_secondObj_o, /* second object */
+ struct onode *a_thirdObj_o) /* third object */
{ /* display_Server_label */
-
static char rn[] = "display_Server_label";
char part[3][20]; /* buffer for three parts of label */
char *strPtr;
}
}
}
-
+ return 0;
} /* display_Server_label */
int
-fs_refresh(a_pageNum, a_LcolNum)
- int a_pageNum; /* page to display */
- int a_LcolNum; /* starting (leftmost) column number */
-
+fs_refresh(int a_pageNum, /* page to display */
+ int a_LcolNum) /* starting (leftmost) column number */
{ /* fs_refresh */
static char rn[] = "fs_refresh"; /* routine name */
fs_pageType = resolve_CmdLine(cmdLine, 1 /* fs frame */ , a_pageNum,
fs_numPages, fs_numCols, a_LcolNum,
- fs_cols_perPage);
+ fs_cols_perPage, 0);
/* display the command line */
tmp_lightobj = (struct gator_lightobj *)fs_cmd_o->o_data;
* Switch from the File Server screen to the Overview Screen
*----------------------------------------------------------------------*/
int
-Switch_fs_2_ovw()
+Switch_fs_2_ovw(void *d1, void *d2)
{
/* bind the overview frame to the window */
gtxframe_SetFrame(afsmon_win, ovwFrame);
* Switch from the File Server screen to the Cache Managers screen.
*----------------------------------------------------------------------*/
int
-Switch_fs_2_cm()
+Switch_fs_2_cm(void *d1, void *d2)
{
if (fs_pageType & CMD_CM) {
/* bind the overview Cache Managers to the window */
* Switch to next page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_next()
+Switch_fs_next(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_next";
-
if (fs_pageType & CMD_NEXT) {
/* we have a next page, refresh with next page number */
fs_refresh(fs_currPage + 1, fs_curr_LCol);
* Switch to last page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_last()
+Switch_fs_last(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_last";
-
-
if (fs_pageType & CMD_NEXT) {
/* we have a next page, refresh with the last page number */
fs_refresh(fs_numPages, fs_curr_LCol);
* Switch to previous page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_prev()
+Switch_fs_prev(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_prev";
-
if (fs_pageType & CMD_PREV) {
/* we have a previous page, refresh with the rpevious page number */
fs_refresh(fs_currPage - 1, fs_curr_LCol);
* Switch to first page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_first()
+Switch_fs_first(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_first";
-
if (fs_pageType & CMD_PREV) {
/* we have a previous page, got to first page */
fs_refresh(1, fs_curr_LCol);
* Scroll left on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_left()
+Switch_fs_left(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_left";
-
if (fs_pageType & CMD_LEFT) {
/* we have columns on left, refresh with new column number */
fs_refresh(fs_currPage, fs_curr_LCol - fs_cols_perPage);
* Scroll to first column on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_leftmost()
+Switch_fs_leftmost(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_leftmost";
-
if (fs_pageType & CMD_LEFT) {
/* we have columns on left, go to the first */
fs_refresh(fs_currPage, 0);
* Scroll right on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_right()
+Switch_fs_right(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_right";
-
if (fs_pageType & CMD_RIGHT) {
/* we have columns on right, refresh with new column number */
fs_refresh(fs_currPage, fs_curr_LCol + fs_cols_perPage);
* Scroll to last column on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_rightmost()
+Switch_fs_rightmost(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_rightmost";
int curr_LCol;
-
if (fs_pageType & CMD_RIGHT) {
/* we have columns on right, go to the last column */
if (fs_numCols % fs_cols_perPage)
*----------------------------------------------------------------------*/
int
-create_FSframe_objects()
+create_FSframe_objects(void)
{ /* create_FSframe_objects */
static char rn[] = "create_FSframe_objects";
struct ServerInfo_line *fs_lines_Ptr;
*----------------------------------------------------------------------*/
int
-cm_refresh(a_pageNum, a_LcolNum)
- int a_pageNum; /* page to display */
- int a_LcolNum; /* starting (leftmost) column number */
-
+cm_refresh(int a_pageNum, /* page to display */
+ int a_LcolNum) /* starting (leftmost) column number */
{ /* cm_refresh */
static char rn[] = "cm_refresh"; /* routine name */
cm_pageType = resolve_CmdLine(cmdLine, 2 /* cm frame */ , a_pageNum,
cm_numPages, cm_numCols, a_LcolNum,
- cm_cols_perPage);
+ cm_cols_perPage, 0);
/* display the command line */
tmp_lightobj = (struct gator_lightobj *)cm_cmd_o->o_data;
* Switch from the Cache Manager screen to the Overview Screen
*----------------------------------------------------------------------*/
int
-Switch_cm_2_ovw()
+Switch_cm_2_ovw(void *d1, void *d2)
{
/* bind the overview frame to the window */
gtxframe_SetFrame(afsmon_win, ovwFrame);
* Switch from the Cache Manager screen to the File Servers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_2_fs()
+Switch_cm_2_fs(void *d1, void *d2)
{
if (cm_pageType & CMD_FS) {
/* bind the file servers frame to the window */
* Switch to next page of cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_next()
+Switch_cm_next(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_next";
-
if (cm_pageType & CMD_NEXT) {
/* we have a next page, refresh with next page number */
cm_refresh(cm_currPage + 1, cm_curr_LCol);
* Switch to last page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_cm_last()
+Switch_cm_last(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_last";
-
-
if (cm_pageType & CMD_NEXT) {
/* we have a next page, refresh with last page number */
cm_refresh(cm_numPages, cm_curr_LCol);
* Switch to previous page of cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_prev()
+Switch_cm_prev(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_prev";
-
if (cm_pageType & CMD_PREV) {
/* we have a previous page, refresh to previous page */
cm_refresh(cm_currPage - 1, cm_curr_LCol);
* Switch to first page of cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_first()
+Switch_cm_first(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_first";
-
if (cm_pageType & CMD_PREV) {
/* we have a previous page, refresh to first page */
cm_refresh(1, cm_curr_LCol);
* Scroll left on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_left()
+Switch_cm_left(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_left";
-
if (cm_pageType & CMD_LEFT) {
/* we have columns on left, refresh with new column number */
cm_refresh(cm_currPage, cm_curr_LCol - cm_cols_perPage);
* Scroll to first column on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_leftmost()
+Switch_cm_leftmost(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_leftmost";
-
if (cm_pageType & CMD_LEFT) {
/* we have columns on left, go to the first column */
cm_refresh(cm_currPage, 0);
* Scroll right on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_right()
+Switch_cm_right(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_right";
-
if (cm_pageType & CMD_RIGHT) {
/* we have columns on right, refresh with new column number */
cm_refresh(cm_currPage, cm_curr_LCol + cm_cols_perPage);
* Scroll to last column on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_rightmost()
+Switch_cm_rightmost(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_rightmost";
int curr_LCol;
-
if (cm_pageType & CMD_RIGHT) {
/* we have columns on right, go to the last column */
if (cm_numCols % cm_cols_perPage)
*----------------------------------------------------------------------*/
int
-create_CMframe_objects()
+create_CMframe_objects(void)
{ /* create_CMframe_objects */
static char rn[] = "create_CMframe_objects";
struct ServerInfo_line *cm_lines_Ptr;
}
-
-
-
-
-
/* initialize the column & page counters */
cm_currPage = 1;
* for the overview, File Servers & Cache Managers screens.
*----------------------------------------------------------------------*/
int
-gtx_initialize()
+gtx_initialize(void)
{ /* gtx_initialize */
static char rn[] = "gtx_initialize"; /* routine name */
int code;
#include <gtxdumbwin.h> /*Dumb terminal window package */
#include <gtxX11win.h> /*X11 window package */
#include <gtxframe.h> /*Frame package */
-
-
+#include <gtxinput.h>
#include <afs/xstat_fs.h>
#include <afs/xstat_cm.h>
-
#include "afsmonitor.h"
-
/* command line parameter indices */
#define P_CONFIG 0
/* names of the last host processed in the config file */
static char last_fsHost[HOST_NAME_LEN];
static char last_cmHost[HOST_NAME_LEN];
-static lastHostType = 0; /* 0 = no host entries processed
+static int lastHostType = 0; /* 0 = no host entries processed
* 1 = last host was file server
* 2 = last host was cache manager. */
/* for previous probe cycle */
struct cm_Display_Data *prev_cmData = (struct cm_Display_Data *)0;
-
/* EXTERN DEFINITIONS */
-extern struct hostent *hostutil_GetHostByName();
-
-
-
-/* routines from afsmon-output.c */
-extern int afsmon_fsOutput();
-extern int afsmon_cmOutput();
-
/* file server and cache manager variable names (from afsmon_labels.h) */
extern char *fs_varNames[];
extern char *cm_varNames[];
/* flag to indicate that atleast one probe cycle has completed and
data is available for updating the display */
-extern fs_Data_Available;
-extern cm_Data_Available;
+extern int fs_Data_Available;
+extern int cm_Data_Available;
extern int gtx_initialized; /* gtx initialized ? */
#endif
struct hostent *
-GetHostByName(name)
- char *name;
+GetHostByName(char *name)
{
struct hostent *he;
#ifdef AFS_SUN5_ENV
*----------------------------------------------------------------------*/
int
-afsmon_Exit(a_exitVal)
- int a_exitVal; /* exit code */
+afsmon_Exit(int a_exitVal) /* exit code */
{ /* afsmon_Exit */
static char rn[] = "afsmon_Exit";
struct afsmon_fs_Results_list *tmp_fslist;
*----------------------------------------------------------------------*/
int
-insert_FS(a_hostName)
- char *a_hostName; /* name of cache manager to be inserted in list */
+insert_FS(char *a_hostName) /* name of cache manager to be inserted in list */
{ /* insert_FS() */
- static char rn[] = "insert_FS"; /* routine name */
static struct afsmon_hostEntry *curr_item;
static struct afsmon_hostEntry *prev_item;
* Nothing.
*----------------------------------------------------------------------*/
void
-print_FS()
+print_FS(void)
{ /* print_FS() */
static char rn[] = "print_FS";
struct afsmon_hostEntry *tempFS;
*----------------------------------------------------------------------*/
int
-insert_CM(a_hostName)
- char *a_hostName; /* name of cache manager to be inserted in list */
+insert_CM(char *a_hostName) /* name of cache manager to be inserted in list */
{ /* insert_CM */
- static char rn[] = "insert_CM"; /* routine name */
static struct afsmon_hostEntry *curr_item;
static struct afsmon_hostEntry *prev_item;
* Nothing.
*----------------------------------------------------------------------*/
int
-print_CM()
+print_CM(void)
{ /* print_CM() */
static char rn[] = "print_CM";
struct afsmon_hostEntry *tempCM;
*----------------------------------------------------------------------*/
int
-parse_hostEntry(a_line)
- char *a_line;
+parse_hostEntry(char *a_line)
{ /* parse_hostEntry */
static char rn[] = "parse_hostEntry"; /* routine name */
*----------------------------------------------------------------------*/
int
-parse_threshEntry(a_line)
- char *a_line;
+parse_threshEntry(char *a_line)
{ /* parse_threshEntry */
static char rn[] = "parse_threshEntry"; /* routine name */
char opcode[CFG_STR_LEN]; /* specifies type of config entry */
*----------------------------------------------------------------------*/
int
-store_threshold(a_type, a_varName, a_value, a_handler)
- int a_type; /* 1 = fs , 2 = cm */
- char *a_varName; /* threshold name */
- char *a_value; /* threshold value */
- char *a_handler; /* threshold overflow handler */
-
+store_threshold(int a_type, /* 1 = fs , 2 = cm */
+ char *a_varName, /* threshold name */
+ char *a_value, /* threshold value */
+ char *a_handler) /* threshold overflow handler */
{ /* store_thresholds */
static char rn[] = "store_thresholds"; /* routine name */
*----------------------------------------------------------------------*/
int
-parse_showEntry(a_line)
- char *a_line;
+parse_showEntry(char *a_line)
{ /* parse_showEntry */
static char rn[] = "parse_showEntry";
char opcode[CFG_STR_LEN]; /* specifies type of config entry */
idx++;
numGroups--;
} /* for each group in section */
-
-
-
-
-
-
} else { /* it is a variable name */
for (i = 0; i < NUM_CM_STAT_ENTRIES; i++) {
}
/* it is an cm entry */
return (0);
-
-
} /* parse_showEntry */
*----------------------------------------------------------------------*/
int
-process_config_file(a_config_filename)
- char *a_config_filename;
+process_config_file(char *a_config_filename)
{ /* process_config_file() */
static char rn[] = "process_config_file"; /* routine name */
FILE *configFD; /* config file descriptor */
*----------------------------------------------------------------------*/
void
-Print_FS_CB()
+Print_FS_CB(void)
{ /* Print_FS_CB() */
struct afsmon_fs_Results_list *fslist;
* Failure: Exits afsmonitor.
*----------------------------------------------------------------------*/
int
-save_FS_results_inCB(a_newProbeCycle)
- int a_newProbeCycle; /* start of a new probe cycle ? */
-
+save_FS_results_inCB(int a_newProbeCycle) /* start of a new probe cycle ? */
{ /* save_FS_results_inCB() */
static char rn[] = "save_FS_results_inCB"; /* routine name */
struct afsmon_fs_Results_list *tmp_fslist_item; /* temp fs list item */
*----------------------------------------------------------------------*/
int
-fs_Results_ltoa(a_fsData, a_fsResults)
- struct fs_Display_Data *a_fsData; /* target buffer */
- struct xstat_fs_ProbeResults *a_fsResults; /* ptr to xstat fs Results */
+fs_Results_ltoa(struct fs_Display_Data *a_fsData, /* target buffer */
+ struct xstat_fs_ProbeResults *a_fsResults) /* ptr to xstat fs Results */
{ /* fs_Results_ltoa */
static char rn[] = "fs_Results_ltoa"; /* routine name */
afs_int32 *tmpbuf;
if (afsmon_debug) {
- fprintf(debugFD, "[ %s ] Called, a_fsData= %d, a_fsResults= %d\n", rn,
+ fprintf(debugFD, "[ %s ] Called, a_fsData= %p, a_fsResults= %p\n", rn,
a_fsData, a_fsResults);
fflush(debugFD);
}
*----------------------------------------------------------------------*/
int
-execute_thresh_handler(a_handler, a_hostName, a_hostType, a_threshName,
- a_threshValue, a_actValue)
- char *a_handler; /* ptr to handler function + args */
- char *a_hostName; /* host name for which threshold crossed */
- int a_hostType; /* fs or cm ? */
- char *a_threshName; /* threshold variable name */
- char *a_threshValue; /* threshold value */
- char *a_actValue; /* actual value */
-
+execute_thresh_handler(char *a_handler, /* ptr to handler function + args */
+ char *a_hostName, /* host name for which threshold crossed */
+ int a_hostType, /* fs or cm ? */
+ char *a_threshName, /* threshold variable name */
+ char *a_threshValue, /* threshold value */
+ char *a_actValue) /* actual value */
{ /* execute_thresh_handler */
static char rn[] = "execute_thresh_handler";
*----------------------------------------------------------------------*/
int
-check_fs_thresholds(a_hostEntry, a_Data)
- struct afsmon_hostEntry *a_hostEntry; /* ptr to hostEntry */
- struct fs_Display_Data *a_Data; /* ptr to fs data to be displayed */
-
+check_fs_thresholds(struct afsmon_hostEntry *a_hostEntry, /* ptr to hostEntry */
+ struct fs_Display_Data *a_Data) /* ptr to fs data to be displayed */
{ /* check_fs_thresholds */
static char rn[] = "check_fs_thresholds";
int count; /* number of thresholds exceeded */
if (afsmon_debug) {
- fprintf(debugFD, "[ %s ] Called, a_hostEntry= %d, a_Data= %d\n", rn,
+ fprintf(debugFD, "[ %s ] Called, a_hostEntry= %p, a_Data= %p\n", rn,
a_hostEntry, a_Data);
fflush(debugFD);
}
*----------------------------------------------------------------------*/
int
-save_FS_data_forDisplay(a_fsResults)
- struct xstat_fs_ProbeResults *a_fsResults;
+save_FS_data_forDisplay(struct xstat_fs_ProbeResults *a_fsResults)
{ /* save_FS_data_forDisplay */
static char rn[] = "save_FS_data_forDisplay"; /* routine name */
if (afsmon_debug) {
- fprintf(debugFD, "[ %s ] Called, a_fsResults= %d\n", rn, a_fsResults);
+ fprintf(debugFD, "[ %s ] Called, a_fsResults= %p\n", rn, a_fsResults);
fflush(debugFD);
}
-
-
/* store results in the display array */
okay = 0;
afsmon_Exit(75);
}
-
-
-
/* print the info we just saved */
if (afsmon_debug) {
*----------------------------------------------------------------------*/
int
-afsmon_FS_Handler()
+afsmon_FS_Handler(void)
{ /* afsmon_FS_Handler() */
static char rn[] = "afsmon_FS_Handler"; /* routine name */
int newProbeCycle; /* start of new probe cycle ? */
*----------------------------------------------------------------------*/
void
-Print_CM_CB()
+Print_CM_CB(void)
{ /* Print_CM_CB() */
struct afsmon_cm_Results_list *cmlist;
*----------------------------------------------------------------------*/
int
-save_CM_results_inCB(a_newProbeCycle)
- int a_newProbeCycle; /* start of new probe cycle ? */
-
+save_CM_results_inCB(int a_newProbeCycle) /* start of new probe cycle ? */
{ /* save_CM_results_inCB() */
static char rn[] = "save_CM_results_inCB"; /* routine name */
struct afsmon_cm_Results_list *tmp_cmlist_item; /* temp cm list item */
*----------------------------------------------------------------------*/
int
-cm_Results_ltoa(a_cmData, a_cmResults)
- struct cm_Display_Data *a_cmData; /* target buffer */
- struct xstat_cm_ProbeResults *a_cmResults; /* ptr to xstat cm Results */
+cm_Results_ltoa(struct cm_Display_Data *a_cmData, /* target buffer */
+ struct xstat_cm_ProbeResults *a_cmResults) /* ptr to xstat cm Results */
{ /* cm_Results_ltoa */
static char rn[] = "cm_Results_ltoa"; /* routine name */
afs_int32 numLongs;
if (afsmon_debug) {
- fprintf(debugFD, "[ %s ] Called, a_cmData= %d, a_cmResults= %d\n", rn,
+ fprintf(debugFD, "[ %s ] Called, a_cmData= %p, a_cmResults= %p\n", rn,
a_cmData, a_cmResults);
fflush(debugFD);
}
*----------------------------------------------------------------------*/
int
-check_cm_thresholds(a_hostEntry, a_Data)
- struct afsmon_hostEntry *a_hostEntry; /* ptr to hostEntry */
- struct cm_Display_Data *a_Data; /* ptr to cm data to be displayed */
-
+check_cm_thresholds(struct afsmon_hostEntry *a_hostEntry, /* ptr to hostEntry */
+ struct cm_Display_Data *a_Data) /* ptr to cm data to be displayed */
{ /* check_cm_thresholds */
static char rn[] = "check_cm_thresholds";
int count; /* number of thresholds exceeded */
if (afsmon_debug) {
- fprintf(debugFD, "[ %s ] Called, a_hostEntry= %d, a_Data= %d\n", rn,
+ fprintf(debugFD, "[ %s ] Called, a_hostEntry= %p, a_Data= %p\n", rn,
a_hostEntry, a_Data);
fflush(debugFD);
}
*----------------------------------------------------------------------*/
int
-save_CM_data_forDisplay(a_cmResults)
- struct xstat_cm_ProbeResults *a_cmResults;
+save_CM_data_forDisplay(struct xstat_cm_ProbeResults *a_cmResults)
{ /* save_CM_data_forDisplay */
static char rn[] = "save_CM_data_forDisplay"; /* routine name */
int i;
if (afsmon_debug) {
- fprintf(debugFD, "[ %s ] Called, a_cmResults= %d\n", rn, a_cmResults);
+ fprintf(debugFD, "[ %s ] Called, a_cmResults= %p\n", rn, a_cmResults);
fflush(debugFD);
}
afsmon_Exit(105);
}
-
/* print the info we just saved */
if (afsmon_debug) {
fprintf(debugFD, "\n\t\t ----- CM display data ------\n");
*----------------------------------------------------------------------*/
int
-afsmon_CM_Handler()
+afsmon_CM_Handler(void)
{ /* afsmon_CM_Handler() */
static char rn[] = "afsmon_CM_Handler"; /* routine name */
int code; /* return status */
*----------------------------------------------------------------------*/
int
-init_fs_buffers()
+init_fs_buffers(void)
{ /* init_fs_buffers() */
static char rn[] = "init_fs_buffers"; /* routine name */
struct afsmon_fs_Results_list *new_fslist_item; /* ptr for new struct */
*----------------------------------------------------------------------*/
int
-init_cm_buffers()
+init_cm_buffers(void)
{ /* init_cm_buffers() */
static char rn[] = "init_cm_buffers"; /* routine name */
struct afsmon_cm_Results_list *new_cmlist_item; /* ptr for new struct */
*------------------------------------------------------------------------*/
int
-init_print_buffers()
+init_print_buffers(void)
{ /* init_print_buffers */
static char rn[] = "init_print_buffers"; /* routine name */
}
-
-
/* if file servers to monitor */
/* allocate numCM blocks of the CM print structure */
/* we need two instances of this structure for the same reasons as above */
*----------------------------------------------------------------------*/
void
-quit_signal(sig)
- int sig;
+quit_signal(int sig)
{ /* quit_signal */
- static char *rn = "quit_signal"; /* routine name */
-
fprintf(stderr, "Received signal %d \n", sig);
afsmon_Exit(120);
} /* quit_signal */
*----------------------------------------------------------------------*/
int
-afsmon_execute()
+afsmon_execute(void)
{ /* afsmon_execute() */
static char rn[] = "afsmon_execute"; /* routine name */
static char fullhostname[128]; /* full host name */
}
/* start the gtx input server */
- code = gtx_InputServer(afsmon_win);
+ code = (int) gtx_InputServer(afsmon_win);
if (code) {
fprintf(stderr, "[ %s ] Failed to start input server \n", rn);
afsmon_Exit(140);
int i;
if (afsmon_debug) {
- fprintf(debugFD, "[ %s ] Called, as= %d\n", rn, as);
+ fprintf(debugFD, "[ %s ] Called, as= %p\n", rn, as);
fflush(debugFD);
}
#include "AFS_component_version_number.c"
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{ /* main() */
-
- static char rn[] = "main"; /* routine name */
afs_int32 code; /*Return code */
struct cmd_syndesc *ts; /*Ptr to cmd line syntax descriptor */
/* Set this enable detailed debugging with the -debug switch */
#define DETAILED_DEBUG 0
+
+/* afsmon-output.c */
+
+extern int afsmon_fsOutput(char *, int);
+extern int afsmon_cmOutput(char *, int);
+
+/* afsmon-win.c */
+
+extern int ovw_refresh(int, int);
+extern int fs_refresh(int, int);
+extern int cm_refresh(int, int);
+extern int gtx_initialize(void);
+