vty: Make TCP port configurable and introduce telnet_init_default

Extend the vty_bind_cmd VTY command to allow to optionally specify
a port in addition to the IPv4 address.

Introduce telnet_init_default to relieve client code from having
to query the bind IPv4 address (and now the TCP port). Instead a
client only needs to pass the default TCP port to use.

Client code should use it like:

	int rc = telnet_init_default(ctx, priv, OSMO_VTY_PORT_SGSN);

Change-Id: Id5fb2faaf4311bd7284ee870526a6f87b7e260f3
diff --git a/include/osmocom/vty/telnet_interface.h b/include/osmocom/vty/telnet_interface.h
index d653466..da7cf83 100644
--- a/include/osmocom/vty/telnet_interface.h
+++ b/include/osmocom/vty/telnet_interface.h
@@ -47,6 +47,7 @@
 
 int telnet_init(void *tall_ctx, void *priv, int port);
 int telnet_init_dynif(void *tall_ctx, void *priv, const char *ip, int port);
+int telnet_init_default(void *tall_ctx, void *priv, int default_port);
 
 void telnet_exit(void);
 
diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h
index 02ba03e..c4cf707 100644
--- a/include/osmocom/vty/vty.h
+++ b/include/osmocom/vty/vty.h
@@ -210,6 +210,8 @@
 
 /* Return IP address passed to the 'line vty'/'bind' command, or "127.0.0.1" */
 const char *vty_get_bind_addr(void);
+/** Returns configured port passed to the 'line vty'/'bind' command or default_port. */
+int vty_get_bind_port(int default_port);
 
 extern void *tall_vty_ctx;