diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-16 19:20:24 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-16 19:20:24 +0200 |
commit | 1353f961ef285c23776199419989f5b5039565a1 (patch) | |
tree | e528d3a637096a0a83a8349c1fd94877f47fac1d /openbsc/src/gprs | |
parent | 3071d6aa7d84a2412f64de555f0880f9c008b9fa (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')
-rw-r--r-- | openbsc/src/gprs/gb_proxy_main.c | 14 | ||||
-rw-r--r-- | openbsc/src/gprs/sgsn_main.c | 5 |
2 files changed, 7 insertions, 12 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(); diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index b355fb58d..81b130b12 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -58,11 +58,8 @@ void *tall_bsc_ctx; struct gprs_ns_inst *sgsn_nsi; -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"; @@ -174,7 +171,7 @@ struct gsm_network; int bsc_vty_init(struct gsm_network *dummy) { cmd_init(1); - vty_init(); + vty_init("Osmocom SGSN", PACKAGE_VERSION, openbsc_copyright); openbsc_vty_add_cmds(); sgsn_vty_init(); |