1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef __LINUX_FIB_RULES_H
3 #define __LINUX_FIB_RULES_H
5 #include <linux/types.h>
6 #include <linux/rtnetlink.h>
8 /* rule is permanent, and cannot be deleted */
9 #define FIB_RULE_PERMANENT 0x00000001
10 #define FIB_RULE_INVERT 0x00000002
11 #define FIB_RULE_UNRESOLVED 0x00000004
12 #define FIB_RULE_IIF_DETACHED 0x00000008
13 #define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
14 #define FIB_RULE_OIF_DETACHED 0x00000010
16 /* try to find source address in routing lookups */
17 #define FIB_RULE_FIND_SADDR 0x00010000
26 __u8 res1
; /* reserved */
27 __u8 res2
; /* reserved */
33 struct fib_rule_uid_range
{
38 struct fib_rule_port_range
{
45 FRA_DST
, /* destination address */
46 FRA_SRC
, /* source address */
47 FRA_IIFNAME
, /* interface name */
48 #define FRA_IFNAME FRA_IIFNAME
49 FRA_GOTO
, /* target to jump to (FR_ACT_GOTO) */
51 FRA_PRIORITY
, /* priority/preference */
55 FRA_FWMARK
, /* mark */
56 FRA_FLOW
, /* flow/class id */
59 FRA_SUPPRESS_PREFIXLEN
,
60 FRA_TABLE
, /* Extended table id */
61 FRA_FWMASK
, /* mask for netfilter mark */
64 FRA_L3MDEV
, /* iif or oif is l3mdev goto its table */
65 FRA_UID_RANGE
, /* UID range */
66 FRA_PROTOCOL
, /* Originator of the rule */
67 FRA_IP_PROTO
, /* ip proto */
68 FRA_SPORT_RANGE
, /* sport */
69 FRA_DPORT_RANGE
, /* dport */
74 #define FRA_MAX (__FRA_MAX - 1)
78 FR_ACT_TO_TBL
, /* Pass to fixed table */
79 FR_ACT_GOTO
, /* Jump to another rule */
80 FR_ACT_NOP
, /* No operation */
83 FR_ACT_BLACKHOLE
, /* Drop without notification */
84 FR_ACT_UNREACHABLE
, /* Drop with ENETUNREACH */
85 FR_ACT_PROHIBIT
, /* Drop with EACCES */
89 #define FR_ACT_MAX (__FR_ACT_MAX - 1)