![]() |
NetSim Source Code Help
|
#include <windows.h>

Go to the source code of this file.
Data Structures | |
| struct | WINDIVERT_DATA_NETWORK |
| struct | WINDIVERT_DATA_FLOW |
| struct | WINDIVERT_DATA_SOCKET |
| struct | WINDIVERT_DATA_REFLECT |
| struct | WINDIVERT_ADDRESS |
| struct | WINDIVERT_IPHDR |
| struct | WINDIVERT_IPV6HDR |
| struct | WINDIVERT_ICMPHDR |
| struct | WINDIVERT_ICMPV6HDR |
| struct | WINDIVERT_TCPHDR |
| struct | WINDIVERT_UDPHDR |
Typedefs | |
| typedef enum WINDIVERT_LAYER * | PWINDIVERT_LAYER |
| typedef struct WINDIVERT_DATA_NETWORK * | PWINDIVERT_DATA_NETWORK |
| typedef struct WINDIVERT_DATA_FLOW * | PWINDIVERT_DATA_FLOW |
| typedef struct WINDIVERT_DATA_SOCKET * | PWINDIVERT_DATA_SOCKET |
| typedef struct WINDIVERT_DATA_REFLECT * | PWINDIVERT_DATA_REFLECT |
| typedef struct WINDIVERT_ADDRESS * | PWINDIVERT_ADDRESS |
| typedef enum WINDIVERT_EVENT * | PWINDIVERT_EVENT |
| typedef enum WINDIVERT_PARAM * | PWINDIVERT_PARAM |
| typedef enum WINDIVERT_SHUTDOWN * | PWINDIVERT_SHUTDOWN |
| typedef struct WINDIVERT_IPHDR * | PWINDIVERT_IPHDR |
| typedef struct WINDIVERT_IPV6HDR * | PWINDIVERT_IPV6HDR |
| typedef struct WINDIVERT_ICMPHDR * | PWINDIVERT_ICMPHDR |
| typedef struct WINDIVERT_ICMPV6HDR * | PWINDIVERT_ICMPV6HDR |
| typedef struct WINDIVERT_TCPHDR * | PWINDIVERT_TCPHDR |
| typedef struct WINDIVERT_UDPHDR * | PWINDIVERT_UDPHDR |
Enumerations | |
| enum | WINDIVERT_LAYER { WINDIVERT_LAYER_NETWORK = 0 , WINDIVERT_LAYER_NETWORK_FORWARD = 1 , WINDIVERT_LAYER_FLOW = 2 , WINDIVERT_LAYER_SOCKET = 3 , WINDIVERT_LAYER_REFLECT = 4 } |
| enum | WINDIVERT_EVENT { WINDIVERT_EVENT_NETWORK_PACKET = 0 , WINDIVERT_EVENT_FLOW_ESTABLISHED = 1 , WINDIVERT_EVENT_FLOW_DELETED = 2 , WINDIVERT_EVENT_SOCKET_BIND = 3 , WINDIVERT_EVENT_SOCKET_CONNECT = 4 , WINDIVERT_EVENT_SOCKET_LISTEN = 5 , WINDIVERT_EVENT_SOCKET_ACCEPT = 6 , WINDIVERT_EVENT_SOCKET_CLOSE = 7 , WINDIVERT_EVENT_REFLECT_OPEN = 8 , WINDIVERT_EVENT_REFLECT_CLOSE = 9 } |
| enum | WINDIVERT_PARAM { WINDIVERT_PARAM_QUEUE_LENGTH = 0 , WINDIVERT_PARAM_QUEUE_TIME = 1 , WINDIVERT_PARAM_QUEUE_SIZE = 2 , WINDIVERT_PARAM_VERSION_MAJOR = 3 , WINDIVERT_PARAM_VERSION_MINOR = 4 } |
| enum | WINDIVERT_SHUTDOWN { WINDIVERT_SHUTDOWN_RECV = 0x1 , WINDIVERT_SHUTDOWN_SEND = 0x2 , WINDIVERT_SHUTDOWN_BOTH = 0x3 } |
| #define WINDIVERT_BATCH_MAX 0xFF /* 255 */ |
Definition at line 317 of file windivert.h.
| #define WINDIVERT_FLAG_DROP 0x0002 |
Definition at line 184 of file windivert.h.
| #define WINDIVERT_FLAG_NO_INSTALL 0x0010 |
Definition at line 189 of file windivert.h.
| #define WINDIVERT_FLAG_READ_ONLY WINDIVERT_FLAG_RECV_ONLY |
Definition at line 186 of file windivert.h.
| #define WINDIVERT_FLAG_RECV_ONLY 0x0004 |
Definition at line 185 of file windivert.h.
| #define WINDIVERT_FLAG_SEND_ONLY 0x0008 |
Definition at line 187 of file windivert.h.
| #define WINDIVERT_FLAG_SNIFF 0x0001 |
Definition at line 183 of file windivert.h.
| #define WINDIVERT_FLAG_WRITE_ONLY WINDIVERT_FLAG_SEND_ONLY |
Definition at line 188 of file windivert.h.
| #define WINDIVERT_HELPER_NO_ICMP_CHECKSUM 2 |
Definition at line 462 of file windivert.h.
| #define WINDIVERT_HELPER_NO_ICMPV6_CHECKSUM 4 |
Definition at line 463 of file windivert.h.
| #define WINDIVERT_HELPER_NO_IP_CHECKSUM 1 |
Definition at line 461 of file windivert.h.
| #define WINDIVERT_HELPER_NO_TCP_CHECKSUM 8 |
Definition at line 464 of file windivert.h.
| #define WINDIVERT_HELPER_NO_UDP_CHECKSUM 16 |
Definition at line 465 of file windivert.h.
| #define WINDIVERT_IPHDR_GET_DF | ( | hdr | ) | ((((hdr)->FragOff0) & 0x0040) != 0) |
Definition at line 346 of file windivert.h.
| #define WINDIVERT_IPHDR_GET_FRAGOFF | ( | hdr | ) | (((hdr)->FragOff0) & 0xFF1F) |
Definition at line 342 of file windivert.h.
| #define WINDIVERT_IPHDR_GET_MF | ( | hdr | ) | ((((hdr)->FragOff0) & 0x0020) != 0) |
Definition at line 344 of file windivert.h.
| #define WINDIVERT_IPHDR_GET_RESERVED | ( | hdr | ) | ((((hdr)->FragOff0) & 0x0080) != 0) |
Definition at line 348 of file windivert.h.
| #define WINDIVERT_IPHDR_SET_DF | ( | hdr, | |
| val | |||
| ) |
Definition at line 365 of file windivert.h.
| #define WINDIVERT_IPHDR_SET_FRAGOFF | ( | hdr, | |
| val | |||
| ) |
Definition at line 351 of file windivert.h.
| #define WINDIVERT_IPHDR_SET_MF | ( | hdr, | |
| val | |||
| ) |
Definition at line 358 of file windivert.h.
| #define WINDIVERT_IPHDR_SET_RESERVED | ( | hdr, | |
| val | |||
| ) |
Definition at line 372 of file windivert.h.
| #define WINDIVERT_IPV6HDR_GET_FLOWLABEL | ( | hdr | ) | ((((UINT32)(hdr)->FlowLabel0) << 16) | ((UINT32)(hdr)->FlowLabel1)) |
Definition at line 396 of file windivert.h.
| #define WINDIVERT_IPV6HDR_GET_TRAFFICCLASS | ( | hdr | ) | ((((hdr)->TrafficClass0) << 4) | ((hdr)->TrafficClass1)) |
Definition at line 394 of file windivert.h.
| #define WINDIVERT_IPV6HDR_SET_FLOWLABEL | ( | hdr, | |
| val | |||
| ) |
Definition at line 406 of file windivert.h.
| #define WINDIVERT_IPV6HDR_SET_TRAFFICCLASS | ( | hdr, | |
| val | |||
| ) |
Definition at line 399 of file windivert.h.
| #define WINDIVERT_MTU_MAX (40 + 0xFFFF) |
Definition at line 318 of file windivert.h.
| #define WINDIVERT_PARAM_MAX WINDIVERT_PARAM_VERSION_MINOR |
Definition at line 202 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_LENGTH_DEFAULT 4096 |
Definition at line 308 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_LENGTH_MAX 16384 |
Definition at line 310 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_LENGTH_MIN 32 |
Definition at line 309 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_SIZE_DEFAULT 4194304 /* 4MB */ |
Definition at line 314 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_SIZE_MAX 33554432 /* 32MB */ |
Definition at line 316 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_SIZE_MIN 65535 /* 64KB */ |
Definition at line 315 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_TIME_DEFAULT 2000 /* 2s */ |
Definition at line 311 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_TIME_MAX 16000 /* 16s */ |
Definition at line 313 of file windivert.h.
| #define WINDIVERT_PARAM_QUEUE_TIME_MIN 100 /* 100ms */ |
Definition at line 312 of file windivert.h.
| #define WINDIVERT_PRIORITY_HIGHEST 30000 |
Definition at line 306 of file windivert.h.
| #define WINDIVERT_PRIORITY_LOWEST (-WINDIVERT_PRIORITY_HIGHEST) |
Definition at line 307 of file windivert.h.
| #define WINDIVERT_SHUTDOWN_MAX WINDIVERT_SHUTDOWN_BOTH |
Definition at line 213 of file windivert.h.
| #define WINDIVERTEXPORT __declspec(dllimport) |
Definition at line 43 of file windivert.h.
| typedef struct WINDIVERT_ADDRESS * PWINDIVERT_ADDRESS |
| typedef struct WINDIVERT_DATA_FLOW * PWINDIVERT_DATA_FLOW |
| typedef struct WINDIVERT_DATA_NETWORK * PWINDIVERT_DATA_NETWORK |
| typedef struct WINDIVERT_DATA_REFLECT * PWINDIVERT_DATA_REFLECT |
| typedef struct WINDIVERT_DATA_SOCKET * PWINDIVERT_DATA_SOCKET |
| typedef enum WINDIVERT_EVENT * PWINDIVERT_EVENT |
| typedef struct WINDIVERT_ICMPHDR * PWINDIVERT_ICMPHDR |
| typedef struct WINDIVERT_ICMPV6HDR * PWINDIVERT_ICMPV6HDR |
| typedef struct WINDIVERT_IPHDR * PWINDIVERT_IPHDR |
| typedef struct WINDIVERT_IPV6HDR * PWINDIVERT_IPV6HDR |
| typedef enum WINDIVERT_LAYER * PWINDIVERT_LAYER |
| typedef enum WINDIVERT_PARAM * PWINDIVERT_PARAM |
| typedef enum WINDIVERT_SHUTDOWN * PWINDIVERT_SHUTDOWN |
| typedef struct WINDIVERT_TCPHDR * PWINDIVERT_TCPHDR |
| typedef struct WINDIVERT_UDPHDR * PWINDIVERT_UDPHDR |
| enum WINDIVERT_EVENT |
Definition at line 165 of file windivert.h.
| enum WINDIVERT_LAYER |
| Enumerator | |
|---|---|
| WINDIVERT_LAYER_NETWORK | |
| WINDIVERT_LAYER_NETWORK_FORWARD | |
| WINDIVERT_LAYER_FLOW | |
| WINDIVERT_LAYER_SOCKET | |
| WINDIVERT_LAYER_REFLECT | |
Definition at line 75 of file windivert.h.
| enum WINDIVERT_PARAM |
| Enumerator | |
|---|---|
| WINDIVERT_PARAM_QUEUE_LENGTH | |
| WINDIVERT_PARAM_QUEUE_TIME | |
| WINDIVERT_PARAM_QUEUE_SIZE | |
| WINDIVERT_PARAM_VERSION_MAJOR | |
| WINDIVERT_PARAM_VERSION_MINOR | |
Definition at line 194 of file windivert.h.
| enum WINDIVERT_SHUTDOWN |
| Enumerator | |
|---|---|
| WINDIVERT_SHUTDOWN_RECV | |
| WINDIVERT_SHUTDOWN_SEND | |
| WINDIVERT_SHUTDOWN_BOTH | |
Definition at line 207 of file windivert.h.
| WINDIVERTEXPORT BOOL WinDivertClose | ( | __in HANDLE | handle | ) |
| WINDIVERTEXPORT BOOL WinDivertGetParam | ( | __in HANDLE | handle, |
| __in WINDIVERT_PARAM | param, | ||
| __out UINT64 * | pValue | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperCalcChecksums | ( | __inout VOID * | pPacket, |
| __in UINT | packetLen, | ||
| __out_opt WINDIVERT_ADDRESS * | pAddr, | ||
| __in UINT64 | flags | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperCompileFilter | ( | __in const char * | filter, |
| __in WINDIVERT_LAYER | layer, | ||
| __out_opt char * | object, | ||
| __in UINT | objLen, | ||
| __out_opt const char ** | errorStr, | ||
| __out_opt UINT * | errorPos | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperDecrementTTL | ( | __inout VOID * | pPacket, |
| __in UINT | packetLen | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperEvalFilter | ( | __in const char * | filter, |
| __in const VOID * | pPacket, | ||
| __in UINT | packetLen, | ||
| __in const WINDIVERT_ADDRESS * | pAddr | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperFormatFilter | ( | __in const char * | filter, |
| __in WINDIVERT_LAYER | layer, | ||
| __out char * | buffer, | ||
| __in UINT | bufLen | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperFormatIPv4Address | ( | __in UINT32 | addr, |
| __out char * | buffer, | ||
| __in UINT | bufLen | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperFormatIPv6Address | ( | __in const UINT32 * | pAddr, |
| __out char * | buffer, | ||
| __in UINT | bufLen | ||
| ) |
| WINDIVERTEXPORT UINT64 WinDivertHelperHashPacket | ( | __in const VOID * | pPacket, |
| __in UINT | packetLen, | ||
| __in UINT64 | seed | ||
| ) |
| WINDIVERTEXPORT void WinDivertHelperHtonIpv6Address | ( | __in const UINT * | inAddr, |
| __out UINT * | outAddr | ||
| ) |
| WINDIVERTEXPORT UINT32 WinDivertHelperHtonl | ( | __in UINT32 | x | ) |
| WINDIVERTEXPORT UINT64 WinDivertHelperHtonll | ( | __in UINT64 | x | ) |
| WINDIVERTEXPORT UINT16 WinDivertHelperHtons | ( | __in UINT16 | x | ) |
| WINDIVERTEXPORT void WinDivertHelperNtohIpv6Address | ( | __in const UINT * | inAddr, |
| __out UINT * | outAddr | ||
| ) |
| WINDIVERTEXPORT UINT32 WinDivertHelperNtohl | ( | __in UINT32 | x | ) |
| WINDIVERTEXPORT UINT64 WinDivertHelperNtohll | ( | __in UINT64 | x | ) |
| WINDIVERTEXPORT UINT16 WinDivertHelperNtohs | ( | __in UINT16 | x | ) |
| WINDIVERTEXPORT BOOL WinDivertHelperParseIPv4Address | ( | __in const char * | addrStr, |
| __out_opt UINT32 * | pAddr | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperParseIPv6Address | ( | __in const char * | addrStr, |
| __out_opt UINT32 * | pAddr | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertHelperParsePacket | ( | __in const VOID * | pPacket, |
| __in UINT | packetLen, | ||
| __out_opt PWINDIVERT_IPHDR * | ppIpHdr, | ||
| __out_opt PWINDIVERT_IPV6HDR * | ppIpv6Hdr, | ||
| __out_opt UINT8 * | pProtocol, | ||
| __out_opt PWINDIVERT_ICMPHDR * | ppIcmpHdr, | ||
| __out_opt PWINDIVERT_ICMPV6HDR * | ppIcmpv6Hdr, | ||
| __out_opt PWINDIVERT_TCPHDR * | ppTcpHdr, | ||
| __out_opt PWINDIVERT_UDPHDR * | ppUdpHdr, | ||
| __out_opt PVOID * | ppData, | ||
| __out_opt UINT * | pDataLen, | ||
| __out_opt PVOID * | ppNext, | ||
| __out_opt UINT * | pNextLen | ||
| ) |
| WINDIVERTEXPORT HANDLE WinDivertOpen | ( | __in const char * | filter, |
| __in WINDIVERT_LAYER | layer, | ||
| __in INT16 | priority, | ||
| __in UINT64 | flags | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertRecv | ( | __in HANDLE | handle, |
| __out_opt VOID * | pPacket, | ||
| __in UINT | packetLen, | ||
| __out_opt UINT * | pRecvLen, | ||
| __out_opt WINDIVERT_ADDRESS * | pAddr | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertRecvEx | ( | __in HANDLE | handle, |
| __out_opt VOID * | pPacket, | ||
| __in UINT | packetLen, | ||
| __out_opt UINT * | pRecvLen, | ||
| __in UINT64 | flags, | ||
| __out WINDIVERT_ADDRESS * | pAddr, | ||
| __inout_opt UINT * | pAddrLen, | ||
| __inout_opt LPOVERLAPPED | lpOverlapped | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertSend | ( | __in HANDLE | handle, |
| __in const VOID * | pPacket, | ||
| __in UINT | packetLen, | ||
| __out_opt UINT * | pSendLen, | ||
| __in const WINDIVERT_ADDRESS * | pAddr | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertSendEx | ( | __in HANDLE | handle, |
| __in const VOID * | pPacket, | ||
| __in UINT | packetLen, | ||
| __out_opt UINT * | pSendLen, | ||
| __in UINT64 | flags, | ||
| __in const WINDIVERT_ADDRESS * | pAddr, | ||
| __in UINT | addrLen, | ||
| __inout_opt LPOVERLAPPED | lpOverlapped | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertSetParam | ( | __in HANDLE | handle, |
| __in WINDIVERT_PARAM | param, | ||
| __in UINT64 | value | ||
| ) |
| WINDIVERTEXPORT BOOL WinDivertShutdown | ( | __in HANDLE | handle, |
| __in WINDIVERT_SHUTDOWN | how | ||
| ) |