diff options
| author | Russ White <russ@riw.us> | 2023-02-21 08:01:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-21 08:01:03 -0500 |
| commit | ba755d35e508c2452e5459bdd7c0dd67a70a88a4 (patch) | |
| tree | adc08f46788b8012240faec23ae7e7271bb0d40d /python | |
| parent | 39c664c4ea530a9460efa1a78fe669ae56c85f83 (diff) | |
| parent | 616e9f0d9f0458788adf4b30707016c8db383b02 (diff) | |
Merge pull request #12248 from pguibert6WIND/bgpasdot
lib, bgp: add initial support for asdot format
Diffstat (limited to 'python')
| -rw-r--r-- | python/clidef.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/clidef.py b/python/clidef.py index d71b482a99..244a8205bf 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. |
