BSSGP_Emulation: Add SNDCP decoding support

Change-Id: Icd2e8feed9173b0a2729b7ee1cfac37a86eca6cf
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 LLC_Types all;
 import from LLC_Templates all;
 
+import from SNDCP_Types all;
+
 /***********************************************************************
  * Communication between Client Components and Main Component
  ***********************************************************************/
@@ -601,7 +603,8 @@
 	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 @@
 		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 @@
 			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 @@
 	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
 }