diff options
| author | Yamato Sugawara <yamato.sugawara@linecorp.com> | 2021-10-26 12:21:20 +0000 | 
|---|---|---|
| committer | Yamato Sugawara <yamato.sugawara@linecorp.com> | 2021-11-28 23:53:41 +0000 | 
| commit | 559f4b2f2a46823be670cb46f1cd17f56f5f3675 (patch) | |
| tree | 94796e9cef1c06bd971ca5c840c13176404185a8 /zebra/zebra_srv6_vty.c | |
| parent | c786485164de9e75675c32ad1c1f406169637b0f (diff) | |
zebra: Add support for json output in srv6 locator detail command
Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
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 cb1e6c4228..bf87696204 100644 --- a/zebra/zebra_srv6_vty.c +++ b/zebra/zebra_srv6_vty.c @@ -147,10 +147,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)) {  | 
