Add a few soon-to-be-implemented functions.
[wine] / include / nb30.h
1 /*
2  * Copyright (C) 2001 Mike McCormack
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef NCB_INCLUDED
20 #define NCB_INCLUDED
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #define NCBNAMSZ 16
27 #define MAX_LANA 0xfe
28
29 #define NCBCALL        0x10
30 #define NCBLISTEN      0x11
31 #define NCBHANGUP      0x12
32 #define NCBSEND        0x14
33 #define NCBRECV        0x15
34 #define NCBRECVANY     0x16
35 #define NCBCHAINSEND   0x17
36 #define NCBDGSEND      0x20
37 #define NCBDGRECV      0x21
38 #define NCBDGSENDBC    0x22
39 #define NCBDGRECVBC    0x23
40 #define NCBADDNAME     0x30
41 #define NCBDELNAME     0x31
42 #define NCBRESET       0x32
43 #define NCBASTAT       0x33
44 #define NCBSSTAT       0x34
45 #define NCBCANCEL      0x35
46 #define NCBADDGRNAME   0x36
47 #define NCBENUM        0x37
48 #define NCBUNLINK      0x70
49 #define NCBSENDNA      0x71
50 #define NCBCHAINSENDNA 0x72
51 #define NCBLANSTALERT  0x73
52 #define NCBACTION      0x77
53 #define NCBFINDNAME    0x78
54 #define NCBTRACE       0x79
55
56 #define ASYNCH         0x80
57
58 typedef struct _NCB
59 {
60         UCHAR   ncb_command;
61         UCHAR   ncb_retcode;
62         UCHAR   ncb_lsn;
63         UCHAR   ncb_num;
64         PUCHAR  ncb_buffer;
65         WORD    ncb_length;
66         UCHAR   ncb_callname[NCBNAMSZ];
67         UCHAR   ncb_name[NCBNAMSZ];
68         UCHAR   ncb_rto;
69         UCHAR   ncb_sto;
70         VOID    (CALLBACK *ncb_post)(struct _NCB *);
71         UCHAR   ncb_lana_num;
72         UCHAR   ncb_cmd_cplt;
73         UCHAR   ncb_reserved[10];
74         HANDLE  ncb_event;
75 } NCB, *PNCB;
76
77 typedef struct _ADAPTER_STATUS
78 {
79         UCHAR   adapter_address[6];
80         UCHAR   rev_major;
81         UCHAR   reserved0;
82         UCHAR   adapter_type;
83         UCHAR   rev_minor;
84         WORD    duration;
85         WORD    frmr_recv;
86         WORD    frmr_xmit;
87         WORD    iframe_recv_error;
88         WORD    xmit_aborts;
89         DWORD   xmit_success;
90         DWORD   recv_success;
91         WORD    iframe_xmit_error;
92         WORD    recv_buffer_unavail;
93         WORD    t1_timeouts;
94         WORD    ti_timeouts;
95         DWORD   reserved1;
96         WORD    free_ncbs;
97         WORD    max_cfg_ncbs;
98         WORD    max_ncbs;
99         WORD    xmit_buf_unavail;
100         WORD    max_dgram_size;
101         WORD    pending_sess;
102         WORD    max_cfg_sess;
103         WORD    max_sess;
104         WORD    max_sess_pktsize;
105         WORD    name_count;
106 } ADAPTER_STATUS, *PADAPTER_STATUS;
107
108 typedef struct _NAME_BUFFER
109 {
110   UCHAR name[NCBNAMSZ];
111   UCHAR name_num;
112   UCHAR name_flags;
113 } NAME_BUFFER, *PNAME_BUFFER;
114
115 #define NAME_FLAGS_MASK 0x87
116 #define GROUP_NAME      0x80
117 #define UNIQUE_NAME     0x00
118 #define REGISTERING     0x00
119 #define REGISTERED      0x04
120 #define DEREGISTERED    0x05
121 #define DUPLICATE       0x06
122 #define DUPLICATE_DEREG 0x07
123
124 typedef struct _LANA_ENUM
125 {
126         UCHAR length;
127         UCHAR lana[MAX_LANA+1];
128 } LANA_ENUM, *PLANA_ENUM;
129
130 typedef struct _FIND_NAME_HEADER
131 {
132   WORD  node_count;
133   UCHAR reserved;
134   UCHAR unique_group;
135 } FIND_NAME_HEADER, *PFIND_NAME_HEADER;
136
137 typedef struct _FIND_NAME_BUFFER
138 {
139   UCHAR length;
140   UCHAR access_control;
141   UCHAR frame_control;
142   UCHAR destination_addr[6];
143   UCHAR source_addr[6];
144   UCHAR routing_info[6];
145 } FIND_NAME_BUFFER, *PFIND_NAME_BUFFER;
146
147 typedef struct _SESSION_HEADER {
148   UCHAR sess_name;
149   UCHAR num_sess;
150   UCHAR rcv_dg_outstanding;
151   UCHAR rcv_any_outstanding;
152 } SESSION_HEADER, *PSESSION_HEADER;
153
154 typedef struct _SESSION_BUFFER {
155   UCHAR lsn;
156   UCHAR state;
157   UCHAR local_name[NCBNAMSZ];
158   UCHAR remote_name[NCBNAMSZ];
159   UCHAR rcvs_outstanding;
160   UCHAR sends_outstanding;
161 } SESSION_BUFFER, *PSESSION_BUFFER;
162
163 #define LISTEN_OUTSTANDING  0x01
164 #define CALL_PENDING        0x02
165 #define SESSION_ESTABLISHED 0x03
166 #define HANGUP_PENDING      0x04
167 #define HANGUP_COMPLETE     0x05
168 #define SESSION_ABORTED     0x06
169
170 #define ALL_TRANSPORTS "M\0\0\0"
171
172 #define NRC_GOODRET     0x00
173 #define NRC_BUFLEN      0x01
174 #define NRC_ILLCMD      0x03
175 #define NRC_CMDTMO      0x05
176 #define NRC_INCOMP      0x06
177 #define NRC_BADDR       0x07
178 #define NRC_SNUMOUT     0x08
179 #define NRC_NORES       0x09
180 #define NRC_SCLOSED     0x0a
181 #define NRC_CMDCAN      0x0b
182 #define NRC_DUPNAME     0x0d
183 #define NRC_NAMTFUL     0x0e
184 #define NRC_ACTSES      0x0f
185 #define NRC_LOCTFUL     0x11
186 #define NRC_REMTFUL     0x12
187 #define NRC_ILLNN       0x13
188 #define NRC_NOCALL      0x14
189 #define NRC_NOWILD      0x15
190 #define NRC_INUSE       0x16
191 #define NRC_NAMERR      0x17
192 #define NRC_SABORT      0x18
193 #define NRC_NAMCONF     0x19
194 #define NRC_IFBUSY      0x21
195 #define NRC_TOOMANY     0x22
196 #define NRC_BRIDGE      0x23
197 #define NRC_CANOCCR     0x24
198 #define NRC_CANCEL      0x26
199 #define NRC_DUPENV      0x30
200 #define NRC_ENVNOTDEF   0x34
201 #define NRC_OSRESNOTAV  0x35
202 #define NRC_MAXAPPS     0x36
203 #define NRC_NOSAPS      0x37
204 #define NRC_NORESOURCES 0x38
205 #define NRC_INVADDRESS  0x39
206 #define NRC_INVDDID     0x3b
207 #define NRC_LOCKFAIL    0x3c
208 #define NRC_OPENERROR   0x3f
209 #define NRC_SYSTEM      0x40
210 #define NRC_PENDING     0xff
211
212 UCHAR WINAPI Netbios(PNCB pncb);
213
214 #ifdef __cplusplus
215 }
216 #endif
217
218 #endif  /* NCB_INCLUDED */