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/mgcp | |
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/mgcp')
-rw-r--r-- | openbsc/src/mgcp/mgcp_main.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/openbsc/src/mgcp/mgcp_main.c b/openbsc/src/mgcp/mgcp_main.c index f7f1f80fc..fd03c9943 100644 --- a/openbsc/src/mgcp/mgcp_main.c +++ b/openbsc/src/mgcp/mgcp_main.c @@ -58,7 +58,6 @@ static struct bsc_fd bfd; static struct mgcp_config *cfg; static int reset_endpoints = 0; -const char *openbsc_version = "OpenBSC MGCP " PACKAGE_VERSION; const char *openbsc_copyright = "Copyright (C) 2009-2010 Holger Freyther and On-Waves\n" "Contributions by Daniel Willmann, Jan Lübbe,Stefan Schmidt\n" @@ -79,12 +78,6 @@ static void print_help() printf(" -c --config-file filename The config file to use.\n"); } -static void print_mgcp_version() -{ - printf("%s\n\n", openbsc_version); - printf("%s", openbsc_copyright); -} - static void handle_options(int argc, char** argv) { while (1) { @@ -110,7 +103,7 @@ static void handle_options(int argc, char** argv) config_file = talloc_strdup(tall_bsc_ctx, optarg); break; case 'V': - print_mgcp_version(); + print_version(1); exit(0); break; default: @@ -200,9 +193,10 @@ int main(int argc, char** argv) if (!cfg) return -1; + telnet_init(&dummy_network, 4243); + handle_options(argc, argv); - telnet_init(&dummy_network, 4243); rc = mgcp_parse_config(config_file, cfg); if (rc < 0) return rc; @@ -264,7 +258,7 @@ struct gsm_network; int bsc_vty_init(struct gsm_network *dummy) { cmd_init(1); - vty_init(); + vty_init("OpenBSC MGCP", PACKAGE_VERSION, openbsc_copyright); openbsc_vty_add_cmds(); mgcp_vty_init(); |