summaryrefslogtreecommitdiffstats
path: root/src/shared/libosmocore/src/vty/telnet_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/libosmocore/src/vty/telnet_interface.c')
-rw-r--r--src/shared/libosmocore/src/vty/telnet_interface.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/libosmocore/src/vty/telnet_interface.c b/src/shared/libosmocore/src/vty/telnet_interface.c
index ed64cdab..167acc18 100644
--- a/src/shared/libosmocore/src/vty/telnet_interface.c
+++ b/src/shared/libosmocore/src/vty/telnet_interface.c
@@ -221,4 +221,16 @@ void vty_event(enum event event, int sock, struct vty *vty)
}
}
+void telnet_exit(void)
+{
+ struct telnet_connection *tc, *tc2;
+
+ llist_for_each_entry_safe(tc, tc2, &active_connections, entry)
+ telnet_close_client(&tc->fd);
+
+ osmo_fd_unregister(&server_socket);
+ close(server_socket.fd);
+ talloc_free(tall_telnet_ctx);
+}
+
/*! }@ */