msuraev has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/31660 )

Change subject: mobile: deprecate --gsmtap-ip option
......................................................................

mobile: deprecate --gsmtap-ip option

Change-Id: I44b355f9a0bafee16a284537de76662a61111b09
---
M src/host/layer23/src/mobile/main.c
1 file changed, 19 insertions(+), 9 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  msuraev: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/host/layer23/src/mobile/main.c 
b/src/host/layer23/src/mobile/main.c
index deb7948..581c6cb 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 @@
 {
        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 @@
                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 @@
                        print_help();
                        exit(0);
                        break;
-               case 'i':
-                       gsmtap_ip = optarg;
-                       break;
                case 'c':
                        custom_cfg_file = optarg;
                        break;
@@ -131,6 +126,11 @@
                        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 @@
                        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);

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/31660
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I44b355f9a0bafee16a284537de76662a61111b09
Gerrit-Change-Number: 31660
Gerrit-PatchSet: 2
Gerrit-Owner: msuraev <msur...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: msuraev <msur...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to