ReactOS  0.4.15-dev-2704-gd5265b0
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 
69 typedef enum _GlobalFilter
70 {
75 
76 typedef enum _PfAddresType
77 {
81 
82 typedef enum _PfForwardAction
83 {
87 
88 typedef enum _PfFrameType
89 {
91  PFFT_FRAG = 2,
94 
95 typedef struct _pfLogFrame
96 {
107 
108 typedef struct _PF_FILTER_DESCRIPTOR
109 {
124 
125 #define FILTERSIZE (sizeof(PF_FILTER_DESCRIPTOR) - (DWORD)FIELD_OFFSET(PF_FILTER_DESCRIPTOR, SrcAddr))
126 
127 typedef struct _PF_FILTER_STATS
128 {
132 
133 typedef struct _PF_INTERFACE_STATS
134 {
152 
153 typedef struct _PF_LATEBIND_INFO
154 {
159 
162  INTERFACE_HANDLE ih,
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 
212 PfMakeLog(
213  HANDLE hEvent);
214 
218  PPF_LATEBIND_INFO pLateBindInfo);
219 
223  DWORD cFilters,
224  PFILTER_HANDLE pvHandles);
225 
228  INTERFACE_HANDLE ih,
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,
242  DWORD dwSize,
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
_PfAddresType
Definition: fltdefs.h:76
_GlobalFilter
Definition: fltdefs.h:69
LARGE_INTEGER liTotalLogged
Definition: fltdefs.h:148
enum _PfFrameType PFFRAMETYPE
PFFORWARD_ACTION eaInAction
Definition: fltdefs.h:139
PFAPIENTRY PfRemoveFilterHandles(INTERFACE_HANDLE pInterface, DWORD cFilters, PFILTER_HANDLE pvHandles)
PVOID * PFILTER_HANDLE
Definition: fltdefs.h:66
struct _PF_FILTER_STATS PF_FILTER_STATS
PFAPIENTRY PfBindInterfaceToIndex(INTERFACE_HANDLE pInterface, DWORD dwIndex, PFADDRESSTYPE pfatLinkType, PBYTE LinkIPAddress)
#define PFAPIENTRY
Definition: fltdefs.h:38
DWORD dwInterfaceName
Definition: fltdefs.h:103
PFAPIENTRY PfRemoveGlobalFilterFromInterface(INTERFACE_HANDLE pInterface, GLOBAL_FILTER gfFilter)
PFAPIENTRY PfAddFiltersToInterface(INTERFACE_HANDLE ih, DWORD cInFilters, PPF_FILTER_DESCRIPTOR pfiltIn, DWORD cOutFilters, PPF_FILTER_DESCRIPTOR pfiltOut, PFILTER_HANDLE pfHandle)
PFAPIENTRY PfUnBindInterface(INTERFACE_HANDLE pInterface)
enum _GlobalFilter * PGLOBAL_FILTER
struct _PF_INTERFACE_STATS * PPF_INTERFACE_STATS
PFAPIENTRY PfRemoveFiltersFromInterface(INTERFACE_HANDLE ih, DWORD cInFilters, PPF_FILTER_DESCRIPTOR pfiltIn, DWORD cOutFilters, PPF_FILTER_DESCRIPTOR pfiltOut)
PINTERFACE pInterface
struct _PF_FILTER_DESCRIPTOR PF_FILTER_DESCRIPTOR
DWORD dwIPIndex
Definition: fltdefs.h:104
PFAPIENTRY PfCreateInterface(DWORD dwName, PFFORWARD_ACTION inAction, PFFORWARD_ACTION outAction, BOOL bUseLog, BOOL bMustBeUnique, INTERFACE_HANDLE *ppInterface)
PF_FILTER_STATS FilterInfo[1]
Definition: fltdefs.h:150
static HANDLE hEvent
Definition: comm.c:54
PFAPIENTRY PfMakeLog(HANDLE hEvent)
static REFIID LPVOID * ppInterface
Definition: metahost.c:34
enum _PfAddresType PFADDRESSTYPE
unsigned int BOOL
Definition: ntddk_ex.h:94
PVOID * PINTERFACE_HANDLE
Definition: fltdefs.h:67
enum _PfFrameType * PPFFRAMETYPE
WORD wSizeOfIpHeader
Definition: fltdefs.h:102
PFAPIENTRY PfAddGlobalFilterToInterface(INTERFACE_HANDLE pInterface, GLOBAL_FILTER gfFilter)
PVOID FILTER_HANDLE
Definition: fltdefs.h:66
struct _PF_LATEBIND_INFO * PPF_LATEBIND_INFO
DWORD dwTotalSizeUsed
Definition: fltdefs.h:99
PFAPIENTRY PfTestPacket(INTERFACE_HANDLE pInInterface OPTIONAL, INTERFACE_HANDLE pOutInterface OPTIONAL, DWORD cBytes, PBYTE pbPacket, PPFFORWARD_ACTION ppAction)
LARGE_INTEGER Timestamp
Definition: fltdefs.h:97
enum _GlobalFilter GLOBAL_FILTER
PFADDRESSTYPE pfatType
Definition: fltdefs.h:112
PFFORWARD_ACTION eaOutAction
Definition: fltdefs.h:140
PFAPIENTRY PfDeleteInterface(INTERFACE_HANDLE pInterface)
PFAPIENTRY PfRebindFilters(INTERFACE_HANDLE pInterface, PPF_LATEBIND_INFO pLateBindInfo)
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
enum _PfForwardAction * PPFFORWARD_ACTION
enum _PfAddresType * PPFADDRESSTYPE
LARGE_INTEGER liSYN
Definition: fltdefs.h:147
WORD wSizeOfAdditionalData
Definition: fltdefs.h:101
struct _PF_LATEBIND_INFO PF_LATEBIND_INFO
struct _PF_FILTER_DESCRIPTOR * PPF_FILTER_DESCRIPTOR
PFFRAMETYPE pfeTypeOfFrame
Definition: fltdefs.h:98
PF_FILTER_DESCRIPTOR info
Definition: fltdefs.h:130
DWORD dwNumPacketsFiltered
Definition: fltdefs.h:129
DWORD dwNumInFilters
Definition: fltdefs.h:141
unsigned char BYTE
Definition: xxhash.c:193
PFAPIENTRY PfSetLogBuffer(PBYTE pbBuffer, DWORD dwSize, DWORD dwThreshold, DWORD dwEntries, PDWORD pdwLoggedEntries, PDWORD pdwLostEntries, PDWORD pdwSizeUsed)
DWORD dwLostLogEntries
Definition: fltdefs.h:149
PVOID pvDriverContext
Definition: fltdefs.h:135
struct _pfLogFrame PFLOGFRAME
PFAPIENTRY PfDeleteLog(VOID)
DWORD dwFilterRule
Definition: fltdefs.h:100
PFAPIENTRY PfBindInterfaceToIPAddress(INTERFACE_HANDLE pInterface, PFADDRESSTYPE pfatType, PBYTE IPAddress)
DWORD * PDWORD
Definition: pedump.c:68
_PfFrameType
Definition: fltdefs.h:88
PVOID INTERFACE_HANDLE
Definition: fltdefs.h:67
BYTE bPacketData[1]
Definition: fltdefs.h:105
PFAPIENTRY PfGetInterfaceStatistics(INTERFACE_HANDLE pInterface, PPF_INTERFACE_STATS ppfStats, PDWORD pdwBufferSize, BOOL fResetCounters)
_PfForwardAction
Definition: fltdefs.h:82
BYTE * PBYTE
Definition: pedump.c:66
struct _PF_INTERFACE_STATS PF_INTERFACE_STATS
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
enum _PfForwardAction PFFORWARD_ACTION
struct _PF_FILTER_STATS * PPF_FILTER_STATS
struct _pfLogFrame * PPFLOGFRAME
DWORD dwNumOutFilters
Definition: fltdefs.h:142
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68