Change in libosmo-sccp[master]: ss7: Use sctp value_string from libosmo-netif

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
Tue Nov 23 14:50:43 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/26347 )


Change subject: ss7: Use sctp value_string from libosmo-netif
......................................................................

ss7: Use sctp value_string from libosmo-netif

Depends: libosmo-netif Change-Id Ica6f01851fb94e31f4ef097494bb1b8a95597ba6
Change-Id: I42323eb5d02d4f67daac7b0a4365f5f6f6057666
---
M TODO-RELEASE
M src/osmo_ss7.c
2 files changed, 4 insertions(+), 30 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/47/26347/1

diff --git a/TODO-RELEASE b/TODO-RELEASE
index d0852fc..9e75c9a 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
 # If any interfaces have been added since the last public release: c:r:a + 1.
 # If any interfaces have been removed or changed since the last public release: c:r:0.
 #library	what		description / commit summary line
+libosmo-netif >1.1.0            use of netif/sctp.h
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index b4c0b51..649e3f7 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -45,6 +45,7 @@
 
 #include <osmocom/netif/stream.h>
 #include <osmocom/netif/ipa.h>
+#include <osmocom/netif/sctp.h>
 
 #include "sccp_internal.h"
 #include "xua_internal.h"
@@ -1663,32 +1664,6 @@
  * libosmo-netif integration for SCTP stream server/client
  ***********************************************************************/
 
-static const struct value_string sctp_assoc_chg_vals[] = {
-	{ SCTP_COMM_UP,		"COMM_UP" },
-	{ SCTP_COMM_LOST,	"COMM_LOST" },
-	{ SCTP_RESTART,		"RESTART" },
-	{ SCTP_SHUTDOWN_COMP,	"SHUTDOWN_COMP" },
-	{ SCTP_CANT_STR_ASSOC,	"CANT_STR_ASSOC" },
-	{ 0, NULL }
-};
-
-static const struct value_string sctp_sn_type_vals[] = {
-	{ SCTP_ASSOC_CHANGE,		"ASSOC_CHANGE" },
-	{ SCTP_PEER_ADDR_CHANGE,	"PEER_ADDR_CHANGE" },
-	{ SCTP_SHUTDOWN_EVENT, 		"SHUTDOWN_EVENT" },
-	{ SCTP_SEND_FAILED,		"SEND_FAILED" },
-	{ SCTP_REMOTE_ERROR,		"REMOTE_ERROR" },
-	{ SCTP_PARTIAL_DELIVERY_EVENT,	"PARTIAL_DELIVERY_EVENT" },
-	{ SCTP_ADAPTATION_INDICATION,	"ADAPTATION_INDICATION" },
-#ifdef SCTP_AUTHENTICATION_INDICATION
-	{ SCTP_AUTHENTICATION_INDICATION, "AUTHENTICATION_INDICATION" },
-#endif
-#ifdef SCTP_SENDER_DRY_EVENT
-	{ SCTP_SENDER_DRY_EVENT,	"SENDER_DRY_EVENT" },
-#endif
-	{ 0, NULL }
-};
-
 static int get_logevel_by_sn_type(int sn_type)
 {
 	switch (sn_type) {
@@ -1728,13 +1703,11 @@
 	switch (notif->sn_header.sn_type) {
 	case SCTP_ASSOC_CHANGE:
 		LOGPASP(asp, DLSS7, log_level, "%s SCTP_ASSOC_CHANGE: %s\n",
-			pfx, get_value_string(sctp_assoc_chg_vals,
-				notif->sn_assoc_change.sac_state));
+			pfx, osmo_sctp_assoc_chg_str(notif->sn_assoc_change.sac_state));
 		break;
 	default:
 		LOGPASP(asp, DLSS7, log_level, "%s %s\n",
-			pfx, get_value_string(sctp_sn_type_vals,
-				notif->sn_header.sn_type));
+			pfx, osmo_sctp_sn_type_str(notif->sn_header.sn_type));
 		break;
 	}
 }

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/26347
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I42323eb5d02d4f67daac7b0a4365f5f6f6057666
Gerrit-Change-Number: 26347
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/20211123/de60158d/attachment.htm>


More information about the gerrit-log mailing list