diff options
author | Oliver Smith <osmith@sysmocom.de> | 2019-09-05 17:13:33 +0200 |
---|---|---|
committer | laforge <laforge@gnumonks.org> | 2019-09-14 15:28:43 +0000 |
commit | cfb6321b88391ff58e5915c67ef0398024572566 (patch) | |
tree | 2d8be0aaccca7d9afbaf84b7d4ede5f6db579f9c /src/gprs_rlcmac.cpp | |
parent | 5360ef5447e192f20c86a2f92af031c45c724e18 (diff) |
Forward ETWS Primary Notification to MS
Receive an Application Information Request from the BTS via PCU
interface. Construct a Packet Application Information message from it
(3GPP TS 44.060 11.2.47) and send it to all MS with active TBF.
The TTCN-3 test infrastructure to test this feature is not quite ready
yet, so I've added C unit tests instead.
Related: OS#4048
Change-Id: Ie35959f833f46bde5f2126314b6f96763f863b36
Diffstat (limited to 'src/gprs_rlcmac.cpp')
-rw-r--r-- | src/gprs_rlcmac.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index 5a223c13..4d93f8f0 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -41,4 +41,25 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, return 0; } +/* Encode Application Information Request to Packet Application Information (3GPP TS 44.060 11.2.47) */ +struct msgb *gprs_rlcmac_app_info_msg(const struct gsm_pcu_if_app_info_req *req) { + struct msgb *msg; + uint16_t msgb_len = req->len + 1; + struct bitvec bv = {0, msgb_len, NULL}; + const enum bit_value page_mode[] = {ZERO, ZERO}; /* Normal Paging (3GPP TS 44.060 12.20) */ + if (!req->len) { + LOGP(DRLCMAC, LOGL_ERROR, "Application Information Request with zero length received!\n"); + return NULL; + } + + msg = msgb_alloc(msgb_len, "app_info_msg"); + if (!msg) + return NULL; + + bv.data = msgb_put(msg, msgb_len); + bitvec_set_bits(&bv, page_mode, 2); + bitvec_set_uint(&bv, req->application_type, 4); + bitvec_set_bytes(&bv, req->data, req->len); + return msg; +} |