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 _DLCAPI_
7#define _DLCAPI_
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#define LLC_DIR_INTERRUPT 0x00
14#define LLC_DIR_OPEN_ADAPTER 0x03
15#define LLC_DIR_CLOSE_ADAPTER 0x04
16#define LLC_DIR_SET_MULTICAST_ADDRESS 0x05
17#define LLC_DIR_SET_GROUP_ADDRESS 0x06
18#define LLC_DIR_SET_FUNCTIONAL_ADDRESS 0x07
19#define LLC_DIR_READ_LOG 0x08
20#define LLC_TRANSMIT_FRAMES 0x09
21#define LLC_TRANSMIT_DIR_FRAME 0x0A
22#define LLC_TRANSMIT_I_FRAME 0x0B
23#define LLC_TRANSMIT_UI_FRAME 0x0D
24#define LLC_TRANSMIT_XID_CMD 0x0E
25#define LLC_TRANSMIT_XID_RESP_FINAL 0x0F
26#define LLC_TRANSMIT_XID_RESP_NOT_FINAL 0x10
27#define LLC_TRANSMIT_TEST_CMD 0x11
28#define LLC_DLC_RESET 0x14
29#define LLC_DLC_OPEN_SAP 0x15
30#define LLC_DLC_CLOSE_SAP 0x16
31#define LLC_DLC_REALLOCATE_STATIONS 0x17
32#define LLC_DLC_OPEN_STATION 0x19
33#define LLC_DLC_CLOSE_STATION 0x1A
34#define LLC_DLC_CONNECT_STATION 0x1B
35#define LLC_DLC_MODIFY 0x1C
36#define LLC_DLC_FLOW_CONTROL 0x1D
37#define LLC_DLC_STATISTICS 0x1E
38#define LLC_DIR_INITIALIZE 0x20
39#define LLC_DIR_STATUS 0x21
40#define LLC_DIR_TIMER_SET 0x22
41#define LLC_DIR_TIMER_CANCEL 0x23
42#define LLC_BUFFER_GET 0x26
43#define LLC_BUFFER_FREE 0x27
44#define LLC_RECEIVE 0x28
45#define LLC_RECEIVE_CANCEL 0x29
46#define LLC_RECEIVE_MODIFY 0x2A
47#define LLC_DIR_TIMER_CANCEL_GROUP 0x2C
48#define LLC_DIR_SET_EXCEPTION_FLAGS 0x2D
49#define LLC_BUFFER_CREATE 0x30
50#define LLC_READ 0x31
51#define LLC_READ_CANCEL 0x32
52#define LLC_DLC_SET_THRESHOLD 0x33
53#define LLC_DIR_CLOSE_DIRECT 0x34
54#define LLC_DIR_OPEN_DIRECT 0x35
55#define LLC_MAX_DLC_COMMAND 0x37
56
57  union _LLC_PARMS;
58  typedef union _LLC_PARMS LLC_PARMS,*PLLC_PARMS;
59
60  typedef union {
61    PLLC_PARMS pParameterTable;
62    struct {
63      USHORT usStationId;
64      USHORT usParameter;
65    } dlc;
66    struct {
67      USHORT usParameter0;
68      USHORT usParameter1;
69    } dir;
70    UCHAR auchBuffer[4];
71    ULONG ulParameter;
72  } CCB_PARMS;
73
74  typedef struct _LLC_CCB {
75    UCHAR uchAdapterNumber;
76    UCHAR uchDlcCommand;
77    UCHAR uchDlcStatus;
78    UCHAR uchReserved1;
79    struct _LLC_CCB *pNext;
80    ULONG ulCompletionFlag;
81    CCB_PARMS u;
82    HANDLE hCompletionEvent;
83    UCHAR uchReserved2;
84    UCHAR uchReadFlag;
85    USHORT usReserved3;
86  } LLC_CCB,*PLLC_CCB;
87
88  union _LLC_BUFFER;
89  typedef union _LLC_BUFFER LLC_BUFFER,*PLLC_BUFFER;
90
91  typedef struct {
92    PLLC_BUFFER pNextBuffer;
93    USHORT cbFrame;
94    USHORT cbBuffer;
95    USHORT offUserData;
96    USHORT cbUserData;
97  } LLC_NEXT_BUFFER;
98
99  typedef struct {
100    PLLC_BUFFER pNextBuffer;
101    USHORT cbFrame;
102    USHORT cbBuffer;
103    USHORT offUserData;
104    USHORT cbUserData;
105    USHORT usStationId;
106    UCHAR uchOptions;
107    UCHAR uchMsgType;
108    USHORT cBuffersLeft;
109    UCHAR uchRcvFS;
110    UCHAR uchAdapterNumber;
111    PLLC_BUFFER pNextFrame;
112    UCHAR cbLanHeader;
113    UCHAR cbDlcHeader;
114    UCHAR auchLanHeader[32];
115    UCHAR auchDlcHeader[4];
116    USHORT usPadding;
117  } LLC_NOT_CONTIGUOUS_BUFFER;
118
119  typedef struct {
120    PLLC_BUFFER pNextBuffer;
121    USHORT cbFrame;
122    USHORT cbBuffer;
123    USHORT offUserData;
124    USHORT cbUserData;
125    USHORT usStationId;
126    UCHAR uchOptions;
127    UCHAR uchMsgType;
128    USHORT cBuffersLeft;
129    UCHAR uchRcvFS;
130    UCHAR uchAdapterNumber;
131    PLLC_BUFFER pNextFrame;
132  } LLC_CONTIGUOUS_BUFFER;
133
134  union _LLC_BUFFER {
135    PLLC_BUFFER pNext;
136    LLC_NEXT_BUFFER Next;
137    struct LlcNextBuffer {
138      LLC_NEXT_BUFFER Header;
139      UCHAR auchData[];
140    } Buffer;
141    LLC_NOT_CONTIGUOUS_BUFFER NotContiguous;
142    struct {
143      LLC_NOT_CONTIGUOUS_BUFFER Header;
144      UCHAR auchData[];
145    } NotCont;
146    LLC_CONTIGUOUS_BUFFER Contiguous;
147    struct {
148      LLC_CONTIGUOUS_BUFFER Header;
149      UCHAR auchData[];
150    } Cont;
151  };
152
153  struct _LLC_XMIT_BUFFER;
154  typedef struct _LLC_XMIT_BUFFER LLC_XMIT_BUFFER,*PLLC_XMIT_BUFFER;
155
156  struct _LLC_XMIT_BUFFER {
157    PLLC_XMIT_BUFFER pNext;
158    USHORT usReserved1;
159    USHORT cbBuffer;
160    USHORT usReserved2;
161    USHORT cbUserData;
162    UCHAR auchData[];
163  };
164
165#define LLC_XMIT_BUFFER_SIZE sizeof(LLC_XMIT_BUFFER)
166
167  typedef struct {
168    HANDLE hBufferPool;
169    PVOID pBuffer;
170    ULONG cbBufferSize;
171    ULONG cbMinimumSizeThreshold;
172  } LLC_BUFFER_CREATE_PARMS,*PLLC_BUFFER_CREATE_PARMS;
173
174  typedef struct {
175    USHORT usReserved1;
176    USHORT cBuffersLeft;
177    ULONG ulReserved;
178    PLLC_XMIT_BUFFER pFirstBuffer;
179  } LLC_BUFFER_FREE_PARMS,*PLLC_BUFFER_FREE_PARMS;
180
181  typedef struct {
182    USHORT usReserved1;
183    USHORT cBuffersLeft;
184    USHORT cBuffersToGet;
185    USHORT cbBufferSize;
186    PLLC_XMIT_BUFFER pFirstBuffer;
187  } LLC_BUFFER_GET_PARMS,*PLLC_BUFFER_GET_PARMS;
188
189  typedef struct {
190    USHORT usStationId;
191    USHORT usReserved;
192    PUCHAR pRoutingInfo;
193  } LLC_DLC_CONNECT_PARMS,*PLLC_DLC_CONNECT_PARMS;
194
195#define LLC_RESET_LOCAL_BUSY_USER 0x80
196#define LLC_RESET_LOCAL_BUSY_BUFFER 0xC0
197#define LLC_SET_LOCAL_BUSY_USER 0
198
199  typedef struct {
200    USHORT usRes;
201    USHORT usStationId;
202    UCHAR uchT1;
203    UCHAR uchT2;
204    UCHAR uchTi;
205    UCHAR uchMaxOut;
206    UCHAR uchMaxIn;
207    UCHAR uchMaxOutIncr;
208    UCHAR uchMaxRetryCnt;
209    UCHAR uchReserved1;
210    USHORT usMaxInfoFieldLength;
211    UCHAR uchAccessPriority;
212    UCHAR auchReserved3[4];
213    UCHAR cGroupCount;
214    PUCHAR pGroupList;
215  } LLC_DLC_MODIFY_PARMS,*PLLC_DLC_MODIFY_PARMS;
216
217#define LLC_XID_HANDLING_IN_APPLICATION 0x08
218#define LLC_XID_HANDLING_IN_DLC 0
219#define LLC_INDIVIDUAL_SAP 0x04
220#define LLC_GROUP_SAP 0x02
221#define LLC_MEMBER_OF_GROUP_SAP 0x01
222
223  typedef struct {
224    USHORT usStationId;
225    USHORT usUserStatValue;
226    UCHAR uchT1;
227    UCHAR uchT2;
228    UCHAR uchTi;
229    UCHAR uchMaxOut;
230    UCHAR uchMaxIn;
231    UCHAR uchMaxOutIncr;
232    UCHAR uchMaxRetryCnt;
233    UCHAR uchMaxMembers;
234    USHORT usMaxI_Field;
235    UCHAR uchSapValue;
236    UCHAR uchOptionsPriority;
237    UCHAR uchcStationCount;
238    UCHAR uchReserved2[2];
239    UCHAR cGroupCount;
240    PUCHAR pGroupList;
241    ULONG DlcStatusFlags;
242    UCHAR uchReserved3[8];
243    UCHAR cLinkStationsAvail;
244  } LLC_DLC_OPEN_SAP_PARMS,*PLLC_DLC_OPEN_SAP_PARMS;
245
246  typedef struct {
247    USHORT usSapStationId;
248    USHORT usLinkStationId;
249    UCHAR uchT1;
250    UCHAR uchT2;
251    UCHAR uchTi;
252    UCHAR uchMaxOut;
253    UCHAR uchMaxIn;
254    UCHAR uchMaxOutIncr;
255    UCHAR uchMaxRetryCnt;
256    UCHAR uchRemoteSap;
257    USHORT usMaxI_Field;
258    UCHAR uchAccessPriority;
259    PVOID pRemoteNodeAddress;
260  } LLC_DLC_OPEN_STATION_PARMS,*PLLC_DLC_OPEN_STATION_PARMS;
261
262#define LLC_INCREASE_LINK_STATIONS 0
263#define LLC_DECREASE_LINK_STATIONS 0x80
264
265  typedef struct {
266    USHORT usStationId;
267    UCHAR uchOption;
268    UCHAR uchStationCount;
269    UCHAR uchStationsAvailOnAdapter;
270    UCHAR uchStationsAvailOnSap;
271    UCHAR uchTotalStationsOnAdapter;
272    UCHAR uchTotalStationsOnSap;
273  } LLC_DLC_REALLOCATE_PARMS,*PLLC_DLC_REALLOCATE_PARMS;
274
275  typedef struct {
276    USHORT usStationId;
277    USHORT cBufferThreshold;
278    PVOID AlertEvent;
279  } LLC_DLC_SET_THRESHOLD_PARMS,*PLLC_DLC_SET_THRESHOLD_PARMS;
280
281  typedef struct {
282    PVOID TraceBuffer;
283    ULONG TraceBufferSize;
284    ULONG TraceFlags;
285  } LLC_TRACE_INITIALIZE_PARMS,*PLLC_TRACE_INITIALIZE_PARMS;
286
287#define LLC_DLC_RESET_STATISTICS 0x80
288#define LLC_DLC_READ_STATISTICS 0
289
290  typedef struct {
291    ULONG cTransmittedFrames;
292    ULONG cReceivedFrames;
293    ULONG cDiscardedFrames;
294    ULONG cDataLost;
295    USHORT cBuffersAvailable;
296  } DLC_SAP_LOG,*PDLC_SAP_LOG;
297
298  typedef struct {
299    USHORT cI_FramesTransmitted;
300    USHORT cI_FramesReceived;
301    UCHAR cI_FrameReceiveErrors;
302    UCHAR cI_FrameTransmissionErrors;
303    USHORT cT1_ExpirationCount;
304    UCHAR uchLastCmdRespReceived;
305    UCHAR uchLastCmdRespTransmitted;
306    UCHAR uchPrimaryState;
307    UCHAR uchSecondaryState;
308    UCHAR uchSendStateVariable;
309    UCHAR uchReceiveStateVariable;
310    UCHAR uchLastNr;
311    UCHAR cbLanHeader;
312    UCHAR auchLanHeader[32];
313  } DLC_LINK_LOG,*PDLC_LINK_LOG;
314
315  typedef union {
316    DLC_SAP_LOG Sap;
317    DLC_LINK_LOG Link;
318  } LLC_DLC_LOG_BUFFER,*PLLC_DLC_LOG_BUFFER;
319
320  typedef struct {
321    USHORT usStationId;
322    USHORT cbLogBufSize;
323    PLLC_DLC_LOG_BUFFER pLogBuf;
324    USHORT usActLogLength;
325    UCHAR uchOptions;
326  } LLC_DLC_STATISTICS_PARMS,*PLLC_DLC_STATISTICS_PARMS;
327
328  typedef struct {
329    USHORT usBringUps;
330    UCHAR Reserved[30];
331  } LLC_DIR_INITIALIZE_PARMS,*PLLC_DIR_INITIALIZE_PARMS;
332
333  typedef struct {
334    USHORT usOpenErrorCode;
335    USHORT usOpenOptions;
336    UCHAR auchNodeAddress[6];
337    UCHAR auchGroupAddress[4];
338    UCHAR auchFunctionalAddress[4];
339    USHORT usReserved1;
340    USHORT usReserved2;
341    USHORT usMaxFrameSize;
342    USHORT usReserved3[4];
343    USHORT usBringUps;
344    USHORT InitWarnings;
345    USHORT usReserved4[3];
346  } LLC_ADAPTER_OPEN_PARMS,*PLLC_ADAPTER_OPEN_PARMS;
347
348  typedef struct {
349    UCHAR uchDlcMaxSaps;
350    UCHAR uchDlcMaxStations;
351    UCHAR uchDlcMaxGroupSaps;
352    UCHAR uchDlcMaxGroupMembers;
353    UCHAR uchT1_TickOne;
354    UCHAR uchT2_TickOne;
355    UCHAR uchTi_TickOne;
356    UCHAR uchT1_TickTwo;
357    UCHAR uchT2_TickTwo;
358    UCHAR uchTi_TickTwo;
359  } LLC_DLC_PARMS,*PLLC_DLC_PARMS;
360
361  typedef enum {
362    LLC_ETHERNET_TYPE_DEFAULT,LLC_ETHERNET_TYPE_AUTO,LLC_ETHERNET_TYPE_802_3,LLC_ETHERNET_TYPE_DIX
363  } LLC_ETHERNET_TYPE,*PLLC_ETHERNET_TYPE;
364
365  typedef struct {
366    PVOID hBufferPool;
367    PVOID pSecurityDescriptor;
368    LLC_ETHERNET_TYPE LlcEthernetType;
369  } LLC_EXTENDED_ADAPTER_PARMS,*PLLC_EXTENDED_ADAPTER_PARMS;
370
371  typedef struct {
372    PLLC_ADAPTER_OPEN_PARMS pAdapterParms;
373    PLLC_EXTENDED_ADAPTER_PARMS pExtendedParms;
374    PLLC_DLC_PARMS pDlcParms;
375    PVOID pReserved1;
376  } LLC_DIR_OPEN_ADAPTER_PARMS,*PLLC_DIR_OPEN_ADAPTER_PARMS;
377
378  typedef struct {
379    UCHAR auchMulticastAddress[6];
380  } LLC_DIR_MULTICAST_ADDRESS,*PLLC_DIR_MULTICAST_ADDRESS;
381
382#define LLC_DIRECT_OPTIONS_ALL_MACS 0x1880
383
384  typedef struct {
385    USHORT Reserved[4];
386    USHORT usOpenOptions;
387    USHORT usEthernetType;
388    ULONG ulProtocolTypeMask;
389    ULONG ulProtocolTypeMatch;
390    USHORT usProtocolTypeOffset;
391  } LLC_DIR_OPEN_DIRECT_PARMS,*PLLC_DIR_OPEN_DIRECT_PARMS;
392
393  typedef struct {
394    UCHAR cLineError;
395    UCHAR cInternalError;
396    UCHAR cBurstError;
397    UCHAR cAC_Error;
398    UCHAR cAbortDelimiter;
399    UCHAR uchReserved1;
400    UCHAR cLostFrame;
401    UCHAR cReceiveCongestion;
402    UCHAR cFrameCopiedError;
403    UCHAR cFrequencyError;
404    UCHAR cTokenError;
405    UCHAR uchReserved2;
406    UCHAR uchReserved3;
407    UCHAR uchReserved4;
408  } LLC_ADAPTER_LOG_TR,*PLLC_ADAPTER_LOG_TR;
409
410  typedef struct {
411    UCHAR cCRC_Error;
412    UCHAR uchReserved1;
413    UCHAR cAlignmentError;
414    UCHAR uchReserved2;
415    UCHAR cTransmitError;
416    UCHAR uchReserved3;
417    UCHAR cCollisionError;
418    UCHAR cReceiveCongestion;
419    UCHAR uchReserved[6];
420  } LLC_ADAPTER_LOG_ETH,*PLLC_ADAPTER_LOG_ETH;
421
422  typedef union {
423    LLC_ADAPTER_LOG_TR Tr;
424    LLC_ADAPTER_LOG_ETH Eth;
425  } LLC_ADAPTER_LOG,*PLLC_ADAPTER_LOG;
426
427  typedef struct {
428    ULONG cTransmittedFrames;
429    ULONG cReceivedFrames;
430    ULONG cDiscardedFrames;
431    ULONG cDataLost;
432    USHORT cBuffersAvailable;
433  } LLC_DIRECT_LOG,*PLLC_DIRECT_LOG;
434
435  typedef union {
436    LLC_ADAPTER_LOG Adapter;
437    LLC_DIRECT_LOG Dir;
438    struct {
439      LLC_ADAPTER_LOG Adapter;
440      LLC_DIRECT_LOG Dir;
441    } both;
442  } LLC_DIR_READ_LOG_BUFFER,*PLLC_DIR_READ_LOG_BUFFER;
443
444#define LLC_DIR_READ_LOG_ADAPTER 0
445#define LLC_DIR_READ_LOG_DIRECT 1
446#define LLC_DIR_READ_LOG_BOTH 2
447
448  typedef struct {
449    USHORT usTypeId;
450    USHORT cbLogBuffer;
451    PLLC_DIR_READ_LOG_BUFFER pLogBuffer;
452    USHORT cbActualLength;
453  } LLC_DIR_READ_LOG_PARMS,*PLLC_DIR_READ_LOG_PARMS;
454
455  typedef struct {
456    ULONG ulAdapterCheckFlag;
457    ULONG ulNetworkStatusFlag;
458    ULONG ulPcErrorFlag;
459    ULONG ulSystemActionFlag;
460  } LLC_DIR_SET_EFLAG_PARMS,*PLLC_DIR_SET_EFLAG_PARMS;
461
462#define LLC_ADAPTER_ETHERNET 0x0010
463#define LLC_ADAPTER_TOKEN_RING 0x0040
464
465  typedef struct {
466    UCHAR auchPermanentAddress[6];
467    UCHAR auchNodeAddress[6];
468    UCHAR auchGroupAddress[4];
469    UCHAR auchFunctAddr[4];
470    UCHAR uchMaxSap;
471    UCHAR uchOpenSaps;
472    UCHAR uchMaxStations;
473    UCHAR uchOpenStation;
474    UCHAR uchAvailStations;
475    UCHAR uchAdapterConfig;
476    UCHAR auchReserved1[10];
477    ULONG ulReserved1;
478    ULONG ulReserved2;
479    ULONG ulMaxFrameLength;
480    USHORT usLastNetworkStatus;
481    USHORT usAdapterType;
482  } LLC_DIR_STATUS_PARMS,*PLLC_DIR_STATUS_PARMS;
483
484#define LLC_OPTION_READ_STATION 0
485#define LLC_OPTION_READ_SAP 1
486#define LLC_OPTION_READ_ALL 2
487
488#define LLC_EVENT_SYSTEM_ACTION 0x0040
489#define LLC_EVENT_NETWORK_STATUS 0x0020
490#define LLC_EVENT_CRITICAL_EXCEPTION 0x0010
491#define LLC_EVENT_STATUS_CHANGE 0x0008
492#define LLC_EVENT_RECEIVE_DATA 0x0004
493#define LLC_EVENT_TRANSMIT_COMPLETION 0x0002
494#define LLC_EVENT_COMMAND_COMPLETION 0x0001
495#define LLC_READ_ALL_EVENTS 0x007F
496
497#define LLC_INDICATE_LINK_LOST 0x8000
498#define LLC_INDICATE_DM_DISC_RECEIVED 0x4000
499#define LLC_INDICATE_FRMR_RECEIVED 0x2000
500#define LLC_INDICATE_FRMR_SENT 0x1000
501#define LLC_INDICATE_RESET 0x0800
502#define LLC_INDICATE_CONNECT_REQUEST 0x0400
503#define LLC_INDICATE_REMOTE_BUSY 0x0200
504#define LLC_INDICATE_REMOTE_READY 0x0100
505#define LLC_INDICATE_TI_TIMER_EXPIRED 0x0080
506#define LLC_INDICATE_DLC_COUNTER_OVERFLOW 0x0040
507#define LLC_INDICATE_ACCESS_PRTY_LOWERED 0x0020
508#define LLC_INDICATE_LOCAL_STATION_BUSY 0x0001
509
510  typedef struct {
511    USHORT usStationId;
512    UCHAR uchOptionIndicator;
513    UCHAR uchEventSet;
514    UCHAR uchEvent;
515    UCHAR uchCriticalSubset;
516    ULONG ulNotificationFlag;
517    union {
518      struct {
519	USHORT usCcbCount;
520	PLLC_CCB pCcbCompletionList;
521	USHORT usBufferCount;
522	PLLC_BUFFER pFirstBuffer;
523	USHORT usReceivedFrameCount;
524	PLLC_BUFFER pReceivedFrame;
525	USHORT usEventErrorCode;
526	USHORT usEventErrorData[3];
527      } Event;
528      struct {
529	USHORT usStationId;
530	USHORT usDlcStatusCode;
531	UCHAR uchFrmrData[5];
532	UCHAR uchAccessPritority;
533	UCHAR uchRemoteNodeAddress[6];
534	UCHAR uchRemoteSap;
535	UCHAR uchReserved;
536	USHORT usUserStatusValue;
537      } Status;
538    } Type;
539  } LLC_READ_PARMS,*PLLC_READ_PARMS;
540
541  typedef struct {
542    LLC_CCB Ccb;
543    LLC_READ_PARMS Parms;
544  } LLC_READ_COMMAND,*PLLC_READ_COMMAND;
545
546#define LLC_DIR_RCV_ALL_TR_FRAMES 0
547#define LLC_DIR_RCV_ALL_MAC_FRAMES 1
548#define LLC_DIR_RCV_ALL_8022_FRAMES 2
549#define LLC_DIR_RCV_ALL_FRAMES 4
550#define LLC_DIR_RCV_ALL_ETHERNET_TYPES 5
551
552#define LLC_CONTIGUOUS_MAC 0x80
553#define LLC_CONTIGUOUS_DATA 0x40
554#define LLC_NOT_CONTIGUOUS_DATA 0x00
555
556#define LLC_RCV_READ_INDIVIDUAL_FRAMES 0
557#define LLC_RCV_CHAIN_FRAMES_ON_LINK 1
558#define LLC_RCV_CHAIN_FRAMES_ON_SAP 2
559
560  typedef struct {
561    USHORT usStationId;
562    USHORT usUserLength;
563    ULONG ulReceiveFlag;
564    PLLC_BUFFER pFirstBuffer;
565    UCHAR uchOptions;
566    UCHAR auchReserved1[3];
567    UCHAR uchRcvReadOption;
568  } LLC_RECEIVE_PARMS,*PLLC_RECEIVE_PARMS;
569
570#define LLC_CHAIN_XMIT_COMMANDS_ON_LINK 0
571#define LLC_COMPLETE_SINGLE_XMIT_FRAME 1
572#define LLC_CHAIN_XMIT_COMMANDS_ON_SAP 2
573
574  typedef struct {
575    USHORT usStationId;
576    UCHAR uchTransmitFs;
577    UCHAR uchRemoteSap;
578    PLLC_XMIT_BUFFER pXmitQueue1;
579    PLLC_XMIT_BUFFER pXmitQueue2;
580    USHORT cbBuffer1;
581    USHORT cbBuffer2;
582    PVOID pBuffer1;
583    PVOID pBuffer2;
584    UCHAR uchXmitReadOption;
585  } LLC_TRANSMIT_PARMS,*PLLC_TRANSMIT_PARMS;
586
587#define LLC_FIRST_DATA_SEGMENT 0x01
588#define LLC_NEXT_DATA_SEGMENT 0x02
589
590  typedef struct {
591    UCHAR eSegmentType;
592    UCHAR boolFreeBuffer;
593    USHORT cbBuffer;
594    PVOID pBuffer;
595  } LLC_TRANSMIT_DESCRIPTOR,*PLLC_TRANSMIT_DESCRIPTOR;
596
597  enum _LLC_FRAME_TYPES {
598    LLC_DIRECT_TRANSMIT = 0x0000,LLC_DIRECT_MAC = 0x0002,LLC_I_FRAME = 0x0004,LLC_UI_FRAME = 0x0006,LLC_XID_COMMAND_POLL = 0x0008,
599    LLC_XID_COMMAND_NOT_POLL = 0x000A,LLC_XID_RESPONSE_FINAL = 0x000C,LLC_XID_RESPONSE_NOT_FINAL = 0x000E,LLC_TEST_RESPONSE_FINAL = 0x0010,
600    LLC_TEST_RESPONSE_NOT_FINAL = 0x0012,LLC_DIRECT_8022 = 0x0014,LLC_TEST_COMMAND_POLL = 0x0016,LLC_DIRECT_ETHERNET_TYPE = 0x0018,
601    LLC_LAST_FRAME_TYPE = 0x001a,LLC_FIRST_ETHERNET_TYPE = 0x05DD
602  };
603
604  typedef struct {
605    LLC_CCB Ccb;
606    USHORT usStationId;
607    USHORT usFrameType;
608    UCHAR uchRemoteSap;
609    UCHAR uchXmitReadOption;
610    UCHAR Reserved2[2];
611    ULONG cXmitBufferCount;
612    LLC_TRANSMIT_DESCRIPTOR aXmitBuffer[1];
613  } LLC_TRANSMIT2_COMMAND,*PLLC_TRANSMIT2_COMMAND;
614
615#define LLC_TRANSMIT2_VAR_PARMS(a) struct { LLC_CCB Ccb; USHORT usStationId; USHORT usFrameType; UCHAR uchRemoteSap; UCHAR uchXmitReadOption; UCHAR uchReserved2[2]; ULONG cXmitBufferCount; LLC_TRANSMIT_DESCRIPTOR XmitBuffer[(a)];}
616
617  union _LLC_PARMS {
618    LLC_BUFFER_FREE_PARMS BufferFree;
619    LLC_BUFFER_GET_PARMS BufferGet;
620    LLC_DLC_CONNECT_PARMS DlcConnectStation;
621    LLC_DLC_MODIFY_PARMS DlcModify;
622    LLC_DLC_OPEN_SAP_PARMS DlcOpenSap;
623    LLC_DLC_OPEN_STATION_PARMS DlcOpenStation;
624    LLC_DLC_REALLOCATE_PARMS DlcReallocate;
625    LLC_DLC_SET_THRESHOLD_PARMS DlcSetThreshold;
626    LLC_DLC_STATISTICS_PARMS DlcStatistics;
627    LLC_DIR_INITIALIZE_PARMS DirInitialize;
628    LLC_DIR_OPEN_ADAPTER_PARMS DirOpenAdapter;
629    LLC_DIR_OPEN_DIRECT_PARMS DirOpenDirect;
630    LLC_DIR_READ_LOG_PARMS DirReadLog;
631    LLC_DIR_SET_EFLAG_PARMS DirSetEventFlag;
632    LLC_DIR_STATUS_PARMS DirStatus;
633    LLC_READ_PARMS Read;
634    LLC_RECEIVE_PARMS Receive;
635    LLC_TRANSMIT_PARMS Transmit;
636    LLC_TRANSMIT2_COMMAND Transmit2;
637    LLC_TRACE_INITIALIZE_PARMS TraceInitialize;
638  };
639
640  typedef enum _LLC_STATUS {
641    LLC_STATUS_SUCCESS = 0x00,LLC_STATUS_INVALID_COMMAND = 0x01,LLC_STATUS_DUPLICATE_COMMAND = 0x02,LLC_STATUS_ADAPTER_OPEN = 0x03,
642    LLC_STATUS_ADAPTER_CLOSED = 0x04,LLC_STATUS_PARAMETER_MISSING = 0x05,LLC_STATUS_INVALID_OPTION = 0x06,LLC_STATUS_COMMAND_CANCELLED_FAILURE = 0x07,
643    LLC_STATUS_ACCESS_DENIED = 0x08,LLC_STATUS_ADAPTER_NOT_INITIALIZED = 0x09,LLC_STATUS_CANCELLED_BY_USER = 0x0A,
644    LLC_STATUS_COMMAND_CANCELLED_CLOSED = 0x0B,LLC_STATUS_SUCCESS_NOT_OPEN = 0x0C,LLC_STATUS_TIMER_ERROR = 0x11,LLC_STATUS_NO_MEMORY = 0x12,
645    LLC_STATUS_INVALID_LOG_ID = 0x13,LLC_STATUS_LOST_LOG_DATA = 0x15,LLC_STATUS_BUFFER_SIZE_EXCEEDED = 0x16,LLC_STATUS_INVALID_BUFFER_LENGTH = 0x18,
646    LLC_STATUS_INADEQUATE_BUFFERS = 0x19,LLC_STATUS_USER_LENGTH_TOO_LARGE = 0x1A,LLC_STATUS_INVALID_PARAMETER_TABLE = 0x1B,
647    LLC_STATUS_INVALID_POINTER_IN_CCB = 0x1C,LLC_STATUS_INVALID_ADAPTER = 0x1D,LLC_STATUS_LOST_DATA_NO_BUFFERS = 0x20,
648    LLC_STATUS_LOST_DATA_INADEQUATE_SPACE = 0x21,LLC_STATUS_TRANSMIT_ERROR_FS = 0x22,LLC_STATUS_TRANSMIT_ERROR = 0x23,
649    LLC_STATUS_UNAUTHORIZED_MAC = 0x24,LLC_STATUS_MAX_COMMANDS_EXCEEDED = 0x25,LLC_STATUS_LINK_NOT_TRANSMITTING = 0x27,
650    LLC_STATUS_INVALID_FRAME_LENGTH = 0x28,LLC_STATUS_INADEQUATE_RECEIVE = 0x30,LLC_STATUS_INVALID_NODE_ADDRESS = 0x32,
651    LLC_STATUS_INVALID_RCV_BUFFER_LENGTH = 0x33,LLC_STATUS_INVALID_XMIT_BUFFER_LENGTH = 0x34,LLC_STATUS_INVALID_STATION_ID = 0x40,
652    LLC_STATUS_LINK_PROTOCOL_ERROR = 0x41,LLC_STATUS_PARMETERS_EXCEEDED_MAX = 0x42,LLC_STATUS_INVALID_SAP_VALUE = 0x43,
653    LLC_STATUS_INVALID_ROUTING_INFO = 0x44,LLC_STATUS_RESOURCES_NOT_AVAILABLE = 0x46,LLC_STATUS_LINK_STATIONS_OPEN = 0x47,
654    LLC_STATUS_INCOMPATIBLE_COMMANDS = 0x4A,LLC_STATUS_OUTSTANDING_COMMANDS = 0x4C,LLC_STATUS_CONNECT_FAILED = 0x4D,
655    LLC_STATUS_INVALID_REMOTE_ADDRESS = 0x4F,LLC_STATUS_CCB_POINTER_FIELD = 0x50,LLC_STATUS_INVALID_APPLICATION_ID = 0x52,
656    LLC_STATUS_NO_SYSTEM_PROCESS = 0x56,LLC_STATUS_INADEQUATE_LINKS = 0x57,LLC_STATUS_INVALID_PARAMETER_1 = 0x58,
657    LLC_STATUS_DIRECT_STATIONS_NOT_ASSIGNED = 0x5C,LLC_STATUS_DEVICE_DRIVER_NOT_INSTALLED = 0x5d,LLC_STATUS_ADAPTER_NOT_INSTALLED = 0x5e,
658    LLC_STATUS_CHAINED_DIFFERENT_ADAPTERS = 0x5f,LLC_STATUS_INIT_COMMAND_STARTED = 0x60,LLC_STATUS_TOO_MANY_USERS = 0x61,
659    LLC_STATUS_CANCELLED_BY_SYSTEM_ACTION = 0x62,LLC_STATUS_DIR_STATIONS_NOT_AVAILABLE = 0x63,LLC_STATUS_NO_GDT_SELECTORS = 0x65,
660    LLC_STATUS_MEMORY_LOCK_FAILED = 0x69,LLC_STATUS_INVALID_BUFFER_ADDRESS = 0x80,LLC_STATUS_BUFFER_ALREADY_RELEASED = 0x81,
661    LLC_STATUS_BIND_ERROR = 0xA0,LLC_STATUS_INVALID_VERSION = 0xA1,LLC_STATUS_NT_ERROR_STATUS = 0xA2,LLC_STATUS_PENDING = 0xFF
662  } LLC_STATUS;
663
664#define LLC_STATUS_MAX_ERROR 0xFF
665
666  typedef enum {
667    ACSLAN_STATUS_COMMAND_ACCEPTED = 0,ACSLAN_STATUS_INVALID_CCB_POINTER = 1,ACSLAN_STATUS_CCB_IN_ERROR = 2,ACSLAN_STATUS_CHAINED_CCB_IN_ERROR = 3,
668    ACSLAN_STATUS_SYSTEM_ERROR = 4,ACSLAN_STATUS_SYSTEM_STATUS = 5,ACSLAN_STATUS_INVALID_COMMAND = 6
669  } ACSLAN_STATUS;
670
671  ACSLAN_STATUS WINAPI AcsLan(PLLC_CCB pCcb,PLLC_CCB *ppBadCcb);
672  LLC_STATUS WINAPI GetAdapterNameFromNumber(UINT AdapterNumber,LPTSTR pNdisName);
673  LLC_STATUS WINAPI GetAdapterNumberFromName(LPTSTR pNdisName,UINT *AdapterNumber);
674
675#ifdef __cplusplus
676}
677#endif
678#endif
679