aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-10 12:19:13 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-15 13:14:17 +0100
commit51bf76ef478085a030382e91212e108f71537ccc (patch)
tree7d0f52f6a71c4fa8cb2726849f51fd432e16d104 /openbsc/src/libbsc
parentaa6058203665aa2fb9edd033e852dcb1bf2c003f (diff)
04.08: apply new bitmask functions, fix bitmask use
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r--openbsc/src/libbsc/bsc_api.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index ec3d92677..d9c34d035 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -570,6 +570,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
struct bsc_api *api = msg->lchan->ts->trx->bts->network->bsc_api;
struct gsm48_hdr *gh;
uint8_t pdisc;
+ uint8_t msg_type;
int rc;
if (msgb_l3len(msg) < sizeof(*gh)) {
@@ -578,7 +579,8 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
}
gh = msgb_l3(msg);
- pdisc = gh->proto_discr & 0x0f;
+ pdisc = gsm48_hdr_pdisc(gh);
+ msg_type = gsm48_hdr_msg_type(gh);
/* the idea is to handle all RR messages here, and only hand
* MM/CC/SMS-CP/LCS up to the MSC. Some messages like PAGING
@@ -588,7 +590,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
* will call api->compl_l3() for it */
switch (pdisc) {
case GSM48_PDISC_RR:
- switch (gh->msg_type) {
+ switch (msg_type) {
case GSM48_MT_RR_GPRS_SUSP_REQ:
DEBUGP(DRR, "GRPS SUSPEND REQUEST\n");
break;
@@ -647,7 +649,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
* messages, but we'd rather forward what we
* don't know than drop it... */
LOGP(DRR, LOGL_NOTICE, "BSC: Passing unknown 04.08 "
- "RR message type 0x%02x to MSC\n", gh->msg_type);
+ "RR message type 0x%02x to MSC\n", msg_type);
if (api->dtap)
api->dtap(conn, link_id, msg);
}