source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ddk/afilter.h

Last change on this file was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 4.0 KB
Line 
1/*
2 * afilter.h
3 *
4 * Address filtering for NDIS MACs
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Filip Navara <xnavara@volny.cz>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#ifndef _ARC_FILTER_DEFS_
24#define _ARC_FILTER_DEFS_
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#define ARC_RECEIVE_BUFFERS 64
31#define ARCNET_ADDRESS_LEN 1
32#define ARC_PROTOCOL_HEADER_SIZE (sizeof(ARC_PROTOCOL_HEADER))
33#define ARC_MAX_FRAME_SIZE 504
34#define ARC_MAX_ADDRESS_IDS 256
35#define ARC_MAX_FRAME_HEADER_SIZE 6
36#define ARC_MAX_PACKET_SIZE 576
37#define ARC_FILTER_MAX_OPENS (sizeof(ULONG) * 8)
38
39#define ARC_IS_BROADCAST(Address) (BOOLEAN)(!(Address))
40
41#define ARC_QUERY_FILTER_CLASSES(Filter) ((Filter)->CombinedPacketFilter)
42#define ARC_QUERY_PACKET_FILTER(Filter, NdisFilterHandle) \
43 (((PARC_BINDING_INFO)(NdisFilterHandle))->PacketFilters)
44
45typedef ULONG MASK, *PMASK;
46
47typedef struct _ARC_BUFFER_LIST
48{
49 PVOID Buffer;
50 UINT Size;
51 UINT BytesLeft;
52 struct _ARC_BUFFER_LIST *Next;
53} ARC_BUFFER_LIST, *PARC_BUFFER_LIST;
54
55typedef struct _ARC_PROTOCOL_HEADER
56{
57 UCHAR SourceId[ARCNET_ADDRESS_LEN];
58 UCHAR DestId[ARCNET_ADDRESS_LEN];
59 UCHAR ProtId;
60} ARC_PROTOCOL_HEADER, *PARC_PROTOCOL_HEADER;
61
62typedef struct _ARC_PACKET_HEADER
63{
64 ARC_PROTOCOL_HEADER ProtHeader;
65 USHORT FrameSequence;
66 UCHAR SplitFlag;
67 UCHAR LastSplitFlag;
68 UCHAR FramesReceived;
69} ARC_PACKET_HEADER, *PARC_PACKET_HEADER;
70
71typedef struct _ARC_PACKET
72{
73 ARC_PACKET_HEADER Header;
74 struct _ARC_PACKET *Next;
75 ULONG TotalLength;
76 BOOLEAN LastFrame;
77 PARC_BUFFER_LIST FirstBuffer;
78 PARC_BUFFER_LIST LastBuffer;
79 NDIS_PACKET TmpNdisPacket;
80} ARC_PACKET, *PARC_PACKET;
81
82typedef struct _ARC_BINDING_INFO
83{
84 PNDIS_OPEN_BLOCK NdisBindingHandle;
85 PVOID Reserved;
86 UINT PacketFilters;
87 ULONG References;
88 struct _ARC_BINDING_INFO *NextOpen;
89 BOOLEAN ReceivedAPacket;
90 UINT OldPacketFilters;
91} ARC_BINDING_INFO,*PARC_BINDING_INFO;
92
93typedef struct _ARC_FILTER
94{
95 struct _NDIS_MINIPORT_BLOCK *Miniport;
96 UINT CombinedPacketFilter;
97 PARC_BINDING_INFO OpenList;
98 NDIS_HANDLE ReceiveBufferPool;
99 PARC_BUFFER_LIST FreeBufferList;
100 PARC_PACKET FreePackets;
101 PARC_PACKET OutstandingPackets;
102 UCHAR AdapterAddress;
103 UINT OldCombinedPacketFilter;
104} ARC_FILTER,*PARC_FILTER;
105
106BOOLEAN
107NTAPI
108ArcCreateFilter(
109 IN struct _NDIS_MINIPORT_BLOCK *Miniport,
110 IN UCHAR AdapterAddress,
111 OUT PARC_FILTER *Filter);
112
113VOID
114NTAPI
115ArcDeleteFilter(
116 IN PARC_FILTER Filter);
117
118BOOLEAN
119NTAPI
120ArcNoteFilterOpenAdapter(
121 IN PARC_FILTER Filter,
122 IN NDIS_HANDLE NdisBindingHandle,
123 OUT PNDIS_HANDLE NdisFilterHandle);
124
125NDIS_STATUS
126NTAPI
127ArcDeleteFilterOpenAdapter(
128 IN PARC_FILTER Filter,
129 IN NDIS_HANDLE NdisFilterHandle,
130 IN PNDIS_REQUEST NdisRequest);
131
132NDIS_STATUS
133NTAPI
134ArcFilterAdjust(
135 IN PARC_FILTER Filter,
136 IN NDIS_HANDLE NdisFilterHandle,
137 IN PNDIS_REQUEST NdisRequest,
138 IN UINT FilterClasses,
139 IN BOOLEAN Set);
140
141VOID
142NTAPI
143ArcFilterDprIndicateReceiveComplete(
144 IN PARC_FILTER Filter);
145
146VOID
147NTAPI
148ArcFilterDprIndicateReceive(
149 IN PARC_FILTER Filter,
150 IN PUCHAR pRawHeader,
151 IN PUCHAR pData,
152 IN UINT Length);
153
154NDIS_STATUS
155NTAPI
156ArcFilterTransferData(
157 IN PARC_FILTER Filter,
158 IN NDIS_HANDLE MacReceiveContext,
159 IN UINT ByteOffset,
160 IN UINT BytesToTransfer,
161 OUT PNDIS_PACKET Packet,
162 OUT PUINT BytesTransfered);
163
164VOID
165NTAPI
166ArcFreeNdisPacket(
167 IN PARC_PACKET Packet);
168
169VOID
170NTAPI
171ArcFilterDoIndication(
172 IN PARC_FILTER Filter,
173 IN PARC_PACKET Packet);
174
175VOID
176NTAPI
177ArcDestroyPacket(
178 IN PARC_FILTER Filter,
179 IN PARC_PACKET Packet);
180
181#ifdef __cplusplus
182}
183#endif
184
185#endif /* _ARC_FILTER_DEFS_ */
Note: See TracBrowser for help on using the repository browser.