home *** CD-ROM | disk | FTP | other *** search
- #ifndef NETBIOS_H
- #define NETBIOS_H
-
- /* netbios2.h - defines for NETBIOS calls
- * Thomas A. Marciniak, M.D.
- * Division of Cancer Prevention & Control, NCI
- */
-
- /* Revision history:
- * 1.01 tam 02/22/92 make names & case compatible with Lan Manager
- * 1.00 tam 01/31/91 first release
- */
-
- /* Program notes:
- * Adapted from Nance B., Network Programming in C, Carmel, IN: Que, 1990
- * The capitalizations of the NCB structure and defines is consistent with
- * the OS/2 Lan Manager Toolkit 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. */
- word ncb_postoffset; /* address of POST routine */
- word ncb_postseg;
- 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 */