summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/main.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-11-21 10:34:58 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-11-21 10:36:57 +0700
commitda96b3c0aed7a63772faee91b7056dd0b3d72890 (patch)
tree7dea071f59df7d40cc9f1d4c622324a6032eab20 /src/host/layer23/src/mobile/main.c
parent65110d2d99282a566b1d0e621783259bab909dce (diff)
mobile: use VTY bind addr from config, deprecate cmd line options
This change revives the main idea of: Change-Id: I32517567847fd5c54b1742f18bf409ff81e316fa to stop ignoring the VTY bind address from the config file. Furthermore, it deprecates (and disables) both 'u' and 'v' command line options, because they are redundant. Change-Id: I99e0ec1717edd29b3be231be86616cc7effe5d95
Diffstat (limited to 'src/host/layer23/src/mobile/main.c')
-rw-r--r--src/host/layer23/src/mobile/main.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c
index e015c301..9764b333 100644
--- a/src/host/layer23/src/mobile/main.c
+++ b/src/host/layer23/src/mobile/main.c
@@ -51,8 +51,6 @@ struct llist_head ms_list;
static char *gsmtap_ip = 0;
static const char *custom_cfg_file = NULL;
struct gsmtap_inst *gsmtap_inst = NULL;
-static char *vty_ip = "127.0.0.1";
-unsigned short vty_port = 4247;
char *config_dir = NULL;
int use_mncc_sock = 0;
int daemonize = 0;
@@ -87,10 +85,6 @@ static void print_help()
printf(" Some help...\n");
printf(" -h --help this text\n");
printf(" -i --gsmtap-ip The destination IP used for GSMTAP.\n");
- printf(" -u --vty-ip The VTY IP to telnet to. "
- "(default %s)\n", vty_ip);
- printf(" -v --vty-port The VTY port number to telnet to. "
- "(default %u)\n", vty_port);
printf(" -d --debug Change debug flags. default: %s\n",
debug_default);
printf(" -D --daemonize Run as daemon\n");
@@ -106,12 +100,13 @@ static int handle_options(int argc, char **argv)
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"gsmtap-ip", 1, 0, 'i'},
- {"vty-ip", 1, 0, 'u'},
- {"vty-port", 1, 0, 'v'},
{"debug", 1, 0, 'd'},
{"daemonize", 0, 0, 'D'},
{"config-file", 1, 0, 'c'},
{"mncc-sock", 0, 0, 'm'},
+ /* DEPRECATED options, to be removed */
+ {"vty-ip", 1, 0, 'u'},
+ {"vty-port", 1, 0, 'v'},
{0, 0, 0, 0},
};
@@ -129,15 +124,9 @@ static int handle_options(int argc, char **argv)
case 'i':
gsmtap_ip = optarg;
break;
- case 'u':
- vty_ip = optarg;
- break;
case 'c':
custom_cfg_file = optarg;
break;
- case 'v':
- vty_port = atoi(optarg);
- break;
case 'd':
log_parse_category_mask(osmo_stderr_target, optarg);
break;
@@ -147,6 +136,13 @@ static int handle_options(int argc, char **argv)
case 'm':
use_mncc_sock = 1;
break;
+ /* DEPRECATED options, to be removed */
+ case 'u':
+ case 'v':
+ fprintf(stderr, "Both 'u' and 'v' options are "
+ "deprecated! Please use the configuration file "
+ "in order to set VTY bind address.\n");
+ /* fall-thru */
default:
/* Unknown parameter passed */
return -EINVAL;
@@ -255,9 +251,9 @@ int main(int argc, char **argv)
config_dir = dirname(config_dir);
if (use_mncc_sock)
- rc = l23_app_init(mncc_recv_socket, config_file, vty_ip, vty_port);
+ rc = l23_app_init(mncc_recv_socket, config_file);
else
- rc = l23_app_init(NULL, config_file, vty_ip, vty_port);
+ rc = l23_app_init(NULL, config_file);
if (rc)
exit(rc);