aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-14 16:06:46 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-15 14:10:45 +0100
commit282e90843476989629f8ae7e36e4a59b69da40eb (patch)
treeb34952010bd0aadb8ad6db7ebe8ebddbca5f53aa /src
parentc0d9a6c083aa7e35174093c7a7265319bf993a9d (diff)
04.08: add inline funcs for pdisc + msg type bitmasks
Add inline functions for both release <= 98 and release >= 99 as well as a default define. Use the release 98 by default since the current code base uses the r98 bitmasks. These inline functions relieve callers of the decision on masking bits of the protocol discriminator and message type octets. Also add a define for the protocol discriminator extension to one octet length (GSM48_PDISC_EXTEND). Apply new pdisc function in gsm0480.c. [hfreyther: Make the hdr param const]
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsm0480.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 952604b9..8963b788 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -220,7 +220,7 @@ int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len,
return 0;
}
- if ((hdr->proto_discr & 0x0f) == GSM48_PDISC_NC_SS) {
+ if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {
req->transaction_id = hdr->proto_discr & 0x70;
ss.transaction_id = req->transaction_id;
@@ -254,7 +254,7 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len,
return 0;
}
- if ((hdr->proto_discr & 0x0f) == GSM48_PDISC_NC_SS) {
+ if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {
req->transaction_id = hdr->proto_discr & 0x70;
rc = parse_ss(hdr, len, req);
}