diff --git a/TODO-RELEASE b/TODO-RELEASE index 1ed7b53d8..2bbfab598 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 b12125ccb..c3e5dcea5 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -378,6 +378,7 @@ struct gsm_bts { 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 c579af518..e9095deb2 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1855,6 +1856,7 @@ static void gsmtap_csd_rlp_process(struct gsm_lchan *lchan, bool is_uplink, { 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; @@ -1908,6 +1910,12 @@ static void gsmtap_csd_rlp_process(struct gsm_lchan *lchan, bool is_uplink, 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 b5ab132c3..2bc5bf8fc 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -447,8 +447,12 @@ static void config_write_bts_single(struct vty *vty, const struct gsm_bts *bts) 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_no_gsmtap_sapi, cfg_bts_no_gsmtap_sapi_cmd, } 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; } diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty index a7be40cea..97629d0af 100644 --- a/tests/osmo-bts.vty +++ b/tests/osmo-bts.vty @@ -262,7 +262,7 @@ OsmoBTS(bts)# list gsmtap-sapi (enable-all|disable-all) gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch) no gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch) - gsmtap-rlp + gsmtap-rlp [skip-null] no gsmtap-rlp osmux trx <0-254>