From 47b16dc884992d9c100bc0161d4ca6776a3cd507 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 12 Apr 2021 13:08:42 +0200 Subject: Allow packet over-allocation on send Should client desire to prepare packets for Wintun inside the ring memory (e.g. to reduce memory copying), the final sending packet size is not always known at the WintunAllocateSendPacket() time. This commit modifies Wintun to calculate the packet size on delivery to NDIS. The packet size is derived from IPv4/IPv6 packet header. Signed-off-by: Simon Rozman --- api/wintun.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'api/wintun.h') diff --git a/api/wintun.h b/api/wintun.h index b90ba82..b2395be 100644 --- a/api/wintun.h +++ b/api/wintun.h @@ -313,7 +313,9 @@ typedef void(WINAPI *WINTUN_RELEASE_RECEIVE_PACKET_FUNC)(_In_ WINTUN_SESSION_HAN * * @param Session Wintun session handle obtained with WintunStartSession * - * @param PacketSize Exact packet size. Must be less or equal to WINTUN_MAX_IP_PACKET_SIZE. + * @param PacketSize Upper estimate of packet size. Must be less or equal to WINTUN_MAX_IP_PACKET_SIZE. The exact + * size of the packet is determined from layer 3 IPv4 or IPv6 packet header on WintunSendPacket. + * IPv6 Jumbograms are not supported. * * @return Returns pointer to memory where to prepare layer 3 IPv4 or IPv6 packet for sending. If the function fails, * the return value is NULL. To get extended error information, call GetLastError. Possible errors include the -- cgit v1.2.3-59-g8ed1b