pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39638?usp=email )


Change subject: m3ua: Log Tx NOTIFY msg
......................................................................

m3ua: Log Tx NOTIFY msg

Change-Id: Iae3f0922bd924e1472d551c8a3144b203da21f79
---
M src/m3ua.c
M src/xua_as_fsm.c
M src/xua_internal.h
3 files changed, 23 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran 
refs/changes/38/39638/1

diff --git a/src/m3ua.c b/src/m3ua.c
index 5f94674..068eec2 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -100,6 +100,18 @@
        { 0, NULL }
 };

+const char *m3ua_ntfy_info_name(uint16_t ntfy_status_type, uint16_t 
ntfy_status_info)
+{
+       switch (ntfy_status_type) {
+       case M3UA_NOTIFY_T_STATCHG:
+               return get_value_string(m3ua_ntfy_stchg_names, 
ntfy_status_info);
+       case M3UA_NOTIFY_T_OTHER:
+               return get_value_string(m3ua_ntfy_other_names, 
ntfy_status_info);
+       default:
+       }
+       return "NULL";
+}
+
 static const struct value_string m3ua_iei_names[] = {
        { M3UA_IEI_INFO_STRING,         "INFO String" },
        { M3UA_IEI_ROUTE_CTX,           "Routing Context" },
@@ -643,20 +655,7 @@
        m3ua_decode_notify(&ntfy, asp, xua);

        type_name = get_value_string(m3ua_ntfy_type_names, ntfy.status_type);
-
-       switch (ntfy.status_type) {
-       case M3UA_NOTIFY_T_STATCHG:
-               info_name = get_value_string(m3ua_ntfy_stchg_names,
-                                               ntfy.status_info);
-               break;
-       case M3UA_NOTIFY_T_OTHER:
-               info_name = get_value_string(m3ua_ntfy_other_names,
-                                               ntfy.status_info);
-               break;
-       default:
-               info_name = "NULL";
-               break;
-       }
+       info_name = m3ua_ntfy_info_name(ntfy.status_type, ntfy.status_info);
        LOGPASP(asp, DLM3UA, LOGL_NOTICE, "Received NOTIFY Type %s:%s (%s)\n",
                type_name, info_name,
                ntfy.info_string ? ntfy.info_string : "");
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 6517f73..577c7d3 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -43,11 +43,18 @@
 {
        struct msgb *msg;
        unsigned int i, sent = 0;
+       const char *type_name, *info_name, *info_str;

        /* we don't send notify to IPA peers! */
        if (as->cfg.proto == OSMO_SS7_ASP_PROT_IPA)
                return 0;

+       type_name = get_value_string(m3ua_ntfy_type_names, npar->status_type);
+       info_name = m3ua_ntfy_info_name(npar->status_type, npar->status_info);
+       info_str = npar->info_string ? npar->info_string : "";
+       LOGPFSM(as->fi, "Broadcasting NOTIFY Type %s:%s (%s) to all non-DOWN 
ASPs\n",
+               type_name, info_name, info_str);
+
        /* iterate over all non-DOWN ASPs and send them the message */
        for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
                struct osmo_ss7_asp *asp = as->cfg.asps[i];
@@ -71,6 +78,8 @@

                /* TODO: Optional Routing Context */

+               LOGPASP(asp, DLSS7, LOGL_INFO, "Tx NOTIFY Type %s:%s (%s)\n",
+                       type_name, info_name, info_str);
                msg = encode_notify(npar);
                osmo_ss7_asp_send(asp, msg);
                sent++;
diff --git a/src/xua_internal.h b/src/xua_internal.h
index 4f6e931..3e9c15b 100644
--- a/src/xua_internal.h
+++ b/src/xua_internal.h
@@ -71,6 +71,7 @@
 extern const struct value_string m3ua_ntfy_type_names[];
 extern const struct value_string m3ua_ntfy_stchg_names[];
 extern const struct value_string m3ua_ntfy_other_names[];
+const char *m3ua_ntfy_info_name(uint16_t ntfy_status_type, uint16_t 
ntfy_status_info);

 struct xua_msg *m3ua_encode_notify(const struct osmo_xlm_prim_notify *npar);
 int m3ua_decode_notify(struct osmo_xlm_prim_notify *npar, void *ctx,

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39638?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Iae3f0922bd924e1472d551c8a3144b203da21f79
Gerrit-Change-Number: 39638
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>

Reply via email to