missing.h revision bd1acc9f2ffa9c2baf1ddd6bb965352aef5c7446
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#pragma once
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering/***
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering This file is part of systemd.
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering Copyright 2010 Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering systemd is free software; you can redistribute it and/or modify it
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering under the terms of the GNU Lesser General Public License as published by
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering (at your option) any later version.
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering systemd is distributed in the hope that it will be useful, but
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering Lesser General Public License for more details.
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering You should have received a copy of the GNU Lesser General Public License
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering***/
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering/* Missing glibc definitions to access certain kernel APIs */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <sys/resource.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <sys/syscall.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <fcntl.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <stdlib.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <unistd.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <errno.h>
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#include <linux/oom.h>
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#include <linux/input.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <linux/if_link.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <linux/loop.h>
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#include <linux/audit.h>
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#include <linux/capability.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <linux/neighbour.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifdef HAVE_AUDIT
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <libaudit.h>
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifdef ARCH_MIPS
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <asm/sgidefs.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifdef HAVE_LINUX_BTRFS_H
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#include <linux/btrfs.h>
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
3f9da416457c4265b8f1179516a32ad1a987ff7dLennart Poettering
4f10118016f9b2fd7e1d26c9ef7d91eb33fba694Lennart Poettering#include "macro.h"
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef RLIMIT_RTTIME
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define RLIMIT_RTTIME 15
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering/* If RLIMIT_RTTIME is not defined, then we cannot use RLIMIT_NLIMITS as is */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define _RLIMIT_MAX (RLIMIT_RTTIME+1 > RLIMIT_NLIMITS ? RLIMIT_RTTIME+1 : RLIMIT_NLIMITS)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef F_LINUX_SPECIFIC_BASE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_LINUX_SPECIFIC_BASE 1024
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef F_SETPIPE_SZ
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef F_GETPIPE_SZ
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef F_ADD_SEALS
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_SEAL_GROW 0x0004 /* prevent file from growing */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_SEAL_WRITE 0x0008 /* prevent writes */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef F_OFD_GETLK
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define F_OFD_GETLK 36
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define F_OFD_SETLK 37
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define F_OFD_SETLKW 38
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef MFD_ALLOW_SEALING
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define MFD_ALLOW_SEALING 0x0002U
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef MFD_CLOEXEC
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define MFD_CLOEXEC 0x0001U
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef IP_FREEBIND
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IP_FREEBIND 15
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef OOM_SCORE_ADJ_MIN
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define OOM_SCORE_ADJ_MIN (-1000)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef OOM_SCORE_ADJ_MAX
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define OOM_SCORE_ADJ_MAX 1000
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef AUDIT_SERVICE_START
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define AUDIT_SERVICE_START 1130 /* Service (daemon) start */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef AUDIT_SERVICE_STOP
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define AUDIT_SERVICE_STOP 1131 /* Service (daemon) stop */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef TIOCVHANGUP
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define TIOCVHANGUP 0x5437
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef IP_TRANSPARENT
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IP_TRANSPARENT 19
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef SOL_NETLINK
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define SOL_NETLINK 270
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_PIVOT_ROOT
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstatic inline int pivot_root(const char *new_root, const char *put_old) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return syscall(SYS_pivot_root, new_root, put_old);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef __NR_memfd_create
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if defined __x86_64__
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 319
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined __arm__
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 385
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined __aarch64__
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 279
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined _MIPS_SIM
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_ABI32
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 4354
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_NABI32
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 6318
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_ABI64
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 5314
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined __i386__
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 356
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# else
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# warning "__NR_memfd_create unknown for your architecture"
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_memfd_create 0xffffffff
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef HAVE_MEMFD_CREATE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstatic inline int memfd_create(const char *name, unsigned int flags) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return syscall(__NR_memfd_create, name, flags);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#ifndef __NR_getrandom
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# if defined __x86_64__
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# define __NR_getrandom 318
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined(__i386__)
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# define __NR_getrandom 355
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# elif defined(__arm__)
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# define __NR_getrandom 384
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# elif defined(__aarch64__)
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# define __NR_getrandom 278
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# elif defined(__ia64__)
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# define __NR_getrandom 1339
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# elif defined(__m68k__)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_getrandom 352
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined(__s390x__)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_getrandom 349
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined(__powerpc__)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_getrandom 359
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined _MIPS_SIM
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_ABI32
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_getrandom 4353
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_NABI32
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_getrandom 6317
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_ABI64
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_getrandom 5313
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# else
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# warning "__NR_getrandom unknown for your architecture"
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_getrandom 0xffffffff
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_GETRANDOM
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstatic inline int getrandom(void *buffer, size_t count, unsigned flags) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return syscall(__NR_getrandom, buffer, count, flags);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef GRND_NONBLOCK
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define GRND_NONBLOCK 0x0001
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef GRND_RANDOM
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define GRND_RANDOM 0x0002
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_IOCTL_MAGIC
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_IOCTL_MAGIC 0x94
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_PATH_NAME_MAX
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_PATH_NAME_MAX 4087
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_DEVICE_PATH_NAME_MAX
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_DEVICE_PATH_NAME_MAX 1024
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_FSID_SIZE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_FSID_SIZE 16
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_UUID_SIZE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_UUID_SIZE 16
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_SUBVOL_RDONLY
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_SUBVOL_NAME_MAX
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_SUBVOL_NAME_MAX 4039
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_INO_LOOKUP_PATH_MAX
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_INO_LOOKUP_PATH_MAX 4080
3f9da416457c4265b8f1179516a32ad1a987ff7dLennart Poettering#endif
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack
3f9da416457c4265b8f1179516a32ad1a987ff7dLennart Poettering#ifndef BTRFS_SEARCH_ARGS_BUFSIZE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
3f9da416457c4265b8f1179516a32ad1a987ff7dLennart Poettering
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#ifndef HAVE_LINUX_BTRFS_H
3f9da416457c4265b8f1179516a32ad1a987ff7dLennart Poetteringstruct btrfs_ioctl_vol_args {
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering int64_t fd;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering char name[BTRFS_PATH_NAME_MAX + 1];
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering};
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstruct btrfs_qgroup_limit {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 flags;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 max_rfer;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 max_excl;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 rsv_rfer;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 rsv_excl;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstruct btrfs_qgroup_inherit {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 flags;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 num_qgroups;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 num_ref_copies;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 num_excl_copies;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_qgroup_limit lim;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 qgroups[0];
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstruct btrfs_ioctl_vol_args_v2 {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __s64 fd;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 transid;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 flags;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering union {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering struct {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 size;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_qgroup_inherit *qgroup_inherit;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering };
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 unused[4];
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering };
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering char name[BTRFS_SUBVOL_NAME_MAX + 1];
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstruct btrfs_ioctl_dev_info_args {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint64_t devid; /* in/out */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint8_t uuid[BTRFS_UUID_SIZE]; /* in/out */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint64_t bytes_used; /* out */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint64_t total_bytes; /* out */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint64_t unused[379]; /* pad to 4k */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering char path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstruct btrfs_ioctl_fs_info_args {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint64_t max_id; /* out */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint64_t num_devices; /* out */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering uint8_t fsid[BTRFS_FSID_SIZE]; /* out */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering uint64_t reserved[124]; /* pad to 1k */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstruct btrfs_ioctl_ino_lookup_args {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 treeid;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 objectid;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering char name[BTRFS_INO_LOOKUP_PATH_MAX];
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstruct btrfs_ioctl_search_key {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /* which root are we searching. 0 is the tree of tree roots */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 tree_id;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /* keys returned will be >= min and <= max */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 min_objectid;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 max_objectid;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering /* keys returned will be >= min and <= max */
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 min_offset;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 max_offset;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /* max and min transids to search for */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 min_transid;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 max_transid;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /* keys returned will be >= min and <= max */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u32 min_type;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u32 max_type;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /*
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering * how many items did userland ask for, and how many are we
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering * returning
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u32 nr_items;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /* align to 64 bits */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u32 unused;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /* some extra for later */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 unused1;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 unused2;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 unused3;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 unused4;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering};
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstruct btrfs_ioctl_search_header {
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 transid;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 objectid;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u64 offset;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u32 type;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering __u32 len;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering};
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstruct btrfs_ioctl_search_args {
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_search_key key;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstruct btrfs_ioctl_clone_range_args {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __s64 src_fd;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 src_offset, src_length;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering __u64 dest_offset;
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering};
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_IOC_DEFRAG
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering struct btrfs_ioctl_vol_args)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_IOC_CLONE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_CLONE_RANGE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_clone_range_args)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_SUBVOL_CREATE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_vol_args)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_SNAP_DESTROY
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_vol_args)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_TREE_SEARCH
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_search_args)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_INO_LOOKUP
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_ino_lookup_args)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_SNAP_CREATE_V2
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_vol_args_v2)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_SUBVOL_GETFLAGS
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_SUBVOL_SETFLAGS
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_DEV_INFO
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_dev_info_args)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_IOC_FS_INFO
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering struct btrfs_ioctl_fs_info_args)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_IOC_DEVICES_READY
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, \
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering struct btrfs_ioctl_vol_args)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_FIRST_FREE_OBJECTID
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_FIRST_FREE_OBJECTID 256
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_LAST_FREE_OBJECTID
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_LAST_FREE_OBJECTID -256ULL
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_ROOT_TREE_OBJECTID
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_ROOT_TREE_OBJECTID 1
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_QUOTA_TREE_OBJECTID
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_QUOTA_TREE_OBJECTID 8ULL
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_ROOT_ITEM_KEY
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_ROOT_ITEM_KEY 132
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_QGROUP_STATUS_KEY
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_QGROUP_STATUS_KEY 240
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BTRFS_QGROUP_INFO_KEY
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define BTRFS_QGROUP_INFO_KEY 242
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_QGROUP_LIMIT_KEY
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_QGROUP_LIMIT_KEY 244
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_ROOT_BACKREF_KEY
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_ROOT_BACKREF_KEY 144
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BTRFS_SUPER_MAGIC
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BTRFS_SUPER_MAGIC 0x9123683E
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef MS_MOVE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define MS_MOVE 8192
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef MS_PRIVATE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define MS_PRIVATE (1 << 18)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_GETTID
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstatic inline pid_t gettid(void) {
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack return (pid_t) syscall(SYS_gettid);
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack}
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#endif
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#ifndef SCM_SECURITY
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#define SCM_SECURITY 0x03
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#endif
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#ifndef MS_STRICTATIME
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#define MS_STRICTATIME (1<<24)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef MS_REC
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define MS_REC 16384
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef MS_SHARED
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define MS_SHARED (1<<20)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef PR_SET_NO_NEW_PRIVS
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define PR_SET_NO_NEW_PRIVS 38
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef PR_SET_CHILD_SUBREAPER
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define PR_SET_CHILD_SUBREAPER 36
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef MAX_HANDLE_SZ
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define MAX_HANDLE_SZ 128
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef __NR_name_to_handle_at
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# if defined(__x86_64__)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# define __NR_name_to_handle_at 303
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# elif defined(__i386__)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# define __NR_name_to_handle_at 341
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# elif defined(__arm__)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# define __NR_name_to_handle_at 370
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# elif defined(__powerpc__)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# define __NR_name_to_handle_at 345
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# else
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# error "__NR_name_to_handle_at is not defined"
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_NAME_TO_HANDLE_AT
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstruct file_handle {
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering unsigned int handle_bytes;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering int handle_type;
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering unsigned char f_handle[0];
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering};
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstatic inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef HAVE_SECURE_GETENV
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# ifdef HAVE___SECURE_GETENV
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define secure_getenv __secure_getenv
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# else
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# error "neither secure_getenv nor __secure_getenv are available"
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef CIFS_MAGIC_NUMBER
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack# define CIFS_MAGIC_NUMBER 0xFF534D42
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#endif
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef TFD_TIMER_CANCEL_ON_SET
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define TFD_TIMER_CANCEL_ON_SET (1 << 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef SO_REUSEPORT
16ac401407959cbc62312e61c2dd76dbc3a0793bLennart Poettering# define SO_REUSEPORT 15
16ac401407959cbc62312e61c2dd76dbc3a0793bLennart Poettering#endif
ff975efb2e88dcd5221a2f0d76c4c87e85b821a8Lennart Poettering
16ac401407959cbc62312e61c2dd76dbc3a0793bLennart Poettering#ifndef EVIOCREVOKE
16ac401407959cbc62312e61c2dd76dbc3a0793bLennart Poettering# define EVIOCREVOKE _IOW('E', 0x91, int)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef DRM_IOCTL_SET_MASTER
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define DRM_IOCTL_SET_MASTER _IO('d', 0x1e)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef DRM_IOCTL_DROP_MASTER
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if defined(__i386__) || defined(__x86_64__)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering/* The precise definition of __O_TMPFILE is arch specific, so let's
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering * just define this on x86 where we know the value. */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef __O_TMPFILE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __O_TMPFILE 020000000
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering/* a horrid kludge trying to make sure that this will fail on old kernels */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef O_TMPFILE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef __NR_setns
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if defined(__x86_64__)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_setns 308
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined(__i386__)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# define __NR_setns 346
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# else
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# error "__NR_setns is not defined"
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_SETNS
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poetteringstatic inline int setns(int fd, int nstype) {
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering return syscall(__NR_setns, fd, nstype);
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_LO_FLAGS_PARTSCAN
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define LO_FLAGS_PARTSCAN 8
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef LOOP_CTL_REMOVE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define LOOP_CTL_REMOVE 0x4C81
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef LOOP_CTL_GET_FREE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define LOOP_CTL_GET_FREE 0x4C82
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_IFLA_INET6_ADDR_GEN_MODE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_INET6_UNSPEC 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_INET6_FLAGS 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_INET6_CONF 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_INET6_STATS 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_INET6_MCAST 4
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_INET6_CACHEINFO 5
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_INET6_ICMP6STATS 6
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_INET6_TOKEN 7
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_INET6_ADDR_GEN_MODE 8
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define __IFLA_INET6_MAX 9
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IN6_ADDR_GEN_MODE_EUI64 0
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IN6_ADDR_GEN_MODE_NONE 1
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_IFLA_MACVLAN_FLAGS
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_MACVLAN_UNSPEC 0
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_MACVLAN_MODE 1
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#define IFLA_MACVLAN_FLAGS 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __IFLA_MACVLAN_MAX 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_IFLA_IPVLAN_MODE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPVLAN_UNSPEC 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPVLAN_MODE 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __IFLA_IPVLAN_MAX 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IPVLAN_MODE_L2 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IPVLAN_MODE_L3 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IPVLAN_MAX 2
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_IFLA_VTI_REMOTE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VTI_UNSPEC 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VTI_LINK 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VTI_IKEY 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VTI_OKEY 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VTI_LOCAL 4
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VTI_REMOTE 5
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __IFLA_VTI_MAX 6
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_IFLA_PHYS_PORT_ID
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#undef IFLA_PROMISCUITY
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_PROMISCUITY 30
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_NUM_TX_QUEUES 31
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_NUM_RX_QUEUES 32
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_CARRIER 33
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_PHYS_PORT_ID 34
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __IFLA_MAX 35
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_MAX (__IFLA_MAX - 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_IFLA_BOND_AD_INFO
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_UNSPEC 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_MODE 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_ACTIVE_SLAVE 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_MIIMON 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_UPDELAY 4
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_DOWNDELAY 5
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_USE_CARRIER 6
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_ARP_INTERVAL 7
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_ARP_IP_TARGET 8
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_ARP_VALIDATE 9
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_ARP_ALL_TARGETS 10
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_PRIMARY 11
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_PRIMARY_RESELECT 12
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_FAIL_OVER_MAC 13
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BOND_XMIT_HASH_POLICY 14
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BOND_RESEND_IGMP 15
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BOND_NUM_PEER_NOTIF 16
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BOND_ALL_SLAVES_ACTIVE 17
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BOND_MIN_LINKS 18
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BOND_LP_INTERVAL 19
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BOND_PACKETS_PER_SLAVE 20
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_AD_LACP_RATE 21
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_AD_SELECT 22
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_AD_INFO 23
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __IFLA_BOND_MAX 24
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
03e334a1c7dc8c20c38902aa039440763acc9b17Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_IFLA_VLAN_PROTOCOL
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VLAN_UNSPEC 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VLAN_ID 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VLAN_FLAGS 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VLAN_EGRESS_QOS 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VLAN_INGRESS_QOS 4
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VLAN_PROTOCOL 5
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __IFLA_VLAN_MAX 6
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_IFLA_VXLAN_LOCAL6
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_UNSPEC 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_ID 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_GROUP 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_LINK 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_LOCAL 4
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_TTL 5
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_TOS 6
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_LEARNING 7
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_AGEING 8
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_LIMIT 9
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_PORT_RANGE 10
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_PROXY 11
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_RSC 12
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_L2MISS 13
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_L3MISS 14
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_PORT 15
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_GROUP6 16
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_LOCAL6 17
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define __IFLA_VXLAN_MAX 18
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_IFLA_IPTUN_6RD_RELAY_PREFIXLEN
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPTUN_UNSPEC 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPTUN_LINK 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPTUN_LOCAL 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPTUN_REMOTE 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPTUN_TTL 4
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPTUN_TOS 5
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define IFLA_IPTUN_ENCAP_LIMIT 6
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_FLOWINFO 7
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_FLAGS 8
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_PROTO 9
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_PMTUDISC 10
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_6RD_PREFIX 11
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_6RD_RELAY_PREFIX 12
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_6RD_PREFIXLEN 13
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_6RD_RELAY_PREFIXLEN 14
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define __IFLA_IPTUN_MAX 15
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_IFLA_BRIDGE_VLAN_INFO
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRIDGE_FLAGS 0
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRIDGE_MODE 1
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRIDGE_VLAN_INFO 2
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define __IFLA_BRIDGE_MAX 3
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_IFLA_BRPORT_UNICAST_FLOOD
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_UNSPEC 0
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_STATE 1
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_PRIORITY 2
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_COST 3
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_MODE 4
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_GUARD 5
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_PROTECT 6
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_FAST_LEAVE 7
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_LEARNING 8
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_UNICAST_FLOOD 9
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define __IFLA_BRPORT_MAX 10
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#if !HAVE_DECL_NDA_IFINDEX
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_UNSPEC 0
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_DST 1
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_LLADDR 2
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_CACHEINFO 3
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_PROBES 4
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_VLAN 5
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_PORT 6
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_VNI 7
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_IFINDEX 8
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define __NDA_MAX 9
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define NDA_MAX (__NDA_MAX - 1)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef IPV6_UNICAST_IF
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IPV6_UNICAST_IF 76
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef IFF_MULTI_QUEUE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFF_MULTI_QUEUE 0x100
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef IFF_LOWER_UP
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFF_LOWER_UP 0x10000
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef IFF_DORMANT
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define IFF_DORMANT 0x20000
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BOND_XMIT_POLICY_ENCAP23
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BOND_XMIT_POLICY_ENCAP23 3
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef BOND_XMIT_POLICY_ENCAP34
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define BOND_XMIT_POLICY_ENCAP34 4
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef NET_ADDR_RANDOM
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering# define NET_ADDR_RANDOM 1
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef NET_NAME_UNKNOWN
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define NET_NAME_UNKNOWN 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef NET_NAME_ENUM
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define NET_NAME_ENUM 1
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef NET_NAME_PREDICTABLE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define NET_NAME_PREDICTABLE 2
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef NET_NAME_USER
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define NET_NAME_USER 3
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef NET_NAME_RENAMED
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define NET_NAME_RENAMED 4
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef BPF_XOR
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define BPF_XOR 0xa0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering/* Note that LOOPBACK_IFINDEX is currently not exported by the
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering * kernel/glibc, but hardcoded internally by the kernel. However, as
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering * it is exported to userspace indirectly via rtnetlink and the
2f671520ebade4877cbf6aca3572a5f8c4e1871dLennart Poettering * ioctls, and made use of widely we define it here too, in a way that
2f671520ebade4877cbf6aca3572a5f8c4e1871dLennart Poettering * is compatible with the kernel's internal definition. */
2f671520ebade4877cbf6aca3572a5f8c4e1871dLennart Poettering#ifndef LOOPBACK_IFINDEX
2f671520ebade4877cbf6aca3572a5f8c4e1871dLennart Poettering#define LOOPBACK_IFINDEX 1
2f671520ebade4877cbf6aca3572a5f8c4e1871dLennart Poettering#endif
2f671520ebade4877cbf6aca3572a5f8c4e1871dLennart Poettering
2f671520ebade4877cbf6aca3572a5f8c4e1871dLennart Poettering#ifndef MAX_AUDIT_MESSAGE_LENGTH
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define MAX_AUDIT_MESSAGE_LENGTH 8970
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef AUDIT_NLGRP_MAX
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define AUDIT_NLGRP_READLOG 1
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef CAP_MAC_OVERRIDE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define CAP_MAC_OVERRIDE 32
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef CAP_MAC_ADMIN
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define CAP_MAC_ADMIN 33
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef CAP_SYSLOG
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define CAP_SYSLOG 34
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef CAP_WAKE_ALARM
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define CAP_WAKE_ALARM 35
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef CAP_BLOCK_SUSPEND
5892a914d173e4b968d2a14fbf717373dee3999aDaniel Mack#define CAP_BLOCK_SUSPEND 36
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef CAP_AUDIT_READ
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define CAP_AUDIT_READ 37
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstatic inline int raw_clone(unsigned long flags, void *child_stack) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if defined(__s390__) || defined(__CRIS__)
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering /* On s390 and cris the order of the first and second arguments
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering * of the raw clone() system call is reversed. */
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return (int) syscall(__NR_clone, child_stack, flags);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#else
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering return (int) syscall(__NR_clone, flags, child_stack);
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering}
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
700ff4d97311902a440109a2c081731ab6ae8a20Lennart Poetteringstatic inline pid_t raw_getpid(void) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return (pid_t) syscall(__NR_getpid);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_RENAMEAT2
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack#ifndef __NR_renameat2
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack# if defined __x86_64__
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack# define __NR_renameat2 316
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack# elif defined __arm__
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack# define __NR_renameat2 382
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack# elif defined _MIPS_SIM
54d76c92868838e17d6aad0a3bb0cc7a5b11e35fDaniel Mack# if _MIPS_SIM == _MIPS_SIM_ABI32
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_renameat2 4351
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_NABI32
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_renameat2 6315
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# if _MIPS_SIM == _MIPS_SIM_ABI64
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_renameat2 5311
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# elif defined __i386__
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_renameat2 353
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# else
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# warning "__NR_renameat2 unknown for your architecture"
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# define __NR_renameat2 0xffffffff
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering# endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstatic inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef RENAME_NOREPLACE
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#define RENAME_NOREPLACE (1 << 0)
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#if !HAVE_DECL_KCMP
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poetteringstatic inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering}
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bdLennart Poettering#ifndef KCMP_FILE
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define KCMP_FILE 0
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef INPUT_PROP_POINTING_STICK
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define INPUT_PROP_POINTING_STICK 0x05
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#ifndef INPUT_PROP_ACCELEROMETER
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#define INPUT_PROP_ACCELEROMETER 0x06
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering#endif
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0Lennart Poettering