diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-27 00:57:58 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-27 01:03:28 +0200 |
commit | 95fefbdb39dfdac91567c6454e74a354203ef03f (patch) | |
tree | 161174e725a7273c15c0e3685a46cef18b0e547c /wireguard-go-bridge/example.c | |
parent | bridge: go get requires arch paths (diff) | |
download | wireguard-apple-95fefbdb39dfdac91567c6454e74a354203ef03f.tar.xz wireguard-apple-95fefbdb39dfdac91567c6454e74a354203ef03f.zip |
Allow customizing MTU
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'wireguard-go-bridge/example.c')
-rw-r--r-- | wireguard-go-bridge/example.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wireguard-go-bridge/example.c b/wireguard-go-bridge/example.c index 912d181..33ed1f0 100644 --- a/wireguard-go-bridge/example.c +++ b/wireguard-go-bridge/example.c @@ -14,14 +14,14 @@ static struct { static bool is_closed = false; -ssize_t do_read(const void *ctx, const unsigned char *buf, size_t len) +ssize_t do_read(void *ctx, unsigned char *buf, size_t len) { printf("Reading from instance with ctx %p into buffer %p of length %zu\n", ctx, buf, len); sleep(1); return is_closed ? -1 : 0; } -ssize_t do_write(const void *ctx, const unsigned char *buf, size_t len) +ssize_t do_write(void *ctx, unsigned char *buf, size_t len) { printf("Writing from instance with ctx %p into buffer %p of length %zu\n", ctx, buf, len); return len; @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) printf("WireGuard Go Version %s\n", wgVersion()); wgSetLogger(do_log); - handle = wgTurnOn((gostring_t){ .p = "test", .n = 4 }, (gostring_t){ .p = "", .n = 0 }, do_read, do_write, &ctx); + handle = wgTurnOn((gostring_t){ .p = "test", .n = 4 }, (gostring_t){ .p = "", .n = 0 }, 0, do_read, do_write, &ctx); sleep(5); is_closed = true; wgTurnOff(handle); |