pespin has uploaded this change for review.

View Change

sigtran: N-NOTICE.ind: Use proper SCCP-User return reason

Until recently, libosmo-sigtran was incorrectly expecting low-level
wire-format cause in N-NOTICE.ind. Nowadays it supports specific
reason values in the SCCP-User SAP, so use those instead.
This change is backward-compatible since the value for both enums are
the same as per specs.

Change-Id: I4b412dcc95df6566a3ec1bb91fa93b4115406b0f
Related: OS#2601
---
M TODO-RELEASE
M src/osmo-bsc/lb.c
M src/osmo-bsc/osmo_bsc_sigtran.c
3 files changed, 10 insertions(+), 10 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/43807/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index b6d61b1..510eed7 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,4 +7,5 @@
# 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-sigtran >2.3.0 OSMO_SCCP_REL_REASON_NSU_*
+libosmo-sigtran >2.3.0 OSMO_SCCP_REL_REASON_NSU_*,
+libosmo-sigtran >2.3.0 OSMO_SCCP_RETURN_REASON_*, osmo_sccp_return_reason_name()
diff --git a/src/osmo-bsc/lb.c b/src/osmo-bsc/lb.c
index 33cc548..6f79502 100644
--- a/src/osmo-bsc/lb.c
+++ b/src/osmo-bsc/lb.c
@@ -160,19 +160,19 @@
if (!smlc) {
LOGP(DLCS, LOGL_DEBUG, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u didn't match SMLC, ignoring\n",
osmo_sccp_addr_dump(&ni->calling_addr),
- ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->cause, osmo_sccp_return_reason_name(ni->cause),
ni->importance);
return -EINVAL;
}

LOGP(DLCS, LOGL_NOTICE, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u\n",
osmo_sccp_addr_dump(&ni->calling_addr),
- ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->cause, osmo_sccp_return_reason_name(ni->cause),
ni->importance);

switch (ni->cause) {
- case SCCP_RETURN_CAUSE_SUBSYSTEM_CONGESTION:
- case SCCP_RETURN_CAUSE_NETWORK_CONGESTION:
+ case OSMO_SCCP_RETURN_REASON_SUBSYSTEM_CONGESTION:
+ case OSMO_SCCP_RETURN_REASON_NETWORK_CONGESTION:
/* Transient failures (hopefully), keep going. */
return rc;
default:
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index c96aebf..c91b725 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -24,7 +24,6 @@
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/sigtran/protocol/mtp.h>
#include <osmocom/sigtran/mtp_sap.h>
-#include <osmocom/sccp/sccp_types.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/gsm0808.h>
#include <osmocom/gsm/protocol/ipaccess.h>
@@ -160,19 +159,19 @@
if (!msc) {
LOGP(DMSC, LOGL_DEBUG, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u didn't match any MSC, ignoring\n",
osmo_sccp_addr_dump(&ni->calling_addr),
- ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->cause, osmo_sccp_return_reason_name(ni->cause),
ni->importance);
return rc;
}

LOG_MSC(msc, LOGL_NOTICE, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u\n",
osmo_sccp_addr_dump(&ni->calling_addr),
- ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->cause, osmo_sccp_return_reason_name(ni->cause),
ni->importance);

switch (ni->cause) {
- case SCCP_RETURN_CAUSE_SUBSYSTEM_CONGESTION:
- case SCCP_RETURN_CAUSE_NETWORK_CONGESTION:
+ case OSMO_SCCP_RETURN_REASON_SUBSYSTEM_CONGESTION:
+ case OSMO_SCCP_RETURN_REASON_NETWORK_CONGESTION:
/* Transient failures (hopefully), keep going. */
return rc;
default:

To view, visit change 43807. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I4b412dcc95df6566a3ec1bb91fa93b4115406b0f
Gerrit-Change-Number: 43807
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>