home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
lan
/
who
/
whoall.c
< prev
next >
Wrap
Text File
|
1987-10-13
|
2KB
|
79 lines
/********************************************************************
WHO.C
Alternate menu function for Novell Netware
First code : 10/13/87
********************************************************************/
#include <stdio.h>
#include <dos.h>
union REGPACK r;
struct {
int length ;
char function;
char station ;
} req ;
struct {
int length ;
char uniqueid[4] ;
int type ;
char objectname[48] ;
char year ;
char month ;
char day ;
char hour ;
char minute ;
char logtime[3] ;
} who ;
struct {
int length ;
char network[4] ;
char host[6] ;
char socket[2] ;
} map ;
main()
{
int station,physical,mystation ;
char fg ;
r.r_ds=_DS ;
r.r_es=_DS ;
r.r_ax=(0xdc00) ;
intr(0x21,&r) ;
mystation=(r.r_ax & 0xff) ;
printf("Station Connect User DATE TIME \n"
"------- ------- --------------- -------- -----\n") ;
for (station=1; station<=20; station++) {
r.r_si=(int)&req ;
r.r_di=(int)&who ;
r.r_ax= (0xe300) ;
who.length=sizeof(who) ;
req.length=sizeof(req) ;
req.function=22 ;
req.station=station ;
intr(0x21,&r) ;
r.r_si=(int)&req ;
r.r_di=(int)&map ;
r.r_ax=0xe300 ;
req.length=sizeof(req) ;
req.function=19 ;
req.station=station ;
map.length=sizeof(map) ;
intr(0x21,&r) ;
physical=map.host[5] ;
if (station==mystation) fg='*' ;
else fg=' ' ;
if (who.objectname[0]!=0)
printf(" %3i %3i %c %-15s %02i/%02i/%02i %02i:%02i\n",
station,physical,fg,who.objectname,who.month,who.day,who.year,
who.hour,who.minute) ;
}
}