2015-11-26 10:58:26 +00:00
|
|
|
package nl
|
|
|
|
|
2021-09-10 02:30:28 +00:00
|
|
|
// syscall package lack of rule attributes type.
|
2015-11-26 10:58:26 +00:00
|
|
|
// Thus there are defined below
|
|
|
|
const (
|
|
|
|
FRA_UNSPEC = iota
|
|
|
|
FRA_DST /* destination address */
|
|
|
|
FRA_SRC /* source address */
|
|
|
|
FRA_IIFNAME /* interface name */
|
|
|
|
FRA_GOTO /* target to jump to (FR_ACT_GOTO) */
|
|
|
|
FRA_UNUSED2
|
|
|
|
FRA_PRIORITY /* priority/preference */
|
|
|
|
FRA_UNUSED3
|
|
|
|
FRA_UNUSED4
|
|
|
|
FRA_UNUSED5
|
|
|
|
FRA_FWMARK /* mark */
|
|
|
|
FRA_FLOW /* flow/class id */
|
2015-12-09 13:14:24 +00:00
|
|
|
FRA_TUN_ID
|
2015-11-26 10:58:26 +00:00
|
|
|
FRA_SUPPRESS_IFGROUP
|
|
|
|
FRA_SUPPRESS_PREFIXLEN
|
|
|
|
FRA_TABLE /* Extended table id */
|
|
|
|
FRA_FWMASK /* mask for netfilter mark */
|
|
|
|
FRA_OIFNAME
|
2020-01-16 16:27:48 +00:00
|
|
|
FRA_PAD
|
|
|
|
FRA_L3MDEV /* iif or oif is l3mdev goto its table */
|
|
|
|
FRA_UID_RANGE /* UID range */
|
|
|
|
FRA_PROTOCOL /* Originator of the rule */
|
|
|
|
FRA_IP_PROTO /* ip proto */
|
|
|
|
FRA_SPORT_RANGE /* sport */
|
|
|
|
FRA_DPORT_RANGE /* dport */
|
2015-11-26 10:58:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ip rule netlink request types
|
|
|
|
const (
|
|
|
|
FR_ACT_UNSPEC = iota
|
|
|
|
FR_ACT_TO_TBL /* Pass to fixed table */
|
|
|
|
FR_ACT_GOTO /* Jump to another rule */
|
|
|
|
FR_ACT_NOP /* No operation */
|
|
|
|
FR_ACT_RES3
|
|
|
|
FR_ACT_RES4
|
|
|
|
FR_ACT_BLACKHOLE /* Drop without notification */
|
|
|
|
FR_ACT_UNREACHABLE /* Drop with ENETUNREACH */
|
|
|
|
FR_ACT_PROHIBIT /* Drop with EACCES */
|
|
|
|
)
|
2017-02-02 23:07:22 +00:00
|
|
|
|
|
|
|
// socket diags related
|
|
|
|
const (
|
|
|
|
SOCK_DIAG_BY_FAMILY = 20 /* linux.sock_diag.h */
|
|
|
|
TCPDIAG_NOCOOKIE = 0xFFFFFFFF /* TCPDIAG_NOCOOKIE in net/ipv4/tcp_diag.h*/
|
|
|
|
)
|
2017-02-19 03:22:09 +00:00
|
|
|
|
|
|
|
// RTA_ENCAP subtype
|
|
|
|
const (
|
|
|
|
MPLS_IPTUNNEL_UNSPEC = iota
|
|
|
|
MPLS_IPTUNNEL_DST
|
|
|
|
)
|
|
|
|
|
|
|
|
// light weight tunnel encap types
|
|
|
|
const (
|
|
|
|
LWTUNNEL_ENCAP_NONE = iota
|
|
|
|
LWTUNNEL_ENCAP_MPLS
|
|
|
|
LWTUNNEL_ENCAP_IP
|
|
|
|
LWTUNNEL_ENCAP_ILA
|
|
|
|
LWTUNNEL_ENCAP_IP6
|
2017-09-27 14:08:13 +00:00
|
|
|
LWTUNNEL_ENCAP_SEG6
|
|
|
|
LWTUNNEL_ENCAP_BPF
|
2018-05-01 04:11:23 +00:00
|
|
|
LWTUNNEL_ENCAP_SEG6_LOCAL
|
2017-09-27 14:08:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// routing header types
|
|
|
|
const (
|
|
|
|
IPV6_SRCRT_STRICT = 0x01 // Deprecated; will be removed
|
|
|
|
IPV6_SRCRT_TYPE_0 = 0 // Deprecated; will be removed
|
|
|
|
IPV6_SRCRT_TYPE_2 = 2 // IPv6 type 2 Routing Header
|
|
|
|
IPV6_SRCRT_TYPE_4 = 4 // Segment Routing with IPv6
|
2017-02-19 03:22:09 +00:00
|
|
|
)
|