summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-18 19:03:36 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-18 19:47:04 +0100
commita2526a85d3f6e0ab083ef1b1f3418d75740aa1d9 (patch)
tree9daa312fbffc60c4ac0dcab6782dd96f07289061
parentf58a0222211b264382223663f7526e024c6e6651 (diff)
BSSGP_Emulation: Add SNDCP decoding support
-rwxr-xr-xgprs_gb/gen_links.sh5
-rw-r--r--library/BSSGP_Emulation.ttcn30
-rw-r--r--library/LLC_Templates.ttcn7
-rw-r--r--sgsn/SGSN_Tests.ttcn5
-rwxr-xr-xsgsn/gen_links.sh5
5 files changed, 47 insertions, 5 deletions
diff --git a/gprs_gb/gen_links.sh b/gprs_gb/gen_links.sh
index 85a35ab..5cbaaae 100755
--- a/gprs_gb/gen_links.sh
+++ b/gprs_gb/gen_links.sh
@@ -47,6 +47,11 @@ DIR=$BASEDIR/titan.ProtocolModules.LLC_v7.1.0/src
FILES="LLC_EncDec.cc LLC_Types.ttcn"
gen_links $DIR $FILES
+DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src
+FILES="SNDCP_Types.ttcn"
+gen_links $DIR $FILES
+
+
DIR=../library
FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "
FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn
index 0be12e8..a26e01f 100644
--- a/library/BSSGP_Emulation.ttcn
+++ b/library/BSSGP_Emulation.ttcn
@@ -14,6 +14,8 @@ import from MobileL3_Types all;
import from LLC_Types all;
import from LLC_Templates all;
+import from SNDCP_Types all;
+
/***********************************************************************
* Communication between Client Components and Main Component
***********************************************************************/
@@ -601,7 +603,8 @@ type record BssgpDecoded {
PDU_BSSGP bssgp,
PDU_LLC llc optional,
PDU_L3_MS_SGSN l3_mo optional,
- PDU_L3_SGSN_MS l3_mt optional
+ PDU_L3_SGSN_MS l3_mt optional,
+ PDU_SN sndcp optional
}
/* Decode a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */
@@ -610,7 +613,8 @@ private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_CT return BssgpDecod
bssgp := bssgp,
llc := omit,
l3_mo := omit,
- l3_mt := omit
+ l3_mt := omit,
+ sndcp := omit
};
/* Decode LLC, if it is a PDU that contains LLC */
@@ -628,6 +632,11 @@ private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_CT return BssgpDecod
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 (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) {
+ dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI);
+ }
return dec;
}
@@ -657,21 +666,32 @@ template BssgpDecoded tr_BD_BSSGP(template PDU_BSSGP bg) := {
bssgp := bg,
llc := *,
l3_mo := *,
- l3_mt := *
+ l3_mt := *,
+ sndcp := *
+}
+
+template BssgpDecoded tr_BD_LLC(template PDU_LLC llc) := {
+ bssgp := ?,
+ llc := llc,
+ l3_mo := *,
+ l3_mt := *,
+ sndcp := *
}
template BssgpDecoded tr_BD_L3_MT(template PDU_L3_SGSN_MS mt) := {
bssgp := ?,
llc := ?,
l3_mo := omit,
- l3_mt := mt
+ l3_mt := mt,
+ sndcp := omit
}
template BssgpDecoded tr_BD_L3_MO(template PDU_L3_MS_SGSN mo) := {
bssgp := ?,
llc := ?,
l3_mo := mo,
- l3_mt := omit
+ l3_mt := omit,
+ sndcp := omit
}
diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn
index cfe97f8..7bc4088 100644
--- a/library/LLC_Templates.ttcn
+++ b/library/LLC_Templates.ttcn
@@ -68,5 +68,12 @@ const BIT1 LLC_CR_UL_RSP := '1'B;
/* LLC UI frame with SAPI for L3 payload */
template PDU_LLC tr_LLC_UI_L3 := ( tr_LLC_UI(?, c_LLC_SAPI_LLGMM) );
+/* LLC UI frame with SAPI for User payload */
+template PDU_LLC tr_LLC_UI_USER := tr_LLC_UI(?, (c_LLC_SAPI_LL3,
+ c_LLC_SAPI_LL5,
+ c_LLC_SAPI_LL9,
+ c_LLC_SAPI_LL11)
+ );
+
}
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 6dd56ae..a381692 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -24,6 +24,11 @@ import from GTP_CodecPort all;
import from GTPC_Types all;
import from GTPU_Types all;
+import from LLC_Types all;
+import from LLC_Templates all;
+
+import from SNDCP_Types all;
+
import from TELNETasp_PortType all;
import from Osmocom_VTY_Functions all;
diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh
index b450288..c398779 100755
--- a/sgsn/gen_links.sh
+++ b/sgsn/gen_links.sh
@@ -59,6 +59,11 @@ DIR=$BASEDIR/titan.ProtocolModules.LLC_v7.1.0/src
FILES="LLC_EncDec.cc LLC_Types.ttcn"
gen_links $DIR $FILES
+DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src
+FILES="SNDCP_Types.ttcn"
+gen_links $DIR $FILES
+
+
DIR=$BASEDIR/titan.ProtocolModules.MobileL3_v13.4.0/src
FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn"
gen_links $DIR $FILES