From 80b584bbe72c2d5aee39e521a33ec2c25962d77a Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 14 Apr 2010 11:19:07 +0200 Subject: [bsc_msc_ip] Implement a simple RF lock command interface Right now this is using unix domain sockets and it only supports query, on and off as commands. In the future we want to have a vty<->snmp bridge or at least more status exposed via snmp. --- openbsc/src/bsc_msc_ip.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'openbsc/src/bsc_msc_ip.c') diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c index 87f8a4442..deba7d3ba 100644 --- a/openbsc/src/bsc_msc_ip.c +++ b/openbsc/src/bsc_msc_ip.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,7 @@ static struct bsc_msc_connection *msc_con; static struct in_addr local_addr; static LLIST_HEAD(active_connections); static struct write_queue mgcp_agent; +static const char *rf_ctl = NULL; extern int ipacc_rtp_direct; extern int bsc_bootstrap_network(int (*layer4)(struct gsm_network *, int, void *), const char *cfg_file); @@ -890,6 +892,7 @@ static void print_help() printf(" -m --msc=IP. The address of the MSC.\n"); printf(" -l --local=IP. The local address of the MGCP.\n"); printf(" -e --log-level number. Set a global loglevel.\n"); + printf(" -r --rf-ctl NAME. A unix domain socket to listen for cmds.\n"); } static void handle_options(int argc, char** argv) @@ -905,10 +908,11 @@ static void handle_options(int argc, char** argv) {"msc", 1, 0, 'm'}, {"local", 1, 0, 'l'}, {"log-level", 1, 0, 'e'}, + {"rf-ctl", 1, 0, 'r'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hd:sTc:m:l:e:", + c = getopt_long(argc, argv, "hd:sTc:m:l:e:r:", long_options, &option_index); if (c == -1) break; @@ -942,6 +946,9 @@ static void handle_options(int argc, char** argv) case 'e': log_set_log_level(stderr_target, atoi(optarg)); break; + case 'r': + rf_ctl = optarg; + break; default: /* ignore */ break; @@ -1084,6 +1091,15 @@ int main(int argc, char **argv) exit(1); } + if (rf_ctl) { + struct bsc_msc_rf *rf; + rf = bsc_msc_rf_create(rf_ctl, bsc_gsmnet); + if (!rf) { + fprintf(stderr, "Failed to create the RF service.\n"); + exit(1); + } + } + while (1) { bsc_select_main(0); } -- cgit v1.2.3