Sample Code

Windows Driver Samples/ Windows Filtering Platform Sample/ C++/ inc/ ProviderContexts.h/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
///////////////////////////////////////////////////////////////////////////////
//
//   Copyright (c) 2012 Microsoft Corporation.  All Rights Reserved.
//
//   Module Name:
//      ProviderContexts.h
//
//   Abstract:
//      This module contains global definitions of FWPM_PROVIDER_CONTEXT Data for the WFPSampler project
//
//   Author:
//      Dusty Harper      (DHarper)
//
//   Revision History:
//
//      [ Month ][Day] [Year] - [Revision]-[ Comments ]
//      May       01,   2010  -     1.0   -  Creation
//
///////////////////////////////////////////////////////////////////////////////
 
#ifndef WFP_SAMPLER_PROVIDER_CONTEXT_H
#define WFP_SAMPLER_PROVIDER_CONTEXT_H
 
/// ProviderContext ProxyData Flags
#define PCPDF_PROXY_LOCAL_ADDRESS  0x01
#define PCPDF_PROXY_LOCAL_PORT     0x02
#define PCPDF_PROXY_REMOTE_ADDRESS 0x04
#define PCPDF_PROXY_REMOTE_PORT    0x08
 
///ProviderContext PacketModificationData Flags
#define PCPMDF_MODIFY_MAC_HEADER                     0x10
#define PCPMDF_MODIFY_MAC_HEADER_SOURCE_ADDRESS      0x01
#define PCPMDF_MODIFY_MAC_HEADER_DESTINATION_ADDRESS 0x02
 
#define PCPMDF_MODIFY_IP_HEADER                     0x20
#define PCPMDF_MODIFY_IP_HEADER_SOURCE_ADDRESS      0x01
#define PCPMDF_MODIFY_IP_HEADER_DESTINATION_ADDRESS 0x02
 
#define PCPMDF_MODIFY_TRANSPORT_HEADER                  0x40
#define PCPMDF_MODIFY_TRANSPORT_HEADER_SOURCE_PORT      0x01
#define PCPMDF_MODIFY_TRANSPORT_HEADER_DESTINATION_PORT 0x02
 
#define PCPMDF_MODIFY_TRANSPORT_HEADER_ICMP_TYPE PCPMDF_MODIFY_TRANSPORT_HEADER_SOURCE_PORT
#define PCPMDF_MODIFY_TRANSPORT_HEADER_ICMP_CODE PCPMDF_MODIFY_TRANSPORT_HEADER_DESTINATION_PORT
 
typedef struct MAC_DATA_
{
   UINT32 flags;
   BYTE   pReserved[4];
   BYTE   pSourceMACAddress[8];
   BYTE   pDestinationMACAddress[8];
}MAC_DATA;
 
typedef struct IP_DATA_
{
   UINT32 flags;
   BYTE   pReserved[3];
   UINT8  ipVersion;
   union
   {
      BYTE pIPv4[4];                       /// Network Byte Order
      BYTE pIPv6[16];
      BYTE pBytes[16];
   }sourceAddress;
   union
   {
      BYTE pIPv4[4];                       /// Network Byte Order
      BYTE pIPv6[16];
      BYTE pBytes[16];
   }destinationAddress;
}IP_DATA;
 
typedef struct TRANSPORT_DATA_
{
   UINT32 flags;
   BYTE   pReserved[3];
   UINT8  protocol;
   union
   {
      UINT8  icmpType;
      UINT16 sourcePort;                   /// Network Byte Order
   };
   union
   {
      UINT8  icmpCode;
      UINT16 destinationPort;              /// Network Byte Order
   };
   BYTE pPadding[4];
} TRANSPORT_DATA;
 
typedef struct PC_BASIC_ACTION_DATA_
{
   UINT8 percentBlock;
   UINT8 percentPermit;
   UINT8 percentContinue;
   BYTE  pReserved[5];
} PC_BASIC_ACTION_DATA, *PPC_BASIC_ACTION_DATA;
 
typedef struct PC_BASIC_PACKET_INJECTION_DATA_
{
   BOOLEAN performInline;  /// Inline vs. Out of Band
   BOOLEAN useWorkItems;   /// Work Items vs. Deferred Procedure Calls
   BOOLEAN useThreadedDPC; /// Threaded DPCs vs Deferred Procedure Calls
   BYTE    pReserved[5];
} PC_BASIC_PACKET_INJECTION_DATA, *PPC_BASIC_PACKET_INJECTION_DATA;
 
typedef struct PC_BASIC_PACKET_MODIFICATION_DATA_
{
   UINT32         flags;
   BOOLEAN        performInline;  /// Inline vs. Out of Band
   BOOLEAN        useWorkItems;   /// Work Items vs. Deferred Procedure Calls
   BOOLEAN        useThreadedDPC; /// Threaded DPCs vs Deferred Procedure Calls
   BYTE           pReserved[1];
   MAC_DATA       macData;
   IP_DATA        ipData;
   TRANSPORT_DATA transportData;
}PC_BASIC_PACKET_MODIFICATION_DATA;
 
typedef struct PC_BASIC_STREAM_INJECTION_DATA_
{
   BOOLEAN performInline;  /// Inline vs. Out of Band
   BOOLEAN useWorkItems;   /// Work Items vs. Deferred Procedure Calls
   BOOLEAN useThreadedDPC; /// Threaded DPCs vs Deferred Procedure Calls
   BYTE    pReserved[5];
} PC_BASIC_STREAM_INJECTION_DATA, *PPC_BASIC_STREAM_INJECTION_DATA;
 
typedef struct PC_PEND_AUTHORIZATION_DATA_
{
   UINT32  flags;
   UINT32  finalAction;
   UINT32  delay;
   BOOLEAN useWorkItems;                   /// Work Items vs. Deferred Procedure Calls
   BOOLEAN useThreadedDPC;                 /// Threaded DPCs vs Deferred Procedure Calls
   BYTE    pReserved[2];
}PC_PEND_AUTHORIZATION_DATA, *PPC_PEND_AUTHORIZATION_DATA;
 
typedef struct PC_PROXY_DATA_
{
   UINT32  flags;
   BOOLEAN performInline;                  /// Inline vs. Out of Band
   BOOLEAN useWorkItems;                   /// Work Items vs. Deferred Procedure Calls
   BOOLEAN useThreadedDPC;                 /// Threaded DPCs vs Deferred Procedure Calls
   BOOLEAN proxyToRemoteService;           /// Local vs. Remote Service
   BYTE    pReserved[7];
   UINT8   ipVersion;
   union
   {
      BYTE pIPv4[4];                       /// Network Byte Order
      BYTE pIPv6[16];
      BYTE pBytes[16];
   }proxyLocalAddress;
   union
   {
      BYTE pIPv4[4];                       /// Network Byte Order
      BYTE pIPv6[16];
      BYTE pBytes[16];
   }proxyRemoteAddress;
   UINT32  localScopeId;
   UINT32  remoteScopeId;
   UINT16  proxyLocalPort;                 /// Network Byte Order
   UINT16  proxyRemotePort;                /// Network Byte Order
   UINT32  targetProcessID;
   UINT64  tcpPortReservationToken;
   UINT64  udpPortReservationToken;
 
} PC_PROXY_DATA, *PPC_PROXY_DATA;
 
#endif /// WFP_SAMPLER_PROVIDER_CONTEXT_H

Our Services

  • What our customers say about us?

© 2011-2025 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS