Harald Welte has submitted this change and it was merged. Change subject: GSMTAP: Don't log fill frames via GSMTAP ......................................................................
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(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 4bf24a5..97cbac1 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -317,6 +317,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; @@ -364,6 +386,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: merged Gerrit-Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder