home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_02_02
/
2n02050a
< prev
next >
Wrap
Text File
|
1990-12-30
|
843b
|
33 lines
#include <string.h>
#include "netbios.h"
/*****************************************************
* max_dg - Determine largest acceptable datagram size
* Parameters:
* Returns: Maximum valid datagram size in bytes
* Notes: This code assumes that you are using a memory
* model which will result in buffer being a far
* pointer.
* History: Original code by William H. Roetzheim, 1990
******************************************************/
int max_dg()
{
struct net_control_block ncb;
int length = 0;
init_ncb(&ncb);
while (ncb.retcode == 0)
{
length++;
init_ncb(&ncb);
ncb.command = NCB_SEND_DATAGRAM;
ncb.length = length;
ncb.number = 0x01; /* use adapter standard name */
int_netbios(&ncb);
}
return length -1;
}