]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - include/uapi/linux/fib_rules.h
Merge tag 'drm-fixes-2021-01-29' of git://anongit.freedesktop.org/drm/drm
[mirror_ubuntu-hirsute-kernel.git] / include / uapi / linux / fib_rules.h
CommitLineData
6f52b16c 1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
14c0b97d
TG
2#ifndef __LINUX_FIB_RULES_H
3#define __LINUX_FIB_RULES_H
4
5#include <linux/types.h>
6#include <linux/rtnetlink.h>
7
8/* rule is permanent, and cannot be deleted */
29f6af77
YH
9#define FIB_RULE_PERMANENT 0x00000001
10#define FIB_RULE_INVERT 0x00000002
11#define FIB_RULE_UNRESOLVED 0x00000004
491deb24
PM
12#define FIB_RULE_IIF_DETACHED 0x00000008
13#define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
1b038a5e 14#define FIB_RULE_OIF_DETACHED 0x00000010
29f6af77
YH
15
16/* try to find source address in routing lookups */
17#define FIB_RULE_FIND_SADDR 0x00010000
14c0b97d 18
d94d9fee 19struct fib_rule_hdr {
14c0b97d
TG
20 __u8 family;
21 __u8 dst_len;
22 __u8 src_len;
23 __u8 tos;
24
25 __u8 table;
1b71af60
DS
26 __u8 res1; /* reserved */
27 __u8 res2; /* reserved */
14c0b97d
TG
28 __u8 action;
29
30 __u32 flags;
31};
32
622ec2c9
LC
33struct fib_rule_uid_range {
34 __u32 start;
35 __u32 end;
36};
37
bfff4862
RP
38struct fib_rule_port_range {
39 __u16 start;
40 __u16 end;
41};
42
d94d9fee 43enum {
14c0b97d
TG
44 FRA_UNSPEC,
45 FRA_DST, /* destination address */
46 FRA_SRC, /* source address */
491deb24
PM
47 FRA_IIFNAME, /* interface name */
48#define FRA_IFNAME FRA_IIFNAME
0947c9fe 49 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
14c0b97d
TG
50 FRA_UNUSED2,
51 FRA_PRIORITY, /* priority/preference */
52 FRA_UNUSED3,
53 FRA_UNUSED4,
54 FRA_UNUSED5,
b8964ed9 55 FRA_FWMARK, /* mark */
14c0b97d 56 FRA_FLOW, /* flow/class id */
e7030878 57 FRA_TUN_ID,
6ef94cfa 58 FRA_SUPPRESS_IFGROUP,
73f5698e 59 FRA_SUPPRESS_PREFIXLEN,
9e762a4a 60 FRA_TABLE, /* Extended table id */
bbfb39cb 61 FRA_FWMASK, /* mask for netfilter mark */
1b038a5e 62 FRA_OIFNAME,
b46f6ded 63 FRA_PAD,
96c63fa7 64 FRA_L3MDEV, /* iif or oif is l3mdev goto its table */
622ec2c9 65 FRA_UID_RANGE, /* UID range */
1b71af60 66 FRA_PROTOCOL, /* Originator of the rule */
bfff4862
RP
67 FRA_IP_PROTO, /* ip proto */
68 FRA_SPORT_RANGE, /* sport */
69 FRA_DPORT_RANGE, /* dport */
14c0b97d
TG
70 __FRA_MAX
71};
72
73#define FRA_MAX (__FRA_MAX - 1)
74
d94d9fee 75enum {
14c0b97d
TG
76 FR_ACT_UNSPEC,
77 FR_ACT_TO_TBL, /* Pass to fixed table */
0947c9fe 78 FR_ACT_GOTO, /* Jump to another rule */
fa0b2d1d 79 FR_ACT_NOP, /* No operation */
14c0b97d
TG
80 FR_ACT_RES3,
81 FR_ACT_RES4,
82 FR_ACT_BLACKHOLE, /* Drop without notification */
83 FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
84 FR_ACT_PROHIBIT, /* Drop with EACCES */
85 __FR_ACT_MAX,
86};
87
88#define FR_ACT_MAX (__FR_ACT_MAX - 1)
89
90#endif