home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. CD ROM (Annual Premium Edition)
/
premium.zip
/
premium
/
IBMOS2_2
/
MAILMIND.ZIP
/
NETBIOS.H
< prev
next >
Wrap
Text File
|
1991-02-05
|
4KB
|
123 lines
#ifndef NETBIOS_H
#define NETBIOS_H
/* netbios.h - defines for NETBIOS calls
* adapted from Nance B., Network Programming in C, Carmel, IN: Que, 1990
* Division of Cancer Prevention & Control, NCI
*/
/* Revision history:
* 1.00 tam 01/31/91 first release
*/
/* Program notes:
* The capitalizations of the NCB structure and defines is consistent with
* the 3Com documentation and not DCPC standards!
*/
/* constants */
#define NETBIOS_NAME_LEN 16
#define MAX_PACKET 512
#define MAX_NB_NAMES 15
/* Network Control Block (NCB) */
#define NCB struct ncb
NCB
{
byte NCB_COMMAND; /* command id */
byte NCB_RETCODE; /* immediate return code */
byte NCB_LSN; /* local session number */
byte NCB_NUM; /* network name number */
void far *NCB_BUFFER; /* address of message packet */
word NCB_LENGTH; /* length of message packet */
byte NCB_CALLNAME[NETBIOS_NAME_LEN]; /* name of the other computer */
byte NCB_NAME[NETBIOS_NAME_LEN]; /* our network name */
byte NCB_RTO; /* receive time-out in 500 ms. */
byte NCB_STO; /* send time-out in 500 ms. */
void interrupt (*NCB_POST)(void); /* address of POST routine */
byte NCB_LANA_NUM; /* adapter number (0 or 1) */
byte NCB_CMD_CPLT; /* final return code */
byte NCB_RESERVE[14]; /* reserved area */
};
/* Netbios name table entry */
#define NB_NAME_ENTRY struct nb_name_entry
NB_NAME_ENTRY
{
char caName[16]; /* name */
byte byNcbNum; /* network name number */
byte byStatus; /* status */
};
/* Adapter status table */
#define NB_STATUS struct nb_status
NB_STATUS
{
byte byaUnitID[6];
byte byaReserved1[2];
word wVersion;
word wLength;
byte byaReserved2[4];
word wCollisions;
word wAborts;
long lTransmissions;
long lReceptions;
word wRetransmissions;
byte byaReserved3[10];
word wFreeBlks;
word wConfigMaxBlks;
word wTotalMaxBlks;
byte byaReserved4[4];
word wPending;
word wConfigMaxSessions;
word wTotalMaxSessions;
word wMaxPacket;
word wNames;
NB_NAME_ENTRY aNameEntry[MAX_NB_NAMES];
};
/* Symbolic names for NetBIOS commands */
#define RESET 0x32
#define CANCEL 0x35
#define STATUS 0xb3
#define STATUS_WAIT 0x33
#define TRACE 0xf9
#define TRACE_WAIT 0x79
#define UNLINK 0x70
#define ADD_NAME 0xb0
#define ADD_NAME_WAIT 0x30
#define ADD_GROUP_NAME 0xb6
#define ADD_GROUP_NAME_WAIT 0x36
#define DELETE_NAME 0xb1
#define DELETE_NAME_WAIT 0x31
#define CALL 0x90
#define CALL_WAIT 0x10
#define LISTEN 0x91
#define LISTEN_WAIT 0x11
#define HANG_UP 0x92
#define HANG_UP_WAIT 0x12
#define SEND 0x94
#define SEND_WAIT 0x14
#define SEND_NO_ACK 0xf1
#define SEND_NO_ACK_WAIT 0x71
#define CHAIN_SEND 0x97
#define CHAIN_SEND_WAIT 0x17
#define CHAIN_SEND_NO_ACK 0xf2
#define CHAIN_SEND_NO_ACK_WAIT 0x72
#define RECEIVE 0x95
#define RECEIVE_WAIT 0x15
#define RECEIVE_ANY 0x96
#define RECEIVE_ANY_WAIT 0x16
#define SESSION_STATUS 0xb4
#define SESSION_STATUS_WAIT 0x34
#define SEND_DATAGRAM 0xa0
#define SEND_DATAGRAM_WAIT 0x20
#define SEND_BCST_DATAGRAM 0xa2
#define SEND_BCST_DATAGRAM_WAIT 0x22
#define RECEIVE_DATAGRAM 0xa1
#define RECEIVE_DATAGRAM_WAIT 0x21
#define RECEIVE_BCST_DATAGRAM 0xa3
#define RECEIVE_BCST_DATAGRAM_WAIT 0x23
#endif /* NETBIOS_H */