diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-09-01 12:06:19 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2014-04-05 12:48:22 +0200 |
commit | acf314967d0a36f7f55c74c028281967c60e7eb6 (patch) | |
tree | 81b0688ca2d74192e3e58a9cca99b51ddbb27e45 /src/osmo-bts-sysmo | |
parent | c157385ae83e9ecaf0428df172b6223b8e781b0b (diff) |
Add gsmtap option to command line to main.c of osmo-bts-sysmo
Diffstat (limited to 'src/osmo-bts-sysmo')
-rw-r--r-- | src/osmo-bts-sysmo/main.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index d3836c78..9eb05ffd 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -37,6 +37,8 @@ #include <osmocom/core/application.h> #include <osmocom/vty/telnet_interface.h> #include <osmocom/vty/logging.h> +#include <osmocom/core/gsmtap_util.h> +#include <osmocom/core/gsmtap.h> #include <osmo-bts/gsm_data.h> #include <osmo-bts/logging.h> @@ -45,6 +47,7 @@ #include <osmo-bts/vty.h> #include <osmo-bts/bts_model.h> #include <osmo-bts/pcu_if.h> +#include <osmo-bts/l1sap.h> #define SYSMOBTS_RF_LOCK_PATH "/var/lock/bts_rf_lock" @@ -61,6 +64,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) { @@ -163,6 +167,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" ); } @@ -194,10 +199,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; @@ -242,6 +248,9 @@ static void handle_options(int argc, char **argv) case 'r': rt_prio = atoi(optarg); break; + case 'i': + gsmtap_ip = optarg; + break; default: break; } @@ -321,6 +330,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); |