summaryrefslogtreecommitdiffstats
path: root/src/vty
diff options
context:
space:
mode:
authorAndreas.Eversberg <jolly@eversberg.eu>2011-11-06 20:09:28 +0100
committerHarald Welte <laforge@gnumonks.org>2011-11-12 23:23:36 +0100
commitdc3be0a6533be782c76f23ce653f4fc683b3b4f1 (patch)
tree0c1ff5b7b4126cc6c129c2a1ca1384b2759b16c7 /src/vty
parentaeeb7070f84437aa608a3d843346b1efa916d175 (diff)
vty/telnet_interface: Add telnet_exit function
This frees socket and pending connections Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/vty')
-rw-r--r--src/vty/telnet_interface.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c
index ed64cdab..167acc18 100644
--- a/src/vty/telnet_interface.c
+++ b/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);
+}
+
/*! }@ */