From 232459cc11c98d20eb9eac1cc0571f4447cdb1ff Mon Sep 17 00:00:00 2001
From: basil00
Date: Tue, 18 Nov 2014 00:02:47 +0800
Subject: [PATCH] - Document the WinDivertHelperParseIPvXAddress() byte/word
orderings.
---
doc/windivert.html | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/doc/windivert.html b/doc/windivert.html
index 1315b59..a359020 100644
--- a/doc/windivert.html
+++ b/doc/windivert.html
@@ -1168,7 +1168,9 @@ Use GetLastError() to get the reason for the error.
Remarks
Parses an IPv4 address stored in addrStr.
-If non-NULL, the result is stored in pAddr.
+If non-NULL, the result is stored in pAddr
+in host-byte-order.
+Use htonl() to convert the result into network-byte-order.
@@ -1198,6 +1200,18 @@ Parses an IPv6 address stored in addrStr.
If non-NULL, the result is stored in pAddr.
The pAddr parameter is assumed to point to a buffer large enough
to hold a 16-byte IPv6 address.
+Given an IPv6 address of the form
+0011:2233:4455:6677:8899:aabb:ccdd:eeff, then
+the result is ordered as follows:
+
+pAddr[0] = 0x00112233
+pAddr[1] = 0x44556677
+pAddr[2] = 0x8899aabb
+pAddr[3] = 0xccddeeff
+
+where each pAddr[i] is in host-byte-order.
+The result can be converted into network-byte-order by setting
+pAddr[i] = htonl(pAddr[i]) for each i.