HNBAP, RUA and RANAP protocol codecs
This patch introduces protocol codecs for the HNBAP, RUA and RANAP
protocols, which is mandatory for testing IuCS, IuPS or Iuh in
the future.
As Eclipse TITAN ASN.1 only supports the BER codec and the above
protocols all use APER, we need to use an external transcoder from
APER to BER and vice-versa. This was implemented using a proprietary
ASN.1 compiler / trnaslator which sysmocom is packaging as
libfftranscode, which is made available as binary package
for Debian 9 at https://ftp.osmocom.org/binaries/libfftranscode/
Related: OS#2856, OS#2857, OS#2858
Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5
diff --git a/library/ranap/RANAP_Selftests.ttcn b/library/ranap/RANAP_Selftests.ttcn
new file mode 100644
index 0000000..dd72e35
--- /dev/null
+++ b/library/ranap/RANAP_Selftests.ttcn
@@ -0,0 +1,76 @@
+module RANAP_Selftests {
+
+import from RANAP_CommonDataTypes all;
+import from RANAP_Constants all;
+import from RANAP_Containers all;
+import from RANAP_IEs all;
+import from RANAP_PDU_Contents all;
+import from RANAP_PDU_Descriptions all;
+import from RANAP_Types all;
+
+type component test_CT {
+};
+
+const octetstring c_InitUE_CM_SRV_REQ := '001340400000060003400100000f40060046f3120064003a40080046f312006400000010400e0d052471034f188005f407000008004f40030000000056400546f312000f'O;
+const octetstring c_CommonId := '000f4010000001001740095046239134707780f3'O;
+const octetstring c_DT_CM_SRV_ACK := '0014400f000002003b40010000104003020521'O;
+const octetstring c_DT_MO_SETUP := '00144019000001001040121103450404600200815e0381654215021101'O;
+const octetstring c_DT_MT_CALL_PROC := '00144010000002003b4001000010400403830280'O;
+const octetstring c_RAB_AssReq := '0000404700000100360040000001003500363802d0012fa7202fa80000f44c080a028000514000272028140067400000222814003c40000000503d0800101faf026ed64047d40000400100'O;
+const octetstring c_RAB_AssResp := '6000001a000001003440130000010033400c60087c0a80242240e2040000'O;
+const octetstring c_IuRelReq := '000b4009000001000440020340'O;
+const octetstring c_ResetResource := '001b001c00000300030001000004400142004d400b000001004e000400000000'O;
+const octetstring c_IuRelCmd := '00014009000001000400020340'O;
+
+type record EnDecTestcase {
+ charstring name,
+ octetstring encoded
+};
+
+type record of EnDecTestcase EnDecTestcases;
+
+const EnDecTestcases test_data := {
+ {
+ name := "InitialUE_CM_SRV_REQ",
+ encoded := c_InitUE_CM_SRV_REQ
+ }, {
+ name := "CommonID",
+ encoded := c_CommonId
+ }, {
+ name := "DirectTransfer CM SERVICE ACK",
+ encoded := c_DT_CM_SRV_ACK
+ }, {
+ name := "DirectTransfer MO CC SETUP",
+ encoded := c_DT_MO_SETUP
+ }, {
+ name := "DirectTransfer MT CC CALL PROCEEDING",
+ encoded := c_DT_MT_CALL_PROC
+ }, {
+ name := "RAB Assignment Request",
+ encoded := c_RAB_AssReq
+ }, {
+ name := "RAB Assignment Response",
+ encoded := c_RAB_AssResp
+ }, {
+ name := "Iu Release Request",
+ encoded := c_IuRelReq
+ }, {
+ name := "Reset Resource",
+ encoded := c_ResetResource
+ }, {
+ name := "Iu Release Command",
+ encoded := c_IuRelCmd
+ }
+};
+
+testcase TC_foo() runs on test_CT {
+ var integer i;
+ for (i := 0; i < lengthof(test_data); i := i+1) {
+ var EnDecTestcase tc := test_data[i];
+ var RANAP_PDU pdu := dec_RANAP_PDU(tc.encoded);
+ log(tc.name, " decoded: ", pdu);
+ }
+ setverdict(pass);
+}
+
+}