aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-18 11:57:08 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-18 11:57:08 +0200
commitb3911a071bace3928178c5c71e1a36338cdc681f (patch)
treeef76949bde9bff608e05d0f0d29db459664552f5 /openbsc
parent75827d65a489fd63fea054b281b091eb064b3495 (diff)
[GPRS] BSSGP: Use correct values for SIGNALLING and PTM BVCI
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gprs_bssgp.h4
-rw-r--r--openbsc/src/gprs/gprs_bssgp.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/openbsc/include/openbsc/gprs_bssgp.h b/openbsc/include/openbsc/gprs_bssgp.h
index 4afe811c9..90b945aba 100644
--- a/openbsc/include/openbsc/gprs_bssgp.h
+++ b/openbsc/include/openbsc/gprs_bssgp.h
@@ -3,6 +3,10 @@
#include <stdint.h>
+/* Section 5.4.1 */
+#define BVCI_SIGNALLING 0x0000
+#define BVCI_PTM 0x0001
+
/* Section 11.3.26 / Table 11.27 */
enum bssgp_pdu_type {
/* PDUs between RL and BSSGP SAPs */
diff --git a/openbsc/src/gprs/gprs_bssgp.c b/openbsc/src/gprs/gprs_bssgp.c
index 0bc243ba4..d5ff44d87 100644
--- a/openbsc/src/gprs/gprs_bssgp.c
+++ b/openbsc/src/gprs/gprs_bssgp.c
@@ -186,7 +186,7 @@ static int bssgp_rx_bvc_block(struct msgb *msg, struct tlv_parsed *tp)
struct bssgp_bvc_ctx *ptp_ctx;
bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI));
- if (bvci == 0) {
+ if (bvci == BVCI_SIGNALLING) {
/* 8.3.2: Signalling BVC shall never be blocked */
LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u/BVCI=%u "
"received block for signalling BVC!?!\n",
@@ -216,7 +216,7 @@ static int bssgp_rx_bvc_unblock(struct msgb *msg, struct tlv_parsed *tp)
struct bssgp_bvc_ctx *ptp_ctx;
bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI));
- if (bvci == 0) {
+ if (bvci == BVCI_SIGNALLING) {
/* 8.3.2: Signalling BVC shall never be blocked */
LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u/BVCI=%u "
"received unblock for signalling BVC!?!\n",
@@ -517,9 +517,9 @@ int gprs_bssgp_rcvmsg(struct msgb *msg)
msgb_bssgp_len(msg));
}
- if (ns_bvci == 1)
+ if (ns_bvci == BVCI_SIGNALLING)
rc = gprs_bssgp_rx_sign(msg, &tp, bctx);
- else if (ns_bvci == 2)
+ else if (ns_bvci == BVCI_PTM)
rc = bssgp_tx_status(BSSGP_CAUSE_PDU_INCOMP_FEAT, NULL, msg);
else
rc = gprs_bssgp_rx_ptp(msg, &tp, bctx);
@@ -542,7 +542,7 @@ int gprs_bssgp_tx_dl_ud(struct msgb *msg)
uint16_t nsei = msgb_nsei(msg);
/* Identifiers from UP: TLLI, BVCI, NSEI (all in msgb->cb) */
- if (bvci < 2) {
+ if (bvci <= BVCI_PTM ) {
LOGP(DBSSGP, LOGL_ERROR, "Cannot send DL-UD to BVCI %u\n",
bvci);
return -EINVAL;