
/*
 *  DStat.C
 */

#include "lib.h"

int
DStat(host, buffer, max)
char *host;
APTR buffer;
long max;
{
    IOSTD ior;
    char buf[sizeof(DNETPORTNAME)+32];
    PORT *replyport = CreatePort(NULL, 0);
    PORT *dnetport;

    if (!host)
	host = "0";
    sprintf(buf, "%s%s", DNETPORTNAME, host);
    if (dnetport = FindPort(buf)) {
	ior.io_Command = DNCMD_INFO;
	ior.io_Unit = 0;
	ior.io_Offset = 0;
	ior.io_Data = buffer;
	ior.io_Message.mn_ReplyPort = replyport;
	PutMsg(dnetport, (MSG *)&ior);
	WaitMsg(&ior);
	DeletePort(replyport);
    }
    return(dnetport != NULL);
}

