home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / MAILMIND.ZOO / NETBIOS2.H < prev    next >
Text File  |  1992-02-27  |  5KB  |  126 lines

  1. #ifndef NETBIOS_H
  2. #define NETBIOS_H
  3.  
  4. /* netbios2.h - defines for NETBIOS calls
  5.  * Thomas A. Marciniak, M.D.
  6.  * Division of Cancer Prevention & Control, NCI
  7.  */
  8.  
  9. /* Revision history:
  10.  * 1.01  tam  02/22/92  make names & case compatible with Lan Manager
  11.  * 1.00  tam  01/31/91  first release
  12.  */
  13.  
  14. /* Program notes:
  15.  * Adapted from Nance B., Network Programming in C, Carmel, IN: Que, 1990
  16.  * The capitalizations of the NCB structure and defines is consistent with
  17.  * the OS/2 Lan Manager Toolkit and not DCPC standards!
  18.  */
  19.  
  20. /* constants */
  21. #define NETBIOS_NAME_LEN 16
  22. #define MAX_PACKET       512
  23. #define MAX_NB_NAMES     15
  24.  
  25. /* Network Control Block (NCB) */
  26. #define NCB struct ncb
  27. NCB
  28.   {
  29.   byte ncb_command;                     /* command id */
  30.   byte ncb_retcode;                     /* immediate return code */
  31.   byte ncb_lsn;                         /* local session number               */
  32.   byte ncb_num;                         /* network name number */
  33.   void far *ncb_buffer;                 /* address of message packet */
  34.   word ncb_length;                      /* length of message packet */
  35.   byte ncb_callname[NETBIOS_NAME_LEN];  /* name of the other computer */
  36.   byte ncb_name[NETBIOS_NAME_LEN];      /* our network name */
  37.   byte ncb_rto;                         /* receive time-out in 500 ms. */
  38.   byte ncb_sto;                         /* send time-out in 500 ms. */
  39.   word ncb_postoffset;                  /* address of POST routine */
  40.   word ncb_postseg;
  41.   byte ncb_lana_num;                    /* adapter number (0 or 1) */
  42.   byte ncb_cmd_cplt;                    /* final return code */
  43.   byte ncb_reserve[14];                 /* reserved area */
  44.   };
  45.  
  46. /* Netbios name table entry */
  47. #define NB_NAME_ENTRY struct nb_name_entry
  48. NB_NAME_ENTRY
  49.   {
  50.   char caName[16];                        /* name */
  51.   byte byNcbNum;                          /* network name number */
  52.   byte byStatus;                          /* status */
  53.   };
  54.  
  55. /* Adapter status table */
  56. #define NB_STATUS struct nb_status
  57. NB_STATUS
  58.   {
  59.   byte byaUnitID[6];
  60.   byte byaReserved1[2];
  61.   word wVersion;
  62.   word wLength;
  63.   byte byaReserved2[4];
  64.   word wCollisions;
  65.   word wAborts;
  66.   long lTransmissions;
  67.   long lReceptions;
  68.   word wRetransmissions;
  69.   byte byaReserved3[10];
  70.   word wFreeBlks;
  71.   word wConfigMaxBlks;
  72.   word wTotalMaxBlks;
  73.   byte byaReserved4[4];
  74.   word wPending;
  75.   word wConfigMaxSessions;
  76.   word wTotalMaxSessions;
  77.   word wMaxPacket;
  78.   word wNames;
  79.   NB_NAME_ENTRY aNameEntry[MAX_NB_NAMES];
  80.   };
  81.  
  82. /* Symbolic names for NetBIOS commands  */
  83. #define RESET                           0x32
  84. #define CANCEL                          0x35
  85. #define STATUS                          0xb3
  86. #define STATUS_WAIT                     0x33
  87. #define TRACE                           0xf9
  88. #define TRACE_WAIT                      0x79
  89. #define UNLINK                          0x70
  90. #define ADD_NAME                        0xb0
  91. #define ADD_NAME_WAIT                   0x30
  92. #define ADD_GROUP_NAME                  0xb6
  93. #define ADD_GROUP_NAME_WAIT             0x36
  94. #define DELETE_NAME                     0xb1
  95. #define DELETE_NAME_WAIT                0x31
  96. #define CALL                            0x90
  97. #define CALL_WAIT                       0x10
  98. #define LISTEN                          0x91
  99. #define LISTEN_WAIT                     0x11
  100. #define HANG_UP                         0x92
  101. #define HANG_UP_WAIT                    0x12
  102. #define SEND                            0x94
  103. #define SEND_WAIT                       0x14
  104. #define SEND_NO_ACK                     0xf1
  105. #define SEND_NO_ACK_WAIT                0x71
  106. #define CHAIN_SEND                      0x97
  107. #define CHAIN_SEND_WAIT                 0x17
  108. #define CHAIN_SEND_NO_ACK               0xf2
  109. #define CHAIN_SEND_NO_ACK_WAIT          0x72
  110. #define RECEIVE                         0x95
  111. #define RECEIVE_WAIT                    0x15
  112. #define RECEIVE_ANY                     0x96
  113. #define RECEIVE_ANY_WAIT                0x16
  114. #define SESSION_STATUS                  0xb4
  115. #define SESSION_STATUS_WAIT             0x34
  116. #define SEND_DATAGRAM                   0xa0
  117. #define SEND_DATAGRAM_WAIT              0x20
  118. #define SEND_BCST_DATAGRAM              0xa2
  119. #define SEND_BCST_DATAGRAM_WAIT         0x22
  120. #define RECEIVE_DATAGRAM                0xa1
  121. #define RECEIVE_DATAGRAM_WAIT           0x21
  122. #define RECEIVE_BCST_DATAGRAM           0xa3
  123. #define RECEIVE_BCST_DATAGRAM_WAIT      0x23
  124.  
  125. #endif /* NETBIOS_H */
  126.