aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_bssgp_pcu.cpp
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-07-06 09:28:15 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2012-07-06 09:28:15 +0200
commit3e372d57ed36e68836b14dd96f6bda595bb6fe9e (patch)
tree91a0f25a2d7112222e2b1e53ff9be541681b6a5e /src/gprs_bssgp_pcu.cpp
parentbf5a0f6e2c9d0ae564b171b210f0f97bcbdddbf3 (diff)
Cleanup of BSSGP code.
The hack for resetting BSSGP instance is removed and now performed whenever the NS state changes to UNBLOCKED. The BSSGP instance is now created only once, as it should be. Received STATUS messages are ignored as they should be. The creation and destruction of BSSGP/NS instances is now handled by layer 1 interface alone.
Diffstat (limited to 'src/gprs_bssgp_pcu.cpp')
-rw-r--r--src/gprs_bssgp_pcu.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index c08cc8f2..4921b217 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -23,7 +23,7 @@
struct sgsn_instance *sgsn;
void *tall_bsc_ctx;
-struct bssgp_bvc_ctx *bctx = btsctx_alloc(BVCI, NSEI);
+struct bssgp_bvc_ctx *bctx = NULL;
struct gprs_nsvc *nsvc = NULL;
extern uint16_t spoof_mcc, spoof_mnc;
@@ -225,6 +225,13 @@ int gprs_bssgp_pcu_rcvmsg(struct msgb *msg)
uint16_t ns_bvci = msgb_bvci(msg);
int data_len;
int rc = 0;
+ struct bssgp_bvc_ctx *bctx;
+
+ if (pdu_type == BSSGP_PDUT_STATUS) {
+ LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u received STATUS\n",
+ msgb_nsei(msg), ns_bvci);
+ return 0;
+ }
/* Identifiers from DOWN: NSEI, BVCI (both in msg->cb) */
@@ -243,12 +250,6 @@ int gprs_bssgp_pcu_rcvmsg(struct msgb *msg)
/* look-up or create the BTS context for this BVC */
bctx = btsctx_by_bvci_nsei(ns_bvci, msgb_nsei(msg));
- /* Only a RESET PDU can create a new BVC context */
- if (!bctx)
- {
- bctx = btsctx_alloc(ns_bvci, msgb_nsei(msg));
- }
-
if (!bctx && pdu_type != BSSGP_PDUT_BVC_RESET_ACK)
{
LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU "