aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-28 14:38:28 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-09 10:03:30 +0000
commitbc56094cacd868cdb0336b215e4268bb69cab168 (patch)
tree4723d0d6f05efba5a930a7037de48be4f1b93049
parentde99be4afbc35e22f4f0263b0e9661dcecdc1ea2 (diff)
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
-rw-r--r--src/common/l1sap.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 4bf24a5d..97cbac19 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -317,6 +317,28 @@ static int gsmtap_ph_rach(struct osmo_phsap_prim *l1sap, uint8_t *chan_type,
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;
@@ -364,6 +386,11 @@ static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
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);