diff options
author | Oliver Smith <osmith@sysmocom.de> | 2019-09-02 08:36:36 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2019-09-02 09:15:33 +0200 |
commit | aac9b9cecaaf3f6e93bf888c195416cf32a99987 (patch) | |
tree | a66b0e58a29bd9bac11799d064ef9fb1006cfb89 | |
parent | 0167c2aecf5fbef31ae255d0d3848e30a5c5622a (diff) |
BSSGP_Emulation: add BssgpDecodeDepth
Make the decoding level (BSSGP, LLC, SNDCP, L3) configurable, so the
existing PCU tests, that expect messages only decoded to the BSSGP
level, can pass again. Move the SNDCP decoding in f_dec_bssgp above the
L3 decoding, so f_dec_bssgp goes through the layers in the reverse order
of f_send_bssgp_dec.
I have verified, that all testsuites using the BSSGP Emulation (SGSN,
PCU, PCU-SNS) are still working with this patch.
Related: OS#4180
Fixes: 955aa94504510139a12d223071cf49ef90788a3d ("BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure")
Change-Id: I8f76385528c1de98c557cee451c0e0dfd182b605
-rw-r--r-- | library/BSSGP_Emulation.ttcn | 43 | ||||
-rw-r--r-- | pcu/PCU_Tests.ttcn | 3 | ||||
-rw-r--r-- | sgsn/SGSN_Tests.ttcn | 9 |
3 files changed, 37 insertions, 18 deletions
diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index 44946c11..e3023edf 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -164,11 +164,19 @@ private template LLC_Entity t_LLC_init(boolean sgsn_role := false) := { n_u_rx_last := - } +type enumerated BssgpDecodeDepth { + BSSGP_DECODE_DEPTH_BSSGP, + BSSGP_DECODE_DEPTH_LLC, + BSSGP_DECODE_DEPTH_SNDCP, + BSSGP_DECODE_DEPTH_L3 +}; + type record BssgpConfig { Nsvci nsei, Nsvci bvci, BssgpCellId cell_id, - boolean sgsn_role + boolean sgsn_role, + BssgpDecodeDepth depth }; function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci) @@ -706,25 +714,32 @@ private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_CT return BssgpDecod }; /* Decode LLC, if it is a PDU that contains LLC */ - if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) { - dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU); - } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) { - dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU); + if (g_cfg.depth >= BSSGP_DECODE_DEPTH_LLC) { + if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) { + dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU); + } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) { + dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU); + } } - /* Decode L3, if it is a LLC PDU containing L3 */ - if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) { - if (g_cfg.sgsn_role) { - dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI); - } else { - dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI); + /* Decode SNDCP, if it is a LLC PDU containing user plane data */ + if (g_cfg.depth >= BSSGP_DECODE_DEPTH_SNDCP) { + if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) { + dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI); } } - /* Decode SNDCP, if it is a LLC PDU containing user plane data */ - if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) { - dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI); + /* Decode L3, if it is a LLC PDU containing L3 */ + if (g_cfg.depth >= BSSGP_DECODE_DEPTH_L3) { + if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) { + if (g_cfg.sgsn_role) { + dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI); + } else { + dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI); + } + } } + return dec; } diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn index a88dfed5..0f43f289 100644 --- a/pcu/PCU_Tests.ttcn +++ b/pcu/PCU_Tests.ttcn @@ -44,7 +44,8 @@ modulepar { }, cell_id := 20960 }, - sgsn_role := true + sgsn_role := true, + depth := BSSGP_DECODE_DEPTH_BSSGP }; NSConfiguration mp_nsconfig := { diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index db7d54b5..b68df853 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -286,7 +286,8 @@ function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT { }, cell_id := 20960 }, - sgsn_role := false + sgsn_role := false, + depth := BSSGP_DECODE_DEPTH_L3 }; g_gb[1].cfg := { nsei := 97, @@ -299,7 +300,8 @@ function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT { }, cell_id := 20961 }, - sgsn_role := false + sgsn_role := false, + depth := BSSGP_DECODE_DEPTH_L3 }; g_gb[2].cfg := { nsei := 98, @@ -312,7 +314,8 @@ function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT { }, cell_id := 20962 }, - sgsn_role := false + sgsn_role := false, + depth := BSSGP_DECODE_DEPTH_L3 }; f_init_vty(); |