MinGWify 'depends'
[msysgit.git] / mingw / include / ddk / pfhook.h
blob1b42bfab406074f6b09458086a7325b3799a4591
1 /*
2 * pfhook.h
4 * Packet filter API
6 * This file is part of the w32api package.
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
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.
23 #ifndef __PFHOOK_H
24 #define __PFHOOK_H
26 #if __GNUC__ >=3
27 #pragma GCC system_header
28 #endif
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #include "ntddk.h"
36 #define DD_IPFLTRDRVR_DEVICE_NAME L"\\Device\\IPFILTERDRIVER"
38 #define INVALID_PF_IF_INDEX 0xffffffff
39 #define ZERO_PF_IP_ADDR 0
41 typedef ULONG IPAddr;
43 typedef enum _PF_FORWARD_ACTION {
44 PF_FORWARD = 0,
45 PF_DROP = 1,
46 PF_PASS = 2,
47 PF_ICMP_ON_DROP = 3
48 } PF_FORWARD_ACTION;
50 typedef PF_FORWARD_ACTION STDCALL
51 (*PacketFilterExtensionPtr)(
52 /*IN*/ unsigned char *PacketHeader,
53 /*IN*/ unsigned char *Packet,
54 /*IN*/ unsigned int PacketLength,
55 /*IN*/ unsigned int RecvInterfaceIndex,
56 /*IN*/ unsigned int SendInterfaceIndex,
57 /*IN*/ IPAddr RecvLinkNextHop,
58 /*IN*/ IPAddr SendLinkNextHop);
60 typedef struct _PF_SET_EXTENSION_HOOK_INFO {
61 PacketFilterExtensionPtr ExtensionPointer;
62 } PF_SET_EXTENSION_HOOK_INFO, *PPF_SET_EXTENSION_HOOK_INFO;
64 #define FSCTL_IPFLTRDRVR_BASE FILE_DEVICE_NETWORK
66 #define _IPFLTRDRVR_CTL_CODE(function, method, access) \
67 CTL_CODE(FSCTL_IPFLTRDRVR_BASE, function, method, access)
69 #define IOCTL_PF_SET_EXTENSION_POINTER \
70 _IPFLTRDRVR_CTL_CODE(22, METHOD_BUFFERED, FILE_WRITE_ACCESS)
72 #ifdef __cplusplus
74 #endif
76 #endif /* __PFHOOK_H */