laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bts/+/35133?usp=email )
Change subject: gsmtap-rlp: Add support for skipping generating NULL frames
......................................................................
gsmtap-rlp: Add support for skipping generating NULL frames
If there's nothing to transmit over a CSD NT channel, both ends generate
NULL frames. Let's add an option to suppress GSMTAP output for those,
creating pcap files with less noise.
Change-Id: I85a2159cfaa01bfb4205c1462e3a9dbda68e4bad
---
M TODO-RELEASE
M include/osmo-bts/bts.h
M src/common/l1sap.c
M src/common/vty.c
4 files changed, 36 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/35133/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 1ed7b53..2bbfab5 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -8,3 +8,4 @@
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
libosmogsm >1.9.0 added new PRIM_INFO to include/osmocom/gsm/l1sap.h
+libosmogsm >1.9.0 use of RLP code in libosmogsm
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index f9ddb1e..8f1f1ab 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -378,6 +378,7 @@
uint32_t sapi_mask;
uint8_t sapi_acch;
bool rlp;
+ bool rlp_skip_null;
} gsmtap;
struct osmux_state osmux;
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 2395319..14ae5c7 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -33,6 +33,7 @@
#include <osmocom/gsm/l1sap.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/rsl.h>
+#include <osmocom/gsm/rlp.h>
#include <osmocom/core/gsmtap.h>
#include <osmocom/core/gsmtap_util.h>
#include <osmocom/core/utils.h>
@@ -1848,6 +1849,7 @@
{
struct gsm_bts_trx *trx = lchan->ts->trx;
struct gsmtap_inst *inst = trx->bts->gsmtap.inst;
+ struct osmo_rlp_frame_decoded rlpf;
pbit_t *rlp_buf;
int byte_len;
@@ -1897,6 +1899,12 @@
byte_len = osmo_ubit2pbit_ext(rlp_buf, 0, data, 0, data_len, 1);
}
+ if (trx->bts->gsmtap.rlp_skip_null) {
+ int rc = osmo_rlp_decode(&rlpf, 0, rlp_buf, byte_len);
+ if (rc == 0 && rlpf.ftype == OSMO_RLP_FT_U && rlpf.u_ftype ==
OSMO_RLP_U_FT_NULL)
+ return;
+ }
+
gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP, trx->arfcn | is_uplink ?
GSMTAP_ARFCN_F_UPLINK : 0,
lchan->ts->nr,
lchan->type == GSM_LCHAN_TCH_H ? GSMTAP_CHANNEL_VOICE_H :
GSMTAP_CHANNEL_VOICE_F,
diff --git a/src/common/vty.c b/src/common/vty.c
index b5ab132..2bc5bf8 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -447,8 +447,12 @@
sapi_buf = osmo_str_tolower(get_value_string(gsmtap_sapi_names, GSMTAP_CHANNEL_ACCH));
vty_out(vty, " gsmtap-sapi %s%s", sapi_buf, VTY_NEWLINE);
}
- if (bts->gsmtap.rlp)
- vty_out(vty, " gsmtap-rlp%s", VTY_NEWLINE);
+ if (bts->gsmtap.rlp) {
+ if (bts->gsmtap.rlp_skip_null)
+ vty_out(vty, " gsmtap-rlp skip-null%s", VTY_NEWLINE);
+ else
+ vty_out(vty, " gsmtap-rlp%s", VTY_NEWLINE);
+ }
vty_out(vty, " min-qual-rach %d%s", bts->min_qual_rach,
VTY_NEWLINE);
vty_out(vty, " min-qual-norm %d%s", bts->min_qual_norm,
@@ -2389,11 +2393,16 @@
}
DEFUN(cfg_bts_gsmtap_rlp, cfg_bts_gsmtap_rlp_cmd,
- "gsmtap-rlp",
- "Enable generation of GSMTAP frames for RLP (non-transparent CSD)\n")
+ "gsmtap-rlp [skip-null]",
+ "Enable generation of GSMTAP frames for RLP (non-transparent CSD)\n"
+ "Skip the generation of GSMTAP for RLP NULL frames\n")
{
struct gsm_bts *bts = vty->index;
bts->gsmtap.rlp = true;
+ if (argc >= 1 && !strcmp(argv[0], "skip-null"))
+ bts->gsmtap.rlp_skip_null = true;
+ else
+ bts->gsmtap.rlp_skip_null = false;
return CMD_SUCCESS;
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/35133?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I85a2159cfaa01bfb4205c1462e3a9dbda68e4bad
Gerrit-Change-Number: 35133
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange