From patchwork Wed Aug 27 21:54:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Welte X-Patchwork-Id: 383590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [IPv6:2001:780:45:1d:225:90ff:fe52:c662]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C44171400B2 for ; Thu, 28 Aug 2014 08:10:51 +1000 (EST) Received: from localhost ([127.0.0.1] helo=ganesha.gnumonks.org) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1XMlQN-0006qp-Fh; Thu, 28 Aug 2014 00:10:39 +0200 Received: from uucp by ganesha.gnumonks.org with local-bsmtp (Exim 4.72) (envelope-from ) id 1XMlC1-0004Mn-73; Wed, 27 Aug 2014 23:55:49 +0200 Received: from laforge by localhost.localdomain with local (Exim 4.84) (envelope-from ) id 1XMlBI-0003Xg-EA; Wed, 27 Aug 2014 23:55:04 +0200 From: Harald Welte To: openbsc@lists.osmocom.org Subject: [PATCH 31/33] Add gsmtap option to command line to main.c of osmo-bts-sysmo Date: Wed, 27 Aug 2014 23:54:50 +0200 Message-Id: <1409176492-13269-32-git-send-email-laforge@gnumonks.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409176492-13269-1-git-send-email-laforge@gnumonks.org> References: <1409176492-13269-1-git-send-email-laforge@gnumonks.org> Cc: Andreas Eversberg X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openbsc-bounces@lists.osmocom.org Errors-To: openbsc-bounces@lists.osmocom.org From: Andreas Eversberg --- src/osmo-bts-sysmo/main.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index 27b593b..8abff5f 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include @@ -47,6 +49,7 @@ #include #include #include +#include #define SYSMOBTS_RF_LOCK_PATH "/var/lock/bts_rf_lock" @@ -64,6 +67,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) { @@ -167,6 +171,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" ); } @@ -198,10 +203,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; @@ -246,6 +252,9 @@ static void handle_options(int argc, char **argv) case 'r': rt_prio = atoi(optarg); break; + case 'i': + gsmtap_ip = optarg; + break; default: break; } @@ -328,6 +337,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);