nb30.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef NCB_INCLUDED
  7. #define NCB_INCLUDED
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #define NCBNAMSZ 16
  12. #define MAX_LANA 254
  13. typedef struct _NCB {
  14. UCHAR ncb_command;
  15. UCHAR ncb_retcode;
  16. UCHAR ncb_lsn;
  17. UCHAR ncb_num;
  18. PUCHAR ncb_buffer;
  19. WORD ncb_length;
  20. UCHAR ncb_callname[NCBNAMSZ];
  21. UCHAR ncb_name[NCBNAMSZ];
  22. UCHAR ncb_rto;
  23. UCHAR ncb_sto;
  24. void (CALLBACK *ncb_post)(struct _NCB *);
  25. UCHAR ncb_lana_num;
  26. UCHAR ncb_cmd_cplt;
  27. #ifdef _WIN64
  28. UCHAR ncb_reserve[18];
  29. #else
  30. UCHAR ncb_reserve[10];
  31. #endif
  32. HANDLE ncb_event;
  33. } NCB,*PNCB;
  34. typedef struct _ADAPTER_STATUS {
  35. UCHAR adapter_address[6];
  36. UCHAR rev_major;
  37. UCHAR reserved0;
  38. UCHAR adapter_type;
  39. UCHAR rev_minor;
  40. WORD duration;
  41. WORD frmr_recv;
  42. WORD frmr_xmit;
  43. WORD iframe_recv_err;
  44. WORD xmit_aborts;
  45. DWORD xmit_success;
  46. DWORD recv_success;
  47. WORD iframe_xmit_err;
  48. WORD recv_buff_unavail;
  49. WORD t1_timeouts;
  50. WORD ti_timeouts;
  51. DWORD reserved1;
  52. WORD free_ncbs;
  53. WORD max_cfg_ncbs;
  54. WORD max_ncbs;
  55. WORD xmit_buf_unavail;
  56. WORD max_dgram_size;
  57. WORD pending_sess;
  58. WORD max_cfg_sess;
  59. WORD max_sess;
  60. WORD max_sess_pkt_size;
  61. WORD name_count;
  62. } ADAPTER_STATUS,*PADAPTER_STATUS;
  63. typedef struct _NAME_BUFFER {
  64. UCHAR name[NCBNAMSZ];
  65. UCHAR name_num;
  66. UCHAR name_flags;
  67. } NAME_BUFFER,*PNAME_BUFFER;
  68. #define NAME_FLAGS_MASK 0x87
  69. #define GROUP_NAME 0x80
  70. #define UNIQUE_NAME 0x00
  71. #define REGISTERING 0x00
  72. #define REGISTERED 0x04
  73. #define DEREGISTERED 0x05
  74. #define DUPLICATE 0x06
  75. #define DUPLICATE_DEREG 0x07
  76. typedef struct _SESSION_HEADER {
  77. UCHAR sess_name;
  78. UCHAR num_sess;
  79. UCHAR rcv_dg_outstanding;
  80. UCHAR rcv_any_outstanding;
  81. } SESSION_HEADER,*PSESSION_HEADER;
  82. typedef struct _SESSION_BUFFER {
  83. UCHAR lsn;
  84. UCHAR state;
  85. UCHAR local_name[NCBNAMSZ];
  86. UCHAR remote_name[NCBNAMSZ];
  87. UCHAR rcvs_outstanding;
  88. UCHAR sends_outstanding;
  89. } SESSION_BUFFER,*PSESSION_BUFFER;
  90. #define LISTEN_OUTSTANDING 0x01
  91. #define CALL_PENDING 0x02
  92. #define SESSION_ESTABLISHED 0x03
  93. #define HANGUP_PENDING 0x04
  94. #define HANGUP_COMPLETE 0x05
  95. #define SESSION_ABORTED 0x06
  96. typedef struct _LANA_ENUM {
  97. UCHAR length;
  98. UCHAR lana[MAX_LANA+1];
  99. } LANA_ENUM,*PLANA_ENUM;
  100. typedef struct _FIND_NAME_HEADER {
  101. WORD node_count;
  102. UCHAR reserved;
  103. UCHAR unique_group;
  104. } FIND_NAME_HEADER,*PFIND_NAME_HEADER;
  105. typedef struct _FIND_NAME_BUFFER {
  106. UCHAR length;
  107. UCHAR access_control;
  108. UCHAR frame_control;
  109. UCHAR destination_addr[6];
  110. UCHAR source_addr[6];
  111. UCHAR routing_info[18];
  112. } FIND_NAME_BUFFER,*PFIND_NAME_BUFFER;
  113. typedef struct _ACTION_HEADER {
  114. ULONG transport_id;
  115. USHORT action_code;
  116. USHORT reserved;
  117. } ACTION_HEADER,*PACTION_HEADER;
  118. #define ALL_TRANSPORTS "M\0\0\0"
  119. #define MS_NBF "MNBF"
  120. #define NCBCALL 0x10
  121. #define NCBLISTEN 0x11
  122. #define NCBHANGUP 0x12
  123. #define NCBSEND 0x14
  124. #define NCBRECV 0x15
  125. #define NCBRECVANY 0x16
  126. #define NCBCHAINSEND 0x17
  127. #define NCBDGSEND 0x20
  128. #define NCBDGRECV 0x21
  129. #define NCBDGSENDBC 0x22
  130. #define NCBDGRECVBC 0x23
  131. #define NCBADDNAME 0x30
  132. #define NCBDELNAME 0x31
  133. #define NCBRESET 0x32
  134. #define NCBASTAT 0x33
  135. #define NCBSSTAT 0x34
  136. #define NCBCANCEL 0x35
  137. #define NCBADDGRNAME 0x36
  138. #define NCBENUM 0x37
  139. #define NCBUNLINK 0x70
  140. #define NCBSENDNA 0x71
  141. #define NCBCHAINSENDNA 0x72
  142. #define NCBLANSTALERT 0x73
  143. #define NCBACTION 0x77
  144. #define NCBFINDNAME 0x78
  145. #define NCBTRACE 0x79
  146. #define ASYNCH 0x80
  147. #define NRC_GOODRET 0x00
  148. #define NRC_BUFLEN 0x01
  149. #define NRC_ILLCMD 0x03
  150. #define NRC_CMDTMO 0x05
  151. #define NRC_INCOMP 0x06
  152. #define NRC_BADDR 0x07
  153. #define NRC_SNUMOUT 0x08
  154. #define NRC_NORES 0x09
  155. #define NRC_SCLOSED 0x0a
  156. #define NRC_CMDCAN 0x0b
  157. #define NRC_DUPNAME 0x0d
  158. #define NRC_NAMTFUL 0x0e
  159. #define NRC_ACTSES 0x0f
  160. #define NRC_LOCTFUL 0x11
  161. #define NRC_REMTFUL 0x12
  162. #define NRC_ILLNN 0x13
  163. #define NRC_NOCALL 0x14
  164. #define NRC_NOWILD 0x15
  165. #define NRC_INUSE 0x16
  166. #define NRC_NAMERR 0x17
  167. #define NRC_SABORT 0x18
  168. #define NRC_NAMCONF 0x19
  169. #define NRC_IFBUSY 0x21
  170. #define NRC_TOOMANY 0x22
  171. #define NRC_BRIDGE 0x23
  172. #define NRC_CANOCCR 0x24
  173. #define NRC_CANCEL 0x26
  174. #define NRC_DUPENV 0x30
  175. #define NRC_ENVNOTDEF 0x34
  176. #define NRC_OSRESNOTAV 0x35
  177. #define NRC_MAXAPPS 0x36
  178. #define NRC_NOSAPS 0x37
  179. #define NRC_NORESOURCES 0x38
  180. #define NRC_INVADDRESS 0x39
  181. #define NRC_INVDDID 0x3B
  182. #define NRC_LOCKFAIL 0x3C
  183. #define NRC_OPENERR 0x3f
  184. #define NRC_SYSTEM 0x40
  185. #define NRC_PENDING 0xff
  186. UCHAR WINAPI Netbios(PNCB pncb);
  187. #define NCB_POST void CALLBACK
  188. #ifdef __cplusplus
  189. }
  190. #endif
  191. #endif