From 1ad6a2e515bbc3a73a283eb104feb899086a24a3 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 12 Oct 2016 02:55:31 +0200 Subject: IuCS, IuPS: move flag to use X.213 NSAP addr into ue_conn_ctx The future perspective is to remember the preferred RAB Transport Layer Address encoding for each 3G cell that is connected, so store per UE conn instead of globally hardcoding. Add rab_assign_addr_enc member to ue_conn_ctx. Thus the iu_rab_act_cs() and iu_rab_act_ps() functions no longer need the explicit use_x213_nsap argument. Add include/openbsc/common.h in order to define the enum nsap_addr_enc, in a separate file to be able to easily include it in all of libmsc, libiu and gprs/* without creating include cycles. Set the rab_assign_addr_enc when an MM ctx is created for iu, and whenever the ue_conn_ctx for an Iu MM ctx is updated. This looks a bit clumsy so far, the hope is that there will be a nice way to setup the ue_conn_ctx prior to that. Change-Id: I49bb5736df7bdfdd55d3e7b74ee559595cfd2f7d --- openbsc/src/libmsc/msc_ifaces.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'openbsc/src/libmsc/msc_ifaces.c') diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c index 412177566..ea68af9cb 100644 --- a/openbsc/src/libmsc/msc_ifaces.c +++ b/openbsc/src/libmsc/msc_ifaces.c @@ -111,10 +111,12 @@ int msc_tx_common_id(struct gsm_subscriber_connection *conn) #ifdef BUILD_IU static int iu_rab_act_cs(struct ue_conn_ctx *uectx, uint8_t rab_id, - uint32_t rtp_ip, uint16_t rtp_port, - bool use_x213_nsap) + uint32_t rtp_ip, uint16_t rtp_port) { struct msgb *msg; + bool use_x213_nsap; + + use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: rab_id=%d, rtp=%x:%u," " use_x213_nsap=%d\n", rab_id, rtp_ip, rtp_port, use_x213_nsap); @@ -154,7 +156,7 @@ static int conn_iu_rab_act_cs(struct gsm_trans *trans) mgcpgw_client_remote_addr_n(conn->network->mgcpgw.client); return iu_rab_act_cs(uectx, conn->iu.rab_id, rtp_ip, - conn->iu.mgcp_rtp_port_ue, 1); + conn->iu.mgcp_rtp_port_ue); /* use_x213_nsap == 0 for ip.access nano3G */ } #endif -- cgit v1.2.3