FR/FRNET: add Frame Relay emulation

Add frame relay testcase for BSS and SGSN side.
The test cases require hdlc interfaces (based on
dadhi with super channels and no lmi).

Change-Id: I95d64dc26a8d2ff02d6cf2bfcd22a97e5481f957
diff --git a/fr-net/FRNET_Tests.ttcn b/fr-net/FRNET_Tests.ttcn
new file mode 100644
index 0000000..c2994f6
--- /dev/null
+++ b/fr-net/FRNET_Tests.ttcn
@@ -0,0 +1,80 @@
+module FRNET_Tests {
+
+import from General_Types all;
+import from Osmocom_Types all;
+import from Osmocom_Gb_Types all;
+
+import from NS_Emulation all;
+import from BSSGP_Emulation all;
+
+modulepar {
+	NSConfigurations mp_nsconfig := {
+		{
+			provider := {
+				fr := {
+					netdev := "hdlc2",
+					dlci := 123
+				}
+			},
+			nsvci := 123,
+			nsei := 123,
+			role_sgsn := true,
+			handle_sns := false
+		}
+	};
+}
+
+type record GbInstance {
+	NS_CT vc_NS,
+	BSSGP_CT vc_BSSGP,
+	BssgpConfig cfg
+};
+
+const integer NUM_GB := 1;
+type record length(NUM_GB) of GbInstance GbInstances;
+type record length(NUM_GB) of NSConfiguration NSConfigurations;
+type record length(NUM_GB) of BssgpCellId BssgpCellIds;
+
+
+type component test_CT {
+	var GbInstances g_gb;
+};
+
+private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT {
+	var charstring id_idx := id & int2str(offset);
+	gb.vc_NS := NS_CT.create(id_idx & "-NSemu");
+	gb.vc_BSSGP := BSSGP_CT.create(id_idx & "-BSSGPemu");
+	connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP);
+	gb.vc_NS.start(NSStart(mp_nsconfig[offset], id_idx));
+	gb.vc_BSSGP.start(BssgpStart(gb.cfg, testcasename()));
+}
+
+testcase TC_foo() runs on test_CT {
+	g_gb[0].cfg := {
+		nsei := 123,
+		sgsn_role := true,
+		bvc := {
+			{
+				bvci := 1123,
+				cell_id := {
+					ra_id := {
+						lai := {
+							mcc_mnc := '262F42'H,
+							lac := 11123
+						},
+						rac := 1
+					},
+					cell_id := 31123
+				},
+				depth := BSSGP_DECODE_DEPTH_LLC
+			}
+		}
+	};
+	f_init_gb(g_gb[0], "gb", 0);
+	while (true) {
+		f_sleep(100.0);
+	}
+}
+
+
+}