home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
conlst.exe
/
CONNLIST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-29
|
2KB
|
57 lines
/****************************************************************************
** DISCLAIMER
**
** Novell, Inc. makes no representations or warranties with respect to
** any NetWare software, and specifically disclaims any express or
** implied warranties of merchantability, title, or fitness for a
** particular purpose.
**
** Distribution of any NetWare software is forbidden without the
** express written consent of Novell, Inc. Further, Novell reserves
** the right to discontinue distribution of any NetWare software.
**
** Novell is not responsible for lost profits or revenue, loss of use
** of the software, loss of data, costs of re-creating lost data, the
** cost of any substitute equipment or program, or claims by any party
** other than you. Novell strongly recommends a backup be made before
** any software is installed. Technical support for this software
** may be provided at the discretion of Novell.
****************************************************************************
#include <stdio.h>
#include <string.h>
#include <alloc.h>
#include <nwcalls.h>
void main (void)
{
NWCONN_HANDLE connHandle;
NWCONN_HANDLE *connList;
CONNECT_INFO connInfo;
NWNUMBER maxConns, numConns;
NWCCODE ccode;
char server[50];
int i;
ccode = NWCallsInit (NULL,NULL);
if (ccode) return;
NWGetMaximumConnections (&maxConns);
connList = malloc (maxConns * sizeof (NWCONN_HANDLE));
ccode = NWGetConnectionList (0, connList, maxConns, &numConns);
if (ccode)
{
free (connList);
return;
}
printf ("\nYou are connected to %d servers\n", numConns);
for (i = 0; i < numConns; i++)
{
NWGetFileServerName (connList[i], server);
printf ("ID: %04X Server: %s\n", connList[i], server);
}
free (connList);
}