aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-05 15:07:25 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-03 16:19:07 +0100
commit195d2dc72423069d6192140a65b6fff76ace79fa (patch)
tree1739ef24fc363a16c928b6df42f7944bb66224ca
parent315abfd46b7de3923d8d111322f56aab88f7fd27 (diff)
migrate WIP osmo-iuh hack to use system-installed libosm-ranap.so
this means we no longer try to link to hard-coded files outside of the openbsc.git repository.
-rw-r--r--openbsc/configure.ac3
-rw-r--r--openbsc/include/openbsc/debug.h2
-rw-r--r--openbsc/src/gprs/Makefile.am17
-rw-r--r--openbsc/src/gprs/sgsn_iu.c22
-rw-r--r--openbsc/src/gprs/sgsn_main.c8
5 files changed, 26 insertions, 26 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 24dbc30f7..e9930f1b0 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -28,6 +28,9 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0)
PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4)
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1)
PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
+PKG_CHECK_MODULES(LIBASN1C, libasn1c)
+PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap)
+PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran)
# Enabke/disable the NAT?
AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h
index 189ca476e..6231a2c36 100644
--- a/openbsc/include/openbsc/debug.h
+++ b/openbsc/include/openbsc/debug.h
@@ -34,6 +34,8 @@ enum {
DSMPP,
DFILTER,
DGTPHUB,
+ DSUA,
+ DRANAP,
Debug_LastEntry,
};
diff --git a/openbsc/src/gprs/Makefile.am b/openbsc/src/gprs/Makefile.am
index 6a02fb9da..4549547f0 100644
--- a/openbsc/src/gprs/Makefile.am
+++ b/openbsc/src/gprs/Makefile.am
@@ -3,12 +3,10 @@ AM_CFLAGS=-Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOCTRL_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOGB_CFLAGS) $(COVERAGE_CFLAGS) \
$(LIBCARES_CFLAGS) $(LIBCRYPTO_CFLAGS) $(LIBGTP_CFLAGS) \
- -I/usr/local/include/asn1c \
- -I$(top_srcdir)/../../osmo-iuh/src/ \
- -I$(top_srcdir)/../../osmo-iuh/src/tests/
+ $(LIBASN1C_CFLAGS) $(LIBOSMOSIGTRAN_CFLAGS) $(LIBOSMORANAP_CFLAGS)
OSMO_LIBS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \
- $(LIBOSMOCTRL_LIBS) $(LIBOSMOGB_LIBS) -ltalloc -lasn1c -losmo-sigtran -lm
+ $(LIBOSMOCTRL_LIBS) $(LIBOSMOGB_LIBS) -ltalloc -lm
noinst_HEADERS = gprs_sndcp.h
@@ -35,20 +33,15 @@ osmo_sgsn_SOURCES = gprs_gmm.c gprs_sgsn.c gprs_sndcp.c gprs_sndcp_vty.c \
gprs_gsup_messages.c gprs_utils.c gprs_gsup_client.c \
gsm_04_08_gprs.c sgsn_cdr.c sgsn_ares.c \
oap.c oap_messages.c \
- $(IUHDIR)/src/iu_helpers.c \
- $(IUHDIR)/src/asn1helpers.c \
- $(IUHDIR)/src/ranap_common.c \
- $(IUHDIR)/src/ranap_encoder.c \
- $(IUHDIR)/src/ranap_decoder.c \
- $(IUHDIR)/src/ranap_msg_factory.c \
- $(IUHDIR)/src/tests/ranap_common_cn.c \
sgsn_iu.c
+#$(IUHDIR)/src/tests/ranap_common_cn.c
+
osmo_sgsn_LDADD = \
$(top_builddir)/src/libcommon/libcommon.a \
-lgtp $(OSMO_LIBS) $(LIBOSMOABIS_LIBS) $(LIBCARES_LIBS) \
$(LIBCRYPTO_LIBS) -lrt \
- $(IUHDIR)/src/ranap/libosmo-asn1-ranap.a
+ $(LIBOSMOSIGTRAN_LIBS) $(LIBOSMORANAP_LIBS) $(LIBASN1C_LIBS)
osmo_gtphub_SOURCES = gtphub_main.c gtphub.c gtphub_sock.c gtphub_ares.c \
gtphub_vty.c sgsn_ares.c gprs_utils.c
diff --git a/openbsc/src/gprs/sgsn_iu.c b/openbsc/src/gprs/sgsn_iu.c
index 1cb95f587..7b8eb0e5d 100644
--- a/openbsc/src/gprs/sgsn_iu.c
+++ b/openbsc/src/gprs/sgsn_iu.c
@@ -18,10 +18,10 @@
#include <osmocom/sigtran/sccp_sap.h>
#include <openbsc/gprs_sgsn.h>
+#include <openbsc/debug.h>
-#include "ranap_ies_defs.h"
-#include "ranap_common_cn.h"
-#include "hnbgw.h"
+#include <osmocom/ranap/ranap_ies_defs.h>
+#include <osmocom/ranap/ranap_common_cn.h>
int asn1_xer_print = 1;
void *talloc_asn1_ctx;
@@ -239,7 +239,7 @@ static int ranap_handle_co_rab_ass_resp(void *ctx, RANAP_RAB_AssignmentResponseI
}
/* Entry point for connection-oriented ANAP message */
-int cn_ranap_handle_co(void *ctx, ranap_message *message)
+static void cn_ranap_handle_co(void *ctx, ranap_message *message)
{
int rc = 0;
@@ -282,8 +282,6 @@ int cn_ranap_handle_co(void *ctx, ranap_message *message)
rc = -1;
break;
}
-
- return rc;
}
static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies)
@@ -303,7 +301,7 @@ static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies)
}
/* Entry point for connection-less RANAP message */
-int cn_ranap_handle_cl(void *ctx, ranap_message *message)
+static void cn_ranap_handle_cl(void *ctx, ranap_message *message)
{
int rc = 0;
@@ -370,7 +368,7 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *link)
printf("N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id);
if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */
!msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) {
- LOGP(DMAIN, LOGL_NOTICE, "Received invalid N-CONNECT.ind\n");
+ LOGP(DGPRS, LOGL_NOTICE, "Received invalid N-CONNECT.ind\n");
return 0;
}
/* FIXME: allocate UE context */
@@ -379,13 +377,13 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *link)
resp = make_conn_resp(&prim->u.connect);
osmo_sua_user_link_down(link, resp);
/* then handle the RANAP payload */
- rc = cn_ranap_rx_co(ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
+ rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
break;
case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION):
/* indication of disconnect */
printf("N-DISCONNECT.ind(%u)\n", prim->u.disconnect.conn_id);
ue = ue_conn_ctx_find(link, prim->u.disconnect.conn_id);
- rc = cn_ranap_rx_co(ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
+ rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
break;
case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION):
/* connection-oriented data received */
@@ -393,13 +391,13 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *link)
osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
/* resolve UE context */
ue = ue_conn_ctx_find(link, prim->u.data.conn_id);
- rc = cn_ranap_rx_co(ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
+ rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
break;
case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION):
/* connection-oriented data received */
printf("N-UNITDATA.ind(%s)\n",
osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
- rc = cn_ranap_rx_cl(link, msgb_l2(oph->msg), msgb_l2len(oph->msg));
+ rc = ranap_cn_rx_cl(cn_ranap_handle_cl, link, msgb_l2(oph->msg), msgb_l2len(oph->msg));
break;
}
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 0ee304aa7..6cae131bf 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -234,7 +234,6 @@ static void handle_options(int argc, char **argv)
extern int asn_debug;
-#include "hnbgw.h"
/* default categories */
static struct log_info_cat gprs_categories[] = {
[DMM] = {
@@ -284,9 +283,14 @@ static struct log_info_cat gprs_categories[] = {
.description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)",
.enabled = 1, .loglevel = LOGL_DEBUG,
},
+ [DSUA] = {
+ .name = "DSUA",
+ .description = "SCCP User Adaptation (SUA)",
+ .enabled = 1, .loglevel = LOGL_DEBUG,
+ },
[DRANAP] = {
.name = "DRANAP",
- .description = "RAN Application Part",
+ .description = "RAN Application Part (RANAP)",
.enabled = 1, .loglevel = LOGL_DEBUG,
},
};