From 0f478e3050ce918402bcc718569c8918cc1eef4a Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Sat, 18 Nov 2017 22:26:50 -0800 Subject: ospfd: show ip ospf route json support Define JSON_C_TO_STRING_NOSLASHESCAPE used for escaping forward slash. Disply json output for 'show ip ospf route [vrf all] json' Ticket:CM-18659 Reviewed By: Testing Done: Configure multiple non-default VRF, inject external routes via redistribute to ospf area. checked show ip ospf route vrf all /json based output. Signed-off-by: Chirag Shah --- lib/json.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/json.h') diff --git a/lib/json.h b/lib/json.h index e3e55ab962..675d852af7 100644 --- a/lib/json.h +++ b/lib/json.h @@ -52,4 +52,19 @@ extern void json_object_free(struct json_object *obj); #define JSON_STR "JavaScript Object Notation\n" +/* NOTE: json-c lib has following commit 316da85 which + * handles escape of forward slash. + * This allows prefix "20.0.14.0\/24":{ + * to "20.0.14.0/24":{ some platforms do not have + * latest copy of json-c where defining below macro. + */ + +#ifndef JSON_C_TO_STRING_NOSLASHESCAPE + +/** + * Don't escape forward slashes. + */ +#define JSON_C_TO_STRING_NOSLASHESCAPE (1<<4) +#endif + #endif /* _QUAGGA_JSON_H */ -- cgit v1.2.3