ReactOS 0.4.15-dev-5666-gc548b97
fltdefs.h
Go to the documentation of this file.
1/*
2 * fltdefs.h
3 *
4 * This file is part of the ReactOS PSDK package.
5 *
6 * Contributors:
7 * Created by Timo Kreuzer.
8 *
9 * THIS SOFTWARE IS NOT COPYRIGHTED
10 *
11 * This source code is offered for use in the public domain. You may
12 * use, modify or distribute it freely.
13 *
14 * This code is distributed in the hope that it will be useful but
15 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16 * DISCLAIMED. This includes but is not limited to warranties of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 */
20
21#ifndef _FLTDEFS_H
22#define _FLTDEFS_H
23
24#pragma once
25
26#ifdef __cplusplus
27#define EXTERNCDECL EXTERN_C
28#else
29#define EXTERNCDECL
30#endif
31
32#ifdef _M_CEE_PURE
33#define PFEXPORT
34#else
35#define PFEXPORT /* __declspec(dllexport) Native headers have this, but this breaks exports with GCC! */
36#endif
37
38#define PFAPIENTRY EXTERNCDECL DWORD PFEXPORT WINAPI
39
40#define ERROR_BASE 23000
41#define PFERROR_NO_PF_INTERFACE (ERROR_BASE + 0)
42#define PFERROR_NO_FILTERS_GIVEN (ERROR_BASE + 1)
43#define PFERROR_BUFFER_TOO_SMALL (ERROR_BASE + 2)
44#define ERROR_IPV6_NOT_IMPLEMENTED (ERROR_BASE + 3)
45
46#define FD_FLAGS_NOSYN 0x1
47#define FD_FLAGS_ALLFLAGS FD_FLAGS_NOSYN
48
49#define FILTER_PROTO(ProtoId) MAKELONG(MAKEWORD((ProtoId), 0x00), 0x00000)
50#define FILTER_PROTO_ANY FILTER_PROTO(0x00)
51#define FILTER_PROTO_ICMP FILTER_PROTO(0x01)
52#define FILTER_PROTO_TCP FILTER_PROTO(0x06)
53#define FILTER_PROTO_UDP FILTER_PROTO(0x11)
54
55#define FILTER_TCPUDP_PORT_ANY ((WORD)0x0000)
56#define FILTER_ICMP_TYPE_ANY ((BYTE)0xff)
57#define FILTER_ICMP_CODE_ANY ((BYTE)0xff)
58
59#define LB_SRC_ADDR_USE_SRCADDR_FLAG 0x00000001
60#define LB_SRC_ADDR_USE_DSTADDR_FLAG 0x00000002
61#define LB_DST_ADDR_USE_SRCADDR_FLAG 0x00000004
62#define LB_DST_ADDR_USE_DSTADDR_FLAG 0x00000008
63#define LB_SRC_MASK_LATE_FLAG 0x00000010
64#define LB_DST_MASK_LATE_FLAG 0x00000020
65
68
69typedef enum _GlobalFilter
70{
73 GF_FRAGCACHE = 9
75
76typedef enum _PfAddresType
77{
81
82typedef enum _PfForwardAction
83{
87
88typedef enum _PfFrameType
89{
92 PFFT_SPOOF = 3
94
95typedef struct _pfLogFrame
96{
107
109{
124
125#define FILTERSIZE (sizeof(PF_FILTER_DESCRIPTOR) - (DWORD)FIELD_OFFSET(PF_FILTER_DESCRIPTOR, SrcAddr))
126
127typedef struct _PF_FILTER_STATS
128{
132
134{
152
153typedef struct _PF_LATEBIND_INFO
154{
159
163 DWORD cInFilters,
164 PPF_FILTER_DESCRIPTOR pfiltIn,
165 DWORD cOutFilters,
166 PPF_FILTER_DESCRIPTOR pfiltOut,
167 PFILTER_HANDLE pfHandle);
168
172 GLOBAL_FILTER gfFilter);
173
177 PFADDRESSTYPE pfatType,
178 PBYTE IPAddress);
179
183 DWORD dwIndex,
184 PFADDRESSTYPE pfatLinkType,
185 PBYTE LinkIPAddress);
186
189 DWORD dwName,
190 PFFORWARD_ACTION inAction,
191 PFFORWARD_ACTION outAction,
192 BOOL bUseLog,
193 BOOL bMustBeUnique,
195
199
202 VOID);
203
207 PPF_INTERFACE_STATS ppfStats,
208 PDWORD pdwBufferSize,
209 BOOL fResetCounters);
210
213 HANDLE hEvent);
214
218 PPF_LATEBIND_INFO pLateBindInfo);
219
223 DWORD cFilters,
224 PFILTER_HANDLE pvHandles);
225
229 DWORD cInFilters,
230 PPF_FILTER_DESCRIPTOR pfiltIn,
231 DWORD cOutFilters,
232 PPF_FILTER_DESCRIPTOR pfiltOut);
233
237 GLOBAL_FILTER gfFilter);
238
241 PBYTE pbBuffer,
243 DWORD dwThreshold,
244 DWORD dwEntries,
245 PDWORD pdwLoggedEntries,
246 PDWORD pdwLostEntries,
247 PDWORD pdwSizeUsed);
248
251 INTERFACE_HANDLE pInInterface OPTIONAL,
252 INTERFACE_HANDLE pOutInterface OPTIONAL,
253 DWORD cBytes,
254 PBYTE pbPacket,
255 PPFFORWARD_ACTION ppAction);
256
260
261#endif // _FLTDEFS_H
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
struct _PF_LATEBIND_INFO * PPF_LATEBIND_INFO
enum _PfAddresType PFADDRESSTYPE
enum _PfForwardAction * PPFFORWARD_ACTION
struct _PF_FILTER_STATS * PPF_FILTER_STATS
_PfFrameType
Definition: fltdefs.h:89
@ PFFT_SPOOF
Definition: fltdefs.h:92
@ PFFT_FILTER
Definition: fltdefs.h:90
@ PFFT_FRAG
Definition: fltdefs.h:91
enum _PfAddresType * PPFADDRESSTYPE
PFAPIENTRY PfAddGlobalFilterToInterface(INTERFACE_HANDLE pInterface, GLOBAL_FILTER gfFilter)
PFAPIENTRY PfRemoveFilterHandles(INTERFACE_HANDLE pInterface, DWORD cFilters, PFILTER_HANDLE pvHandles)
struct _PF_FILTER_STATS PF_FILTER_STATS
struct _PF_FILTER_DESCRIPTOR * PPF_FILTER_DESCRIPTOR
_PfAddresType
Definition: fltdefs.h:77
@ PF_IPV4
Definition: fltdefs.h:78
@ PF_IPV6
Definition: fltdefs.h:79
enum _GlobalFilter * PGLOBAL_FILTER
PFAPIENTRY PfRemoveGlobalFilterFromInterface(INTERFACE_HANDLE pInterface, GLOBAL_FILTER gfFilter)
_GlobalFilter
Definition: fltdefs.h:70
@ GF_FRAGMENTS
Definition: fltdefs.h:71
@ GF_FRAGCACHE
Definition: fltdefs.h:73
@ GF_STRONGHOST
Definition: fltdefs.h:72
struct _PF_FILTER_DESCRIPTOR PF_FILTER_DESCRIPTOR
#define PFAPIENTRY
Definition: fltdefs.h:38
PFAPIENTRY PfDeleteInterface(INTERFACE_HANDLE pInterface)
enum _PfFrameType PFFRAMETYPE
PFAPIENTRY PfTestPacket(INTERFACE_HANDLE pInInterface OPTIONAL, INTERFACE_HANDLE pOutInterface OPTIONAL, DWORD cBytes, PBYTE pbPacket, PPFFORWARD_ACTION ppAction)
PFAPIENTRY PfGetInterfaceStatistics(INTERFACE_HANDLE pInterface, PPF_INTERFACE_STATS ppfStats, PDWORD pdwBufferSize, BOOL fResetCounters)
enum _PfFrameType * PPFFRAMETYPE
PVOID * PINTERFACE_HANDLE
Definition: fltdefs.h:67
PVOID INTERFACE_HANDLE
Definition: fltdefs.h:67
PFAPIENTRY PfBindInterfaceToIndex(INTERFACE_HANDLE pInterface, DWORD dwIndex, PFADDRESSTYPE pfatLinkType, PBYTE LinkIPAddress)
struct _PF_INTERFACE_STATS * PPF_INTERFACE_STATS
PFAPIENTRY PfCreateInterface(DWORD dwName, PFFORWARD_ACTION inAction, PFFORWARD_ACTION outAction, BOOL bUseLog, BOOL bMustBeUnique, INTERFACE_HANDLE *ppInterface)
PFAPIENTRY PfDeleteLog(VOID)
PVOID * PFILTER_HANDLE
Definition: fltdefs.h:66
struct _PF_LATEBIND_INFO PF_LATEBIND_INFO
PFAPIENTRY PfMakeLog(HANDLE hEvent)
struct _pfLogFrame PFLOGFRAME
enum _PfForwardAction PFFORWARD_ACTION
enum _GlobalFilter GLOBAL_FILTER
PFAPIENTRY PfAddFiltersToInterface(INTERFACE_HANDLE ih, DWORD cInFilters, PPF_FILTER_DESCRIPTOR pfiltIn, DWORD cOutFilters, PPF_FILTER_DESCRIPTOR pfiltOut, PFILTER_HANDLE pfHandle)
PFAPIENTRY PfBindInterfaceToIPAddress(INTERFACE_HANDLE pInterface, PFADDRESSTYPE pfatType, PBYTE IPAddress)
PFAPIENTRY PfRebindFilters(INTERFACE_HANDLE pInterface, PPF_LATEBIND_INFO pLateBindInfo)
_PfForwardAction
Definition: fltdefs.h:83
@ PF_ACTION_FORWARD
Definition: fltdefs.h:84
@ PF_ACTION_DROP
Definition: fltdefs.h:85
PFAPIENTRY PfRemoveFiltersFromInterface(INTERFACE_HANDLE ih, DWORD cInFilters, PPF_FILTER_DESCRIPTOR pfiltIn, DWORD cOutFilters, PPF_FILTER_DESCRIPTOR pfiltOut)
PFAPIENTRY PfUnBindInterface(INTERFACE_HANDLE pInterface)
struct _pfLogFrame * PPFLOGFRAME
PVOID FILTER_HANDLE
Definition: fltdefs.h:66
struct _PF_INTERFACE_STATS PF_INTERFACE_STATS
PFAPIENTRY PfSetLogBuffer(PBYTE pbBuffer, DWORD dwSize, DWORD dwThreshold, DWORD dwEntries, PDWORD pdwLoggedEntries, PDWORD pdwLostEntries, PDWORD pdwSizeUsed)
PINTERFACE pInterface
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static HANDLE hEvent
Definition: comm.c:54
static REFIID LPVOID * ppInterface
Definition: metahost.c:34
BYTE * PBYTE
Definition: pedump.c:66
DWORD * PDWORD
Definition: pedump.c:68
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
PFADDRESSTYPE pfatType
Definition: fltdefs.h:112
DWORD dwNumPacketsFiltered
Definition: fltdefs.h:129
PF_FILTER_DESCRIPTOR info
Definition: fltdefs.h:130
DWORD dwLostLogEntries
Definition: fltdefs.h:149
LARGE_INTEGER liTotalLogged
Definition: fltdefs.h:148
DWORD dwNumOutFilters
Definition: fltdefs.h:142
PFFORWARD_ACTION eaInAction
Definition: fltdefs.h:139
PF_FILTER_STATS FilterInfo[1]
Definition: fltdefs.h:150
PFFORWARD_ACTION eaOutAction
Definition: fltdefs.h:140
DWORD dwNumInFilters
Definition: fltdefs.h:141
LARGE_INTEGER liSYN
Definition: fltdefs.h:147
PVOID pvDriverContext
Definition: fltdefs.h:135
LARGE_INTEGER Timestamp
Definition: fltdefs.h:97
DWORD dwTotalSizeUsed
Definition: fltdefs.h:99
DWORD dwIPIndex
Definition: fltdefs.h:104
DWORD dwFilterRule
Definition: fltdefs.h:100
DWORD dwInterfaceName
Definition: fltdefs.h:103
WORD wSizeOfAdditionalData
Definition: fltdefs.h:101
BYTE bPacketData[1]
Definition: fltdefs.h:105
WORD wSizeOfIpHeader
Definition: fltdefs.h:102
PFFRAMETYPE pfeTypeOfFrame
Definition: fltdefs.h:98
unsigned char BYTE
Definition: xxhash.c:193