aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msc_vlr/msc_vlr_tests.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-04-09 12:32:51 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-29 12:51:18 +0000
commitfbf6610dc1778f87d75d59af3e6eda1eb1f3295c (patch)
tree255ca59294c1d43c4d4a1dd431e8a86e29a0ab3f /tests/msc_vlr/msc_vlr_tests.c
parent09e2c9f07db7935623d097ffff7a5b3a152f7902 (diff)
Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)
This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
Diffstat (limited to 'tests/msc_vlr/msc_vlr_tests.c')
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 6da34aed6..a45b10fbb 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -59,6 +59,11 @@ const char *auth_request_expect_autn;
bool cipher_mode_cmd_sent;
bool cipher_mode_cmd_sent_with_imeisv;
+bool iu_release_expected = false;
+bool iu_release_sent = false;
+bool bssap_clear_expected = false;
+bool bssap_clear_sent = false;
+
struct msgb *msgb_from_hex(const char *label, uint16_t size, const char *hex)
{
struct msgb *msg = msgb_alloc(size, label);
@@ -149,7 +154,6 @@ struct gsm_subscriber_connection *conn_new(void)
if (conn->via_ran == RAN_UTRAN_IU) {
struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx);
*ue_ctx = (struct ue_conn_ctx){
- .link = (void*)0x23,
.conn_id = 42,
};
conn->iu.ue_ctx = ue_ctx;
@@ -298,9 +302,9 @@ int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac)
return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac);
}
-/* override, requires '-Wl,--wrap=a_page' */
-int __real_a_page(const char *imsi, uint32_t tmsi, uint16_t lac);
-int __wrap_a_page(const char *imsi, uint32_t tmsi, uint16_t lac)
+/* override, requires '-Wl,--wrap=a_iface_tx_paging' */
+int __real_a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac);
+int __wrap_a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac)
{
return _paging_sent(RAN_GERAN_A, imsi, tmsi, lac);
}
@@ -333,6 +337,11 @@ void clear_vlr()
next_rand_byte = 0;
+ iu_release_expected = false;
+ iu_release_sent = false;
+ bssap_clear_expected = false;
+ bssap_clear_sent = false;
+
osmo_gettimeofday_override = false;
}
@@ -475,6 +484,9 @@ int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *caus
int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause)
{
btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU));
+ OSMO_ASSERT(iu_release_expected);
+ iu_release_expected = false;
+ iu_release_sent = true;
return 0;
}
@@ -486,13 +498,24 @@ int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi)
return 0;
}
-/* override, requires '-Wl,--wrap=a_tx' */
-int __real_a_tx(struct msgb *msg, uint8_t sapi);
-int __wrap_a_tx(struct msgb *msg, uint8_t sapi)
+/* override, requires '-Wl,--wrap=a_iface_tx_dtap' */
+int __real_a_iface_tx_dtap(struct msgb *msg);
+int __wrap_a_iface_tx_dtap(struct msgb *msg)
{
return _validate_dtap(msg, RAN_GERAN_A);
}
+/* override, requires '-Wl,--wrap=a_iface_tx_clear_cmd' */
+int __real_a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn);
+int __wrap_a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn)
+{
+ btw("BSSAP Clear --%s--> MS", ran_type_name(RAN_GERAN_A));
+ OSMO_ASSERT(bssap_clear_expected);
+ bssap_clear_expected = false;
+ bssap_clear_sent = true;
+ return 0;
+}
+
static int fake_vlr_tx_lu_acc(void *msc_conn_ref, uint32_t send_tmsi)
{
struct gsm_subscriber_connection *conn = msc_conn_ref;