Change in osmo-hlr[master]: USSD: Add new "DSS" logging category and use it appropriately

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jul 30 14:34:49 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10249


Change subject: USSD: Add new "DSS" logging category and use it appropriately
......................................................................

USSD: Add new "DSS" logging category and use it appropriately

Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8
---
M src/hlr_ussd.c
M src/logging.c
M src/logging.h
3 files changed, 19 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/49/10249/1

diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c
index 8710061..d23debf 100644
--- a/src/hlr_ussd.c
+++ b/src/hlr_ussd.c
@@ -111,14 +111,14 @@
 		struct hlr_euse_route *rt;
 		llist_for_each_entry(rt, &euse->routes, list) {
 			if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) {
-				LOGP(DMAIN, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n",
+				LOGP(DSS, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n",
 					rt->euse->name, rt->prefix, ussd_code);
 				return rt->euse;
 			}
 		}
 	}
 
-	LOGP(DMAIN, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code);
+	LOGP(DSS, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code);
 	return NULL;
 }
 
@@ -127,7 +127,7 @@
  ***********************************************************************/
 
 #define LOGPSS(ss, lvl, fmt, args...) \
-	LOGP(DMAIN, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args)
+	LOGP(DSS, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args)
 
 struct ss_session {
 	/* link us to hlr->ss_sessions */
@@ -361,13 +361,13 @@
 	struct ss_session *ss;
 	struct ss_request req = {0};
 
-	LOGP(DMAIN, LOGL_INFO, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id,
+	LOGP(DSS, LOGL_DEBUG, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id,
 		osmo_gsup_session_state_name(gsup->session_state));
 
 	/* decode and find out what kind of SS message it is */
 	if (gsup->ss_info && gsup->ss_info_len) {
 		if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) {
-			LOGP(DMAIN, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n",
+			LOGP(DSS, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n",
 				gsup->imsi, gsup->session_id,
 				osmo_hexdump(gsup->ss_info, gsup->ss_info_len));
 			/* FIXME: Send a Reject component? */
@@ -379,13 +379,13 @@
 	case OSMO_GSUP_SESSION_STATE_BEGIN:
 		/* Check for overlapping Session ID usage */
 		if (ss_session_find(hlr, gsup->imsi, gsup->session_id)) {
-			LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n",
+			LOGP(DSS, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n",
 				gsup->imsi, gsup->session_id);
 			goto out_err;
 		}
 		ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id);
 		if (!ss) {
-			LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n",
+			LOGP(DSS, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n",
 				gsup->imsi, gsup->session_id);
 			goto out_err;
 		}
@@ -407,7 +407,7 @@
 	case OSMO_GSUP_SESSION_STATE_CONTINUE:
 		ss = ss_session_find(hlr, gsup->imsi, gsup->session_id);
 		if (!ss) {
-			LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n",
+			LOGP(DSS, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n",
 				gsup->imsi, gsup->session_id);
 			goto out_err;
 		}
@@ -422,7 +422,7 @@
 	case OSMO_GSUP_SESSION_STATE_END:
 		ss = ss_session_find(hlr, gsup->imsi, gsup->session_id);
 		if (!ss) {
-			LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n",
+			LOGP(DSS, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n",
 				gsup->imsi, gsup->session_id);
 			goto out_err;
 		}
@@ -436,7 +436,7 @@
 		ss_session_free(ss);
 		break;
 	default:
-		LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi,
+		LOGP(DSS, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi,
 			gsup->session_id, gsup->session_state);
 		goto out_err;
 	}
@@ -449,7 +449,7 @@
 
 int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup)
 {
-	LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id,
+	LOGP(DSS, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id,
 		osmo_gsup_session_state_name(gsup->session_state));
 	return 0;
 }
diff --git a/src/logging.c b/src/logging.c
index f81781d..3fa2a69 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -19,6 +19,13 @@
 		.color = "\033[1;33m",
 		.enabled = 1, .loglevel = LOGL_NOTICE,
 	},
+	[DSS] = {
+		.name = "DSS",
+		.description = "Supplementary Services",
+		.color = "\033[1;34m",
+		.enabled = 1, .loglevel = LOGL_NOTICE,
+	},
+
 };
 
 const struct log_info hlr_log_info = {
diff --git a/src/logging.h b/src/logging.h
index fdaf5d1..ed24075 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -7,6 +7,7 @@
 	DDB,
 	DGSUP,
 	DAUC,
+	DSS,
 };
 
 extern const struct log_info hlr_log_info;

-- 
To view, visit https://gerrit.osmocom.org/10249
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8
Gerrit-Change-Number: 10249
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180730/881830ec/attachment.htm>


More information about the gerrit-log mailing list