Change in osmo-hnodeb[master]: Introduce SCTP log category

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

laforge gerrit-no-reply at lists.osmocom.org
Wed Nov 24 21:52:41 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnodeb/+/26342 )

Change subject: Introduce SCTP log category
......................................................................

Introduce SCTP log category

Change-Id: I2c9cb54958807bd68c04a4c0d3a0f355dd641282
---
M include/osmocom/hnodeb/hnodeb.h
M src/osmo-hnodeb/debug.c
M src/osmo-hnodeb/iuh.c
3 files changed, 14 insertions(+), 8 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h
index 4cc0831..deb683f 100644
--- a/include/osmocom/hnodeb/hnodeb.h
+++ b/include/osmocom/hnodeb/hnodeb.h
@@ -32,6 +32,7 @@
 	DHNBAP,
 	DRUA,
 	DRANAP,
+	DSCTP,
 	DNAS,
 };
 extern const struct log_info hnb_log_info;
diff --git a/src/osmo-hnodeb/debug.c b/src/osmo-hnodeb/debug.c
index f50d8b0..10d1655 100644
--- a/src/osmo-hnodeb/debug.c
+++ b/src/osmo-hnodeb/debug.c
@@ -42,6 +42,11 @@
 		.color = "\033[1;35m",
 		.description = "RANAP User Adaptation",
 	},
+	[DSCTP] = {
+		.name = "DSCTP", .loglevel = LOGL_NOTICE, .enabled = 1,
+		.color = "\033[1;36m",
+		.description = "SCTP connection on the Iuh link",
+	},
 	[DNAS] = {
 		.name = "NAS", .loglevel = LOGL_NOTICE, .enabled = 1,
 		.color = "\033[1;32m",
diff --git a/src/osmo-hnodeb/iuh.c b/src/osmo-hnodeb/iuh.c
index bcd047b..b81b83f 100644
--- a/src/osmo-hnodeb/iuh.c
+++ b/src/osmo-hnodeb/iuh.c
@@ -52,12 +52,12 @@
 	rc = sctp_recvmsg(fd->fd, msgb_data(msg), msgb_tailroom(msg),
 			  NULL, NULL, &sinfo, &flags);
 	if (rc < 0) {
-		LOGP(DMAIN, LOGL_ERROR, "Error during sctp_recvmsg()\n");
+		LOGP(DSCTP, LOGL_ERROR, "Error during sctp_recvmsg()\n");
 		/* FIXME: clean up after disappeared HNB */
 		osmo_stream_cli_close(conn);
 		goto free_ret;
 	} else if (rc == 0) {
-		LOGP(DMAIN, LOGL_INFO, "Connection to HNBGW closed\n");
+		LOGP(DSCTP, LOGL_INFO, "Connection to HNBGW closed\n");
 		osmo_stream_cli_close(conn);
 		rc = -1;
 		goto free_ret;
@@ -66,7 +66,7 @@
 	}
 
 	if (flags & MSG_NOTIFICATION) {
-		LOGP(DMAIN, LOGL_DEBUG, "Ignoring SCTP notification\n");
+		LOGP(DSCTP, LOGL_DEBUG, "Ignoring SCTP notification\n");
 		rc = 0;
 		goto free_ret;
 	}
@@ -85,12 +85,12 @@
 	case IUH_PPI_SABP:
 	case IUH_PPI_RNA:
 	case IUH_PPI_PUA:
-		LOGP(DMAIN, LOGL_ERROR, "Unimplemented SCTP PPID=%u received\n",
+		LOGP(DSCTP, LOGL_ERROR, "Unimplemented SCTP PPID=%u received\n",
 		     sinfo.sinfo_ppid);
 		rc = 0;
 		break;
 	default:
-		LOGP(DMAIN, LOGL_ERROR, "Unknown SCTP PPID=%u received\n",
+		LOGP(DSCTP, LOGL_ERROR, "Unknown SCTP PPID=%u received\n",
 		     sinfo.sinfo_ppid);
 		rc = 0;
 		break;
@@ -103,7 +103,7 @@
 
 static int hnb_iuh_connect_cb(struct osmo_stream_cli *conn)
 {
-	LOGP(DMAIN, LOGL_NOTICE, "Iuh connected to HNBGW\n");
+	LOGP(DSCTP, LOGL_NOTICE, "Iuh connected to HNBGW\n");
 	struct hnb *hnb = osmo_stream_cli_get_data(conn);
 
 	hnb_send_register_req(hnb);
@@ -142,7 +142,7 @@
 {
 	int rc;
 
-	LOGP(DMAIN, LOGL_INFO, "Iuh Connect: %s[:%u] => %s[:%u]\n",
+	LOGP(DSCTP, LOGL_INFO, "Iuh Connect: %s[:%u] => %s[:%u]\n",
 	     hnb->iuh.local_addr, hnb->iuh.local_port, hnb->iuh.remote_addr, hnb->iuh.remote_port);
 
 	osmo_stream_cli_set_addrs(hnb->iuh.client, (const char **)&hnb->iuh.remote_addr, 1);
@@ -151,7 +151,7 @@
 	osmo_stream_cli_set_local_port(hnb->iuh.client, hnb->iuh.local_port);
 	rc = osmo_stream_cli_open(hnb->iuh.client);
 	if (rc < 0) {
-		LOGP(DMAIN, LOGL_ERROR, "Unable to open stream client for Iuh %s[:%u] => %s[:%u]\n",
+		LOGP(DSCTP, LOGL_ERROR, "Unable to open stream client for Iuh %s[:%u] => %s[:%u]\n",
 		     hnb->iuh.local_addr, hnb->iuh.local_port, hnb->iuh.remote_addr, hnb->iuh.remote_port);
 		/* we don't return error in here because osmo_stream_cli_open()
 		   will continue to retry (due to timeout being explicitly set with

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/26342
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I2c9cb54958807bd68c04a4c0d3a0f355dd641282
Gerrit-Change-Number: 26342
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211124/63305fe3/attachment.htm>


More information about the gerrit-log mailing list