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