Browse Source

jenkins: Validate gsm 08.58 IEs are added to tlv_definition

It was recently found that several IEs which were added in the header
file were not actually added to the tlv_definition, and hence the tlv
parser failed to decode them. Let's make sure we don't foget to add new
IEs in the future.

Related: SYS#5915

Change-Id: Id8a679ca43eb0fcc4882780e9a95ec21c7f51972
changes/46/27646/4
Pau Espin 3 months ago
parent
commit
b0c2f75665
  1. 15
      contrib/jenkins_common.sh
  2. 4
      include/osmocom/gsm/protocol/gsm_08_58.h
  3. 2
      src/gsm/rsl.c

15
contrib/jenkins_common.sh

@ -28,6 +28,21 @@ verify_gsm0808_tlv_definition() {
}
verify_gsm0808_tlv_definition
verify_gsm_08_05_tlv_definition() {
set +x;
enums=$(grep "RSL_IE_" include/osmocom/gsm/protocol/gsm_08_58.h | grep -e "=" -e ",$" | awk '{ print $1 }' | tr -d ',')
counted_enums=$(for f in $enums; do printf "%-60s %s\n" "$f" "$(grep -c "\[$f\]" src/gsm/rsl.c)"; done)
# TODO: Add RSL_IE_SIEMENS_* to the tlv struct definitions.
missing_enums=$(echo "$counted_enums" | grep -v RSL_IE_SIEMENS |grep "0$" || true)
if [ "x$missing_enums" != "x" ]; then
echo "Missing IEs in src/gsm/rsl.c!"
echo "$missing_enums"
exit 1
fi
set -x;
}
verify_gsm_08_05_tlv_definition
prep_build() {
_src_dir="$1"
_build_dir="$2"

4
include/osmocom/gsm/protocol/gsm_08_58.h

@ -385,9 +385,9 @@ enum abis_rsl_ie {
RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
RSL_IE_IPAC_RTP_COMPR = 0xfb,
RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
RSL_IE_IPAC_RTP_PAYLOAD2 = 0xfc,
RSL_IE_IPAC_RTP_MPLEX = 0xfd,
RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
RSL_IE_IPAC_RTP_MPLEX_ID = 0xfe,
};
/* Ericsson specific IEs, clash with above partially, so they're not

2
src/gsm/rsl.c

@ -125,6 +125,7 @@ const struct tlv_definition rsl_att_tlvdef = {
[RSL_IE_OSMO_REP_ACCH_CAP] = { TLV_TYPE_TLV },
[RSL_IE_OSMO_TRAINING_SEQUENCE] = { TLV_TYPE_TLV },
[RSL_IE_OSMO_TEMP_OVP_ACCH_CAP] = { TLV_TYPE_TLV },
[RSL_IE_IPAC_SRTP_CONFIG] = { TLV_TYPE_TLV },
[RSL_IE_IPAC_PROXY_UDP] = { TLV_TYPE_FIXED, 2 },
[RSL_IE_IPAC_BSCMPL_TOUT] = { TLV_TYPE_TV },
[RSL_IE_IPAC_REMOTE_IP] = { TLV_TYPE_FIXED, 4 },
@ -134,6 +135,7 @@ const struct tlv_definition rsl_att_tlvdef = {
[RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV },
[RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 },
[RSL_IE_IPAC_CONN_STAT] = { TLV_TYPE_TLV, 28 },
[RSL_IE_IPAC_HO_C_PARMS] = { TLV_TYPE_TLV },
[RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
[RSL_IE_IPAC_RTP_CSD_FMT] = { TLV_TYPE_TV },
[RSL_IE_IPAC_RTP_JIT_BUF] = { TLV_TYPE_FIXED, 2 },

Loading…
Cancel
Save