In a callout's classifyFn, one can use the following code to get the remote IP address:

inFixedValues->
incomingValue[FWPS_FIELD_ALE_AUTH_CONNECT_V4_IP_REMOTE_ADDRESS].value.uint32;
// IPv4

or

inFixedValues->
incomingValue[FWPS_FIELD_ALE_AUTH_CONNECT_V6_IP_REMOTE_ADDRESS].value.byteArray16; 
// IPv6

However, I can't find any documentation to specify the "byte order" of the IP address from MSDN, OSR, etc.

The following link is the same question as mine, but there was no answers.

http://www.osronline.com/showthread.cfm?link=225090he

有帮助吗?

解决方案

I haven't worked with IPv6 addresses, but WFP gives you the IPv4 address in "host order" (little endian). If you need to change it to "network order" (big endian), you can call the htonl() function or if you're writing a kernel-mode driver you can use RtlUlongByteSwap().

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top