summaryrefslogtreecommitdiffstats
path: root/tests/gsup/gsup_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gsup/gsup_test.c')
-rw-r--r--tests/gsup/gsup_test.c73
1 files changed, 72 insertions, 1 deletions
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index 9712d77b..09368933 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -217,6 +217,69 @@ static void test_gsup_messages_dec_enc(void)
0x02, 0x01, 0x47,
};
+ static const uint8_t send_mo_forward_sm_req[] = {
+ 0x24, /* OSMO_GSUP_MSGT_MO_FORWARD_SM_REQUEST */
+ TEST_IMSI_IE,
+
+ /* SM related IEs */
+ 0x40, 0x01, /* SM-RP-MR (Message Reference) */
+ 0xfa,
+ 0x41, 0x08, /* SM-RP-DA (Destination Address) */
+ 0x03, /* SMSC address */
+ 0x91, 0x52, 0x75, 0x47, 0x99, 0x09, 0x82,
+ 0x42, 0x01, /* SM-RP-OA (Originating Address) */
+ 0xff, /* Special case: noSM-RP-OA */
+ 0x43, 0x04, /* SM-RP-UI (TPDU) */
+ 0xde, 0xad, 0xbe, 0xef,
+ };
+
+ static const uint8_t send_mt_forward_sm_req[] = {
+ 0x28, /* OSMO_GSUP_MSGT_MT_FORWARD_SM_REQUEST */
+ TEST_IMSI_IE,
+
+ /* SM related IEs */
+ 0x40, 0x01, /* SM-RP-MR (Message Reference) */
+ 0xfa,
+ 0x41, 0x09, /* SM-RP-DA (Destination Address) */
+ 0x01, /* IMSI */
+ 0x21, 0x43, 0x65, 0x87, 0x09, 0x21, 0x43, 0xf5,
+ 0x42, 0x08, /* SM-RP-OA (Originating Address) */
+ 0x03, /* SMSC address */
+ 0x91, 0x52, 0x75, 0x47, 0x99, 0x09, 0x82,
+ 0x43, 0x04, /* SM-RP-UI (TPDU) */
+ 0xde, 0xad, 0xbe, 0xef,
+ 0x45, 0x01, /* SM-RP-MMS (More Messages to Send) */
+ 0x01,
+ };
+
+ static const uint8_t send_mo_mt_forward_sm_err[] = {
+ 0x25, /* OSMO_GSUP_MSGT_MO_FORWARD_SM_ERROR */
+ TEST_IMSI_IE,
+
+ /* Session related IEs */
+ 0x30, 0x04, /* Session ID */
+ 0xde, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, /* Session state (END) */
+ 0x03,
+
+ /* SM related IEs */
+ 0x40, 0x01, /* SM-RP-MR (Message Reference) */
+ 0xfa,
+ 0x44, 0x01, /* SM-RP-Cause value */
+ 0xaf,
+ };
+
+ static const uint8_t send_mo_mt_forward_sm_rsp[] = {
+ 0x2a, /* OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT */
+ TEST_IMSI_IE,
+
+ /* SM related IEs */
+ 0x40, 0x01, /* SM-RP-MR (Message Reference) */
+ 0xfa,
+ 0x43, 0x04, /* SM-RP-UI (TPDU) */
+ 0xde, 0xad, 0xbe, 0xef,
+ };
+
static const struct test {
char *name;
const uint8_t *data;
@@ -256,6 +319,14 @@ static void test_gsup_messages_dec_enc(void)
send_ussd_req, sizeof(send_ussd_req)},
{"SS/USSD processUnstructuredSS-Request / ReturnResult",
send_ussd_res, sizeof(send_ussd_res)},
+ {"MO-ForwardSM (MSC -> SMSC) Request",
+ send_mo_forward_sm_req, sizeof(send_mo_forward_sm_req)},
+ {"MT-ForwardSM (MSC -> SMSC) Request",
+ send_mt_forward_sm_req, sizeof(send_mt_forward_sm_req)},
+ {"MO-/MT-ForwardSM Response",
+ send_mo_mt_forward_sm_rsp, sizeof(send_mo_mt_forward_sm_rsp)},
+ {"MO-/MT-ForwardSM Error",
+ send_mo_mt_forward_sm_err, sizeof(send_mo_mt_forward_sm_err)},
};
printf("Test GSUP message decoding/encoding\n");
@@ -323,7 +394,7 @@ static void test_gsup_messages_dec_enc(void)
* FIXME: share the maximal IE value somehow
* in order to avoid manual updating of this
*/
- OSMO_ASSERT(t->data[j+0] <= OSMO_GSUP_SS_INFO_IE);
+ OSMO_ASSERT(t->data[j+0] <= OSMO_GSUP_SM_RP_MMS_IE);
OSMO_ASSERT(t->data[j+1] <= ie_end - j - 2);
ie_end = j;