[PATCH] osmo-bts[master]: GSMTAP: Don't log fill frames via GSMTAP

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
Fri Jul 28 13:06:32 UTC 2017


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

GSMTAP: Don't log fill frames via GSMTAP

There's very little point in sending fill frames (such as empty PAGING)
or dummy UI frames via GSMTAP all the time.  They serve no purpose other
than to bloat the log files and make it more difficult for users to find
the interesting bits among all this noise.

Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac
---
M src/common/l1sap.c
1 file changed, 27 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/72/3372/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index b6fcad3..20a8c40 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -315,6 +315,28 @@
 	return 0;
 }
 
+/* Paging Request 1 with "no identity" content, i.e. empty/dummy paging */
+static const uint8_t paging_fill[GSM_MACBLOCK_LEN] = {
+	0x15, 0x06, 0x21, 0x00, 0x01, 0xf0, 0x2b, 0x2b, 0x2b, 0x2b,
+	0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+	0x2b, 0x2b, 0x2b };
+
+static bool is_fill_frame(uint8_t chan_type, const uint8_t *data, unsigned int len)
+{
+	switch (chan_type) {
+	case GSMTAP_CHANNEL_AGCH:
+		if (!memcmp(data, fill_frame, GSM_MACBLOCK_LEN))
+			return true;
+		break;
+	case GSMTAP_CHANNEL_PCH:
+		if (!memcmp(data, paging_fill, GSM_MACBLOCK_LEN))
+			return true;
+		break;
+	default:
+		return false;
+	}
+}
+
 static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
 {
 	uint8_t *data;
@@ -362,6 +384,11 @@
 			return 0;
 	}
 
+	/* don't log fill frames via GSMTAP; they serve no purpose other than
+	 * to clog up your logs */
+	if (is_fill_frame(chan_type, data, len))
+		return 0;
+
 	gsmtap_send(gsmtap, trx->arfcn | uplink, tn, chan_type, ss, fn, 0, 0,
 		data, len);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list