aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/gsm_data.h5
-rw-r--r--openbsc/include/openbsc/iu.h5
-rw-r--r--openbsc/include/openbsc/sgsn.h5
-rw-r--r--openbsc/src/gprs/gprs_gmm.c4
-rw-r--r--openbsc/src/gprs/gprs_sgsn.c1
-rw-r--r--openbsc/src/gprs/sgsn_vty.c10
-rw-r--r--openbsc/src/libiu/iu_vty.c55
-rw-r--r--openbsc/src/libmsc/iucs.c1
-rw-r--r--openbsc/src/libmsc/msc_vty.c5
-rw-r--r--openbsc/src/osmo-msc/Makefile.am2
10 files changed, 88 insertions, 5 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 223c868fe..623d940b9 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -13,6 +13,7 @@
#include <osmocom/crypt/auth.h>
+#include <openbsc/common.h>
#include <openbsc/rest_octets.h>
#include <openbsc/common_cs.h>
#include <openbsc/mgcpgw_client.h>
@@ -467,6 +468,10 @@ struct gsm_network {
struct mgcpgw_client_conf conf;
struct mgcpgw_client *client;
} mgcpgw;
+
+ struct {
+ enum nsap_addr_enc rab_assign_addr_enc;
+ } iu;
};
struct osmo_esme;
diff --git a/openbsc/include/openbsc/iu.h b/openbsc/include/openbsc/iu.h
index a82d53066..0ef2f82f6 100644
--- a/openbsc/include/openbsc/iu.h
+++ b/openbsc/include/openbsc/iu.h
@@ -6,6 +6,8 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/gsm48.h>
+#include <openbsc/common.h>
+
struct sgsn_pdp_ctx;
struct msgb;
struct osmo_sccp_link;
@@ -72,4 +74,5 @@ int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp,
int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi);
int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause);
-void iu_vty_init(void);
+void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc);
+int iu_vty_config_write(struct vty *vty, const char *indent);
diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h
index 1ed1583ed..57b2978ff 100644
--- a/openbsc/include/openbsc/sgsn.h
+++ b/openbsc/include/openbsc/sgsn.h
@@ -7,6 +7,7 @@
#include <osmocom/gprs/gprs_ns.h>
#include <openbsc/gprs_sgsn.h>
#include <openbsc/oap_client.h>
+#include <openbsc/common.h>
#include <ares.h>
@@ -109,6 +110,10 @@ struct sgsn_config {
int p1;
int p2;
} dcomp_v42bis;
+
+ struct {
+ enum nsap_addr_enc rab_assign_addr_enc;
+ } iu;
};
struct sgsn_instance {
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index cedd2da70..3350768db 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -297,6 +297,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 */
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c
index 5d9af7807..b4b5cebeb 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/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/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index 338e8049c..b6b827b14 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/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,8 @@ static int config_write_sgsn(struct vty *vty)
} else
vty_out(vty, " no compression v42bis%s", VTY_NEWLINE);
+ iu_vty_config_write(vty, " ");
+
return CMD_SUCCESS;
}
@@ -1285,7 +1293,7 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd);
#ifdef BUILD_IU
- iu_vty_init();
+ iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);
#endif
return 0;
}
diff --git a/openbsc/src/libiu/iu_vty.c b/openbsc/src/libiu/iu_vty.c
index cfa02ea6c..73ad126ba 100644
--- a/openbsc/src/libiu/iu_vty.c
+++ b/openbsc/src/libiu/iu_vty.c
@@ -18,12 +18,16 @@
*/
#include <stdlib.h>
+#include <string.h>
+#include <osmocom/core/logging.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/logging.h>
#include <openbsc/iu.h>
+static enum nsap_addr_enc *g_rab_assign_addr_enc = NULL;
+
DEFUN(logging_asn_debug,
logging_asn_debug_cmd,
"logging asn1-debug (1|0)",
@@ -48,8 +52,57 @@ DEFUN(logging_asn_xer_print,
return CMD_SUCCESS;
}
-void iu_vty_init(void)
+DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd,
+ "iu rab-assign-addr-enc (x213|v4raw)",
+ "Iu interface protocol options\n"
+ "Choose RAB Assignment's Transport Layer Address encoding\n"
+ "ITU-T X.213 compliant address encoding (default)\n"
+ "32bit length raw IPv4 address (for ip.access nano3G)\n")
{
+ if (!g_rab_assign_addr_enc) {
+ vty_out(vty, "%%RAB Assignment Transport Layer Address"
+ " encoding not available%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ if (strcmp(argv[0], "v4raw") == 0)
+ *g_rab_assign_addr_enc = NSAP_ADDR_ENC_V4RAW;
+ else
+ *g_rab_assign_addr_enc = NSAP_ADDR_ENC_X213;
+ return CMD_SUCCESS;
+}
+
+int iu_vty_config_write(struct vty *vty, const char *indent)
+{
+ if (!g_rab_assign_addr_enc) {
+ vty_out(vty, "%%RAB Assignment Transport Layer Address"
+ " encoding not available%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ switch (*g_rab_assign_addr_enc) {
+ case NSAP_ADDR_ENC_V4RAW:
+ vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent,
+ VTY_NEWLINE);
+ break;
+ case NSAP_ADDR_ENC_X213:
+ /* default value, no need to write anything */
+ break;
+ default:
+ LOGP(0, LOGL_ERROR, "Invalid value for"
+ " net.iu.rab_assign_addr_enc: %d\n",
+ *g_rab_assign_addr_enc);
+ return CMD_WARNING;
+ }
+
+ return CMD_SUCCESS;
+}
+
+void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc)
+{
+ g_rab_assign_addr_enc = rab_assign_addr_enc;
+
install_element(CFG_LOG_NODE, &logging_asn_debug_cmd);
install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd);
+ install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd);
}
diff --git a/openbsc/src/libmsc/iucs.c b/openbsc/src/libmsc/iucs.c
index 3caaf07fb..469d3e0a7 100644
--- a/openbsc/src/libmsc/iucs.c
+++ b/openbsc/src/libmsc/iucs.c
@@ -50,6 +50,7 @@ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_netw
conn->network = network;
conn->via_ran = RAN_UTRAN_IU;
conn->iu.ue_ctx = ue;
+ conn->iu.ue_ctx->rab_assign_addr_enc = network->iu.rab_assign_addr_enc;
conn->lac = lac;
llist_add_tail(&conn->entry, &network->subscr_conns);
diff --git a/openbsc/src/libmsc/msc_vty.c b/openbsc/src/libmsc/msc_vty.c
index 0eb6efa3e..b6fff56af 100644
--- a/openbsc/src/libmsc/msc_vty.c
+++ b/openbsc/src/libmsc/msc_vty.c
@@ -26,11 +26,12 @@
#include <inttypes.h>
#include <osmocom/vty/command.h>
-#include <openbsc/vty.h>
+#include <openbsc/vty.h>
#include <openbsc/gsm_data.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/vlr.h>
+#include <openbsc/iu.h>
static struct cmd_node msc_node = {
MSC_NODE,
@@ -124,6 +125,7 @@ static int config_write_msc(struct vty *vty)
gsmnet->vlr->cfg.assign_tmsi? "" : "no ", VTY_NEWLINE);
mgcpgw_client_config_write(vty, " ");
+ iu_vty_config_write(vty, " ");
return CMD_SUCCESS;
}
@@ -175,4 +177,5 @@ void msc_vty_init(struct gsm_network *msc_network)
install_element(MSC_NODE, &cfg_msc_assign_tmsi_cmd);
install_element(MSC_NODE, &cfg_msc_no_assign_tmsi_cmd);
mgcpgw_client_vty_init(MSC_NODE, &msc_network->mgcpgw.conf);
+ iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc);
}
diff --git a/openbsc/src/osmo-msc/Makefile.am b/openbsc/src/osmo-msc/Makefile.am
index d3191424e..a606b58f6 100644
--- a/openbsc/src/osmo-msc/Makefile.am
+++ b/openbsc/src/osmo-msc/Makefile.am
@@ -37,10 +37,10 @@ osmo_msc_SOURCES = \
$(NULL)
osmo_msc_LDADD = \
- $(top_builddir)/src/libiu/libiu.a \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libvlr/libvlr.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
+ $(top_builddir)/src/libiu/libiu.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a \
$(top_builddir)/src/libmgcp/libmgcp.a \