summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-02-21 14:01:03 +0100
committerGitHub <noreply@github.com>2023-02-21 14:01:03 +0100
commitba755d35e508c2452e5459bdd7c0dd67a70a88a4 (patch)
treeadc08f46788b8012240faec23ae7e7271bb0d40d /python
parentMerge pull request #12849 from opensourcerouting/fix/tests_enum (diff)
parentbgpd: handle case where passed RD is null (diff)
downloadfrr-ba755d35e508c2452e5459bdd7c0dd67a70a88a4.tar.xz
frr-ba755d35e508c2452e5459bdd7c0dd67a70a88a4.zip
Merge pull request #12248 from pguibert6WIND/bgpasdot
lib, bgp: add initial support for asdot format
Diffstat (limited to 'python')
-rw-r--r--python/clidef.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/clidef.py b/python/clidef.py
index d71b482a9..244a8205b 100644
--- a/python/clidef.py
+++ b/python/clidef.py
@@ -51,6 +51,12 @@ _fail = (_end == argv[_i]->arg) || (*_end != '\\0');"""
)
+class AsDotHandler(RenderHandler):
+ argtype = "as_t"
+ decl = Template("as_t $varname = 0;")
+ code = Template("_fail = !asn_str2asn(argv[_i]->arg, &$varname);")
+
+
# A.B.C.D/M (prefix_ipv4) and
# X:X::X:X/M (prefix_ipv6) are "compatible" and can merge into a
# struct prefix:
@@ -152,6 +158,7 @@ handlers = {
"IPV6_PREFIX_TKN": Prefix6Handler,
"MAC_TKN": PrefixEthHandler,
"MAC_PREFIX_TKN": PrefixEthHandler,
+ "ASNUM_TKN": AsDotHandler,
}
# core template invoked for each occurence of DEFPY.