ReactOS  0.4.14-dev-55-g2da92ac
pfhook.h
Go to the documentation of this file.
1 /*
2  * pfhook.h
3  *
4  * Packet filter API
5  *
6  * This file is part of the w32api package.
7  *
8  * Contributors:
9  * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
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 __PFHOOK_H
24 #define __PFHOOK_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #define DD_IPFLTRDRVR_DEVICE_NAME L"\\Device\\IPFILTERDRIVER"
31 
32 #define INVALID_PF_IF_INDEX 0xffffffff
33 #define ZERO_PF_IP_ADDR 0
34 
35 typedef ULONG IPAddr;
36 
37 typedef enum _PF_FORWARD_ACTION {
39  PF_DROP = 1,
40  PF_PASS = 2,
43 
44 typedef PF_FORWARD_ACTION
46  IN unsigned char *PacketHeader,
47  IN unsigned char *Packet,
48  IN unsigned int PacketLength,
49  IN unsigned int RecvInterfaceIndex,
50  IN unsigned int SendInterfaceIndex,
51  IN IPAddr RecvLinkNextHop,
52  IN IPAddr SendLinkNextHop);
53 
57 
58 #define FSCTL_IPFLTRDRVR_BASE FILE_DEVICE_NETWORK
59 
60 #define _IPFLTRDRVR_CTL_CODE(function, method, access) \
61  CTL_CODE(FSCTL_IPFLTRDRVR_BASE, function, method, access)
62 
63 #define IOCTL_PF_SET_EXTENSION_POINTER \
64  _IPFLTRDRVR_CTL_CODE(22, METHOD_BUFFERED, FILE_WRITE_ACCESS)
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* __PFHOOK_H */
#define IN
Definition: typedefs.h:38
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
struct _PF_SET_EXTENSION_HOOK_INFO PF_SET_EXTENSION_HOOK_INFO
PF_FORWARD_ACTION(NTAPI * PacketFilterExtensionPtr)(IN unsigned char *PacketHeader, IN unsigned char *Packet, IN unsigned int PacketLength, IN unsigned int RecvInterfaceIndex, IN unsigned int SendInterfaceIndex, IN IPAddr RecvLinkNextHop, IN IPAddr SendLinkNextHop)
Definition: pfhook.h:45
Definition: pfhook.h:40
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
Definition: pfhook.h:39
ULONG IPAddr
Definition: pfhook.h:35
struct _PF_SET_EXTENSION_HOOK_INFO * PPF_SET_EXTENSION_HOOK_INFO
_PF_FORWARD_ACTION
Definition: pfhook.h:37
enum _PF_FORWARD_ACTION PF_FORWARD_ACTION
unsigned int ULONG
Definition: retypes.h:1
PacketFilterExtensionPtr ExtensionPointer
Definition: pfhook.h:55