[gprs] gb_proxy: Send proper BSSGP STATUS msg in error case
In order to reuse the existing bssgp_tx_* functions without pulling
in the dependencies of gprs_bssgp.c, we have to move those functions
to gprs_bssgp_util.c
Furthermore, we can remove gbprox_nsi and replace it with bssgp_nsi,
and we can do proper processing of BVC-RESET messages coming from
the SGSN on the signalling BVC. In that case we need to send RESET
messages to all the BSS.
diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c
index 72f1417..1a5d7bd 100644
--- a/openbsc/src/gprs/gb_proxy_main.c
+++ b/openbsc/src/gprs/gb_proxy_main.c
@@ -39,6 +39,7 @@
#include <openbsc/signal.h>
#include <openbsc/debug.h>
#include <openbsc/gprs_ns.h>
+#include <openbsc/gprs_bssgp.h>
#include <openbsc/telnet_interface.h>
#include <openbsc/vty.h>
#include <openbsc/gb_proxy.h>
@@ -53,8 +54,6 @@
void *tall_bsc_ctx;
-struct gprs_ns_inst *gbprox_nsi;
-
const char *openbsc_version = "Osmocom NSIP Proxy " PACKAGE_VERSION;
const char *openbsc_copyright =
"Copyright (C) 2010 Harald Welte and On-Waves\n"
@@ -112,20 +111,20 @@
exit(2);
}
- gbprox_nsi = gprs_ns_instantiate(&proxy_ns_cb);
- if (!gbprox_nsi) {
+ bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb);
+ if (!bssgp_nsi) {
LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
exit(1);
}
- gbcfg.nsi = gbprox_nsi;
+ gbcfg.nsi = bssgp_nsi;
register_signal_handler(SS_NS, &gbprox_signal, NULL);
- nsip_listen(gbprox_nsi, gbcfg.nsip_listen_port);
+ nsip_listen(bssgp_nsi, gbcfg.nsip_listen_port);
/* 'establish' the outgoing connection to the SGSN */
sin.sin_family = AF_INET;
sin.sin_port = htons(gbcfg.nsip_sgsn_port);
sin.sin_addr.s_addr = htonl(gbcfg.nsip_sgsn_ip);
- nsip_connect(gbprox_nsi, &sin, gbcfg.nsip_sgsn_nsei,
+ nsip_connect(bssgp_nsi, &sin, gbcfg.nsip_sgsn_nsei,
gbcfg.nsip_sgsn_nsvci);
while (1) {