summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2017-08-11 13:10:48 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-13 22:35:43 +0000
commitcf123c0c4e43c3cad124d535afaf97c9578dcd81 (patch)
tree537a2a4c29c9a69eb027d9c74bef940583362e70 /openbsc/src/libmsc
parent68e4ad155de1c27cf7c7ac6dd17bed8684d7bb0c (diff)
libmsc: use new smpp34 esm_class definitions
Replace magic numbers by esm_class definitions, which have been added to latest libsmpp34 in Change-Id I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/smpp_openbsc.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index 7e23abd38..ddb24b5f1 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -157,14 +157,13 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
osmo_strlcpy(sms->src.addr, (char *)submit->source_addr,
sizeof(sms->src.addr));
- /* This is a Delivery Acknowledgment. */
- if (submit->esm_class == 0x08)
+ if (submit->esm_class == SMPP34_DELIVERY_ACK)
sms->is_report = true;
- if (submit->esm_class & 0x40)
+ if (submit->esm_class & SMPP34_UDHI_IND)
sms->ud_hdr_ind = 1;
- if (submit->esm_class & 0x80) {
+ if (submit->esm_class & SMPP34_REPLY_PATH) {
sms->reply_path_req = 1;
#warning Implement reply path
}
@@ -240,7 +239,7 @@ int handle_smpp_submit(struct osmo_esme *esme, struct submit_sm_t *submit,
sms->smpp.esme = esme;
sms->protocol_id = submit->protocol_id;
- switch (submit->esm_class & 3) {
+ switch (submit->esm_class & SMPP34_MSG_MODE_MASK) {
case 0: /* default */
case 1: /* datagram */
case 3: /* store-and-forward */
@@ -664,16 +663,15 @@ static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms,
memcpy(deliver.destination_addr, sms->dst.addr,
sizeof(deliver.destination_addr));
- /* Short message contains a delivery receipt? Sect. 5.2.12. */
if (sms->is_report)
- deliver.esm_class = 0x04;
+ deliver.esm_class = SMPP34_DELIVERY_RECEIPT;
else
- deliver.esm_class = 1; /* datagram mode */
+ deliver.esm_class = SMPP34_DATAGRAM_MODE;
if (sms->ud_hdr_ind)
- deliver.esm_class |= 0x40;
+ deliver.esm_class |= SMPP34_UDHI_IND;
if (sms->reply_path_req)
- deliver.esm_class |= 0x80;
+ deliver.esm_class |= SMPP34_REPLY_PATH;
deliver.protocol_id = sms->protocol_id;
deliver.priority_flag = 0;