summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 8393f67b6d..1854abb0bf 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Virtual terminal [aka TeletYpe] interface routine.
* Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
@@ -293,7 +278,7 @@ static int vty_json_helper(struct vty *vty, struct json_object *json,
return CMD_SUCCESS;
text = json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE);
+ json, options);
vty_out(vty, "%s\n", text);
json_object_free(json);
@@ -2734,7 +2719,11 @@ static void vty_event_serv(enum vty_event event, struct vty_serv *vty_serv)
vty_serv->sock, &vty_serv->t_accept);
break;
#endif /* VTYSH */
- default:
+ case VTY_READ:
+ case VTY_WRITE:
+ case VTY_TIMEOUT_RESET:
+ case VTYSH_READ:
+ case VTYSH_WRITE:
assert(!"vty_event_serv() called incorrectly");
}
}
@@ -2773,7 +2762,8 @@ static void vty_event(enum vty_event event, struct vty *vty)
thread_add_timer(vty_master, vty_timeout, vty,
vty->v_timeout, &vty->t_timeout);
break;
- default:
+ case VTY_SERV:
+ case VTYSH_SERV:
assert(!"vty_event() called incorrectly");
}
}