aboutsummaryrefslogtreecommitdiffstats
path: root/example/example.c
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2021-04-10 15:33:01 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-13 15:56:04 -0600
commit564a883e23fff00140c10271f08b37dc649d57c8 (patch)
tree7b7ce433ed469541e68489cd9429b00f04e370b0 /example/example.c
parentversion: bump (diff)
downloadwintun-564a883e23fff00140c10271f08b37dc649d57c8.tar.xz
wintun-564a883e23fff00140c10271f08b37dc649d57c8.zip
Allow optional padding before and after layer 3 packets
To avoid additional packet memory allocation and copy when sending or receiving packets, this commit introduces additional available space before and after layer 3 IPv4 or IPv6 packet in the Wintun rings. Wintun will ignore data in those areas. Requested-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'example/example.c')
-rw-r--r--example/example.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/example/example.c b/example/example.c
index 9e5f2e8..004b19f 100644
--- a/example/example.c
+++ b/example/example.c
@@ -24,6 +24,7 @@ static WINTUN_SET_ADAPTER_NAME_FUNC WintunSetAdapterName;
static WINTUN_GET_RUNNING_DRIVER_VERSION_FUNC WintunGetRunningDriverVersion;
static WINTUN_SET_LOGGER_FUNC WintunSetLogger;
static WINTUN_START_SESSION_FUNC WintunStartSession;
+static WINTUN_START_SESSION_WITH_PADDING_FUNC WintunStartSessionWithPadding;
static WINTUN_END_SESSION_FUNC WintunEndSession;
static WINTUN_GET_READ_WAIT_EVENT_FUNC WintunGetReadWaitEvent;
static WINTUN_RECEIVE_PACKET_FUNC WintunReceivePacket;
@@ -47,6 +48,7 @@ InitializeWintun(void)
X(WintunSetAdapterName, WINTUN_SET_ADAPTER_NAME_FUNC) ||
X(WintunGetRunningDriverVersion, WINTUN_GET_RUNNING_DRIVER_VERSION_FUNC) ||
X(WintunSetLogger, WINTUN_SET_LOGGER_FUNC) || X(WintunStartSession, WINTUN_START_SESSION_FUNC) ||
+ X(WintunStartSessionWithPadding, WINTUN_START_SESSION_WITH_PADDING_FUNC) ||
X(WintunEndSession, WINTUN_END_SESSION_FUNC) || X(WintunGetReadWaitEvent, WINTUN_GET_READ_WAIT_EVENT_FUNC) ||
X(WintunReceivePacket, WINTUN_RECEIVE_PACKET_FUNC) ||
X(WintunReleaseReceivePacket, WINTUN_RELEASE_RECEIVE_PACKET_FUNC) ||