summaryrefslogtreecommitdiffstats
path: root/include/osmocom/vty
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-02-23 14:01:41 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-02-25 11:02:34 +0100
commit96172f01002a64359bbe643c4a0d3cfa9a929b56 (patch)
treea23a2ca497877e198153a08415383e6038b4c060 /include/osmocom/vty
parentcc00bf8779f48fd1e592fc7d0a60fc00b04826cd (diff)
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.
Diffstat (limited to 'include/osmocom/vty')
-rw-r--r--include/osmocom/vty/vty.h3
1 files changed, 3 insertions, 0 deletions
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;