aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_hack.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/bsc_hack.c')
-rw-r--r--openbsc/src/bsc_hack.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index 49c9d36ef..f18f7f835 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -42,7 +42,8 @@ static struct debug_target *stderr_target;
struct gsm_network *bsc_gsmnet = 0;
static const char *database_name = "hlr.sqlite3";
static const char *config_file = "openbsc.cfg";
-
+extern const char *openbsc_version;
+extern const char *openbsc_copyright;
/* timer to store statistics */
#define DB_SYNC_INTERVAL 60, 0
@@ -83,6 +84,16 @@ static void print_help()
printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC\n");
}
+static void print_version()
+{
+ printf("%s\n", openbsc_version);
+}
+
+static void print_copyright()
+{
+ puts(openbsc_copyright);
+}
+
static void handle_options(int argc, char** argv)
{
while (1) {
@@ -96,11 +107,12 @@ static void handle_options(int argc, char** argv)
{"authorize-everyone", 0, 0, 'a'},
{"pcap", 1, 0, 'p'},
{"timestamp", 0, 0, 'T'},
+ {"version", 0, 0, 'V' },
{"rtp-proxy", 0, 0, 'P'},
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, "hd:sl:ar:p:TPc:",
+ c = getopt_long(argc, argv, "hd:sl:ar:p:TPVc:",
long_options, &option_index);
if (c == -1)
break;
@@ -131,6 +143,12 @@ static void handle_options(int argc, char** argv)
case 'P':
ipacc_rtp_direct = 0;
break;
+ case 'V':
+ print_version();
+ printf("\n");
+ print_copyright();
+ exit(0);
+ break;
default:
/* ignore */
break;