From dafb0da26d9c27e2a2e836fc56175af5da039479 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 15 Dec 2022 09:59:58 -0500 Subject: static: T4883: add a description field for routing tables --- interface-definitions/protocols-static.xml.in | 14 ++++++++++++++ src/conf_mode/protocols_static.py | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/interface-definitions/protocols-static.xml.in b/interface-definitions/protocols-static.xml.in index e89433022..033c7759e 100644 --- a/interface-definitions/protocols-static.xml.in +++ b/interface-definitions/protocols-static.xml.in @@ -26,6 +26,20 @@ + + + Table description + + + [a-zA-Z0-9_\-]+ + + + #include #include diff --git a/src/conf_mode/protocols_static.py b/src/conf_mode/protocols_static.py index 58e202928..cbbc476a7 100755 --- a/src/conf_mode/protocols_static.py +++ b/src/conf_mode/protocols_static.py @@ -98,6 +98,15 @@ def generate(static): return None def apply(static): + ## Put routing table names in /etc/iproute2/rt_tables + with open("/etc/iproute2/rt_tables.d/vyos.conf", 'w') as f: + print("# Generated by VyOS (protocols_static.py), do not edit by hand", file=f) + for t in static['table']: + if 'description' in static['table'][t]: + print(f"{t}\t{static['table'][t]['description']}", file=f) + + ## Inject routes into FRR + static_daemon = 'staticd' zebra_daemon = 'zebra' -- cgit v1.2.3