home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
sbcast.exe
/
SETBCAST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-28
|
4KB
|
126 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.
****************************************************************************
**
** File: setbcast.c
**
** Desc: This code will set the BroadCast mode to
** 0x0000 Receive all broadcasts
** 0x0001 Recieve only server broadcasts. User messages not stored.
** 0x0002 Desable broadcasts. User messages not stored. Server
** messages are stored but notification is not given to the
** workstation.
** 0x0003 Both user and server messages are stored but message
** notification is not sent to the workstation. The client
** can poll for messages.
**
**
** Programmers:
** Ini Who Firm
** ------------------------------------------------------------------
** ARM A. Ray Maxwell Novell Developer Support.
**
** History:
**
** ------------------------------------------------------------------
** 09-25-95 ARM First code.
*/
/***************************************************************************
** Include headers, macros, function prototypes, etc.
*/
/*------------------------------------------------------------------
** ANSI
*/
#include <stdlib.h> /* exit() */
#include <stdio.h> /* sprintf() */
#include <string.h>
#include <conio.h> /* clrscr() */
/*------------------------------------------------------------------
** NetWare
*/
#define NWDOS
#include <nwcalls.h>
#include <ntypes.h>
extern unsigned _stklen = (1024 * 8);
/****************************************************************************
** Program Start
*/
void main(int argc,char *argv[])
{
NWCCODE ccode;
NWCONN_HANDLE connHandle;
nuint32 mode;
/*-----------------------------------------------------------------------
**Initialize NWCalls
*/
ccode = NWCallsInit( NULL, NULL );
if (ccode)
{
printf( "\nNWCallsInit failed: %04x", ccode );
exit(1);
}
ccode = NWGetDefaultConnectionID(&connHandle);
if (ccode)
{
printf( "\nNWGetDefaultConnectionID failed: %04x", ccode );
exit(1);
}
mode=(strtoul(argv[1],(char**)NULL,16));
if (argc<2 || mode<0 || mode>3)
{
clrscr();
printf(" setbcast <mode number>\n");
printf(" Where mode is one of the following:\n");
printf("0x0000 Receive all broadcasts\n");
printf("0x0001 Recieve only server broadcasts. User messages not stored.\n");
printf("0x0002 Desable broadcasts. User messages not stored. Server \n");
printf(" messages are stored but notification is not given to the \n");
printf(" workstation.\n");
printf("0x0003 Both user and server messages are stored but message \n");
printf(" notification is not sent to the workstation. The client\n");
printf(" can poll for messages.\n");
exit(1);
}
/* Set broadcast mode to 2: disabled */
ccode = NWSetBroadcastMode(connHandle, mode);
if (ccode)
printf( "\nNWSetBroadcastMode: failed %04x", ccode );
else
switch(mode)
{
case 0x0000 : printf("Broadcast mode set to 0x0000\n");
break;
case 0x0001 : printf("Broadcast mode set to 0x0001\n");
break;
case 0x0002 : printf("Broadcast mode set to 0x0002\n");
break;
case 0x0003 : printf("Broadcast mode set to 0x0003\n");
break;
default : printf("Should NEVER get here!!!!!\n");
break;
}
}