diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-12-14 09:11:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-14 09:11:36 +0200 |
| commit | e69ae079b77a0af716f050c48688b7750dbc807a (patch) | |
| tree | 72019bfca317331fc32e4dd34be993f54164d9cf /zebra/zebra_srv6_vty.c | |
| parent | d64d20fcd4967a27fdadc4933ba38e341acaafdb (diff) | |
| parent | 559f4b2f2a46823be670cb46f1cd17f56f5f3675 (diff) | |
Merge pull request #9899 from Drumato/zebra-srv6-locator-detail-json-support
zebra: Add support for json output in srv6 locator detail command
Diffstat (limited to 'zebra/zebra_srv6_vty.c')
| -rw-r--r-- | zebra/zebra_srv6_vty.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c index fe4641cd94..ebe0fffcb2 100644 --- a/zebra/zebra_srv6_vty.c +++ b/zebra/zebra_srv6_vty.c @@ -145,10 +145,16 @@ DEFUN (show_srv6_locator_detail, struct listnode *node; char str[256]; const char *locator_name = argv[4]->arg; + json_object *json_locator = NULL; if (uj) { - vty_out(vty, "JSON format isn't supported\n"); - return CMD_WARNING; + locator = zebra_srv6_locator_lookup(locator_name); + if (!locator) + return CMD_WARNING; + + json_locator = srv6_locator_detailed_json(locator); + vty_json(vty, json_locator); + return CMD_SUCCESS; } for (ALL_LIST_ELEMENTS_RO(srv6->locators, node, locator)) { |
