
/*
 *  STATDNET.C
 *
 *  DNET (c)Copyright 1988, Matthew Dillon, All Rights Reserved.
 *
 *  STATDNET [-Nnet]
 *
 */

#include <stdio.h>
#include "/version.h"

char buf[2048];

main(ac,av)
char *av[];
{
    int ok;
    char *host = NULL;

    printf("StatDNet V%s%s\n", VERSION, STATDNET_VERSION);

    {
	register short i;
	for (i = 1; i < ac; ++i) {
	    if (strncmp(av[i], "-N", 2) == 0) {
		host = av[i] + 2;
		continue;
	    }
	}
    }
    fflush(stdout);
    buf[0] = 0;
    ok = DStat(host, buf, 2048);
    if (ok)
	write(1, buf, strlen(buf));
    else
	puts("DNET master port for network not found");
}

