Add small program to list sessions using FIListSessions2.
This commit is contained in:
parent
33c4871183
commit
d08a36c9ca
|
@ -7,6 +7,9 @@ CFLAGS = -i -w -O95
|
||||||
DSITEST_OBJS = dsitest.o aspinterface.o dsi.o readtcp.o endian.o tcpconnection.o atipmapping.o asmglue.o cmdproc.o installcmds.o afpoptions.o strncasecmp.o
|
DSITEST_OBJS = dsitest.o aspinterface.o dsi.o readtcp.o endian.o tcpconnection.o atipmapping.o asmglue.o cmdproc.o installcmds.o afpoptions.o strncasecmp.o
|
||||||
DSITEST_PROG = dsitest
|
DSITEST_PROG = dsitest
|
||||||
|
|
||||||
|
LISTSESSIONS_OBJS = listsess.o callat.o
|
||||||
|
LISTSESSIONS_PROG = listsessions
|
||||||
|
|
||||||
MOUNTAFP_OBJS = afpmounter.o callat.o endian.o
|
MOUNTAFP_OBJS = afpmounter.o callat.o endian.o
|
||||||
MOUNTAFP_PROG = mountafp
|
MOUNTAFP_PROG = mountafp
|
||||||
|
|
||||||
|
@ -34,6 +37,9 @@ $(MOUNTAFP_PROG): $(MOUNTAFP_OBJS)
|
||||||
$(DUMPCMDTBL_PROG): $(DUMPCMDTBL_OBJS)
|
$(DUMPCMDTBL_PROG): $(DUMPCMDTBL_OBJS)
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
$(LISTSESSIONS_PROG): $(LISTSESSIONS_OBJS)
|
||||||
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
$(AFPBRIDGE_PROG): $(AFPBRIDGE_OBJS)
|
$(AFPBRIDGE_PROG): $(AFPBRIDGE_OBJS)
|
||||||
$(CC) $(CFLAGS) -M -o $@ $< > $@.map
|
$(CC) $(CFLAGS) -M -o $@ $< > $@.map
|
||||||
chtyp -tpif $@
|
chtyp -tpif $@
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <appletalk.h>
|
||||||
|
|
||||||
|
typedef struct ListSessions2ResultRec {
|
||||||
|
Byte sessionRefNum;
|
||||||
|
Byte slotDrive;
|
||||||
|
char volumeName[28];
|
||||||
|
Word volumeID;
|
||||||
|
char serverName[32];
|
||||||
|
char zoneName[33];
|
||||||
|
} ListSessions2ResultRec;
|
||||||
|
|
||||||
|
ListSessions2ResultRec ls2Results[20];
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
PFIListSessions2Rec listSessions2Rec;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
listSessions2Rec.async = 0;
|
||||||
|
listSessions2Rec.command = pfiListSessions2Command;
|
||||||
|
listSessions2Rec.bufferLength = sizeof(ls2Results);
|
||||||
|
listSessions2Rec.bufferPtr = (LongWord)&ls2Results;
|
||||||
|
i = _CALLAT(&listSessions2Rec);
|
||||||
|
if (i != 0) {
|
||||||
|
fprintf(stderr, "Error %04x\n", listSessions2Rec.result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < listSessions2Rec.entriesRtn; i++) {
|
||||||
|
printf("Session=%i, Volume=%b, Server=%b, Zone=%b\n",
|
||||||
|
ls2Results[i].sessionRefNum, ls2Results[i].volumeName,
|
||||||
|
ls2Results[i].serverName, ls2Results[i].zoneName);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue