RAN_Emulation: Modularize protocol support

The RAN_Emulation currently unconditionally provides BSSAP and MGCP support.
Let's re-structure the code so that support for those protocols is now
possible to enable/disable at compile time.

This patch is in preparation of introducing RANAP support in RAN_Emulation.

Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd
Related: OS#2856
diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn
index 63d0451..e52b678 100644
--- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn
+++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn
@@ -53,6 +53,7 @@
 	unitdata_cb := refers(UnitdataCallback),
 	decode_dtap := false,
 	role_ms := true,
+	protocol := RAN_PROTOCOL_BSSAP,
 	sccp_addr_local := omit,
 	sccp_addr_peer := omit
 }
diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn
index 383b67b..8635a29 100644
--- a/bsc-nat/MSC_ConnectionHandler.ttcn
+++ b/bsc-nat/MSC_ConnectionHandler.ttcn
@@ -59,6 +59,7 @@
 	unitdata_cb := refers(UnitdataCallback),
 	decode_dtap := false,
 	role_ms := false,
+	protocol := RAN_PROTOCOL_BSSAP,
 	sccp_addr_local := omit,
 	sccp_addr_peer := omit
 }
diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh
index e54eec4..16e32b7 100755
--- a/bsc-nat/gen_links.sh
+++ b/bsc-nat/gen_links.sh
@@ -47,7 +47,7 @@
 gen_links $DIR $FILES
 
 DIR=../library
-FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn"
+FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn"
 gen_links $DIR $FILES
 
 ignore_pp_results
diff --git a/bsc-nat/regen_makefile.sh b/bsc-nat/regen_makefile.sh
index c5fe64c..f49df7e 100755
--- a/bsc-nat/regen_makefile.sh
+++ b/bsc-nat/regen_makefile.sh
@@ -4,6 +4,6 @@
 
 FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc"
 
-export CPPFLAGS_TTCN3="-DIPA_EMULATION_SCCP -DIPA_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR"
+export CPPFLAGS_TTCN3="-DIPA_EMULATION_SCCP -DIPA_EMULATION_MGCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR"
 
 ../regen-makefile.sh $MAIN $FILES