summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-02-24 11:56:28 +0200
committerGitHub <noreply@github.com>2023-02-24 11:56:28 +0200
commitba995a720b498955720f0caeeb4d26bac2b84be4 (patch)
tree4153dadb61801a8e22ae762391bcc320f2b0de77 /lib
parentb44f0900c2078db5861d39420b4c35875bcff58f (diff)
parent2e86198322e22ce2baac2b5058b6595cffb4d5f9 (diff)
Merge pull request #12751 from Pdoijode/pdoijode/ospf-vrf-neighbor-detail-1
ospfd: Added missing fields and option to query specific neighbor in VRF
Diffstat (limited to 'lib')
-rw-r--r--lib/vty.c7
-rw-r--r--lib/vty.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 76dfe9734e..1854abb0bf 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -297,6 +297,13 @@ int vty_json_no_pretty(struct vty *vty, struct json_object *json)
return vty_json_helper(vty, json, JSON_C_TO_STRING_NOSLASHESCAPE);
}
+void vty_json_empty(struct vty *vty)
+{
+ json_object *json = json_object_new_object();
+
+ vty_json(vty, json);
+}
+
/* Output current time to the vty. */
void vty_time_print(struct vty *vty, int cr)
{
diff --git a/lib/vty.h b/lib/vty.h
index b8c677e354..3cab9590f1 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -344,7 +344,7 @@ extern bool vty_set_include(struct vty *vty, const char *regexp);
*/
extern int vty_json(struct vty *vty, struct json_object *json);
extern int vty_json_no_pretty(struct vty *vty, struct json_object *json);
-
+extern void vty_json_empty(struct vty *vty);
/* post fd to be passed to the vtysh client
* fd is owned by the VTY code after this and will be closed when done
*/