1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! This module contains the definitions for portable NetBIOS 3.0 support.
7 use shared
::minwindef
::{DWORD, PUCHAR, UCHAR, ULONG, USHORT, WORD}
;
9 pub const NCBNAMSZ
: usize = 16;
10 pub const MAX_LANA
: usize = 254;
14 #[cfg(target_pointer_width = "64")]
22 ncb_callname
: [UCHAR
; NCBNAMSZ
],
23 ncb_name
: [UCHAR
; NCBNAMSZ
],
29 ncb_reserve
: [UCHAR
; 18],
32 #[cfg(target_pointer_width = "32")]
40 ncb_callname
: [UCHAR
; NCBNAMSZ
],
41 ncb_name
: [UCHAR
; NCBNAMSZ
],
47 ncb_reserve
: [UCHAR
; 10],
50 pub type PNCB
= *mut NCB
;
51 STRUCT
!{struct ADAPTER_STATUS
{
52 adapter_address
: [UCHAR
; 6],
60 iframe_recv_err
: WORD
,
64 iframe_xmit_err
: WORD
,
65 recv_buff_unavail
: WORD
,
72 xmit_buf_unavail
: WORD
,
77 max_sess_pkt_size
: WORD
,
80 pub type PADAPTER_STATUS
= *mut ADAPTER_STATUS
;
81 STRUCT
!{struct NAME_BUFFER
{
82 name
: [UCHAR
; NCBNAMSZ
],
86 pub type PNAME_BUFFER
= *mut NAME_BUFFER
;
87 pub const NAME_FLAGS_MASK
: UCHAR
= 0x87;
88 pub const GROUP_NAME
: UCHAR
= 0x80;
89 pub const UNIQUE_NAME
: UCHAR
= 0x00;
90 pub const REGISTERING
: UCHAR
= 0x00;
91 pub const REGISTERED
: UCHAR
= 0x04;
92 pub const DEREGISTERED
: UCHAR
= 0x05;
93 pub const DUPLICATE
: UCHAR
= 0x06;
94 pub const DUPLICATE_DEREG
: UCHAR
= 0x07;
95 STRUCT
!{struct SESSION_HEADER
{
98 rcv_dg_outstanding
: UCHAR
,
99 rcv_any_outstanding
: UCHAR
,
101 pub type PSESSION_HEADER
= *mut SESSION_HEADER
;
102 STRUCT
!{struct SESSION_BUFFER
{
105 local_name
: [UCHAR
; NCBNAMSZ
],
106 remote_name
: [UCHAR
; NCBNAMSZ
],
107 rcvs_outstanding
: UCHAR
,
108 sends_outstanding
: UCHAR
,
110 pub type PSESSION_BUFFER
= *mut SESSION_BUFFER
;
111 pub const LISTEN_OUTSTANDING
: UCHAR
= 0x01;
112 pub const CALL_PENDING
: UCHAR
= 0x02;
113 pub const SESSION_ESTABLISHED
: UCHAR
= 0x03;
114 pub const HANGUP_PENDING
: UCHAR
= 0x04;
115 pub const HANGUP_COMPLETE
: UCHAR
= 0x05;
116 pub const SESSION_ABORTED
: UCHAR
= 0x06;
117 STRUCT
!{struct LANA_ENUM
{
119 lana
: [UCHAR
; MAX_LANA
+ 1],
121 pub type PLANA_ENUM
= *mut LANA_ENUM
;
122 STRUCT
!{struct FIND_NAME_HEADER
{
127 pub type PFIND_NAME_HEADER
= *mut FIND_NAME_HEADER
;
128 STRUCT
!{struct FIND_NAME_BUFFER
{
130 access_control
: UCHAR
,
131 frame_control
: UCHAR
,
132 destination_addr
: [UCHAR
; 6],
133 source_addr
: [UCHAR
; 6],
134 routing_info
: [UCHAR
; 18],
136 pub type PFIND_NAME_BUFFER
= *mut FIND_NAME_BUFFER
;
137 STRUCT
!{struct ACTION_HEADER
{
142 pub type PACTION_HEADER
= *mut ACTION_HEADER
;
143 pub const ALL_TRANSPORTS
: ULONG
= 0x0000004d;
144 pub const MS_NBF
: ULONG
= 0x46424e4d;
145 pub const NCBCALL
: UCHAR
= 0x10;
146 pub const NCBLISTEN
: UCHAR
= 0x11;
147 pub const NCBHANGUP
: UCHAR
= 0x12;
148 pub const NCBSEND
: UCHAR
= 0x14;
149 pub const NCBRECV
: UCHAR
= 0x15;
150 pub const NCBRECVANY
: UCHAR
= 0x16;
151 pub const NCBCHAINSEND
: UCHAR
= 0x17;
152 pub const NCBDGSEND
: UCHAR
= 0x20;
153 pub const NCBDGRECV
: UCHAR
= 0x21;
154 pub const NCBDGSENDBC
: UCHAR
= 0x22;
155 pub const NCBADDNAME
: UCHAR
= 0x30;
156 pub const NCBDELNAME
: UCHAR
= 0x31;
157 pub const NCBRESET
: UCHAR
= 0x32;
158 pub const NCBASTAT
: UCHAR
= 0x33;
159 pub const NCBSSTAT
: UCHAR
= 0x34;
160 pub const NCBCANCEL
: UCHAR
= 0x35;
161 pub const NCBADDGRNAME
: UCHAR
= 0x36;
162 pub const NCBENUM
: UCHAR
= 0x37;
163 pub const NCBUNLINK
: UCHAR
= 0x70;
164 pub const NCBSENDNA
: UCHAR
= 0x71;
165 pub const NCBCHAINSENDNA
: UCHAR
= 0x72;
166 pub const NCBLANSTALERT
: UCHAR
= 0x73;
167 pub const NCBACTION
: UCHAR
= 0x77;
168 pub const NCBFINDNAME
: UCHAR
= 0x78;
169 pub const NCBTRACE
: UCHAR
= 0x79;
170 pub const ASYNCH
: UCHAR
= 0x80;
171 pub const NRC_GOODRET
: UCHAR
= 0x00;
172 pub const NRC_BUFLEN
: UCHAR
= 0x01;
173 pub const NRC_ILLCMD
: UCHAR
= 0x03;
174 pub const NRC_CMDTMO
: UCHAR
= 0x05;
175 pub const NRC_INCOMP
: UCHAR
= 0x06;
176 pub const NRC_BADDR
: UCHAR
= 0x07;
177 pub const NRC_SNUMOUT
: UCHAR
= 0x08;
178 pub const NRC_NORES
: UCHAR
= 0x09;
179 pub const NRC_SCLOSED
: UCHAR
= 0x0a;
180 pub const NRC_CMDCAN
: UCHAR
= 0x0b;
181 pub const NRC_DUPNAME
: UCHAR
= 0x0d;
182 pub const NRC_NAMTFUL
: UCHAR
= 0x0e;
183 pub const NRC_ACTSES
: UCHAR
= 0x0f;
184 pub const NRC_LOCTFUL
: UCHAR
= 0x11;
185 pub const NRC_REMTFUL
: UCHAR
= 0x12;
186 pub const NRC_ILLNN
: UCHAR
= 0x13;
187 pub const NRC_NOCALL
: UCHAR
= 0x14;
188 pub const NRC_NOWILD
: UCHAR
= 0x15;
189 pub const NRC_INUSE
: UCHAR
= 0x16;
190 pub const NRC_NAMERR
: UCHAR
= 0x17;
191 pub const NRC_SABORT
: UCHAR
= 0x18;
192 pub const NRC_NAMCONF
: UCHAR
= 0x19;
193 pub const NRC_IFBUSY
: UCHAR
= 0x21;
194 pub const NRC_TOOMANY
: UCHAR
= 0x22;
195 pub const NRC_BRIDGE
: UCHAR
= 0x23;
196 pub const NRC_CANOCCR
: UCHAR
= 0x24;
197 pub const NRC_CANCEL
: UCHAR
= 0x26;
198 pub const NRC_DUPENV
: UCHAR
= 0x30;
199 pub const NRC_ENVNOTDEF
: UCHAR
= 0x34;
200 pub const NRC_OSRESNOTAV
: UCHAR
= 0x35;
201 pub const NRC_MAXAPPS
: UCHAR
= 0x36;
202 pub const NRC_NOSAPS
: UCHAR
= 0x37;
203 pub const NRC_NORESOURCES
: UCHAR
= 0x38;
204 pub const NRC_INVADDRESS
: UCHAR
= 0x39;
205 pub const NRC_INVDDID
: UCHAR
= 0x3B;
206 pub const NRC_LOCKFAIL
: UCHAR
= 0x3C;
207 pub const NRC_OPENERR
: UCHAR
= 0x3f;
208 pub const NRC_SYSTEM
: UCHAR
= 0x40;
209 pub const NRC_PENDING
: UCHAR
= 0xff;