linux/include/uapi/linux/if_tun.h

/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
 *  Universal TUN/TAP device driver.
 *  Copyright (C) 1999-2000 Maxim Krasnyansky <[email protected]>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 */

#ifndef _UAPI__IF_TUN_H
#define _UAPI__IF_TUN_H

#include <linux/types.h>
#include <linux/if_ether.h>
#include <linux/filter.h>

/* Read queue size */
#define TUN_READQ_SIZE
/* TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead. */
#define TUN_TUN_DEV
#define TUN_TAP_DEV
#define TUN_TYPE_MASK

/* Ioctl defines */
#define TUNSETNOCSUM 
#define TUNSETDEBUG 
#define TUNSETIFF 
#define TUNSETPERSIST 
#define TUNSETOWNER
#define TUNSETLINK
#define TUNSETGROUP
#define TUNGETFEATURES
#define TUNSETOFFLOAD
#define TUNSETTXFILTER
#define TUNGETIFF
#define TUNGETSNDBUF
#define TUNSETSNDBUF
#define TUNATTACHFILTER
#define TUNDETACHFILTER
#define TUNGETVNETHDRSZ
#define TUNSETVNETHDRSZ
#define TUNSETQUEUE
#define TUNSETIFINDEX
#define TUNGETFILTER
#define TUNSETVNETLE
#define TUNGETVNETLE
/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on
 * little-endian hosts. Not all kernel configurations support them, but all
 * configurations that support SET also support GET.
 */
#define TUNSETVNETBE
#define TUNGETVNETBE
#define TUNSETSTEERINGEBPF
#define TUNSETFILTEREBPF
#define TUNSETCARRIER
#define TUNGETDEVNETNS

/* TUNSETIFF ifr flags */
#define IFF_TUN
#define IFF_TAP
#define IFF_NAPI
#define IFF_NAPI_FRAGS
/* Used in TUNSETIFF to bring up tun/tap without carrier */
#define IFF_NO_CARRIER
#define IFF_NO_PI
/* This flag has no real effect */
#define IFF_ONE_QUEUE
#define IFF_VNET_HDR
#define IFF_TUN_EXCL
#define IFF_MULTI_QUEUE
#define IFF_ATTACH_QUEUE
#define IFF_DETACH_QUEUE
/* read-only flag */
#define IFF_PERSIST
#define IFF_NOFILTER

/* Socket options */
#define TUN_TX_TIMESTAMP

/* Features for GSO (TUNSETOFFLOAD). */
#define TUN_F_CSUM
#define TUN_F_TSO4
#define TUN_F_TSO6
#define TUN_F_TSO_ECN
#define TUN_F_UFO
#define TUN_F_USO4
#define TUN_F_USO6

/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
#define TUN_PKT_STRIP
struct tun_pi {};

/*
 * Filter spec (used for SETXXFILTER ioctls)
 * This stuff is applicable only to the TAP (Ethernet) devices.
 * If the count is zero the filter is disabled and the driver accepts
 * all packets (promisc mode).
 * If the filter is enabled in order to accept broadcast packets
 * broadcast addr must be explicitly included in the addr list.
 */
#define TUN_FLT_ALLMULTI
struct tun_filter {};

#endif /* _UAPI__IF_TUN_H */