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/hnbap/HNBAP_PDU_Contents.asn b/library/hnbap/HNBAP_PDU_Contents.asn
new file mode 100644
index 0000000..97c9743
--- /dev/null
+++ b/library/hnbap/HNBAP_PDU_Contents.asn
@@ -0,0 +1,490 @@
+-- HNBAP-PDU-Contents.asn
+--
+-- 3GPP TS 25.469 V10.1.0 (2011-06)
+-- http://www.3gpp.org/ftp/Specs/html-info/25469.htm
+--
+-- 9.3.3	PDU Definitions
+--
+
+HNBAP-PDU-Contents {
+itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) 
+umts-Access (20) modules (3) hnbap(6) version1 (1) hnbap-PDU-Contents (1) }
+
+DEFINITIONS AUTOMATIC TAGS ::= 
+
+BEGIN
+
+-- **************************************************************
+--
+-- IE parameter types from other modules.
+--
+-- **************************************************************
+
+IMPORTS
+	Cause,
+	CriticalityDiagnostics, 
+	CSGMembershipStatus,
+	HNB-Location-Information,
+	HNB-Identity,
+	Context-ID,
+	UE-Identity,
+	LAC,
+	RAC,
+	SAC,
+	CN-DomainIndicator,
+	IP-Address,
+	Registration-Cause,
+	UE-Capabilities,
+	PLMNidentity,
+	CellIdentity,
+	RNC-ID,
+	CSG-ID,
+	HNB-Cell-Access-Mode,
+	BackoffTimer,
+	MuxPortNumber,
+	RABList,
+	HNBConfigInfo,
+	AccessResult,
+	Update-cause,
+	NeighbourInfoList,
+	NeighbourInfoRequestList,
+	PSC
+
+
+
+FROM HNBAP-IEs
+
+
+	ProtocolExtensionContainer{},
+	ProtocolIE-ContainerList{},
+	ProtocolIE-Container{},
+	ProtocolIE-Single-Container{},
+	PrivateIE-Container{},
+	HNBAP-PRIVATE-IES,
+	HNBAP-PROTOCOL-EXTENSION,
+	HNBAP-PROTOCOL-IES
+
+FROM HNBAP-Containers
+
+	id-Cause,
+	id-CriticalityDiagnostics, 
+	id-CSGMembershipStatus,
+	id-HNB-Location-Information,
+	id-HNB-Identity,
+	id-Context-ID,
+	id-PLMNidentity,
+	id-UE-Identity,
+	id-LAC,
+	id-RAC,
+	id-SAC,
+	id-UE-Capabilities,
+	id-Registration-Cause,
+	id-CellIdentity,
+	id-RNC-ID,
+	id-CSG-ID,
+	id-HNB-Cell-Access-Mode,
+	id-BackoffTimer,
+	id-Service-Area-For-Broadcast,
+	id-MuxPortNumber,
+	id-RABList,
+	id-HNBConfigInfo,
+	id-AccessResult,
+	id-Update-cause,
+	id-NeighbourInfoList,
+	id-NeighbourInfoRequestList,
+	id-Iurh-Signalling-TNL-Address,
+	id-PSC
+
+
+FROM HNBAP-Constants;
+
+-- **************************************************************
+--
+-- HNB Register REQUEST
+--
+-- **************************************************************
+
+HNBRegisterRequest ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container       { {HNBRegisterRequestIEs} },
+	protocolExtensions	ProtocolExtensionContainer { {HNBRegisterRequestExtensions} } 	OPTIONAL,
+	...
+}
+
+HNBRegisterRequestIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-HNB-Identity						CRITICALITY reject	TYPE HNB-Identity					PRESENCE mandatory } |
+	{ ID id-HNB-Location-Information			CRITICALITY reject	TYPE HNB-Location-Information		PRESENCE mandatory } |
+	{ ID id-PLMNidentity						CRITICALITY reject	TYPE PLMNidentity					PRESENCE mandatory } |
+	{ ID id-CellIdentity						CRITICALITY reject	TYPE CellIdentity					PRESENCE mandatory } |
+	{ ID id-LAC									CRITICALITY reject	TYPE LAC							PRESENCE mandatory } |
+	{ ID id-RAC									CRITICALITY reject	TYPE RAC							PRESENCE mandatory } |
+	{ ID id-SAC									CRITICALITY reject	TYPE SAC							PRESENCE mandatory } |
+	{ ID id-CSG-ID								CRITICALITY reject	TYPE CSG-ID							PRESENCE optional } ,
+	...
+}
+
+HNBRegisterRequestExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	{ ID id-Service-Area-For-Broadcast		CRITICALITY ignore	EXTENSION SAC								PRESENCE optional }|
+	{ ID id-HNB-Cell-Access-Mode			CRITICALITY reject	EXTENSION HNB-Cell-Access-Mode				PRESENCE optional }|
+	{ ID id-PSC								CRITICALITY ignore	EXTENSION PSC								PRESENCE optional }|
+	{ ID id-Iurh-Signalling-TNL-Address		CRITICALITY ignore	EXTENSION IP-Address						PRESENCE optional },
+	...
+}
+
+-- **************************************************************
+--
+-- HNB Register Accept
+--
+-- **************************************************************
+
+HNBRegisterAccept ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {HNBRegisterResponseIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {HNBRegisterResponseExtensions} }	OPTIONAL,
+	...
+}
+
+HNBRegisterResponseIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-RNC-ID						CRITICALITY reject	TYPE RNC-ID				PRESENCE mandatory },
+	...
+}
+
+HNBRegisterResponseExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+-- Extension for Release 9 to support CS Multiplexing --
+	{ ID id-MuxPortNumber				CRITICALITY ignore	EXTENSION MuxPortNumber		PRESENCE optional}|
+	{ ID id-Iurh-Signalling-TNL-Address	CRITICALITY ignore	EXTENSION IP-Address		PRESENCE optional},
+	...
+}
+
+-- **************************************************************
+--
+-- HNB Register REJECT
+--
+-- **************************************************************
+
+HNBRegisterReject ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container       { {HNBRegisterRejectIEs} },
+	protocolExtensions	ProtocolExtensionContainer { {HNBRegisterRejectExtensions} } 	OPTIONAL,
+	...
+}
+
+HNBRegisterRejectIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Cause						CRITICALITY ignore	TYPE Cause						PRESENCE mandatory} |
+	{ ID id-CriticalityDiagnostics		CRITICALITY ignore	TYPE CriticalityDiagnostics		PRESENCE optional } |
+	{ ID id-BackoffTimer				CRITICALITY reject	TYPE BackoffTimer				PRESENCE conditional },
+	-- This IE shall be present if the Cause IE is set to "Overload".
+	...
+}
+
+HNBRegisterRejectExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+
+
+-- **************************************************************
+--
+-- HNB De- Register
+--
+-- **************************************************************
+
+HNBDe-Register ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container       { {HNBDe-RegisterIEs} },
+	protocolExtensions	ProtocolExtensionContainer { {HNBDe-RegisterExtensions} } 	OPTIONAL,
+	...
+}
+
+HNBDe-RegisterIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Cause				CRITICALITY ignore	TYPE Cause			PRESENCE mandatory } |
+	{ ID id-BackoffTimer		CRITICALITY reject	TYPE BackoffTimer	PRESENCE conditional },
+	-- This IE shall be present if the Cause IE is set to "Overload".
+	...
+}
+
+HNBDe-RegisterExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+
+-- **************************************************************
+--
+-- UE Register REQUEST
+--
+-- **************************************************************
+
+UERegisterRequest ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container       { {UERegisterRequestIEs} },
+	protocolExtensions	ProtocolExtensionContainer { {UERegisterRequestExtensions} } 	OPTIONAL,
+	...
+}
+
+UERegisterRequestIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-UE-Identity						CRITICALITY reject	TYPE UE-Identity				PRESENCE mandatory } |
+	{ ID id-Registration-Cause				CRITICALITY ignore	TYPE Registration-Cause			PRESENCE mandatory } |
+	{ ID id-UE-Capabilities					CRITICALITY reject	TYPE UE-Capabilities			PRESENCE mandatory },
+	...
+}
+
+UERegisterRequestExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- UE Register ACCEPT
+--
+-- **************************************************************
+
+UERegisterAccept ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {UERegisterAcceptIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {UERegisterAcceptExtensions} } 	OPTIONAL,
+	...
+}
+
+UERegisterAcceptIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-UE-Identity				CRITICALITY reject	TYPE UE-Identity		PRESENCE mandatory } |
+	{ ID id-Context-ID				CRITICALITY reject	TYPE Context-ID			PRESENCE mandatory },
+	...
+}
+
+
+UERegisterAcceptExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	{ ID id-CSGMembershipStatus		CRITICALITY	 reject		EXTENSION CSGMembershipStatus			PRESENCE optional	},
+	...
+}
+
+-- **************************************************************
+--
+-- UE Register REJECT
+--
+-- **************************************************************
+
+UERegisterReject ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {UERegisterRejectIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {UERegisterRejectExtensions} } 	OPTIONAL,
+	...
+}
+
+UERegisterRejectIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-UE-Identity					CRITICALITY reject	TYPE UE-Identity				PRESENCE mandatory } |
+	{ ID id-Cause						CRITICALITY ignore	TYPE Cause						PRESENCE mandatory} |
+	{ ID id-CriticalityDiagnostics		CRITICALITY ignore	TYPE CriticalityDiagnostics		PRESENCE optional },
+	...
+}
+
+UERegisterRejectExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+
+-- **************************************************************
+--
+-- UE De-Register
+--
+-- **************************************************************
+
+UEDe-Register ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {UEDe-RegisterIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {UEDe-RegisterExtensions} } 	OPTIONAL,
+	...
+}
+
+UEDe-RegisterIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Context-ID						CRITICALITY reject	TYPE Context-ID				PRESENCE mandatory } |
+	{ ID id-Cause							CRITICALITY ignore	TYPE Cause					PRESENCE mandatory } ,
+	...
+}
+
+UEDe-RegisterExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- CSG Membership Update
+--
+-- **************************************************************
+
+CSGMembershipUpdate ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {CSGMembershipUpdateIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {CSGMembershipUpdateExtensions} } 	OPTIONAL,
+	...
+}
+
+CSGMembershipUpdateIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Context-ID					CRITICALITY reject	TYPE Context-ID					PRESENCE mandatory } |
+	{ ID id-CSGMembershipStatus			CRITICALITY	reject	TYPE CSGMembershipStatus		PRESENCE mandatory },
+	...
+}
+
+CSGMembershipUpdateExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- TNL Update Request
+--
+-- **************************************************************
+
+TNLUpdateRequest ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {TNLUpdateRequestIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {TNLUpdateExtensions} } 	OPTIONAL,
+	...
+}
+
+TNLUpdateRequestIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Context-ID					CRITICALITY reject	TYPE Context-ID					PRESENCE mandatory } |
+	{ ID id-RABList						CRITICALITY reject	TYPE RABList					PRESENCE mandatory } |
+	{ ID id-Update-cause				CRITICALITY reject	TYPE Update-cause				PRESENCE mandatory } ,
+		...
+}
+
+TNLUpdateExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- TNL UPDATE RESPONSE
+--
+-- **************************************************************
+
+TNLUpdateResponse ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ { TNLUpdateResponseIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ { TNLUpdateResponseExtensions} } 	OPTIONAL,
+	...
+}
+
+TNLUpdateResponseIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Context-ID					CRITICALITY reject	TYPE Context-ID				PRESENCE mandatory } ,
+		...
+}
+
+TNLUpdateResponseExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- TNL UPDATE FAILURE
+--
+-- **************************************************************
+
+TNLUpdateFailure ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {TNLUpdateFailureIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {TNLUpdateFailureExtensions} } 	OPTIONAL,
+	...
+}
+
+TNLUpdateFailureIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Context-ID					CRITICALITY reject	TYPE Context-ID					PRESENCE mandatory } |
+	{ ID id-Cause						CRITICALITY ignore	TYPE Cause						PRESENCE mandatory } |
+	{ ID id-CriticalityDiagnostics		CRITICALITY ignore	TYPE CriticalityDiagnostics		PRESENCE optional } ,
+		...
+}
+
+TNLUpdateFailureExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- HNB Configuration Transfer Request
+--
+-- **************************************************************
+
+HNBConfigTransferRequest ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container       { {HNBConfigTransferRequestIEs} },
+	protocolExtensions	ProtocolExtensionContainer { {HNBConfigTransferRequestExtensions} } 	OPTIONAL,
+	...
+}
+
+HNBConfigTransferRequestIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-NeighbourInfoRequestList		CRITICALITY reject	TYPE NeighbourInfoRequestList			PRESENCE mandatory } ,
+	...
+}
+
+HNBConfigTransferRequestExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- HNB Configuration Transfer Response
+--
+-- **************************************************************
+
+HNBConfigTransferResponse ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container       { { HNBConfigTransferResponseIEs} },
+	protocolExtensions	ProtocolExtensionContainer { { HNBConfigTransferResponseExtensions} } 	OPTIONAL,
+	...
+}
+
+HNBConfigTransferResponseIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-NeighbourInfoList			CRITICALITY reject	TYPE NeighbourInfoList				PRESENCE mandatory } ,
+	...
+}
+
+HNBConfigTransferResponseExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- RELOCATION COMPLETE
+--
+-- **************************************************************
+
+RelocationComplete ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ { RelocationCompleteIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ { RelocationCompleteExtensions} } 	OPTIONAL,
+	...
+}
+
+RelocationCompleteIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Context-ID					CRITICALITY ignore	TYPE Context-ID			PRESENCE mandatory } ,
+	...
+}
+
+
+RelocationCompleteExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- ERROR INDICATION
+--
+-- **************************************************************
+
+ErrorIndication ::= SEQUENCE {
+	protocolIEs			ProtocolIE-Container		{ {ErrorIndicationIEs} },
+	protocolExtensions	ProtocolExtensionContainer	{ {ErrorIndicationExtensions} } 	OPTIONAL,
+	...
+}
+
+ErrorIndicationIEs HNBAP-PROTOCOL-IES ::= {
+	{ ID id-Cause						CRITICALITY ignore	TYPE Cause						PRESENCE mandatory } |
+	{ ID id-CriticalityDiagnostics		CRITICALITY ignore	TYPE CriticalityDiagnostics		PRESENCE optional },
+		...
+}
+
+ErrorIndicationExtensions HNBAP-PROTOCOL-EXTENSION ::= {
+	...
+}
+
+-- **************************************************************
+--
+-- PRIVATE MESSAGE
+--
+-- **************************************************************
+
+PrivateMessage ::= SEQUENCE {
+	privateIEs		PrivateIE-Container  {{PrivateMessage-IEs}},
+	...
+}
+
+PrivateMessage-IEs HNBAP-PRIVATE-IES ::= {
+	...
+}
+
+END