aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-20 21:59:55 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-27 03:52:44 +0200
commitc29505e1d15310ccdf651e213f9040e7977c7db3 (patch)
treec70fb6d07d4278b05a12f8843065e59eb443fa33 /src/gprs
parent66e5e3c328b59bfaac31b958ae1d48fe8bfa72c6 (diff)
Implement IuCS (large refactoring and addition)
osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
Diffstat (limited to 'src/gprs')
-rw-r--r--src/gprs/gprs_gmm.c10
-rw-r--r--src/gprs/gprs_sgsn.c1
-rw-r--r--src/gprs/sgsn_libgtp.c2
-rw-r--r--src/gprs/sgsn_main.c9
-rw-r--r--src/gprs/sgsn_vty.c14
5 files changed, 24 insertions, 12 deletions
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index 577af1bf3..15e2fedf6 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -295,6 +295,10 @@ static void msgid2mmctx(struct sgsn_mm_ctx *mm, const struct msgb *msg)
mm->gb.nsei = msgb_nsei(msg);
/* In case a Iu connection is reconnected we need to update the ue ctx */
mm->iu.ue_ctx = msg->dst;
+ if (mm->ran_type == MM_CTX_T_UTRAN_Iu
+ && mm->iu.ue_ctx)
+ mm->iu.ue_ctx->rab_assign_addr_enc =
+ sgsn->cfg.iu.rab_assign_addr_enc;
}
/* Store BVCI/NSEI in MM context */
@@ -978,7 +982,7 @@ void activate_pdp_rabs(struct sgsn_mm_ctx *ctx)
if (ctx->ran_type != MM_CTX_T_UTRAN_Iu)
return;
llist_for_each_entry(pdp, &ctx->pdp_list, list) {
- iu_rab_act_ps(pdp->nsapi, pdp, 1);
+ iu_rab_act_ps(pdp->nsapi, pdp);
}
}
#endif
@@ -2897,14 +2901,16 @@ int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli,
}
#ifdef BUILD_IU
-int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp, bool use_x213_nsap)
+int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp)
{
struct msgb *msg;
struct sgsn_mm_ctx *mm = pdp->mm;
struct ue_conn_ctx *uectx;
uint32_t ggsn_ip;
+ bool use_x213_nsap;
uectx = mm->iu.ue_ctx;
+ use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213);
/* Get the IP address for ggsn user plane */
memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l);
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 071dd97c8..18625aefe 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -247,6 +247,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx)
ctx->ran_type = MM_CTX_T_UTRAN_Iu;
ctx->iu.ue_ctx = uectx;
+ ctx->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc;
ctx->iu.new_key = 1;
ctx->gmm_state = GMM_DEREGISTERED;
ctx->pmm_state = PMM_DETACHED;
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index cd1093167..7595bf83c 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -407,7 +407,7 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
} else if (pctx->mm->ran_type == MM_CTX_T_UTRAN_Iu) {
#ifdef BUILD_IU
/* Activate a radio bearer */
- iu_rab_act_ps(pdp->nsapi, pctx, 1);
+ iu_rab_act_ps(pdp->nsapi, pctx);
return 0;
#else
return -ENOTSUP;
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index d871939e5..71cb18c96 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -319,12 +319,6 @@ static const struct log_info gprs_log_info = {
.num_cat = ARRAY_SIZE(gprs_categories),
};
-/* Implement the extern asn_debug from libasn1c to indicate whether the ASN.1
- * binary code decoded and encoded during Iu communication should be logged to
- * stderr. See osmocom's libasn1c, asn_internal.h, at "if (asn_debug)":
- * http://git.osmocom.org/libasn1c/tree/include/asn1c/asn_internal.h */
-int asn_debug = 0;
-
int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data);
int main(int argc, char **argv)
@@ -352,9 +346,6 @@ int main(int argc, char **argv)
osmo_stats_vty_add_cmds(&gprs_log_info);
sgsn_vty_init(&sgsn_inst.cfg);
ctrl_vty_init(tall_bsc_ctx);
-#ifdef BUILD_IU
- iu_vty_init(&asn_debug);
-#endif
handle_options(argc, argv);
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 1cefe37cf..888f53a13 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -44,6 +44,12 @@
#include <pdp.h>
+#include "../../bscconfig.h"
+
+#ifdef BUILD_IU
+#include <openbsc/iu.h>
+#endif
+
static struct sgsn_config *g_cfg = NULL;
const struct value_string sgsn_auth_pol_strs[] = {
@@ -297,6 +303,10 @@ static int config_write_sgsn(struct vty *vty)
} else
vty_out(vty, " no compression v42bis%s", VTY_NEWLINE);
+#ifdef BUILD_IU
+ iu_vty_config_write(vty, " ");
+#endif
+
return CMD_SUCCESS;
}
@@ -1284,6 +1294,10 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(SGSN_NODE, &cfg_no_comp_v42bis_cmd);
install_element(SGSN_NODE, &cfg_comp_v42bis_cmd);
install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd);
+
+#ifdef BUILD_IU
+ iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);
+#endif
return 0;
}