diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-09-25 23:03:13 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-12-18 21:52:01 +0700 |
commit | c2628317cc3482262c80b93cbfb2cbe960772558 (patch) | |
tree | e2a36265577bdefa4412e9c938562882359b3e20 /include/osmocom | |
parent | 520743278064c81e7fbe06ba42de6eefa807235a (diff) |
GSUP/SMS: introduce MO-/MT-FORWARD-SM messages
According to 3GPP TS 29.002, there are two services:
- MAP-MO-FORWARD-SHORT-MESSAGE (see 12.2),
- MAP-MT-FORWARD-SHORT-MESSAGE (see 12.9),
which are used to forward MO/MT short messages.
This change replicates both services as GSUP messages:
- OSMO_GSUP_MSGT_MO_FORWARD_SM_*,
- OSMO_GSUP_MSGT_MT_FORWARD_SM_*.
Please note, that only the 'must-have' IEs are introduced
by this change, in particular the following:
- OSMO_GSUP_SM_RP_MR_IE (see note below),
- OSMO_GSUP_SM_RP_DA_IE (see 7.6.8.1),
- OSMO_GSUP_SM_RP_OA_IE (see 7.6.8.2),
- OSMO_GSUP_SM_RP_UI_IE (see 7.6.8.4),
- OSMO_GSUP_SM_RP_MMS_IE (see 7.6.8.7),
- OSMO_GSUP_SM_RP_CAUSE_IE (see GSM TS 04.11, 8.2.5.4),
where both SM_RP_DA and SM_RP_OA IEs basically contain
a single nested TV of the following format:
- T: identity type (see 'osmo_gsup_sms_sm_rp_oda_t'),
- V: encoded identity itself (optional).
According to GSM TS 04.11, every single message on the SM-RL has
an unique message reference (see 8.2.3), that is used to link
an RP-ACK or RP-ERROR message to the associated (preceding)
RP-DATA or RP-SMMA message transfer attempt.
In case of TCAP/MAP, this message reference is being mapped to the
Invoke ID. But since GSUP has no 'Invoke ID' IE, and it is not
required for other applications (other than SMS), this change
introduces a special 'SM_RP_MR' IE that doesn't exist in MAP.
Change-Id: Ibe325c64ae2d6c626b232533bb4cbc65fc2b5d71
Related Change-Id: (docs) Ie0150756c33c1352bc4eb49421824542c711175c
Related Change-Id: (TTCN) Ibf49474a81235096c032ea21f217170f523bd94e
Related: OS#3587
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/gsm/gsup.h | 37 | ||||
-rw-r--r-- | include/osmocom/gsm/gsup_sms.h | 38 |
2 files changed, 75 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index cd6fd31f..192b877b 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -40,6 +40,7 @@ #include <stdint.h> #include <osmocom/core/msgb.h> +#include <osmocom/gsm/gsup_sms.h> #include <osmocom/gsm/protocol/gsm_23_003.h> #include <osmocom/gsm/protocol/gsm_04_08_gprs.h> #include <osmocom/crypt/auth.h> @@ -88,6 +89,14 @@ enum osmo_gsup_iei { /*! Supplementary Services payload */ OSMO_GSUP_SS_INFO_IE = 0x35, + + /* SM related IEs (see 3GPP TS 29.002, section 7.6.8) */ + OSMO_GSUP_SM_RP_MR_IE = 0x40, + OSMO_GSUP_SM_RP_DA_IE = 0x41, + OSMO_GSUP_SM_RP_OA_IE = 0x42, + OSMO_GSUP_SM_RP_UI_IE = 0x43, + OSMO_GSUP_SM_RP_CAUSE_IE = 0x44, + OSMO_GSUP_SM_RP_MMS_IE = 0x45, }; /*! GSUP message type */ @@ -121,6 +130,14 @@ enum osmo_gsup_message_type { OSMO_GSUP_MSGT_PROC_SS_REQUEST = 0b00100000, OSMO_GSUP_MSGT_PROC_SS_ERROR = 0b00100001, OSMO_GSUP_MSGT_PROC_SS_RESULT = 0b00100010, + + OSMO_GSUP_MSGT_MO_FORWARD_SM_REQUEST = 0b00100100, + OSMO_GSUP_MSGT_MO_FORWARD_SM_ERROR = 0b00100101, + OSMO_GSUP_MSGT_MO_FORWARD_SM_RESULT = 0b00100110, + + OSMO_GSUP_MSGT_MT_FORWARD_SM_REQUEST = 0b00101000, + OSMO_GSUP_MSGT_MT_FORWARD_SM_ERROR = 0b00101001, + OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT = 0b00101010, }; #define OSMO_GSUP_IS_MSGT_REQUEST(msgt) (((msgt) & 0b00000011) == 0b00) @@ -213,6 +230,26 @@ struct osmo_gsup_message { /*! ASN.1 encoded MAP payload for Supplementary Services */ uint8_t *ss_info; size_t ss_info_len; + + /*! SM-RP-MR (see 3GPP TS 29.002, 7.6.1.1), Message Reference. + * Please note that there is no SM-RP-MR in TCAP/MAP! SM-RP-MR + * is usually mapped to TCAP's InvokeID, but we don't need it. */ + const uint8_t *sm_rp_mr; + /*! SM-RP-DA (see 3GPP TS 29.002, 7.6.8.1), Destination Address */ + enum osmo_gsup_sms_sm_rp_oda_t sm_rp_da_type; + size_t sm_rp_da_len; + const uint8_t *sm_rp_da; + /*! SM-RP-OA (see 3GPP TS 29.002, 7.6.8.2), Originating Address */ + enum osmo_gsup_sms_sm_rp_oda_t sm_rp_oa_type; + size_t sm_rp_oa_len; + const uint8_t *sm_rp_oa; + /*! SM-RP-UI (see 3GPP TS 29.002, 7.6.8.4), SMS TPDU */ + const uint8_t *sm_rp_ui; + size_t sm_rp_ui_len; + /*! SM-RP-Cause value (1 oct.) as per GSM TS 04.11, section 8.2.5.4 */ + const uint8_t *sm_rp_cause; + /*! SM-RP-MMS (More Messages to Send), section 7.6.8.7 */ + const uint8_t *sm_rp_mms; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/include/osmocom/gsm/gsup_sms.h b/include/osmocom/gsm/gsup_sms.h new file mode 100644 index 00000000..521412d6 --- /dev/null +++ b/include/osmocom/gsm/gsup_sms.h @@ -0,0 +1,38 @@ +#pragma once + +/*! \addtogroup gsup + * @{ + * + * This header defines SMS (Short Message Service) extensions for + * Osmocom GSUP (Generic Subscriber Update Protocol). The scope of + * this module is defined by 3GPP TS 29.002, section 12. + * + * \file gsup_sms.h + * SMS (Short Message Service) extensions for Osmocom GSUP. */ + +#include <stdint.h> + +/*! Possible identity types for SM-RP-{OA|DA} */ +enum osmo_gsup_sms_sm_rp_oda_t { + OSMO_GSUP_SMS_SM_RP_ODA_NONE = 0x00, + OSMO_GSUP_SMS_SM_RP_ODA_IMSI = 0x01, + OSMO_GSUP_SMS_SM_RP_ODA_MSISDN = 0x02, + OSMO_GSUP_SMS_SM_RP_ODA_SMSC_ADDR = 0x03, + /*! Special value for noSM-RP-DA and noSM-RP-OA */ + OSMO_GSUP_SMS_SM_RP_ODA_NULL = 0xff, +}; + +struct osmo_gsup_message; +struct msgb; + +int osmo_gsup_sms_encode_sm_rp_da(struct msgb *msg, + const struct osmo_gsup_message *gsup_msg); +int osmo_gsup_sms_decode_sm_rp_da(struct osmo_gsup_message *gsup_msg, + uint8_t *data, size_t data_len); + +int osmo_gsup_sms_encode_sm_rp_oa(struct msgb *msg, + const struct osmo_gsup_message *gsup_msg); +int osmo_gsup_sms_decode_sm_rp_oa(struct osmo_gsup_message *gsup_msg, + uint8_t *data, size_t data_len); + +/*! @} */ |