diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-04-16 20:04:35 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-05-19 07:26:28 +0000 |
commit | 4dc95597284972b8c862f63121b91d177569b3a4 (patch) | |
tree | 7bfc11816dbecdf91421c88985f04ced3dd4fa2d /src/osmo-bsc/osmo_bsc_sigtran.c | |
parent | a94907ec062067845797775172ad7a973e93c7a0 (diff) |
bssap: Announce Osmux support on RESET (ACK) send
Related: OS#2551
Depends on: libosmocore I28f83e2e32b9533c99e65ccc1562900ac2aec74e
Change-Id: I6b5b475b6109a2882051445762e27046d015b770
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_sigtran.c')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_sigtran.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index f2a6d08d7..5d61c3205 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -82,6 +82,14 @@ static int pick_free_conn_id(const struct bsc_msc_data *msc) return -1; } +/* Patch regular BSSMAP RESET to add extra T to announce Osmux support (osmocom extension) */ +static void _gsm0808_extend_announce_osmux(struct msgb *msg) +{ + OSMO_ASSERT(msg->l3h[1] == msgb_l3len(msg) - 2); /*TL not in len */ + msgb_put_u8(msg, GSM0808_IE_OSMO_OSMUX_SUPPORT); + msg->l3h[1] = msgb_l3len(msg) - 2; +} + /* Send reset to MSC */ static void osmo_bsc_sigtran_tx_reset(const struct bsc_msc_data *msc) { @@ -92,6 +100,10 @@ static void osmo_bsc_sigtran_tx_reset(const struct bsc_msc_data *msc) OSMO_ASSERT(ss7); LOGP(DMSC, LOGL_NOTICE, "Sending RESET to MSC: %s\n", osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); msg = gsm0808_create_reset(); + + if (msc->use_osmux != OSMUX_USAGE_OFF) + _gsm0808_extend_announce_osmux(msg); + osmo_sccp_tx_unitdata_msg(msc->a.sccp_user, &msc->a.bsc_addr, &msc->a.msc_addr, msg); } @@ -107,6 +119,10 @@ void osmo_bsc_sigtran_tx_reset_ack(const struct bsc_msc_data *msc) OSMO_ASSERT(ss7); LOGP(DMSC, LOGL_NOTICE, "Sending RESET ACK to MSC: %s\n", osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); msg = gsm0808_create_reset_ack(); + + if (msc->use_osmux != OSMUX_USAGE_OFF) + _gsm0808_extend_announce_osmux(msg); + osmo_sccp_tx_unitdata_msg(msc->a.sccp_user, &msc->a.bsc_addr, &msc->a.msc_addr, msg); } |