AFS-Monitor
view release on metacpan or search on metacpan
src/Monitor.xs view on Meta::CPAN
av_store(CACHE_ENTRIES, i, newRV_inc((SV *) CENTRY));
continue;
}
if (((aint32 == 0) && !IsLocked(¢ry.lock)) ||
((aint32 == 2) && (centry.refCount == 0)) ||
((aint32 == 4) && (centry.callback == 0)))
continue;
/* otherwise print this entry */
hv_store(CENTRY, "cell", 4, newSViv(centry.cell), 0);
NETFID = newHV();
hv_store(NETFID, "Vnode", 5, newSViv(centry.netFid.Vnode), 0);
hv_store(NETFID, "Volume", 6, newSViv(centry.netFid.Volume), 0);
hv_store(NETFID, "Unique", 6, newSViv(centry.netFid.Unique), 0);
hv_store(CENTRY, "netFid", 6, newRV_inc((SV *) NETFID), 0);
#ifdef USE_GETCELLNAME
cellname = GetCellName(aconn, centry.cell);
if (cellname)
hv_store(CENTRY, "cellname", 8, newSVpv(cellname, 0), 0);
#endif
if (IsLocked(¢ry.lock)) {
LOCK = newHV();
my_PrintLock(¢ry.lock, LOCK);
hv_store(CENTRY, "lock", 4, newRV_inc((SV *) LOCK), 0);
}
hv_store(CENTRY, "Length", 6, newSViv(centry.Length), 0);
hv_store(CENTRY, "DataVersion", 11, newSViv(centry.DataVersion), 0);
hv_store(CENTRY, "refCount", 8, newSViv(centry.refCount), 0);
hv_store(CENTRY, "callback", 8, newSViv(centry.callback), 0);
hv_store(CENTRY, "cbExpires", 9, newSViv(centry.cbExpires), 0);
hv_store(CENTRY, "opens", 5, newSViv(centry.opens), 0);
hv_store(CENTRY, "writers", 7, newSViv(centry.writers), 0);
/* now display states */
if (centry.mvstat == 0)
data_name = "normal file";
else if (centry.mvstat == 1)
data_name = "mount point";
else if (centry.mvstat == 2)
data_name = "volume root";
else if (centry.mvstat == 3)
data_name = "directory";
else if (centry.mvstat == 4)
data_name = "symlink";
else if (centry.mvstat == 5)
data_name = "microsoft dfs link";
else if (centry.mvstat == 6)
data_name = "invalid link";
else
data_name = "bogus mvstat";
hv_store(CENTRY, "mvstat", 6, newSVpv(data_name, strlen(data_name)), 0);
data_name = "";
if (centry.states & 1)
sprintf(data_name, "%s, stat'd", data_name);
if (centry.states & 2)
sprintf(data_name, "%s, backup", data_name);
if (centry.states & 4)
sprintf(data_name, "%s, read-only", data_name);
if (centry.states & 8)
sprintf(data_name, "%s, mt pt valid", data_name);
if (centry.states & 0x10)
sprintf(data_name, "%s, pending core", data_name);
if (centry.states & 0x40)
sprintf(data_name, "%s, wait-for-store", data_name);
if (centry.states & 0x80)
sprintf(data_name, "%s, mapped", data_name);
hv_store(CENTRY, "states", 6, newSVpv(data_name, strlen(data_name)), 0);
av_store(CACHE_ENTRIES, i, newRV_inc((SV *) CENTRY));
}
return 0;
}
/*
* from src/venus/cmdebug.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_PrintCacheEntries(struct rx_connection *aconn, int aint32,
AV *CACHE_ENTRIES, char *buffer)
{
register afs_int32 code;
struct AFSDBCacheEntry64 centry64;
code = RXAFSCB_GetCE64(aconn, 0, ¢ry64);
if (code != RXGEN_OPCODE)
return PrintCacheEntries64(aconn, aint32, CACHE_ENTRIES, buffer);
else
return PrintCacheEntries32(aconn, aint32, CACHE_ENTRIES, buffer);
}
#endif /* ifdef OpenAFS_1_4 */
/* end of cmdebug helper functions */
/* udebug helper functions */
/*
* from src/ubik/ubik.h
*
*/
#define MAXSKEW 10
/*
* from src/ubik/udebug.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
static short
udebug_PortNumber(register char *aport)
( run in 1.702 second using v1.01-cache-2.11-cpan-39bf76dae61 )