From 77700b6eb51be100dce473763df611551eee01f0 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 23 Nov 2021 15:49:21 +0100 Subject: ss7: Use sctp value_string from libosmo-netif Depends: libosmo-netif Change-Id Ica6f01851fb94e31f4ef097494bb1b8a95597ba6 Change-Id: I42323eb5d02d4f67daac7b0a4365f5f6f6057666 --- TODO-RELEASE | 1 + src/osmo_ss7.c | 33 +++------------------------------ 2 files changed, 4 insertions(+), 30 deletions(-) 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 #include +#include #include "sccp_internal.h" #include "xua_internal.h" @@ -1663,32 +1664,6 @@ bool osmo_ss7_asp_active(const struct osmo_ss7_asp *asp) * 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 @@ static void log_sctp_notification(struct osmo_ss7_asp *asp, const char *pfx, 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; } } -- cgit v1.2.3