summaryrefslogtreecommitdiff
path: root/python/vyos/include/uapi/linux/rtnetlink.py
blob: e312724604c9ddf32d1eb6d77627630753ad7ade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright (C) 2025 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

RTM_F_NOTIFY = 0x100
RTM_F_CLONED = 0x200
RTM_F_EQUALIZE = 0x400
RTM_F_PREFIX = 0x800
RTM_F_LOOKUP_TABLE = 0x1000
RTM_F_FIB_MATCH = 0x2000
RTM_F_OFFLOAD = 0x4000
RTM_F_TRAP = 0x8000
RTM_F_OFFLOAD_FAILED = 0x20000000

RTNH_F_DEAD = 1
RTNH_F_PERVASIVE = 2
RTNH_F_ONLINK = 4
RTNH_F_OFFLOAD = 8
RTNH_F_LINKDOWN = 16
RTNH_F_UNRESOLVED = 32
RTNH_F_TRAP = 64

RT_TABLE_COMPAT = 252
RT_TABLE_DEFAULT = 253
RT_TABLE_MAIN = 254
RT_TABLE_LOCAL = 255

RTAX_FEATURE_ECN = (1 << 0)
RTAX_FEATURE_SACK = (1 << 1)
RTAX_FEATURE_TIMESTAMP = (1 << 2)
RTAX_FEATURE_ALLFRAG = (1 << 3)
RTAX_FEATURE_TCP_USEC_TS = (1 << 4)

RT_FlAGS = {
    'dead': RTNH_F_DEAD,
    'onlink': RTNH_F_ONLINK,
    'pervasive':  RTNH_F_PERVASIVE,
    'offload': RTNH_F_OFFLOAD,
    'trap': RTNH_F_TRAP,
    'notify': RTM_F_NOTIFY,
    'linkdown': RTNH_F_LINKDOWN,
    'unresolved': RTNH_F_UNRESOLVED,
    'rt_offload': RTM_F_OFFLOAD,
    'rt_trap': RTM_F_TRAP,
    'rt_offload_failed': RTM_F_OFFLOAD_FAILED,
}

RT_TABLE_TO_NAME = {
    RT_TABLE_COMPAT: 'compat',
    RT_TABLE_DEFAULT: 'default',
    RT_TABLE_MAIN: 'main',
    RT_TABLE_LOCAL: 'local',
}