rsl: Fix tlv_parse of IPAC_DLCX_IND message

The IE was missing in rsl_att_tlvdef.

Related: SYS#5915
Change-Id: Ib637197ef3508ec94aec05d08d4e6aa15ddea055
This commit is contained in:
Pau Espin 2022-04-04 19:26:05 +02:00
parent 767bfd8c87
commit 388a53a8d7
3 changed files with 49 additions and 0 deletions

View File

@ -133,6 +133,7 @@ const struct tlv_definition rsl_att_tlvdef = {
[RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 }, [RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 },
[RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV }, [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV },
[RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 }, [RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 },
[RSL_IE_IPAC_CONN_STAT] = { TLV_TYPE_TLV, 28 },
[RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 }, [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
[RSL_IE_IPAC_RTP_CSD_FMT] = { TLV_TYPE_TV }, [RSL_IE_IPAC_RTP_CSD_FMT] = { TLV_TYPE_TV },
[RSL_IE_IPAC_RTP_JIT_BUF] = { TLV_TYPE_FIXED, 2 }, [RSL_IE_IPAC_RTP_JIT_BUF] = { TLV_TYPE_FIXED, 2 },

View File

@ -193,6 +193,52 @@ static void test_sw_descr()
msgb_free(msg); msgb_free(msg);
} }
/* Test decode IPAC_DLCX_IND obtained from SYS#5915 */
static void test_dec_ipac_dlc_indx()
{
/* Radio Signalling Link (RSL)
0111 111. = Message discriminator: ip.access Vendor Specific messages (63)
.... ...0 = T bit: Not considered transparent by BTS
.111 0110 = Message type: ip.access DLCX INDication (0x76)
Channel number IE
Element identifier: Channel Number (0x01)
0000 1... = C-bits: Bm + ACCH (1)
.... .110 = Time slot number (TN): 6
Element identifier: Connection Identifier (0xf8)
ip.access Connection ID: 0
Element identifier: Connection Statistics (0xf6)
[1 byte length here, val = 28 (0x1c)]
Packets Sent: 1202
Octets Sent: 45052
Packets Received: 556
Octets Received: 24580
Packets Lost: 0
Inter-arrival Jitter: 0
Average Tx Delay: 0
Cause IE
Element identifier: Cause (0x1a)
Length: 1
0... .... = Extension: No Extension
.000 .... = Class: Normal event (0)
.000 1111 = Cause Value: normal event, unspecified (15)
*/
const uint8_t hex[] = {
0x7e, 0x76, 0x01, 0x0e, 0xf8, 0x00, 0x00, 0xf6, 0x1c, 0x00, 0x00, 0x04, 0xb2, 0x00, 0x00, 0xaf,
0xfc, 0x00, 0x00, 0x02, 0x2c, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x01, 0x0f
};
struct abis_rsl_dchan_hdr *dh = (struct abis_rsl_dchan_hdr *)&hex[0];
struct tlv_parsed tp;
int rc;
printf("Testing decoding IPAC_DLCX_IND\n");
rc = rsl_tlv_parse(&tp, dh->data, sizeof(hex) - sizeof(*dh));
OSMO_ASSERT(rc == 3);
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
void *ctx = talloc_named_const(NULL, 0, "abis_test"); void *ctx = talloc_named_const(NULL, 0, "abis_test");
@ -202,6 +248,7 @@ int main(int argc, char **argv)
test_simple_sw_config(); test_simple_sw_config();
test_simple_sw_short(); test_simple_sw_short();
test_dual_sw_config(); test_dual_sw_config();
test_dec_ipac_dlc_indx();
printf("OK.\n"); printf("OK.\n");

View File

@ -38,4 +38,5 @@ len: 13
file_id: 09 07 05 file_id: 09 07 05
file_ver: 06 07 08 file_ver: 06 07 08
test_dual_sw_config(): OK test_dual_sw_config(): OK
Testing decoding IPAC_DLCX_IND
OK. OK.