aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-07-05 15:19:52 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-12 23:42:47 +0200
commitb271e460490131f7d9c4873057b7ebe0826803b8 (patch)
tree47d48f4eb6ce2f47020e8ed0d36e446adc3be51d /src/gprs
parente97d8754cae116469a7c6fc6c24eb5836dc5245d (diff)
move libiu to osmo-iuh/libosmo-ranapaoip
Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
Diffstat (limited to 'src/gprs')
-rw-r--r--src/gprs/Makefile.am1
-rw-r--r--src/gprs/gprs_gmm.c34
-rw-r--r--src/gprs/gprs_sgsn.c2
-rw-r--r--src/gprs/sgsn_libgtp.c6
-rw-r--r--src/gprs/sgsn_main.c7
-rw-r--r--src/gprs/sgsn_vty.c6
6 files changed, 28 insertions, 28 deletions
diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am
index e05eb79ff..39a4c12a7 100644
--- a/src/gprs/Makefile.am
+++ b/src/gprs/Makefile.am
@@ -106,7 +106,6 @@ osmo_sgsn_LDADD = \
$(NULL)
if BUILD_IU
osmo_sgsn_LDADD += \
- $(top_builddir)/src/libiu/libiu.a \
$(LIBOSMOSIGTRAN_LIBS) \
$(LIBOSMORANAP_LIBS) \
$(LIBASN1C_LIBS) \
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index 56e8c4fc8..a07f7ea79 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -52,6 +52,7 @@
#ifdef BUILD_IU
#include <osmocom/ranap/ranap_ies_defs.h>
#include <osmocom/ranap/ranap_msg_factory.h>
+#include <osmocom/ranap/iu_client.h>
#endif
#include <openbsc/debug.h>
@@ -67,7 +68,6 @@
#include <openbsc/gprs_subscriber.h>
#include <openbsc/sgsn.h>
#include <openbsc/signal.h>
-#include <openbsc/iu.h>
#include <openbsc/gprs_sndcp.h>
#include <pdp.h>
@@ -174,7 +174,7 @@ void mmctx_set_mm_state(struct sgsn_mm_ctx *ctx, enum gprs_pmm_state state)
#ifdef BUILD_IU
int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies);
-int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data)
+int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data)
{
struct sgsn_mm_ctx *mm;
int rc = -1;
@@ -188,14 +188,14 @@ int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *
}
switch (type) {
- case IU_EVENT_RAB_ASSIGN:
+ case RANAP_IU_EVENT_RAB_ASSIGN:
REQUIRE_MM
rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
break;
- case IU_EVENT_IU_RELEASE:
+ case RANAP_IU_EVENT_IU_RELEASE:
/* fall thru */
- case IU_EVENT_LINK_INVALIDATED:
- /* Clean up ue_conn_ctx here */
+ case RANAP_IU_EVENT_LINK_INVALIDATED:
+ /* Clean up ranap_ue_conn_ctx here */
if (mm)
LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
else
@@ -205,7 +205,7 @@ int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *
mmctx_set_pmm_state(mm, PMM_IDLE);
rc = 0;
break;
- case IU_EVENT_SECURITY_MODE_COMPLETE:
+ case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE:
REQUIRE_MM
/* Continue authentication here */
mm->iu.ue_ctx->integrity_active = 1;
@@ -262,16 +262,16 @@ static int gsm48_gmm_sendmsg(struct msgb *msg, int command,
rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]);
#ifdef BUILD_IU
if (mm->ran_type == MM_CTX_T_UTRAN_Iu)
- return iu_tx(msg, GPRS_SAPI_GMM);
+ return ranap_iu_tx(msg, GPRS_SAPI_GMM);
#endif
}
#ifdef BUILD_IU
- /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode
+ /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode
* dst is empty. */
/* FIXME: have a more explicit indicator for Iu messages */
if (msg->dst)
- return iu_tx(msg, GPRS_SAPI_GMM);
+ return ranap_iu_tx(msg, GPRS_SAPI_GMM);
#endif
/* caller needs to provide TLLI, BVCI and NSEI */
@@ -1048,7 +1048,7 @@ static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx)
/* The MS is authorized */
#ifdef BUILD_IU
if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) {
- rc = iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet, 0, ctx->iu.new_key);
+ rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key);
ctx->iu.new_key = 0;
return rc;
}
@@ -1259,14 +1259,14 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
* with a foreign TLLI (P-TMSI that was allocated to the MS before),
* or with random TLLI. */
- /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode
+ /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode
* dst is empty. */
/* FIXME: have a more explicit indicator for Iu messages */
if (!msg->dst) {
/* Gb mode */
cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg));
} else
- ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id;
+ ra_id = ((struct ranap_ue_conn_ctx*)msg->dst)->ra_id;
/* MS network capability 10.5.5.12 */
msnc_len = *cur++;
@@ -1627,7 +1627,7 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
* is an optimization to avoid the RA reject (impl detached)
* below, which will cause a new attach cycle. */
/* Look-up the MM context based on old RA-ID and TLLI */
- /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb
+ /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb
* mode dst is empty. */
/* FIXME: have a more explicit indicator for Iu messages */
if (!msg->dst) {
@@ -2905,12 +2905,12 @@ 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;
+ struct ranap_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);
+ use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213);
/* Get the IP address for ggsn user plane */
memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l);
@@ -2923,6 +2923,6 @@ int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp)
msg = ranap_new_msg_rab_assign_data(rab_id, ggsn_ip,
pdp->lib->teid_gn, use_x213_nsap);
msg->l2h = msg->data;
- return iu_rab_act(uectx, msg);
+ return ranap_iu_rab_act(uectx, msg);
}
#endif
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 18625aefe..340fcb08d 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -30,6 +30,7 @@
#include <osmocom/gprs/gprs_ns.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
+#include <osmocom/ranap/iu_client.h>
#include <openbsc/gprs_subscriber.h>
#include <openbsc/debug.h>
@@ -39,7 +40,6 @@
#include <openbsc/gprs_utils.h>
#include <openbsc/signal.h>
#include "openbsc/gprs_llc.h"
-#include <openbsc/iu.h>
#include <pdp.h>
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index 7595bf83c..1da31d292 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -52,7 +52,7 @@
#include <openbsc/gprs_sndcp.h>
#ifdef BUILD_IU
-#include <openbsc/iu.h>
+#include <osmocom/ranap/iu_client.h>
#include <osmocom/ranap/ranap_ies_defs.h>
#endif
@@ -533,7 +533,7 @@ static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
} else {
#ifdef BUILD_IU
/* Deactivate radio bearer */
- iu_rab_deact(pctx->mm->iu.ue_ctx, 1);
+ ranap_iu_rab_deact(pctx->mm->iu.ue_ctx, 1);
#else
return -ENOTSUP;
#endif
@@ -672,7 +672,7 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
#ifdef BUILD_IU
/* Ignore the packet for now and page the UE to get the RAB
* reestablished */
- iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac);
+ ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac);
return 0;
#else
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 52c300cee..5af23321a 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -50,13 +50,14 @@
#include <osmocom/ctrl/control_vty.h>
+#include <osmocom/ranap/iu_client.h>
+
#include <openbsc/signal.h>
#include <openbsc/debug.h>
#include <openbsc/vty.h>
#include <openbsc/sgsn.h>
#include <openbsc/gprs_llc.h>
#include <openbsc/gprs_gmm.h>
-#include <openbsc/iu.h>
#include <osmocom/ctrl/control_if.h>
#include <osmocom/ctrl/ports.h>
@@ -318,7 +319,7 @@ static const struct log_info gprs_log_info = {
.num_cat = ARRAY_SIZE(gprs_categories),
};
-int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data);
+int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data);
int main(int argc, char **argv)
{
@@ -446,7 +447,7 @@ int main(int argc, char **argv)
return 8;
}
- iu_init(tall_bsc_ctx, sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event);
+ ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event);
#endif
if (daemonize) {
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 2ec200bd3..77eb32bb6 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -47,7 +47,7 @@
#include "../../bscconfig.h"
#ifdef BUILD_IU
-#include <openbsc/iu.h>
+#include <osmocom/ranap/iu_client.h>
#endif
static struct sgsn_config *g_cfg = NULL;
@@ -303,7 +303,7 @@ static int config_write_sgsn(struct vty *vty)
} else
vty_out(vty, " no compression v42bis%s", VTY_NEWLINE);
- iu_vty_config_write(vty, " ");
+ ranap_iu_vty_config_write(vty, " ");
return CMD_SUCCESS;
}
@@ -1294,7 +1294,7 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd);
#ifdef BUILD_IU
- iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);
+ ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);
#endif
return 0;
}