BSSGP_Emulation: Implement LLC sending also for SGSN-role

We used to support sending of LLC messages only for the MS role,
where we generated BSSGP UL UNITDATA.  Let's also support the
SGSN role, where we have to generate BSSGP DL UNITDATA

Change-Id: If86f4b7c9e7c3c799c274f37a350dec4a788f124
diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn
index 849e147..c60868e 100644
--- a/library/BSSGP_Emulation.ttcn
+++ b/library/BSSGP_Emulation.ttcn
@@ -597,11 +597,18 @@
 		BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci));
 	}
 
-	[] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {
+	/* ConnHdlr sends raw LLC: Encode and send as UL_UD / DL_UD */
+	[not g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {
 		var integer idx := f_tbl_idx_by_comp(vc_conn);
 		var octetstring llc_enc := enc_PDU_LLC(llc);
 		BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci));
 	}
+	[g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {
+		var integer idx := f_tbl_idx_by_comp(vc_conn);
+		var octetstring llc_enc := enc_PDU_LLC(llc);
+		BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));
+	}
+
 }
 
 function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t {