aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-23 18:08:26 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-23 18:34:58 +0100
commita27303094ab8bedb0a3b3bfe771daeed10a2e0a9 (patch)
tree146d6a943d44c950ee10244691c01061624ae309 /openbsc/src/gprs/sgsn_main.c
parent49f9e5b6b42cae9f6083e5c69c70af0b29b15b23 (diff)
sgsn/ctrl: Add ctrl interface, implement listing subscribers
Add the control interface with no hierachy right now and implement the first command to list IMSI + Context Address of active sessions. sgsn_cmd_handle could share more code with bsc variant. Fixes: SYS#264, SYS#265
Diffstat (limited to 'openbsc/src/gprs/sgsn_main.c')
-rw-r--r--openbsc/src/gprs/sgsn_main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 9d42648a4..f5a66e663 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -50,6 +50,7 @@
#include <openbsc/sgsn.h>
#include <openbsc/gprs_llc.h>
#include <openbsc/gprs_gmm.h>
+#include <openbsc/control_if.h>
#include <gtp.h>
@@ -288,6 +289,7 @@ static const struct log_info gprs_log_info = {
int main(int argc, char **argv)
{
+ struct ctrl_handle *ctrl;
struct gsm_network dummy_network;
int rc;
@@ -314,6 +316,17 @@ int main(int argc, char **argv)
if (rc < 0)
exit(1);
+ ctrl = sgsn_controlif_setup(NULL, 4251);
+ if (!ctrl) {
+ LOGP(DGPRS, LOGL_ERROR, "Failed to create CTRL interface.\n");
+ exit(1);
+ }
+
+ if (sgsn_ctrl_cmds_install() != 0) {
+ LOGP(DGPRS, LOGL_ERROR, "Failed to install CTRL commands.\n");
+ exit(1);
+ }
+
gprs_ns_set_log_ss(DNS);
bssgp_set_log_ss(DBSSGP);