aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-09-01 12:06:19 +0200
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:39:04 +0200
commita450ef73edb35c19392b34f663e0570a8839ece6 (patch)
tree6969c5035b0ba86599c8e9e13fd5c9620279a929
parent04b5d655752d7afeb94018765ae08b1d7b0f91c5 (diff)
Add gsmtap option to command line to main.c of osmo-bts-sysmo
-rw-r--r--src/osmo-bts-sysmo/main.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index 3b95bd6..b9f9fe9 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -38,6 +38,8 @@
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
#include <osmocom/vty/ports.h>
+#include <osmocom/core/gsmtap_util.h>
+#include <osmocom/core/gsmtap.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/logging.h>
@@ -47,6 +49,7 @@
#include <osmo-bts/bts_model.h>
#include <osmo-bts/pcu_if.h>
#include <osmo-bts/control_if.h>
+#include <osmo-bts/l1sap.h>
#define SYSMOBTS_RF_LOCK_PATH "/var/lock/bts_rf_lock"
@@ -62,6 +65,7 @@ static const char *config_file = "osmo-bts.cfg";
static int daemonize = 0;
static unsigned int dsp_trace = 0x71c00020;
static int rt_prio = -1;
+static char *gsmtap_ip = 0;
int bts_model_init(struct gsm_bts *bts)
{
@@ -165,6 +169,7 @@ static void print_help()
" -w --hw-version Print the targeted HW Version\n"
" -M --pcu-direct Force PCU to access message queue for "
"PDCH dchannel directly\n"
+ " -i --gsmtap-ip The destination IP used for GSMTAP.\n"
);
}
@@ -196,10 +201,11 @@ static void handle_options(int argc, char **argv)
{ "hw-version", 0, 0, 'w' },
{ "pcu-direct", 0, 0, 'M' },
{ "realtime", 1, 0, 'r' },
+ { "gsmtap-ip", 1, 0, 'i' },
{ 0, 0, 0, 0 }
};
- c = getopt_long(argc, argv, "hc:d:Dc:sTVe:p:w:Mr:",
+ c = getopt_long(argc, argv, "hc:d:Dc:sTVe:p:w:Mr:i:",
long_options, &option_idx);
if (c == -1)
break;
@@ -244,6 +250,9 @@ static void handle_options(int argc, char **argv)
case 'r':
rt_prio = atoi(optarg);
break;
+ case 'i':
+ gsmtap_ip = optarg;
+ break;
default:
break;
}
@@ -326,6 +335,15 @@ int main(int argc, char **argv)
}
}
+ if (gsmtap_ip) {
+ gsmtap = gsmtap_source_init(gsmtap_ip, GSMTAP_UDP_PORT, 1);
+ if (!gsmtap) {
+ fprintf(stderr, "Failed during gsmtap_init()\n");
+ exit(1);
+ }
+ gsmtap_source_add_sink(gsmtap);
+ }
+
if (bts_init(bts) < 0) {
fprintf(stderr, "unable to open bts\n");
exit(1);