From 96172f01002a64359bbe643c4a0d3cfa9a929b56 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 23 Feb 2016 14:01:41 +0100 Subject: vty: add bind command for telnet vty line Add VTY command line vty bind A.B.C.D The command merely stores the configured IP-address, which can then be used by the calling main program to set the telnet port of the VTY line. (Commits in openbsc and osmo-iuh will follow up on this.) Add function vty_get_bind_addr() to publish the address in the vty.h API. Add static vty_bind_addr to store. For allocation/freeing reasons, a NULL address defaults to 127.0.0.1. BTW, I decided against allowing keywords 'any' and 'localhost' in place of an actual IP address to make sure a written config is always identical to the parsed config. --- include/osmocom/vty/vty.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index 36843974..43cb0cfe 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -186,6 +186,9 @@ void *vty_current_index(struct vty *); int vty_current_node(struct vty *vty); int vty_go_parent(struct vty *vty); +/* Return IP address passed to the 'line vty'/'bind' command, or "127.0.0.1" */ +const char *vty_get_bind_addr(void); + extern void *tall_vty_ctx; extern struct cmd_element cfg_description_cmd; -- cgit v1.2.3