[PATCH] osmo-iuh[master]: osmo-hnbgw: auto-config remote PCs if omitted

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Nov 22 23:47:04 UTC 2017


Review at  https://gerrit.osmocom.org/4977

osmo-hnbgw: auto-config remote PCs if omitted

The current default point-code for OsmoMSC is 0.23.1 and for OsmoSGSN 0.0.2.
Not sure how we ended up with those, but that is secondary and can be changed.

Before this patch, osmo-hnbgw requires a cs7 config and explicit point-codes
for MSC and SGSN as well as a local one. Provide default config if none is
provided:

Use above default point-codes if no MSC and/or SGSN address are provided. Also
create a default cs7 instance with local PC 0.0.3.

This allows completely omitting cs7 instance and SCCP addresses from
osmo-hnbgw.cfg in a single-box setup.

Change-Id: I056547f26858d3ad52e66a15f7a4273dcc300e97
---
M src/hnbgw_cn.c
1 file changed, 15 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/77/4977/1

diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c
index a48b651..b84a08d 100644
--- a/src/hnbgw_cn.c
+++ b/src/hnbgw_cn.c
@@ -410,13 +410,16 @@
 }
 
 static int resolve_addr_name(struct osmo_sccp_addr *dest, struct osmo_ss7_instance **ss7,
-			      const char *addr_name, const char *label)
+			     const char *addr_name, const char *label,
+			     uint32_t default_pc)
 {
 	struct osmo_ss7_instance *ss7_tmp;
 
 	if (!addr_name) {
-		LOGP(DMAIN, LOGL_ERROR, "Missing config: %s remote-addr\n", label);
-		return -1;
+		osmo_sccp_make_addr_pc_ssn(dest, default_pc, OSMO_SCCP_SSN_RANAP);
+		LOGP(DMAIN, LOGL_INFO, "%s remote addr not configured, using default: %s\n", label,
+		     osmo_sccp_addr_name(*ss7, dest));
+		return 0;
 	}
 
 	ss7_tmp = osmo_sccp_addr_by_name(dest, addr_name);
@@ -458,12 +461,19 @@
 
 	ss7 = NULL;
 	if (resolve_addr_name(&gw->sccp.iucs_remote_addr, &ss7,
-			      gw->config.iucs_remote_addr_name, "IuCS"))
+			      gw->config.iucs_remote_addr_name, "IuCS", 185))
 		return -1;
 	if (resolve_addr_name(&gw->sccp.iups_remote_addr, &ss7,
-			      gw->config.iups_remote_addr_name, "IuPS"))
+			      gw->config.iups_remote_addr_name, "IuPS", 2))
 		return -1;
 
+	if (!ss7) {
+		LOGP(DRANAP, LOGL_NOTICE, "No cs7 instance configured for IuCS nor IuPS,"
+		     " creating default instance\n");
+		ss7 = osmo_ss7_instance_find_or_create(gw, 0);
+		ss7->cfg.primary_pc = 24;
+	}
+
 	if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) {
 		LOGP(DMAIN, LOGL_ERROR, "IuCS/IuPS uplink cannot be setup: CS7 instance %d has no point-code set\n",
 		     ss7->cfg.id);

-- 
To view, visit https://gerrit.osmocom.org/4977
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I056547f26858d3ad52e66a15f7a4273dcc300e97
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list