CTRL: Introduce support to run osmocom CTRL server

Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn
index d26dc89..294fe33 100644
--- a/library/Osmocom_CTRL_Functions.ttcn
+++ b/library/Osmocom_CTRL_Functions.ttcn
@@ -117,6 +117,26 @@
 		return rx.cmd.val;
 	}
 
+	/* Expect a matching SET, optionally answer */
+	function f_ctrl_exp_get(IPA_CTRL_PT pt, template CtrlVariable variable,
+				 template (omit) CtrlValue rsp := omit,
+				 float timeout_val := 2.0) {
+		timer T := timeout_val;
+		var CtrlMessage rx;
+		T.start;
+		alt {
+		[] pt.receive(tr_CtrlMsgGet(?, variable)) -> value rx {
+			if (ispresent(rsp)) {
+				pt.send(ts_CtrlMsgGetRepl(rx.cmd.id, valueof(variable), valueof(rsp)));
+			}
+			}
+		[] T.timeout {
+			setverdict(fail, "Timeout waiting for GET ", variable);
+			mtc.stop;
+			}
+		}
+	}
+
 	/* Expect a matching GET result */
 	function f_ctrl_get_exp(IPA_CTRL_PT pt, CtrlVariable variable, template CtrlValue exp) {
 		var charstring ctrl_resp;