Change in ...osmo-bsc[master]: Introduce msc_is_{sccplite, aoip}() helpers

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/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Jun 6 15:00:48 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/14383


Change subject: Introduce msc_is_{sccplite,aoip}() helpers
......................................................................

Introduce msc_is_{sccplite,aoip}() helpers

Having the helper makes it easier to read/find for transport type checks. It
will be ifurther re-used in forthcoming commits.

Change-Id: Ic0ee4c472e29ec3092049e5e23b744395613616d
---
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/osmo_bsc_sigtran.c
3 files changed, 23 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/83/14383/1

diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index 4720845..1f9872a 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -191,5 +191,25 @@
 	return (port - base) / 2;
 }
 
+static inline bool msc_is_aoip(const struct bsc_msc_data *msc)
+{
+	switch (msc->a.asp_proto) {
+	case OSMO_SS7_ASP_PROT_SUA:
+	case OSMO_SS7_ASP_PROT_M3UA:
+		return true;
+	default:
+		return false;
+	}
+}
+
+static inline bool msc_is_sccplite(const struct bsc_msc_data *msc)
+{
+	switch (msc->a.asp_proto) {
+	case OSMO_SS7_ASP_PROT_IPA:
+		return true;
+	default:
+		return false;
+	}
+}
 
 #endif
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 87ad567..7b9f912 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -1058,14 +1058,7 @@
 	if (!conn || !conn->sccp.msc)
 		return false;
 
-	switch (conn->sccp.msc->a.asp_proto) {
-	case OSMO_SS7_ASP_PROT_SUA:
-	case OSMO_SS7_ASP_PROT_M3UA:
-		return true;
-
-	default:
-		return false;
-	}
+	return msc_is_aoip(conn->sccp.msc);
 }
 
 bool gscon_is_sccplite(struct gsm_subscriber_connection *conn)
@@ -1073,11 +1066,5 @@
 	if (!conn || !conn->sccp.msc)
 		return false;
 
-	switch (conn->sccp.msc->a.asp_proto) {
-	case OSMO_SS7_ASP_PROT_IPA:
-		return true;
-
-	default:
-		return false;
-	}
+	return msc_is_sccplite(conn->sccp.msc);
 }
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 5d61c32..8303c4f 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -523,8 +523,7 @@
 		 * an X-Osmo-IGN flag telling osmo-mgw to ignore CallID mismatches for this endpoint.
 		 * If an explicit VTY command has already indicated whether or not to send X-Osmo-IGN, do
 		 * not overwrite that setting. */
-		if (msc->a.asp_proto == OSMO_SS7_ASP_PROT_IPA
-		    && !msc->x_osmo_ign_configured)
+		if (msc_is_sccplite(msc) && !msc->x_osmo_ign_configured)
 			msc->x_osmo_ign |= MGCP_X_OSMO_IGN_CALLID;
 
 		/* If unset, use default local SCCP address */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/14383
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic0ee4c472e29ec3092049e5e23b744395613616d
Gerrit-Change-Number: 14383
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190606/8d958a48/attachment.htm>


More information about the gerrit-log mailing list