aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy_main.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-16 19:20:24 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-16 19:20:24 +0200
commit1353f961ef285c23776199419989f5b5039565a1 (patch)
treee528d3a637096a0a83a8349c1fd94877f47fac1d /openbsc/src/gprs/gb_proxy_main.c
parent3071d6aa7d84a2412f64de555f0880f9c008b9fa (diff)
VTY: pass program name, version and copyright to vty_init()
This enables us to make the VTY completely independent of any compile-time program-specific information, i.e. one step closer to using VTY as a shared library from multiple programs.
Diffstat (limited to 'openbsc/src/gprs/gb_proxy_main.c')
-rw-r--r--openbsc/src/gprs/gb_proxy_main.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c
index de83186f3..9cd73e17d 100644
--- a/openbsc/src/gprs/gb_proxy_main.c
+++ b/openbsc/src/gprs/gb_proxy_main.c
@@ -46,6 +46,8 @@
#include <openbsc/vty.h>
#include <openbsc/gb_proxy.h>
+#include <vty/command.h>
+
#include "../../bscconfig.h"
/* this is here for the vty... it will never be called */
@@ -56,11 +58,8 @@ void subscr_put() { abort(); }
void *tall_bsc_ctx;
-const char *openbsc_version = "Osmocom NSIP Proxy " PACKAGE_VERSION;
const char *openbsc_copyright =
"Copyright (C) 2010 Harald Welte and On-Waves\n"
- "Contributions by Daniel Willmann, Jan Lübbe, Stefan Schmidt\n"
- "Dieter Spaar, Andreas Eversberg, Holger Freyther\n\n"
"License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n";
@@ -175,9 +174,7 @@ static void handle_options(int argc, char **argv)
log_set_log_level(stderr_target, atoi(optarg));
break;
case 'V':
- printf("%s\n", openbsc_version);
- printf("\n");
- puts(openbsc_copyright);
+ print_version(1);
exit(0);
break;
default:
@@ -208,10 +205,11 @@ int main(int argc, char **argv)
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
+ telnet_init(&dummy_network, 4246);
+
handle_options(argc, argv);
rate_ctr_init(tall_bsc_ctx);
- telnet_init(&dummy_network, 4246);
bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb);
if (!bssgp_nsi) {
@@ -254,7 +252,7 @@ struct gsm_network;
int bsc_vty_init(struct gsm_network *dummy)
{
cmd_init(1);
- vty_init();
+ vty_init("Osmocom Gb Proxy", PACKAGE_VERSION, openbsc_copyright);
openbsc_vty_add_cmds();
gbproxy_vty_init();