[PATCH] libosmo-sccp[master]: add converter functions between osmo_ss7 and m3ua traffic mo...

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Apr 9 19:31:09 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/2236

to look at the new patch set (#3).

add converter functions between osmo_ss7 and m3ua traffic mode types

Change-Id: I6cc9530d7d2812cbc8feb6e9db51902865ebfe83
---
M include/osmocom/sigtran/osmo_ss7.h
M include/osmocom/sigtran/protocol/m3ua.h
M src/osmo_ss7.c
3 files changed, 36 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/36/2236/3

diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 7918a51..d765ae0 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -406,3 +406,6 @@
 				 const char *name, uint32_t pc,
 				 int local_port, int remote_port,
 				 const char *remote_ip);
+
+enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in);
+int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod);
diff --git a/include/osmocom/sigtran/protocol/m3ua.h b/include/osmocom/sigtran/protocol/m3ua.h
index d4dc1fe..c10808c 100644
--- a/include/osmocom/sigtran/protocol/m3ua.h
+++ b/include/osmocom/sigtran/protocol/m3ua.h
@@ -145,3 +145,9 @@
 	M3UA_ERR_INVAL_ROUT_CTX		= 0x19,
 	M3UA_ERR_NO_CONFGD_AS_FOR_ASP	= 0x1a,
 };
+
+enum m3ua_traffic_mode {
+	M3UA_TMOD_OVERRIDE	= 1,
+	M3UA_TMOD_LOADSHARE	= 2,
+	M3UA_TMOD_BCAST		= 3,
+};
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index ab0636c..2dbb94d 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1494,3 +1494,30 @@
 	ss7_initialized = true;
 	return 0;
 }
+
+int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod)
+{
+	switch (tmod) {
+	case OSMO_SS7_AS_TMOD_OVERRIDE:
+		return M3UA_TMOD_OVERRIDE;
+	case OSMO_SS7_AS_TMOD_LOADSHARE:
+		return M3UA_TMOD_LOADSHARE;
+	case OSMO_SS7_AS_TMOD_BCAST:
+		return M3UA_TMOD_BCAST;
+	default:
+		return -1;
+	}
+}
+
+enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in)
+{
+	switch (in) {
+	case M3UA_TMOD_OVERRIDE:
+	default:
+		return OSMO_SS7_AS_TMOD_OVERRIDE;
+	case M3UA_TMOD_LOADSHARE:
+		return OSMO_SS7_AS_TMOD_LOADSHARE;
+	case M3UA_TMOD_BCAST:
+		return OSMO_SS7_AS_TMOD_BCAST;
+	}
+}

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6cc9530d7d2812cbc8feb6e9db51902865ebfe83
Gerrit-PatchSet: 3
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list