mobile/TS23040_SMS: fix incorrect field order in TPDUs

Unfortunately, the message format definitions of the transport layer
in subclause 9.2.2 of 3GPP TS 23.040 are ambiguous. In particular,
the order in tables defining basic elements does not match the
order defined in the message layout tables.

Most implementations including Wireshark and TTCN-3 L3 definitions
by Ericsson [1] follow the order defined the those layout tables.
For example, this is how tshark dissects an SMS-SUBMIT message:

  GSM SMS TPDU (GSM 03.40) SMS-SUBMIT
  0... .... = TP-RP: TP Reply Path parameter is not set in this SMS SUBMIT/DELIVER
  .0.. .... = TP-UDHI: The TP UD field contains only the short message
  ..1. .... = TP-SRR: A status report is requested
  ...0 0... = TP-VPF: TP-VP field not present (0)
  .... .1.. = TP-RD: Instruct SC to reject duplicates
  .... ..01 = TP-MTI: SMS-SUBMIT (1)

This order has been manually verified by sending two short messages
with and without status report request (TP-SRR) enabled. Let's also
follow the order defined in the layout tables.

[1] https://git.eclipse.org/c/titan/titan.ProtocolModules.MobileL3_v13.4.0.git/tree/src/MobileL3_SMS_Types.ttcn
This commit is contained in:
Vadim Yanitskiy 2020-01-24 22:41:40 +07:00
parent 4d851e1cab
commit 8404debca4
1 changed files with 6 additions and 6 deletions

View File

@ -1154,11 +1154,11 @@ class TP_PI(Envelope):
class SMS_DELIVER(SMS_TP):
_GEN = (
Uint('TP_SRI', bl=1, dic=_TP_SRI_dict),
Uint('TP_UDHI', desc='UDH Indicator', bl=1),
Uint('TP_RP', bl=1, dic=_TP_RP_dict),
Uint('TP_LP', desc='Loop Prevention', bl=1),
Uint('TP_UDHI', desc='UDH Indicator', bl=1),
Uint('TP_SRI', bl=1, dic=_TP_SRI_dict),
Uint('spare', bl=1),
Uint('TP_LP', desc='Loop Prevention', bl=1),
Uint('TP_MMS', desc='no More Message to Send', bl=1),
Uint('TP_MTI', val=0, bl=2, dic=_TP_MTI_MT_dict),
TP_OA(desc='Originating Address'),
@ -1229,9 +1229,9 @@ class SMS_DELIVER_REPORT_RP_ACK(SMS_TP):
class SMS_SUBMIT(SMS_TP):
ENV_SEL_TRANS = False
_GEN = (
Uint('TP_SRR', bl=1, dic=_TP_SRR_dict),
Uint('TP_UDHI', desc='UDH Indicator', bl=1),
Uint('TP_RP', bl=1, dic=_TP_RP_dict),
Uint('TP_UDHI', desc='UDH Indicator', bl=1),
Uint('TP_SRR', bl=1, dic=_TP_SRR_dict),
Uint('TP_VPF', bl=2, dic=_TP_VPF_dict),
Uint('TP_RD', desc='Reject Duplicates', bl=1),
Uint('TP_MTI', val=1, bl=2, dic=_TP_MTI_MT_dict),
@ -1317,8 +1317,8 @@ class SMS_STATUS_REPORT(SMS_TP):
Uint('spare', bl=1),
Uint('TP_UDHI', desc='UDH Indicator', bl=1),
Uint('TP_SRQ', bl=1, dic=_TP_SRQ_dict),
Uint('TP_LP', desc='Loop Prevention', bl=1),
Uint('spare', bl=1),
Uint('TP_LP', desc='Loop Prevention', bl=1),
Uint('TP_MMS', desc='no More Message to Send', bl=1),
Uint('TP_MTI', val=2, bl=2, dic=_TP_MTI_MT_dict),
Uint8('TP_MR', desc='Message Reference'),