From e6308f6e28fe40312d9a99b8c3ce97a37c496b70 Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Sat, 13 Jun 2026 22:33:14 +0200 Subject: feat: Implement TUN module --- src/tun.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/tun.h (limited to 'src/tun.h') diff --git a/src/tun.h b/src/tun.h new file mode 100644 index 0000000..98a307d --- /dev/null +++ b/src/tun.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ + +#pragma once + +// +// This module implements a Linux tun device. The tun_alloc() functions creates a tun device +// with a given name, IP address, subnet mask and MTU. +// + +#include + +/// Allocate a tun device with the given CIDR (e.g. "172.16.0.1/24") and MTU. +/// Returns fd on success, -1 on failure (errno is set). +int tun_alloc(const char* ifname, const char* cidr, int mtu); -- cgit v1.3.1