summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-06 12:31:00 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-18 17:50:08 +0200
commitfabe468dd47ffd72a3ff2b6387422d304b178665 (patch)
treea7e2e1ec73a1075ba980d4e916284e41a2e0530e
parent926f84a2a33432091fffc22a6166fbb6df2920e5 (diff)
sccp: Use osmo-stp instead of direct server/client connection
This patch adjusts the code to use osmo-stp. This is only an intermediate solution, since we still have hardcoded parameter. Next step is to use the VTY options from libosmo-sigtran to issue the configurations.
-rw-r--r--openbsc/src/libmsc/a_iface.c26
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_sigtran.c3
2 files changed, 15 insertions, 14 deletions
diff --git a/openbsc/src/libmsc/a_iface.c b/openbsc/src/libmsc/a_iface.c
index a8c040e..9ff1b48 100644
--- a/openbsc/src/libmsc/a_iface.c
+++ b/openbsc/src/libmsc/a_iface.c
@@ -22,6 +22,9 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/logging.h>
#include <osmocom/sigtran/sccp_helpers.h>
+#include <osmocom/sigtran/sccp_sap.h>
+#include <osmocom/sigtran/osmo_ss7.h>
+#include <osmocom/sigtran/protocol/m3ua.h>
#include <osmocom/gsm/gsm0808.h>
#include <osmocom/gsm/protocol/gsm_08_08.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
@@ -34,6 +37,9 @@
#include <openbsc/mgcpgw_client.h>
#include <osmocom/core/byteswap.h>
+#define SSN_BSSAP 254 /* SCCP_SSN_BSSAP */
+#define SENDER_PC 1 /* Our local point code */
+
/* A pointer to the GSM network we work with. By the current paradigm,
* there can only be one gsm_network per MSC. The pointer is set once
* when calling a_init() */
@@ -339,23 +345,19 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu)
int a_init(void *ctx, const char *name, uint32_t local_pc,
const char *listen_addr, const char *remote_addr, uint16_t local_port, struct gsm_network *network)
{
- /* FIXME: Clean this up! */
- /* FIXME: Don't use the simple_server, use the simple_client instead! */
-#define RECEIVER_PC 23
-#define SSN_BSSAP 254 /* SCCP_SSN_BSSAP */
-#define SENDER_PC 1
-
+ /* FIXME: Remove hardcoded parameters, use parameters in parameter list */
struct osmo_sccp_instance *sccp;
+ LOGP(DMSC, LOGL_NOTICE, "Initalizing SCCP connection to stp...\n");
+
gsm_network = network;
osmo_ss7_init();
- sccp = osmo_sccp_simple_server(NULL, SENDER_PC, OSMO_SS7_ASP_PROT_M3UA, -1, "127.0.0.2");
-
- /* Why? */
- osmo_sccp_simple_server_add_clnt(sccp, OSMO_SS7_ASP_PROT_M3UA, "RECEIVER", RECEIVER_PC, -1, 0, NULL);
-
- osmo_sccp_user_bind(sccp, "MSC", &sccp_sap_up, SSN_BSSAP);
+ /* SCCP Protocol stack */
+ sccp =
+ osmo_sccp_simple_client(NULL, "osmo-msc", SENDER_PC, OSMO_SS7_ASP_PROT_M3UA, 0, NULL, M3UA_PORT,
+ "127.0.0.1");
+ osmo_sccp_user_bind(sccp, "osmo-msc", sccp_sap_up, SSN_BSSAP);
return 0;
}
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c b/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
index b95ec9d..bcd2946 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -311,7 +311,6 @@ int osmo_bsc_sigtran_del_conn(struct osmo_bsc_sccp_con *sccp)
int osmo_bsc_sigtran_init(struct llist_head *mscs)
{
/* FIXME: Remove hardcoded IP-Addresses */
- /* FIXME: Use STP! */
struct bsc_msc_data *msc;
char msc_name[256];
@@ -328,7 +327,7 @@ int osmo_bsc_sigtran_init(struct llist_head *mscs)
/* SCCP Protocol stack */
msc->msc_con->sccp =
osmo_sccp_simple_client(NULL, msc_name, msc->msc_con->g_calling_addr.pc,
- OSMO_SS7_ASP_PROT_M3UA, 0, NULL, M3UA_PORT, "127.0.0.2");
+ OSMO_SS7_ASP_PROT_M3UA, 0, NULL, M3UA_PORT, "127.0.0.1");
msc->msc_con->sccp_user =
osmo_sccp_user_bind(msc->msc_con->sccp, msc_name, sccp_sap_up, SCCP_SSN_BSSAP);