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().
What is the byte order of the IP address specified in a callout's classifyFn in WFP?
-
15-01-2022 - |
题
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.
解决方案
不隶属于 StackOverflow