aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-02-01 11:35:10 +0100
committerOliver Smith <osmith@sysmocom.de>2019-02-11 13:51:30 +0100
commit428352b1902e248ebd08e04b30b53a3fdf88e3d4 (patch)
tree9d6e317508ab653e38a902f1b02b663872a2594d
parent6b4895ff53b0fe8880dadf7c8d759a63938bbb3e (diff)
GSUP: add inter-MSC handover related msgs and IEsosmith/gsup-msc-ho
Based on a draft created by Neels, which is the result of reading a MAP trace of two MSCs negotiating inter-MSC handovers, and of reading the TS 29.002, TS 29.010 and related specs: https://lists.osmocom.org/pipermail/openbsc/2019-January/012653.html I figured out that the "Handover Number" mentioned in the specifications is the same as the MSISDN IE that we already have, so we can use that instead of creating a new IE (example usage in tests/gsup/gsup_test.c). Related: OS#3774 Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db
-rw-r--r--include/osmocom/gsm/gsup.h54
-rw-r--r--src/gsm/gsup.c125
-rw-r--r--tests/gsup/gsup_test.c219
-rw-r--r--tests/gsup/gsup_test.err69
-rw-r--r--tests/gsup/gsup_test.ok26
5 files changed, 489 insertions, 4 deletions
diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h
index 29ea11aa..cdb7367d 100644
--- a/include/osmocom/gsm/gsup.h
+++ b/include/osmocom/gsm/gsup.h
@@ -42,7 +42,9 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/gsup_sms.h>
#include <osmocom/gsm/protocol/gsm_23_003.h>
+#include <osmocom/gsm/protocol/gsm_03_40.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
+#include <osmocom/gsm/protocol/gsm_08_08.h>
#include <osmocom/crypt/auth.h>
#define OSMO_GSUP_PORT 4222
@@ -102,6 +104,14 @@ enum osmo_gsup_iei {
OSMO_GSUP_IMEI_IE = 0x50,
OSMO_GSUP_IMEI_RESULT_IE = 0x51,
+ /* Inter-MSC handover related */
+ OSMO_GSUP_SOURCE_NAME_IE = 0x60,
+ OSMO_GSUP_DESTINATION_NAME_IE = 0x61,
+ OSMO_GSUP_AN_APDU_IE = 0x62,
+ OSMO_GSUP_CAUSE_RR_IE = 0x63,
+ OSMO_GSUP_CAUSE_BSSAP_IE = 0x64,
+ OSMO_GSUP_CAUSE_SM_IE = 0x65,
+
_OSMO_GSUP_IEI_END_MARKER
};
@@ -163,6 +173,24 @@ enum osmo_gsup_message_type {
OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST = 0b00110000,
OSMO_GSUP_MSGT_CHECK_IMEI_ERROR = 0b00110001,
OSMO_GSUP_MSGT_CHECK_IMEI_RESULT = 0b00110010,
+
+ OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST = 0b00110100,
+ OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR = 0b00110101,
+ OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT = 0b00110110,
+
+ OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST = 0b00111000,
+ OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR = 0b00111001,
+ OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT = 0b00111010,
+
+ OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST = 0b00111100,
+ OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR = 0b00111101,
+ OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT = 0b00111110,
+
+ OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST = 0b01000000,
+ OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST = 0b01000100,
+
+ OSMO_GSUP_MSGT_E_CLOSE = 0b01000111,
+ OSMO_GSUP_MSGT_E_ABORT = 0b01001011,
};
#define OSMO_GSUP_IS_MSGT_REQUEST(msgt) (((msgt) & 0b00000011) == 0b00)
@@ -189,6 +217,12 @@ enum osmo_gsup_imei_result {
OSMO_GSUP_IMEI_RESULT_NACK = 2, /* on wire: 1 */
};
+/* 3GPP 29.002 AccessNetworkProtocolId */
+enum osmo_gsup_access_network_protocol {
+ OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006 = 1,
+ OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413 = 2,
+};
+
/*! TCAP-like session state */
enum osmo_gsup_session_state {
/*! Undefined session state */
@@ -229,6 +263,12 @@ struct osmo_gsup_pdp_info {
size_t pdp_charg_enc_len;
};
+struct osmo_gsup_an_apdu {
+ enum osmo_gsup_access_network_protocol access_network_proto;
+ const void *data;
+ size_t data_len;
+};
+
/*! parsed/decoded GSUP protocol message */
struct osmo_gsup_message {
enum osmo_gsup_message_type message_type;
@@ -286,6 +326,20 @@ struct osmo_gsup_message {
const uint8_t *imei_enc;
size_t imei_enc_len;
enum osmo_gsup_imei_result imei_result;
+
+ const uint8_t *source_name;
+ size_t source_name_len;
+ const uint8_t *destination_name;
+ size_t destination_name_len;
+ struct osmo_gsup_an_apdu an_apdu;
+
+ uint8_t cause_rr; /* 0 is a valid cause */
+ bool cause_rr_set; /* indicate if cause_rr is set */
+
+ enum gsm0808_cause cause_bssap; /* 0 is a valid cause */
+ bool cause_bssap_set; /* indicate if cause_bssap is set */
+
+ enum gsm48_gsm_cause cause_sm;
};
int osmo_gsup_decode(const uint8_t *data, size_t data_len,
diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index a0893221..b3ca3842 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -83,6 +83,24 @@ const struct value_string osmo_gsup_message_type_names[] = {
OSMO_VALUE_STRING(OSMO_GSUP_MSGT_CHECK_IMEI_ERROR),
OSMO_VALUE_STRING(OSMO_GSUP_MSGT_CHECK_IMEI_RESULT),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT),
+
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT),
+
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT),
+
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST),
+
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_CLOSE),
+ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_ABORT),
+
{ 0, NULL }
};
@@ -247,6 +265,26 @@ parse_error:
return -1;
}
+/*! Decode AN-apdu (see 7.6.9.1).
+ * \param[out] gsup_msg abstract GSUP message structure
+ * \param[in] data pointer to the raw IE payload
+ * \param[in] data_len length of IE pointed by \ref data
+ * \returns 0 in case of success, negative in case of error
+ */
+int osmo_gsup_handover_decode_an_apdu(struct osmo_gsup_message *gsup_msg, const uint8_t *data, size_t data_len)
+{
+ if (data_len < 1) {
+ LOGP(DLGSUP, LOGL_ERROR, "Corrupted an_apdu message (length must be >= 1)\n");
+ return -EINVAL;
+ }
+
+ gsup_msg->an_apdu.access_network_proto = data[0];
+ gsup_msg->an_apdu.data_len = data_len -1;
+ gsup_msg->an_apdu.data = data + 1;
+
+ return 0;
+}
+
/*! Decode (parse) a GSUP message
* \param[in] const_data input data to be parsed
* \param[in] data_len length of input (\a const_data)
@@ -477,6 +515,37 @@ int osmo_gsup_decode(const uint8_t *const_data, size_t data_len,
gsup_msg->imei_result = osmo_decode_big_endian(value, value_len) + 1;
break;
+ case OSMO_GSUP_SOURCE_NAME_IE:
+ gsup_msg->source_name = value;
+ gsup_msg->source_name_len = value_len;
+ break;
+
+ case OSMO_GSUP_DESTINATION_NAME_IE:
+ gsup_msg->destination_name = value;
+ gsup_msg->destination_name_len = value_len;
+ break;
+
+ case OSMO_GSUP_AN_APDU_IE:
+ rc = osmo_gsup_handover_decode_an_apdu(gsup_msg, value, value_len);
+ if (rc)
+ return rc;
+ break;
+
+ case OSMO_GSUP_CAUSE_RR_IE:
+ gsup_msg->cause_rr = osmo_decode_big_endian(value, value_len);
+ gsup_msg->cause_rr_set = true;
+ break;
+
+ case OSMO_GSUP_CAUSE_BSSAP_IE:
+ gsup_msg->cause_bssap = osmo_decode_big_endian(value, value_len);
+ gsup_msg->cause_bssap_set = true;
+ break;
+
+ case OSMO_GSUP_CAUSE_SM_IE:
+ gsup_msg->cause_sm = osmo_decode_big_endian(value, value_len);
+ break;
+
+
default:
LOGP(DLGSUP, LOGL_NOTICE,
"GSUP IE type %d unknown\n", iei);
@@ -564,6 +633,33 @@ static void encode_auth_info(struct msgb *msg, enum osmo_gsup_iei iei,
*len_field = msgb_length(msg) - old_len;
}
+/*! Encode AN-apdu (see 7.6.9.1).
+ * \param[out] msg target message buffer (caller-allocated)
+ * \param[in] gsup_msg abstract GSUP message structure
+ * \returns 0 in case of success, negative in case of error
+ */
+int osmo_gsup_handover_encode_an_apdu(struct msgb *msg, const struct osmo_gsup_message *gsup_msg)
+{
+ const struct osmo_gsup_an_apdu an_apdu = gsup_msg->an_apdu;
+
+ if (msgb_tailroom(msg) < 2 + an_apdu.data_len) {
+ LOGP(DLGSUP, LOGL_ERROR, "Not enough tailroom in msg to encode an_apdu\n");
+ return -ENOMEM;
+ }
+
+ /* Tag and total length */
+ msgb_tv_put(msg, OSMO_GSUP_AN_APDU_IE, 1 + an_apdu.data_len);
+
+ /* Put access_network_proto */
+ msgb_v_put(msg, an_apdu.access_network_proto);
+
+ /* Put data */
+ uint8_t *buf = msgb_put(msg, an_apdu.data_len);
+ memcpy(buf, an_apdu.data, an_apdu.data_len);
+
+ return 0;
+}
+
/*! Encode a GSUP message
* \param[out] msg message buffer to which encoded message is written
* \param[in] gsup_msg \ref osmo_gsup_message data to be encoded
@@ -718,6 +814,35 @@ int osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg)
msgb_tlv_put(msg, OSMO_GSUP_IMEI_RESULT_IE, sizeof(u8), &u8);
}
+ if (gsup_msg->source_name)
+ msgb_tlv_put(msg, OSMO_GSUP_SOURCE_NAME_IE, gsup_msg->source_name_len, gsup_msg->source_name);
+
+ if (gsup_msg->destination_name)
+ msgb_tlv_put(msg, OSMO_GSUP_DESTINATION_NAME_IE, gsup_msg->destination_name_len,
+ gsup_msg->destination_name);
+
+ if (gsup_msg->an_apdu.access_network_proto || gsup_msg->an_apdu.data_len) {
+ rc = osmo_gsup_handover_encode_an_apdu(msg, gsup_msg);
+ if (rc) {
+ LOGP(DLGSUP, LOGL_ERROR, "Failed to encode AN-apdu IE \n");
+ return -EINVAL;
+ }
+ }
+
+ if (gsup_msg->cause_rr_set) {
+ u8 = gsup_msg->cause_rr;
+ msgb_tlv_put(msg, OSMO_GSUP_CAUSE_RR_IE, sizeof(u8), &u8);
+ }
+
+ if (gsup_msg->cause_bssap_set) {
+ u8 = gsup_msg->cause_bssap;
+ msgb_tlv_put(msg, OSMO_GSUP_CAUSE_BSSAP_IE, sizeof(u8), &u8);
+ }
+
+ if ((u8 = gsup_msg->cause_sm))
+ msgb_tlv_put(msg, OSMO_GSUP_CAUSE_SM_IE, sizeof(u8), &u8);
+
+
return 0;
}
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index 4ad7431e..85fa61b0 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -9,8 +9,14 @@
/* Tests for osmo_gsup_messages.c */
+/* Complete IEs used multiple times (sorted alphabetically)
+ * 1st byte: IEI from osmo_gsup_iei, 2nd byte: length */
+#define TEST_AN_APDU_IE 0x62, 0x05, 0x01, 0x42, 0x42, 0x42, 0x42
+#define TEST_DESTINATION_NAME_IE 0x61, 0x05, 'M', 'S', 'C', '-', 'B'
#define TEST_IMSI_IE 0x01, 0x08, 0x21, 0x43, 0x65, 0x87, 0x09, 0x21, 0x43, 0xf5
#define TEST_IMSI_STR "123456789012345"
+#define TEST_MSISDN_IE 0x08, 0x07, 0x91, 0x94, 0x61, 0x46, 0x32, 0x24, 0x43
+#define TEST_SOURCE_NAME_IE 0x60, 0x05, 'M', 'S', 'C', '-', 'A'
static void test_gsup_messages_dec_enc(void)
{
@@ -64,8 +70,7 @@ static void test_gsup_messages_dec_enc(void)
static const uint8_t update_location_res[] = {
0x06,
TEST_IMSI_IE,
- 0x08, 0x07, /* MSISDN of the subscriber */
- 0x91, 0x94, 0x61, 0x46, 0x32, 0x24, 0x43,
+ TEST_MSISDN_IE,
0x09, 0x07, /* HLR-Number of the subscriber */
0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93,
0x04, 0x00, /* PDP info complete */
@@ -310,6 +315,190 @@ static void test_gsup_messages_dec_enc(void)
0x00, /* OSMO_GSUP_IMEI_RESULT_ACK */
};
+ /* Handover related test messages. Oftentimes they only differ in the
+ * AN_APDU_IE, which is mostly a blob in GSUP. To give a better example
+ * of how the messages can be used, I've added the information an_apdu
+ * holds in brackets (see osmo-msc.git's doc/interMSC_HO_GSUP_msgs.txt).
+ * The session states are from the ASCII art in this e-mail:
+ * https://lists.osmocom.org/pipermail/openbsc/2019-January/012653.html */
+ static const uint8_t send_e_prepare_handover_req[] = {
+ 0x34, /* OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (begin) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x01,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (Handover Request) */
+ };
+
+ static const uint8_t send_e_prepare_handover_err[] = {
+ 0x35, /* OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (continue) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x02,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+
+ /* cause_bssap */
+ 0x64, 0x01,
+ 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */
+ };
+
+ static const uint8_t send_e_prepare_handover_res[] = {
+ 0x36, /* OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT */
+ TEST_IMSI_IE,
+ TEST_MSISDN_IE, /* (Handover Number) */
+
+ /* Session ID and state (continue) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x02,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (Handover Request Ack) */
+ };
+
+ static const uint8_t send_e_prepare_subsequent_handover_req[] = {
+ 0x38, /* OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (begin) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x01,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (Handover Required) */
+ };
+
+ static const uint8_t send_e_prepare_subsequent_handover_err[] = {
+ 0x39, /* OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (continue) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x02,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+
+ /* cause_bssap */
+ 0x64, 0x01,
+ 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */
+ };
+
+ static const uint8_t send_e_prepare_subsequent_handover_res[] = {
+ 0x3A, /* OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (continue) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x02,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (Handover Request Ack) */
+ };
+
+ static const uint8_t send_e_send_end_signal_req[] = {
+ 0x3C, /* OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (end) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x03,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (Handover Complete) */
+ };
+
+ static const uint8_t send_e_send_end_signal_err[] = {
+ 0x3D, /* OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (continue) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x02,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+
+ /* cause_bssap */
+ 0x64, 0x01,
+ 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */
+ };
+
+ static const uint8_t send_e_process_access_signalling_req[] = {
+ 0x40, /* OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (continue) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x02,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (Handover Detect) */
+ };
+
+ static const uint8_t send_e_send_end_signal_res[] = {
+ 0x3E, /* OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (end) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x03,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (Handover Complete) */
+ };
+
+ static const uint8_t send_e_forward_access_signalling_req [] = {
+ 0x44, /* OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (continue) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x02,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ TEST_AN_APDU_IE, /* (DTAP, e.g. CC, SMS, ...) */
+ };
+
+ static const uint8_t send_e_close[] = {
+ 0x47, /* OSMO_GSUP_MSGT_E_CLOSE */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (end) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x03,
+
+ TEST_SOURCE_NAME_IE,
+ TEST_DESTINATION_NAME_IE,
+ };
+
+ static const uint8_t send_e_abort[] = {
+ 0x4B, /* OSMO_GSUP_MSGT_E_ABORT */
+ TEST_IMSI_IE,
+
+ /* Session ID and state (end) */
+ 0x30, 0x04, 0xd3, 0xad, 0xbe, 0xef,
+ 0x31, 0x01, 0x03,
+
+ /* cause_bssap */
+ 0x64, 0x01,
+ 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */
+ };
+
static const struct test {
char *name;
const uint8_t *data;
@@ -365,6 +554,32 @@ static void test_gsup_messages_dec_enc(void)
send_check_imei_err, sizeof(send_check_imei_err)},
{"Check IMEI Result",
send_check_imei_res, sizeof(send_check_imei_res)},
+ {"E Prepare Handover Request",
+ send_e_prepare_handover_req, sizeof(send_e_prepare_handover_req)},
+ {"E Prepare Handover Error",
+ send_e_prepare_handover_err, sizeof(send_e_prepare_handover_err)},
+ {"E Prepare Handover Result",
+ send_e_prepare_handover_res, sizeof(send_e_prepare_handover_res)},
+ {"E Prepare Subsequent Handover Request",
+ send_e_prepare_subsequent_handover_req, sizeof(send_e_prepare_subsequent_handover_req)},
+ {"E Prepare Subsequent Handover Error",
+ send_e_prepare_subsequent_handover_err, sizeof(send_e_prepare_subsequent_handover_err)},
+ {"E Prepare Subsequent Handover Result",
+ send_e_prepare_subsequent_handover_res, sizeof(send_e_prepare_subsequent_handover_res)},
+ {"E Send End Signal Request",
+ send_e_send_end_signal_req, sizeof(send_e_send_end_signal_req)},
+ {"E Send End Signal Error",
+ send_e_send_end_signal_err, sizeof(send_e_send_end_signal_err)},
+ {"E Send End Signal Result",
+ send_e_send_end_signal_res, sizeof(send_e_send_end_signal_res)},
+ {"E Process Access Signalling Request",
+ send_e_process_access_signalling_req, sizeof(send_e_process_access_signalling_req)},
+ {"E Forward Access Signalling Request",
+ send_e_forward_access_signalling_req, sizeof(send_e_forward_access_signalling_req)},
+ {"E Close",
+ send_e_close, sizeof(send_e_close)},
+ {"E Abort",
+ send_e_abort, sizeof(send_e_abort)},
};
printf("Test GSUP message decoding/encoding\n");
diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err
index 225735e9..4802dfbd 100644
--- a/tests/gsup/gsup_test.err
+++ b/tests/gsup/gsup_test.err
@@ -73,6 +73,45 @@
generated message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00
original message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00
IMSI: 123456789012345
+ generated message: 34 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 01 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 34 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 01 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 35 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51
+ original message: 35 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51
+ IMSI: 123456789012345
+ generated message: 36 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 36 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 38 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 01 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 38 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 01 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 39 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51
+ original message: 39 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51
+ IMSI: 123456789012345
+ generated message: 3a 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 3a 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 3c 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 3c 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 3d 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51
+ original message: 3d 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51
+ IMSI: 123456789012345
+ generated message: 3e 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 3e 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 40 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 40 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 44 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ original message: 44 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 02 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42
+ IMSI: 123456789012345
+ generated message: 47 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42
+ original message: 47 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42
+ IMSI: 123456789012345
+ generated message: 4b 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 64 01 51
+ original message: 4b 01 08 21 43 65 87 09 21 43 f5 30 04 d3 ad be ef 31 01 03 64 01 51
+ IMSI: 123456789012345
message 0: tested 11 truncations, 11 parse failures
message 1: tested 14 truncations, 13 parse failures
message 2: tested 83 truncations, 81 parse failures
@@ -98,19 +137,32 @@
message 22: tested 22 truncations, 21 parse failures
message 23: tested 14 truncations, 13 parse failures
message 24: tested 14 truncations, 13 parse failures
+ message 25: tested 41 truncations, 36 parse failures
+ message 26: tested 37 truncations, 32 parse failures
+ message 27: tested 50 truncations, 44 parse failures
+ message 28: tested 41 truncations, 36 parse failures
+ message 29: tested 37 truncations, 32 parse failures
+ message 30: tested 41 truncations, 36 parse failures
+ message 31: tested 41 truncations, 36 parse failures
+ message 32: tested 37 truncations, 32 parse failures
+ message 33: tested 41 truncations, 36 parse failures
+ message 34: tested 41 truncations, 36 parse failures
+ message 35: tested 41 truncations, 36 parse failures
+ message 36: tested 34 truncations, 30 parse failures
+ message 37: tested 23 truncations, 20 parse failures
DLGSUP Stopping DLGSUP logging
message 0: tested 2816 modifications, 510 parse failures
message 1: tested 3584 modifications, 770 parse failures
message 2: tested 21248 modifications, 2575 parse failures
message 3: tested 2816 modifications, 510 parse failures
message 4: tested 3584 modifications, 770 parse failures
- message 5: tested 20736 modifications, 4022 parse failures
+ message 5: tested 20736 modifications, 4023 parse failures
message 6: tested 3584 modifications, 771 parse failures
message 7: tested 3584 modifications, 770 parse failures
message 8: tested 2816 modifications, 510 parse failures
message 9: tested 2816 modifications, 510 parse failures
message 10: tested 3584 modifications, 770 parse failures
- message 11: tested 3328 modifications, 769 parse failures
+ message 11: tested 3328 modifications, 770 parse failures
message 12: tested 54016 modifications, 4626 parse failures
message 13: tested 11520 modifications, 1026 parse failures
message 14: tested 5120 modifications, 1030 parse failures
@@ -124,3 +176,16 @@ DLGSUP Stopping DLGSUP logging
message 22: tested 5632 modifications, 771 parse failures
message 23: tested 3584 modifications, 770 parse failures
message 24: tested 3584 modifications, 771 parse failures
+ message 25: tested 10496 modifications, 1802 parse failures
+ message 26: tested 9472 modifications, 1804 parse failures
+ message 27: tested 12800 modifications, 2058 parse failures
+ message 28: tested 10496 modifications, 1802 parse failures
+ message 29: tested 9472 modifications, 1804 parse failures
+ message 30: tested 10496 modifications, 1802 parse failures
+ message 31: tested 10496 modifications, 1802 parse failures
+ message 32: tested 9472 modifications, 1804 parse failures
+ message 33: tested 10496 modifications, 1802 parse failures
+ message 34: tested 10496 modifications, 1802 parse failures
+ message 35: tested 10496 modifications, 1802 parse failures
+ message 36: tested 8704 modifications, 1547 parse failures
+ message 37: tested 5888 modifications, 1288 parse failures
diff --git a/tests/gsup/gsup_test.ok b/tests/gsup/gsup_test.ok
index 70f723c0..24fa5548 100644
--- a/tests/gsup/gsup_test.ok
+++ b/tests/gsup/gsup_test.ok
@@ -49,4 +49,30 @@ Test GSUP message decoding/encoding
Check IMEI Error OK
Testing Check IMEI Result
Check IMEI Result OK
+ Testing E Prepare Handover Request
+ E Prepare Handover Request OK
+ Testing E Prepare Handover Error
+ E Prepare Handover Error OK
+ Testing E Prepare Handover Result
+ E Prepare Handover Result OK
+ Testing E Prepare Subsequent Handover Request
+ E Prepare Subsequent Handover Request OK
+ Testing E Prepare Subsequent Handover Error
+ E Prepare Subsequent Handover Error OK
+ Testing E Prepare Subsequent Handover Result
+ E Prepare Subsequent Handover Result OK
+ Testing E Send End Signal Request
+ E Send End Signal Request OK
+ Testing E Send End Signal Error
+ E Send End Signal Error OK
+ Testing E Send End Signal Result
+ E Send End Signal Result OK
+ Testing E Process Access Signalling Request
+ E Process Access Signalling Request OK
+ Testing E Forward Access Signalling Request
+ E Forward Access Signalling Request OK
+ Testing E Close
+ E Close OK
+ Testing E Abort
+ E Abort OK
Done.