Review at  https://gerrit.osmocom.org/2693

Add human-readable names for signal_ns

Change-Id: Id664355eb8305fb287e4dae0800fb20dc2f9b8cd
Related: SYS#3610
---
M include/osmocom/gprs/gprs_ns.h
M src/gb/gprs_ns.c
M src/gb/libosmogb.map
3 files changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/2693/1

diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h
index 130d8c0..bbff5de 100644
--- a/include/osmocom/gprs/gprs_ns.h
+++ b/include/osmocom/gprs/gprs_ns.h
@@ -203,6 +203,8 @@
        S_NS_MISMATCH, /* got an unexpected IE (sets msg, pdu_type, ie_type) */
 };
 
+extern const struct value_string gprs_signal_ns_names[];
+
 struct ns_signal_data {
        struct gprs_nsvc *nsvc;
        struct gprs_nsvc *old_nsvc;
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index d0c5a17..34c3fac 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -150,6 +150,16 @@
        .class_id = OSMO_STATS_CLASS_PEER,
 };
 
+const struct value_string gprs_signal_ns_names[] = {
+       { S_NS_RESET,           "NS-RESET" },
+       { S_NS_BLOCK,           "NS-BLOCK" },
+       { S_NS_UNBLOCK,         "NS-UNBLOCK" },
+       { S_NS_ALIVE_EXP,       "NS-ALIVE expired" },
+       { S_NS_REPLACED,        "NSVC replaced" },
+       { S_NS_MISMATCH,        "Unexpected IE" },
+       { 0, NULL }
+};
+
 #define CHECK_TX_RC(rc, nsvc) \
                if (rc < 0)                                                     
\
                        LOGP(DNS, LOGL_ERROR, "TX failed (%d) to peer %s\n",    
\
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index 3ec3ee5..a2556a3 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -38,6 +38,8 @@
 bssgp_vty_init;
 bssgp_nsi;
 
+gprs_signal_ns_names;
+
 gprs_ns_pdu_strings;
 gprs_ns_cause_str;
 gprs_ns_destroy;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id664355eb8305fb287e4dae0800fb20dc2f9b8cd
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>

Reply via email to