summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2023-03-04 21:33:07 +0300
committermsuraev <msuraev@sysmocom.de>2023-03-06 15:19:56 +0000
commit9a9fca7e1deb721d22db891ac52de3eeb2824246 (patch)
tree9a98863faaadc7acf070a39ac3d9af03d4c0e72f
parent69bbbc5249769dec2bc4efba4d92418b0de661cb (diff)
mobile: deprecate --gsmtap-ip option
-rw-r--r--src/host/layer23/src/mobile/main.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c
index deb7948f..581c6cb9 100644
--- a/src/host/layer23/src/mobile/main.c
+++ b/src/host/layer23/src/mobile/main.c
@@ -53,7 +53,6 @@
void *l23_ctx = NULL;
struct l23_global_config l23_cfg;
struct llist_head ms_list;
-static char *gsmtap_ip = 0;
static const char *custom_cfg_file = NULL;
static char *config_file = NULL;
char *config_dir = NULL;
@@ -83,7 +82,6 @@ static void print_help(void)
{
printf(" Some help...\n");
printf(" -h --help this text\n");
- printf(" -i --gsmtap-ip The destination IP used for GSMTAP.\n");
printf(" -d --debug Change debug flags. default: %s\n",
debug_default);
printf(" -D --daemonize Run as daemon\n");
@@ -96,11 +94,11 @@ static int handle_options(int argc, char **argv)
int option_index = 0, c;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
- {"gsmtap-ip", 1, 0, 'i'},
{"debug", 1, 0, 'd'},
{"daemonize", 0, 0, 'D'},
{"config-file", 1, 0, 'c'},
/* DEPRECATED options, to be removed */
+ {"gsmtap-ip", 1, 0, 'i'},
{"mncc-sock", 0, 0, 'm'},
{"vty-ip", 1, 0, 'u'},
{"vty-port", 1, 0, 'v'},
@@ -118,9 +116,6 @@ static int handle_options(int argc, char **argv)
print_help();
exit(0);
break;
- case 'i':
- gsmtap_ip = optarg;
- break;
case 'c':
custom_cfg_file = optarg;
break;
@@ -131,6 +126,11 @@ static int handle_options(int argc, char **argv)
daemonize = 1;
break;
/* DEPRECATED options, to be removed */
+ case 'i':
+ fprintf(stderr, "Option 'i' is deprecated! "
+ "Please use the configuration file "
+ "in order to set GSMTAP parameters.\n");
+ return -EINVAL;
case 'm':
fprintf(stderr, "Option 'm' is deprecated! "
"Please use the configuration file "
@@ -311,10 +311,11 @@ int main(int argc, char **argv)
exit(1);
}
- if (gsmtap_ip) {
- l23_cfg.gsmtap.inst = gsmtap_source_init(gsmtap_ip, GSMTAP_UDP_PORT, 1);
+ if (l23_cfg.gsmtap.remote_host) {
+ l23_cfg.gsmtap.inst = gsmtap_source_init(l23_cfg.gsmtap.remote_host, GSMTAP_UDP_PORT, 1);
if (!l23_cfg.gsmtap.inst) {
- fprintf(stderr, "Failed during gsmtap_init()\n");
+ fprintf(stderr, "Failed during gsmtap_source_init(%s:%u)\n",
+ l23_cfg.gsmtap.remote_host, GSMTAP_UDP_PORT);
exit(1);
}
gsmtap_source_add_sink(l23_cfg.gsmtap.inst);