diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..9630214
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,67 @@
+FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as rcbuild
+
+ENV PATH=/opt/go/1.14/bin:$PATH
+ENV PATH $PATH:/usr/local/bin
+RUN echo $PATH
+RUN go version
+ENV GOPATH /go
+ENV GOBIN /go/bin
+ENV CFG_FILE /opt/ric/config/config-file.json
+
+ARG RMRVERSION=4.0.2
+ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb
+ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb
+RUN wget --content-disposition ${RMRLIBURL} && dpkg -i rmr_${RMRVERSION}_amd64.deb
+RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
+RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
+
+ARG XAPPFRAMEVERSION=v0.4.11
+WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt
+RUN git clone -b ${XAPPFRAMEVERSION} "https://gerrit.o-ran-sc.org/r/ric-plt/xapp-frame"
+RUN cd xapp-frame && \
+    GO111MODULE=on go mod vendor -v && \
+    cp -r vendor/* /go/src/ && \
+    rm -rf vendor
+
+WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-app
+COPY go.mod .
+COPY go.sum .
+COPY cmd cmd
+COPY control control
+COPY e2ap e2ap
+COPY e2sm e2sm
+COPY protocol protocol
+COPY xapp-descriptor xapp-descriptor
+RUN ls
+
+RUN go get golang.org/x/net@v0.0.0-20210614182718-04defd469f4e
+RUN go get google.golang.org/grpc@v1.39.0
+
+# "COMPILING E2AP Wrapper"
+RUN cd e2ap && \
+    gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
+    gcc *.o -shared -o libe2apwrapper.so && \
+    cp libe2apwrapper.so /usr/local/lib/ && \
+    mkdir /usr/local/include/e2ap && \
+    cp wrapper.h headers/*.h /usr/local/include/e2ap && \
+    ldconfig
+
+# "COMPILING E2SM Wrapper"
+RUN cd e2sm && \
+    gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
+    gcc *.o -shared -o libe2smwrapper.so && \
+    cp libe2smwrapper.so /usr/local/lib/ && \
+    mkdir /usr/local/include/e2sm && \
+    cp wrapper.h headers/*.h /usr/local/include/e2sm && \
+    ldconfig
+
+
+RUN go build ./cmd/rc.go && pwd && ls -lat
+
+FROM ubuntu:18.04
+ENV CFG_FILE /opt/ric/config/config-file.json
+COPY --from=rcbuild /usr/local/lib /usr/local/lib
+RUN ldconfig
+WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-app
+COPY --from=rcbuild /go/src/gerrit.o-ran-sc.org/r/ric-app/rc .
+CMD ./rc
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3f1d800
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+
+==================================================================================
+       Copyright (c) 2020 AT&T Intellectual Property.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================================
+
+RC Xapp
+================
+
+This repository contains the source for sending RIC control Msg to RAN/E2 Node  based on the GRPC control request received from other xapps
+
+This xApp can be onboarded through the xApp Onboarder.  The xapp descriptor 
+is under the xapp-descriptor/ directory.
+
+Then the xapp can be deployed through the App Manager.
+
+GRPC communication can be tested using the grpccurl command
diff --git a/cmd/rc.go b/cmd/rc.go
new file mode 100644
index 0000000..743894b
--- /dev/null
+++ b/cmd/rc.go
@@ -0,0 +1,10 @@
+package main
+
+import (
+	"gerrit.o-ran-sc.org/r/scp/ric-app/control"
+)
+
+func main() {
+	c := control.NewControl()
+	c.Run()
+}
diff --git a/control/go.mod b/control/go.mod
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/control/go.mod
diff --git a/control/grpcserver.go b/control/grpcserver.go
new file mode 100644
index 0000000..a30770e
--- /dev/null
+++ b/control/grpcserver.go
@@ -0,0 +1,55 @@
+package control
+
+import (
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	"gerrit.o-ran-sc.org/r/scp/ric-app/protocol/grpc/ricmsgcommrpc/rc"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/health"
+	"google.golang.org/grpc/health/grpc_health_v1"
+	"net"
+)
+
+// RCControlServer represents the grpc server
+type RCControlServer struct {
+}
+
+//Start gRPC Server For receiving Control   Messages from dataingestion
+func StartgRPCRCControlCommServerRoutine() error {
+
+	//log.Println("Starting Go Routine for Handling gRPC Server for handling gRPC RCControl Handling")
+	xapp.Logger.Info("Starting Go Routine for Handling gRPC Server for handling gRPC RCControl Handling ")
+	port := xapp.Config.GetString("controls.ricHOControlgRpcServerPort")
+	xapp.Logger.Info("GrpcServer started listening on Port port =  %v", port)
+	lConnStr := ":" + port
+
+	// create a listener on TCP port Configured
+	lLis, lErr := net.Listen("tcp", lConnStr)
+	if lErr != nil {
+		//log.Printf("GrpcServer Listen failed with error", lErr)
+		xapp.Logger.Info("GrpcServer Listen failed with error = %v", lErr)
+		return lErr
+	}
+
+	xapp.Logger.Info("GrpcServer started listening on Connection: %v", lConnStr)
+	// create a server instance
+	lRCControlSrv := RCControlServer{}
+
+	// create a grpc server object
+	lgRPCServer := grpc.NewServer()
+
+	// attach the Ping service to the server
+	rc.RegisterMsgCommServer(lgRPCServer, &lRCControlSrv)
+
+	//Register to health service
+	grpc_health_v1.RegisterHealthServer(lgRPCServer, health.NewServer())
+
+	xapp.Logger.Debug("GrpcServer Serve start with port = %v and lConnStr = %v and lgRPCServer = %v ", lLis, lConnStr, lgRPCServer)
+
+	// start the server
+	if lErr := lgRPCServer.Serve(lLis); lErr != nil {
+		xapp.Logger.Info("GrpcServer Serve failed with error", lErr)
+		return lErr
+	}
+
+	return nil
+}
diff --git a/control/rcControl.go b/control/rcControl.go
new file mode 100644
index 0000000..7570d0b
--- /dev/null
+++ b/control/rcControl.go
@@ -0,0 +1,313 @@
+package control
+
+import (
+	"errors"
+	"fmt"
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	"gerrit.o-ran-sc.org/r/scp/ric-app/protocol/grpc/ricmsgcommrpc/rc"
+	"log"
+	"os"
+	"strconv"
+	"sync"
+	"time"
+)
+
+var (
+	gControlData               *Control
+	gChan_RicControlReq_handle = make(chan *rc.RicControlGrpcReq, 2000) //Make it configurable
+)
+
+func NewControl() Control {
+
+	file := "/opt/rc.log"
+	logFile, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0766)
+	if err != nil {
+		panic(err)
+	}
+	log.SetOutput(logFile)
+	log.SetPrefix("[qSkipTool]")
+	log.SetFlags(log.LstdFlags | log.Lshortfile | log.LUTC)
+	logLevel := xapp.Config.GetInt("controls.logLevel")
+	xapp.Logger.SetLevel(logLevel)
+
+	xapp.Logger.Debug("GRPC Server Port = %v ", xapp.Config.GetString("controls.ricHOControlgRpcServerPort"))
+	xapp.Logger.Debug("Log Level = %d ", xapp.Config.GetInt("controls.logLevel"))
+
+	return Control{5,
+		make(chan *xapp.RMRParams, 1000), //Make it configurable
+		make(map[int]bool),
+		&sync.Mutex{},
+		0}
+}
+
+func ReadyCB(i interface{}) {
+	gControlData = i.(*Control)
+
+	go controlLoop()
+
+	//Start gRPC Server for Receiving messages
+
+	go StartgRPCRCControlCommServerRoutine()
+	xapp.Logger.Info("StartgRPCRCControlCommServerRoutine done")
+
+	//To Handle RIC Control Message
+	go StartHandleControlReqRoutine()
+
+}
+
+func (aControlData *Control) Run() {
+	xapp.SetReadyCB(ReadyCB, aControlData)
+	xapp.Run(aControlData)
+}
+
+func (aControlData *Control) Consume(rp *xapp.RMRParams) (err error) {
+	gControlData.rcChan <- rp
+	return
+}
+
+func (aControlData *Control) rmrSend(params *xapp.RMRParams) (err error) {
+	if !xapp.Rmr.Send(params, false) {
+		err = errors.New("rmr.Send() failed")
+		xapp.Logger.Error("Failed to rmrSend to %v", err)
+		log.Printf("Failed to rmrSend to %v", err)
+	}
+	return
+}
+
+func (aControlData *Control) rmrReplyToSender(params *xapp.RMRParams) (err error) {
+	if !xapp.Rmr.Send(params, true) {
+		err = errors.New("rmr.Send() failed")
+		xapp.Logger.Error("Failed to rmrReplyToSender to %v", err)
+		log.Printf("Failed to rmrReplyToSender to %v", err)
+	}
+	return
+}
+
+func controlLoop() {
+	for {
+		msg := <-gControlData.rcChan
+		xapp.Logger.Debug("Received message type: %d", msg.Mtype)
+		log.Printf("Received message type: %d", msg.Mtype)
+		switch msg.Mtype {
+		case 12041:
+			go HandleControlResponse(msg)
+		case 12042:
+			go HandleControlFailure(msg)
+		default:
+			err := errors.New("Message Type " + strconv.Itoa(msg.Mtype) + " is discarded")
+			xapp.Logger.Error("Unknown message type: %v", err)
+			log.Printf("Unknown message type: %v", err)
+		}
+	}
+}
+
+func StartHandleControlReqRoutine() {
+
+	log.Printf("Starting Go Routine for Handling GRPC RIC Control msg ")
+	xapp.Logger.Info("Starting Go Routine for Handling GRPC RIC Control msg ")
+	for {
+		_, ok := <-gChan_RicControlReq_handle
+		if ok == false {
+			xapp.Logger.Error("Invalid grpc request received, dont process further")
+			break
+		}
+		HandlegRPCRICControlMsgReq(<-gChan_RicControlReq_handle)
+	}
+	xapp.Logger.Debug("StartHandleControlReqRoutine Done")
+}
+
+func HandlegRPCRICControlMsgReq(aPtrRicControlGrpcReq *rc.RicControlGrpcReq) {
+
+	lRicHoControlMsg := RicHoControlMsg{}
+	lRicHoControlMsg.RicControlGrpcReqPtr = aPtrRicControlGrpcReq
+
+	lUEID := lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID
+	xapp.Logger.Debug("HandlegRPCRICControlMsgReq UEID = %s ", lUEID)
+        //Mandatory parameters validation
+        if lRicHoControlMsg.RicControlGrpcReqPtr.E2NodeID == "" ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID == "" ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID == "" ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.PlmnID == "" ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlActionId < 0 ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlStyle < 0 ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.RICControlCellTypeVal < 0 ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RICRequestorID < 0 ||
+                lRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RanFuncId < 0 {
+		xapp.Logger.Error("Mandaroty parameters missing, dont send control request ")
+		return
+	}
+
+	lRicHoControlMsg.GetSequenceNumber()
+
+	go lRicHoControlMsg.SendRicControlRequest(lRicHoControlMsg.GetSequenceNumber())
+
+	return
+}
+
+func (aRicHoControlMsg *RicHoControlMsg) GetSequenceNumber() int {
+
+	//Incrementing the RIC Requestor Instance Id to make the request unique and traceable.
+	gControlData.eventRicControlReqExpiredMu.Lock()
+	gControlData.ricRequestInstanceID = gControlData.ricRequestInstanceID + 1
+	gControlData.eventRicControlReqExpiredMu.Unlock()
+
+	return gControlData.ricRequestInstanceID
+}
+
+func (aRicHoControlMsg *RicHoControlMsg) setEventRicControlCreateExpiredTimer(aSeqNum int) {
+
+	gControlData.eventRicControlReqExpiredMu.Lock()
+	gControlData.eventRicControlReqExpiredMap[aSeqNum] = false
+	gControlData.eventRicControlReqExpiredMu.Unlock()
+
+	timer := time.NewTimer(time.Duration(gControlData.eventRicControlReqTimePeriod) * time.Second)
+	go func(t *time.Timer) {
+		defer t.Stop()
+		xapp.Logger.Debug("RIC_CONTROL_REQ[%s]: Waiting for RIC_CONTROL_RESP...", aSeqNum)
+		log.Printf("RIC_CONTROL_REQ[%s]: Waiting for RIC_CONTROL_RESP...", aSeqNum)
+		for {
+			select {
+			case <-t.C:
+				gControlData.eventRicControlReqExpiredMu.Lock()
+				isResponsed := gControlData.eventRicControlReqExpiredMap[aSeqNum]
+				delete(gControlData.eventRicControlReqExpiredMap, aSeqNum)
+				gControlData.eventRicControlReqExpiredMu.Unlock()
+				if !isResponsed {
+					xapp.Logger.Debug("RIC_CONTROL_REQ[%s]: RIC Event Create Timer experied!", aSeqNum)
+					log.Printf("RIC_CONTROL_REQ[%s]: RIC Event Create Timer experied!", aSeqNum)
+					//Send ErrorIndication message on Timeout
+					return
+				}
+			default:
+				gControlData.eventRicControlReqExpiredMu.Lock()
+				flag := gControlData.eventRicControlReqExpiredMap[aSeqNum]
+				if flag {
+					delete(gControlData.eventRicControlReqExpiredMap, aSeqNum)
+					gControlData.eventRicControlReqExpiredMu.Unlock()
+					xapp.Logger.Debug("RIC_CONTROL_REQ[%s]: RIC Event Create Timer canceled!", aSeqNum)
+					log.Printf("RIC_CONTROL_REQ[%s]: RIC Event Create Timer canceled!", aSeqNum)
+					return
+				} else {
+					gControlData.eventRicControlReqExpiredMu.Unlock()
+				}
+			}
+			time.Sleep(100 * time.Millisecond)
+		}
+	}(timer)
+}
+func (aRicHoControlMsg *RicHoControlMsg) SendRicControlRequest(aRequestSN int) (err error) {
+	var e2ap *E2ap
+	var e2sm *E2sm
+
+	xapp.Logger.Info("SendRicControlRequest Enter for RanName = %s", aRicHoControlMsg.RicControlGrpcReqPtr.RanName)
+
+	if aRicHoControlMsg.RicControlGrpcReqPtr == nil {
+		return err
+	}
+
+	var lRicControlStyleType int64 = aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlStyle
+	var lRicControlActionID int64 = aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlActionId
+	lUEID := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID
+
+	lUeIdBuf := []byte(aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
+
+	xapp.Logger.Debug("UEID:%s, lUeIdBuf: %v", aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID, lUeIdBuf)
+
+	var lRicControlHeader []byte = make([]byte, 256) //Check the Size
+	lRicControlHeaderEncoded, err := e2sm.SetRicControlHeader(lRicControlHeader, lUeIdBuf, lRicControlStyleType, lRicControlActionID)
+	if err != nil {
+		xapp.Logger.Error("SetRicControlHeader Failed: %v, UEID:%s", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
+		log.Printf("SetRicControlHeader Failed: %v, UEID:%s", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
+		return err
+	} else {
+		xapp.Logger.Info("SetRicControlHeader is success: %x", lRicControlHeaderEncoded)
+		fmt.Fprintf(os.Stderr, "Encoded RIC Control Header PDU:\n")
+		for i := 0; i < len(lRicControlHeaderEncoded); i++ {
+			fmt.Fprintf(os.Stderr, " %02x", lRicControlHeaderEncoded[i])
+		}
+		fmt.Fprintf(os.Stderr, "\n")
+	}
+
+	var lTargetPrimaryCell int64 = RIC_CONTROL_TARGET_PRIMARY_CELL
+	var lTargetCell int64 = RIC_CONTROL_TARGET_CELL
+	var lNrCGIOrECGI int64 = RIC_CONTROL_CGI_TYPE
+
+	lNrOrEUtraCellType := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.RICControlCellTypeVal
+	lTargetCellVal := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID
+	lTargetCellValBuf := []byte(lTargetCellVal)
+
+	var lRicControlMessage []byte = make([]byte, 1024) 
+	lRicControlMessageEncoded, err := e2sm.SetRicControlMessage(lRicControlMessage, lTargetPrimaryCell, lTargetCell, lNrCGIOrECGI, int64(lNrOrEUtraCellType), lTargetCellValBuf)
+	if err != nil {
+		xapp.Logger.Error("SetRicControlMessage Failed: %v, UEID:%s", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
+		log.Printf("SetRicControlMessage Failed: %v, UEID:%s", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
+		return err
+	} else {
+		xapp.Logger.Debug("SetRicControlMessage is success: %x", lRicControlMessageEncoded)
+		fmt.Fprintf(os.Stderr, "Encoded RIC Control Message PDU:\n")
+		for i := 0; i < len(lRicControlMessageEncoded); i++ {
+			fmt.Fprintf(os.Stderr, " %02x", lRicControlMessageEncoded[i])
+		}
+		fmt.Fprintf(os.Stderr, "\n")
+	}
+
+	lParams := &xapp.RMRParams{}
+	lParams.Mtype = 12040 //RIC_CONTROL_REQ
+	lParams.SubId = -1
+
+	var lRequestorId uint16 = uint16(aRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RICRequestorID)
+	var lFuncId uint16 = uint16(aRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RanFuncId)
+
+	lParams.Payload = make([]byte, 2048)
+	lParams.Payload, err = e2ap.SetRicControlRequestPayload(lParams.Payload, lRequestorId, uint16(aRequestSN), lFuncId,
+		lRicControlHeaderEncoded, lRicControlMessageEncoded)
+	if err != nil {
+		xapp.Logger.Error("SetRicControlRequestPayload Failed: %v, UEID:%s", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
+		log.Printf("SetRicControlRequestPayload Failed: %v, UEID:%s", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
+		return err
+	} else {
+		xapp.Logger.Debug("Encoding RicControlRequestPayload is success. UEID: %s, Payload: %x", lUEID, lParams.Payload)
+		fmt.Fprintf(os.Stderr, "Encoded RIC Control Req PDU:\n")
+		for i := 0; i < len(lParams.Payload); i++ {
+			fmt.Fprintf(os.Stderr, " %02x", lParams.Payload[i])
+		}
+		fmt.Fprintf(os.Stderr, "\n")
+	}
+
+	valEnbId := aRicHoControlMsg.RicControlGrpcReqPtr.E2NodeID
+	valRanName := aRicHoControlMsg.RicControlGrpcReqPtr.RanName
+	valPlmnId := aRicHoControlMsg.RicControlGrpcReqPtr.PlmnID
+	lParams.Meid = &xapp.RMRMeid{PlmnID: valPlmnId, EnbID: valEnbId, RanName: valRanName}
+
+	xapp.Logger.Debug("The RIC Control RMR message to be sent is with MsgType:%d  SubId=%d, lParams.Meid: %v, UEID: %s", lParams.Mtype, lParams.SubId, lParams.Meid, lUEID)
+
+	xapp.Logger.Debug("Sending RIC Control message to RanName: %s, UEID: %s  ", aRicHoControlMsg.RicControlGrpcReqPtr.RanName, lUEID)
+
+	err = gControlData.rmrSend(lParams)
+	if err != nil {
+		xapp.Logger.Error("Failed to send RIC_CONTROL_REQ: %v", err)
+		log.Printf("Failed to send RIC_CONTROL_REQ: %v", err)
+		return err
+	}
+
+	xapp.Logger.Info("Sending RIC Control message to RanName: %s, UEID: %s  Success", aRicHoControlMsg.RicControlGrpcReqPtr.RanName, lUEID)
+
+	aRicHoControlMsg.setEventRicControlCreateExpiredTimer(aRequestSN) //TODO check if this is required as we are not expecting Control ACK
+
+	return nil
+}
+
+func HandleControlResponse(params *xapp.RMRParams) (err error) {
+	xapp.Logger.Debug("The SubId in RIC_CONTROL_RESP is %d", params.SubId)
+	log.Printf("The SubId in RIC_CONTROL_RESP is %d", params.SubId)
+
+	return nil
+}
+
+func HandleControlFailure(params *xapp.RMRParams) (err error) {
+
+	xapp.Logger.Debug("The SubId in RIC_CONTROL_FAILURE is %d", params.SubId)
+	log.Printf("The SubId in RIC_CONTROL_FAILURE is %d", params.SubId)
+
+	return nil
+}
diff --git a/control/rcE2AP.go b/control/rcE2AP.go
new file mode 100644
index 0000000..456b6d0
--- /dev/null
+++ b/control/rcE2AP.go
@@ -0,0 +1,61 @@
+/*
+==================================================================================
+  Copyright (c) 2019 AT&T Intellectual Property.
+  Copyright (c) 2019 Nokia
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================================
+*/
+
+package control
+
+/*
+#include <stdlib.h>
+#include <e2ap/wrapper.h>
+#cgo LDFLAGS: -le2apwrapper
+#cgo CFLAGS: -I/usr/local/include/e2ap
+*/
+import "C"
+
+import (
+	"errors"
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	"unsafe"
+)
+
+type E2ap struct {
+}
+
+func (c *E2ap) SetRicControlRequestPayload(payload []byte, ricRequestorID uint16, ricRequestSequenceNumber uint16, ranFunctionID uint16,
+	ricControlHdr []byte, ricControlMsg []byte) (newPayload []byte, err error) {
+
+	cptr := unsafe.Pointer(&payload[0])
+	cptr_ricControlHdr := unsafe.Pointer(&ricControlHdr[0])
+	cptr_ricControlMsg := unsafe.Pointer(&ricControlMsg[0])
+
+	xapp.Logger.Debug("\n")
+	xapp.Logger.Debug("ricControlHdr\n", ricControlHdr)
+	xapp.Logger.Debug("\n")
+	xapp.Logger.Debug("ricControlMsg\n", ricControlMsg)
+	xapp.Logger.Debug("\n")
+
+	size := C.e2ap_encode_ric_control_request_message(cptr, C.size_t(len(payload)), C.long(ricRequestorID), C.long(ricRequestSequenceNumber),
+		C.long(ranFunctionID), cptr_ricControlHdr, C.size_t(len(ricControlHdr)), cptr_ricControlMsg, C.size_t(len(ricControlMsg)))
+	if size < 0 {
+		return make([]byte, 0), errors.New("e2ap wrapper is unable to set Subscription Request Payload due to wrong or invalid payload")
+	}
+	newPayload = C.GoBytes(cptr, (C.int(size)+7)/8)
+	xapp.Logger.Info("SetRicControlHeader is success")
+	return
+}
+
diff --git a/control/rcE2SmRc.go b/control/rcE2SmRc.go
new file mode 100644
index 0000000..ea1492d
--- /dev/null
+++ b/control/rcE2SmRc.go
@@ -0,0 +1,64 @@
+/*
+==================================================================================
+  Copyright (c) 2019 AT&T Intellectual Property.
+  Copyright (c) 2019 Nokia
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================================
+*/
+
+package control
+
+/*
+#include <e2sm/wrapper.h>
+#cgo LDFLAGS: -le2smwrapper -lm
+#cgo CFLAGS: -I/usr/local/include/e2sm
+*/
+import "C"
+
+import (
+	"errors"
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	"unsafe"
+)
+
+type E2sm struct {
+}
+
+func (c *E2sm) SetRicControlHeader(buffer []byte, ueIDbuf []byte, ricControlStyleType int64, ricControlActionID int64) (newBuffer []byte, err error) {
+	cptr := unsafe.Pointer(&buffer[0])
+	cptr_ueIDbuf := unsafe.Pointer(&ueIDbuf[0])
+	size := C.e2sm_encode_ric_control_header(cptr, C.size_t(len(buffer)), cptr_ueIDbuf, C.size_t(len(ueIDbuf)),
+		C.long(ricControlStyleType), C.long(ricControlActionID))
+
+	if size < 0 {
+		return make([]byte, 0), errors.New("e2sm wrapper is unable to set EventTriggerDefinition due to wrong or invalid input")
+	}
+	newBuffer = C.GoBytes(cptr, (C.int(size)+7)/8)
+	xapp.Logger.Info("E2sm SetRicControlHeader is success")
+	return
+}
+
+func (c *E2sm) SetRicControlMessage(buffer []byte, targetPrimaryCell int64, targetCell int64, nrCGIOrECGI int64, nrOrEUtraCell int64, ranParameterValue []byte) (newBuffer []byte, err error) {
+	cptr := unsafe.Pointer(&buffer[0])
+	cptrRanParameterValue := unsafe.Pointer(&ranParameterValue[0])
+
+	size := C.e2sm_encode_ric_control_message(cptr, C.size_t(len(buffer)), C.long(targetPrimaryCell),
+		C.long(targetCell), C.long(nrOrEUtraCell), C.long(nrCGIOrECGI), cptrRanParameterValue, C.size_t(len(ranParameterValue)))
+	if size < 0 {
+		return make([]byte, 0), errors.New("e2sm wrapper is unable to set RicControlMessage due to wrong or invalid input")
+	}
+	newBuffer = C.GoBytes(cptr, (C.int(size)+7)/8) //TOCHECK: if C.int(size) is returning bits not bytes to get correct size of the buffer.
+	xapp.Logger.Info("E2sm SetRicControlMessage is success")
+	return
+}
diff --git a/control/rcService.go b/control/rcService.go
new file mode 100644
index 0000000..39175e9
--- /dev/null
+++ b/control/rcService.go
@@ -0,0 +1,59 @@
+package control
+
+import (
+	"log"
+	"runtime/debug"
+	_ "strings"
+	"time"
+
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	"gerrit.o-ran-sc.org/r/scp/ric-app/protocol/grpc/ricmsgcommrpc/rc"
+	"golang.org/x/net/context"
+)
+
+func (aPtrSendMsgSrv *RCControlServer) SendRICControlReqServiceGrpc(aCtx context.Context, aPtrRicControlGrpcReq *rc.RicControlGrpcReq) (*rc.RicControlGrpcRsp, error) {
+
+	xapp.Logger.Info("SendRICControlReqServiceGrpc Enter ")
+
+	defer func() {
+		if r := recover(); r != nil {
+			log.Println("Encountered panic:", r)
+			xapp.Logger.Error("Encountered panic:", r)
+			debug.SetTraceback("all")
+			time.Sleep(100 * time.Millisecond)
+			panic(r)
+		}
+	}()
+
+	var lRicControlGrpcRsp rc.RicControlGrpcRsp
+	lRicControlGrpcRsp.RspCode = GRPC_ERROR 
+	lRicControlGrpcRsp.Description = "The client specified an invalid argument. or some parameters are missing "
+	if aPtrRicControlGrpcReq == nil {
+		xapp.Logger.Error("Received nil data from Send error rsp")
+	} else {
+		if len(aPtrRicControlGrpcReq.E2NodeID) == 0 || len(aPtrRicControlGrpcReq.RICControlMessageData.TargetCellID) == 0 || len(aPtrRicControlGrpcReq.RICControlHeaderData.UEID) == 0 {
+			xapp.Logger.Error("Mandatory parameters are not received send Error rsp to client,no control Request will be initiated ")
+		} else {
+			xapp.Logger.Info("GRPC Control request validated, initiate Control Request to RAN")
+			gChan_RicControlReq_handle <- aPtrRicControlGrpcReq
+			xapp.Logger.Debug("Received RIC Control Request with RicRequestorID: %d", aPtrRicControlGrpcReq.RICE2APHeaderData.RICRequestorID)
+			xapp.Logger.Debug("Received RIC Control Request with RicActionId: %d", aPtrRicControlGrpcReq.RICE2APHeaderData.RanFuncId)
+
+			xapp.Logger.Debug("Received RIC Control Request with UEID: %s", aPtrRicControlGrpcReq.RICControlHeaderData.UEID)
+			xapp.Logger.Debug("Received RIC Control Request with ControlStyle: %d", aPtrRicControlGrpcReq.RICControlHeaderData.ControlStyle)
+			xapp.Logger.Debug("Received RIC Control Request with ControlActionId: %d", aPtrRicControlGrpcReq.RICControlHeaderData.ControlActionId)
+
+			xapp.Logger.Debug("Received RIC Control Request with CellType: %d", aPtrRicControlGrpcReq.RICControlMessageData.RICControlCellTypeVal)
+			xapp.Logger.Debug("Received RIC Control Request with TargetCellID: %s", aPtrRicControlGrpcReq.RICControlMessageData.TargetCellID)
+			xapp.Logger.Debug("Received RIC Control Request with RanName: %s", aPtrRicControlGrpcReq.RanName)
+			lRicControlGrpcRsp.RspCode = GRPC_SUCCESS //int32(lGrpcRspStatusCode)
+			lRicControlGrpcRsp.Description = "Success Response"
+			xapp.Logger.Debug("RICHOCONTROL_EVENT: Success Response sent with  RspCode:%d, Description:%s", lRicControlGrpcRsp.RspCode, lRicControlGrpcRsp.Description)
+		}
+	}
+
+	xapp.Logger.Info("RICHOCONTROL_EVENT: Response sent with  RspCode:%d, Description:%s", lRicControlGrpcRsp.RspCode, lRicControlGrpcRsp.Description)
+
+	log.Printf(" Response sent to , rsp: {Code: ", lRicControlGrpcRsp.RspCode, ", Description: ", lRicControlGrpcRsp.Description, "}")
+	return &lRicControlGrpcRsp, nil
+}
diff --git a/control/rcTypes.go b/control/rcTypes.go
new file mode 100644
index 0000000..7e9f73e
--- /dev/null
+++ b/control/rcTypes.go
@@ -0,0 +1,35 @@
+package control
+
+import (
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	rc "gerrit.o-ran-sc.org/r/scp/ric-app/protocol/grpc/ricmsgcommrpc/rc"
+	"sync"
+)
+
+const MAX_CONTROL_REQ_ATTEMPTS = 2
+const RIC_CONTROL_STYLE_TYPE = 3
+const RIC_CONTROL_ACTION_ID = 1
+
+const TIME_NANOSEC = 1000000000
+
+const RIC_CONTROL_TARGET_PRIMARY_CELL = 1
+const RIC_CONTROL_TARGET_CELL = 2
+const RIC_CONTROL_CELL_TYPE = 3
+const RIC_CONTROL_CGI_TYPE = 4
+
+//GRPC rsp codes
+const GRPC_SUCCESS = 0
+const GRPC_ERROR = -1
+
+type Control struct {
+	eventRicControlReqTimePeriod int32                //maximum time for the RIC Subscription Request event creation procedure in the E2 Node
+	rcChan                       chan *xapp.RMRParams //channel for receiving rmr message
+	eventRicControlReqExpiredMap map[int]bool //map for recording the RIC Subscription Request event creation procedure is expired or not
+	eventRicControlReqExpiredMu  *sync.Mutex  //mutex for eventCreateExpiredMap
+	ricRequestInstanceID         int
+}
+
+type RicHoControlMsg struct {
+	RicControlGrpcReqPtr *rc.RicControlGrpcReq
+}
+
diff --git a/docs/_static/logo.png b/docs/_static/logo.png
new file mode 100644
index 0000000..c3b6ce5
--- /dev/null
+++ b/docs/_static/logo.png
Binary files differ
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..974c309
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,3 @@
+from docs_conf.conf import *
+
+linkcheck_ignore = ["http://localhost.*", "http://127.0.0.1.*", "https://gerrit.o-ran-sc.org.*"]
diff --git a/docs/conf.yaml b/docs/conf.yaml
new file mode 100644
index 0000000..c4cef1d
--- /dev/null
+++ b/docs/conf.yaml
@@ -0,0 +1,3 @@
+---
+project_cfg: oran
+project: ric-app-rc
diff --git a/docs/developers-guide.rst b/docs/developers-guide.rst
new file mode 100644
index 0000000..eca24f3
--- /dev/null
+++ b/docs/developers-guide.rst
@@ -0,0 +1,22 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2020 AT&T Intellectual Property
+
+
+Developers Guide
+=================
+
+.. contents::
+   :depth: 3
+   :local:
+
+
+Version bumping the Xapp
+------------------------
+
+This project follows semver. When changes are made, update the version strings in:
+
+#. ``container-tag.yaml``
+#. ``docs/release-notes.rst``
+#. ``setup.py``
+#. ``xapp-descriptor/config.json``
diff --git a/docs/favicon.ico b/docs/favicon.ico
new file mode 100644
index 0000000..00b0fd0
--- /dev/null
+++ b/docs/favicon.ico
Binary files differ
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..ec3cd0b
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,20 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2020 AT&T Intellectual Property
+
+
+Welcome to O-RAN SC rc Documentation
+============================================
+
+.. toctree::
+   :maxdepth: 2
+   :caption: Contents:
+
+   overview.rst
+   release-notes.rst
+   installation-guide.rst
+   developers-guide.rst
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/docs/installation-guide.rst b/docs/installation-guide.rst
new file mode 100644
index 0000000..dafaacd
--- /dev/null
+++ b/docs/installation-guide.rst
@@ -0,0 +1,16 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2020 AT&T Intellectual Property
+
+
+Installation Guide
+==================
+
+.. contents::
+   :depth: 3
+   :local:
+
+Installation
+------------
+
+[to come]
diff --git a/docs/overview.rst b/docs/overview.rst
new file mode 100644
index 0000000..b68e78f
--- /dev/null
+++ b/docs/overview.rst
@@ -0,0 +1,10 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2020 AT&T Intellectual Property
+
+rc Control Overview
+==================
+
+rc is an Xapp used to send RIC control message to E2 / Ran Node based on the GRPC control request received.
+rc Xapp  acts as a GRPC server.It receives and processes the GRPC control request to construct the RIC Control message.
+ASN1 encoding of RIC Control Message will be done and sent to E2/RAN Node using RMR.
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
new file mode 100644
index 0000000..cf28514
--- /dev/null
+++ b/docs/release-notes.rst
@@ -0,0 +1,12 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2020 AT&T Intellectual Property
+
+Release Notes
+===============
+
+All notable changes to this project will be documented in this file.
+
+The format is based on `Keep a Changelog <http://keepachangelog.com/>`__
+and this project adheres to `Semantic Versioning <http://semver.org/>`__.
+
diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt
new file mode 100644
index 0000000..09a0c1c
--- /dev/null
+++ b/docs/requirements-docs.txt
@@ -0,0 +1,5 @@
+sphinx
+sphinx-rtd-theme
+sphinxcontrib-httpdomain
+recommonmark
+lfdocs-conf
diff --git a/e2ap/headers/ANY.h b/e2ap/headers/ANY.h
new file mode 100644
index 0000000..b30381f
--- /dev/null
+++ b/e2ap/headers/ANY.h
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_TYPE_ANY_H
+#define ASN_TYPE_ANY_H
+
+#include <OCTET_STRING.h>	/* Implemented via OCTET STRING type */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct ANY {
+	uint8_t *buf;	/* BER-encoded ANY contents */
+	int size;	/* Size of the above buffer */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} ANY_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_ANY;
+extern asn_TYPE_operation_t asn_OP_ANY;
+extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
+
+asn_struct_free_f ANY_free;
+asn_struct_print_f ANY_print;
+ber_type_decoder_f ANY_decode_ber;
+der_type_encoder_f ANY_encode_der;
+xer_type_encoder_f ANY_encode_xer;
+per_type_decoder_f ANY_decode_uper;
+per_type_encoder_f ANY_encode_uper;
+per_type_decoder_f ANY_decode_aper;
+per_type_encoder_f ANY_encode_aper;
+
+#define ANY_free         OCTET_STRING_free
+#define ANY_print        OCTET_STRING_print
+#define ANY_compare      OCTET_STRING_compare
+#define ANY_constraint   asn_generic_no_constraint
+#define ANY_decode_ber   OCTET_STRING_decode_ber
+#define ANY_encode_der   OCTET_STRING_encode_der
+#define ANY_decode_xer   OCTET_STRING_decode_xer_hex
+
+/******************************
+ * Handy conversion routines. *
+ ******************************/
+
+/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
+int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
+int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
+ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
+ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
+
+/* Convert the contents of the ANY type into the specified type. */
+int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
+int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
+
+#define	ANY_fromBuf(s, buf, size)	OCTET_STRING_fromBuf((s), (buf), (size))
+#define	ANY_new_fromBuf(buf, size)	OCTET_STRING_new_fromBuf(	\
+						&asn_DEF_ANY, (buf), (size))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_TYPE_ANY_H */
diff --git a/e2ap/headers/BIT_STRING.h b/e2ap/headers/BIT_STRING.h
new file mode 100644
index 0000000..c1bdbbc
--- /dev/null
+++ b/e2ap/headers/BIT_STRING.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BIT_STRING_H_
+#define	_BIT_STRING_H_
+
+#include <OCTET_STRING.h>	/* Some help from OCTET STRING */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct BIT_STRING_s {
+	uint8_t *buf;	/* BIT STRING body */
+	size_t size;	/* Size of the above buffer */
+
+	int bits_unused;/* Unused trailing bits in the last octet (0..7) */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} BIT_STRING_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
+extern asn_TYPE_operation_t asn_OP_BIT_STRING;
+extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
+
+asn_struct_print_f BIT_STRING_print;	/* Human-readable output */
+asn_struct_compare_f BIT_STRING_compare;
+asn_constr_check_f BIT_STRING_constraint;
+xer_type_encoder_f BIT_STRING_encode_xer;
+oer_type_decoder_f BIT_STRING_decode_oer;
+oer_type_encoder_f BIT_STRING_encode_oer;
+per_type_decoder_f BIT_STRING_decode_uper;
+per_type_encoder_f BIT_STRING_encode_uper;
+asn_random_fill_f  BIT_STRING_random_fill;
+
+#define BIT_STRING_free              OCTET_STRING_free
+#define BIT_STRING_decode_ber        OCTET_STRING_decode_ber
+#define BIT_STRING_encode_der        OCTET_STRING_encode_der
+#define BIT_STRING_decode_xer        OCTET_STRING_decode_xer_binary
+#define BIT_STRING_decode_aper       OCTET_STRING_decode_aper
+#define BIT_STRING_encode_aper       OCTET_STRING_encode_aper
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BIT_STRING_H_ */
diff --git a/e2ap/headers/Cause.h b/e2ap/headers/Cause.h
new file mode 100644
index 0000000..7bd7e80
--- /dev/null
+++ b/e2ap/headers/Cause.h
@@ -0,0 +1,68 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_Cause_H_
+#define	_Cause_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "CauseRIC.h"
+#include "CauseRICservice.h"
+#include "CauseTransport.h"
+#include "CauseProtocol.h"
+#include "CauseMisc.h"
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Cause_PR {
+	Cause_PR_NOTHING,	/* No components present */
+	Cause_PR_ricRequest,
+	Cause_PR_ricService,
+	Cause_PR_transport,
+	Cause_PR_protocol,
+	Cause_PR_misc
+	/* Extensions may appear below */
+	
+} Cause_PR;
+
+/* Cause */
+typedef struct Cause {
+	Cause_PR present;
+	union Cause_u {
+		CauseRIC_t	 ricRequest;
+		CauseRICservice_t	 ricService;
+		CauseTransport_t	 transport;
+		CauseProtocol_t	 protocol;
+		CauseMisc_t	 misc;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} Cause_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_Cause;
+extern asn_CHOICE_specifics_t asn_SPC_Cause_specs_1;
+extern asn_TYPE_member_t asn_MBR_Cause_1[5];
+extern asn_per_constraints_t asn_PER_type_Cause_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Cause_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseMisc.h b/e2ap/headers/CauseMisc.h
new file mode 100644
index 0000000..1b1efcf
--- /dev/null
+++ b/e2ap/headers/CauseMisc.h
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseMisc_H_
+#define	_CauseMisc_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseMisc {
+	CauseMisc_control_processing_overload	= 0,
+	CauseMisc_hardware_failure	= 1,
+	CauseMisc_om_intervention	= 2,
+	CauseMisc_unspecified	= 3
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseMisc;
+
+/* CauseMisc */
+typedef long	 CauseMisc_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseMisc_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseMisc;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseMisc_specs_1;
+asn_struct_free_f CauseMisc_free;
+asn_struct_print_f CauseMisc_print;
+asn_constr_check_f CauseMisc_constraint;
+ber_type_decoder_f CauseMisc_decode_ber;
+der_type_encoder_f CauseMisc_encode_der;
+xer_type_decoder_f CauseMisc_decode_xer;
+xer_type_encoder_f CauseMisc_encode_xer;
+oer_type_decoder_f CauseMisc_decode_oer;
+oer_type_encoder_f CauseMisc_encode_oer;
+per_type_decoder_f CauseMisc_decode_uper;
+per_type_encoder_f CauseMisc_encode_uper;
+per_type_decoder_f CauseMisc_decode_aper;
+per_type_encoder_f CauseMisc_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseMisc_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseProtocol.h b/e2ap/headers/CauseProtocol.h
new file mode 100644
index 0000000..8b49178
--- /dev/null
+++ b/e2ap/headers/CauseProtocol.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseProtocol_H_
+#define	_CauseProtocol_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseProtocol {
+	CauseProtocol_transfer_syntax_error	= 0,
+	CauseProtocol_abstract_syntax_error_reject	= 1,
+	CauseProtocol_abstract_syntax_error_ignore_and_notify	= 2,
+	CauseProtocol_message_not_compatible_with_receiver_state	= 3,
+	CauseProtocol_semantic_error	= 4,
+	CauseProtocol_abstract_syntax_error_falsely_constructed_message	= 5,
+	CauseProtocol_unspecified	= 6
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseProtocol;
+
+/* CauseProtocol */
+typedef long	 CauseProtocol_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseProtocol_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseProtocol;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseProtocol_specs_1;
+asn_struct_free_f CauseProtocol_free;
+asn_struct_print_f CauseProtocol_print;
+asn_constr_check_f CauseProtocol_constraint;
+ber_type_decoder_f CauseProtocol_decode_ber;
+der_type_encoder_f CauseProtocol_encode_der;
+xer_type_decoder_f CauseProtocol_decode_xer;
+xer_type_encoder_f CauseProtocol_encode_xer;
+oer_type_decoder_f CauseProtocol_decode_oer;
+oer_type_encoder_f CauseProtocol_encode_oer;
+per_type_decoder_f CauseProtocol_decode_uper;
+per_type_encoder_f CauseProtocol_encode_uper;
+per_type_decoder_f CauseProtocol_decode_aper;
+per_type_encoder_f CauseProtocol_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseProtocol_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseRIC.h b/e2ap/headers/CauseRIC.h
new file mode 100644
index 0000000..92cbb95
--- /dev/null
+++ b/e2ap/headers/CauseRIC.h
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseRIC_H_
+#define	_CauseRIC_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseRIC {
+	CauseRIC_ran_function_id_Invalid	= 0,
+	CauseRIC_action_not_supported	= 1,
+	CauseRIC_excessive_actions	= 2,
+	CauseRIC_duplicate_action	= 3,
+	CauseRIC_duplicate_event	= 4,
+	CauseRIC_function_resource_limit	= 5,
+	CauseRIC_request_id_unknown	= 6,
+	CauseRIC_inconsistent_action_subsequent_action_sequence	= 7,
+	CauseRIC_control_message_invalid	= 8,
+	CauseRIC_call_process_id_invalid	= 9,
+	CauseRIC_unspecified	= 10
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseRIC;
+
+/* CauseRIC */
+typedef long	 CauseRIC_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseRIC_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseRIC;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseRIC_specs_1;
+asn_struct_free_f CauseRIC_free;
+asn_struct_print_f CauseRIC_print;
+asn_constr_check_f CauseRIC_constraint;
+ber_type_decoder_f CauseRIC_decode_ber;
+der_type_encoder_f CauseRIC_encode_der;
+xer_type_decoder_f CauseRIC_decode_xer;
+xer_type_encoder_f CauseRIC_encode_xer;
+oer_type_decoder_f CauseRIC_decode_oer;
+oer_type_encoder_f CauseRIC_encode_oer;
+per_type_decoder_f CauseRIC_decode_uper;
+per_type_encoder_f CauseRIC_encode_uper;
+per_type_decoder_f CauseRIC_decode_aper;
+per_type_encoder_f CauseRIC_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseRIC_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseRICservice.h b/e2ap/headers/CauseRICservice.h
new file mode 100644
index 0000000..99ec743
--- /dev/null
+++ b/e2ap/headers/CauseRICservice.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseRICservice_H_
+#define	_CauseRICservice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseRICservice {
+	CauseRICservice_function_not_required	= 0,
+	CauseRICservice_excessive_functions	= 1,
+	CauseRICservice_ric_resource_limit	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseRICservice;
+
+/* CauseRICservice */
+typedef long	 CauseRICservice_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseRICservice_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseRICservice;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseRICservice_specs_1;
+asn_struct_free_f CauseRICservice_free;
+asn_struct_print_f CauseRICservice_print;
+asn_constr_check_f CauseRICservice_constraint;
+ber_type_decoder_f CauseRICservice_decode_ber;
+der_type_encoder_f CauseRICservice_encode_der;
+xer_type_decoder_f CauseRICservice_decode_xer;
+xer_type_encoder_f CauseRICservice_encode_xer;
+oer_type_decoder_f CauseRICservice_decode_oer;
+oer_type_encoder_f CauseRICservice_encode_oer;
+per_type_decoder_f CauseRICservice_decode_uper;
+per_type_encoder_f CauseRICservice_encode_uper;
+per_type_decoder_f CauseRICservice_decode_aper;
+per_type_encoder_f CauseRICservice_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseRICservice_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseTransport.h b/e2ap/headers/CauseTransport.h
new file mode 100644
index 0000000..5204d28
--- /dev/null
+++ b/e2ap/headers/CauseTransport.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseTransport_H_
+#define	_CauseTransport_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseTransport {
+	CauseTransport_unspecified	= 0,
+	CauseTransport_transport_resource_unavailable	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseTransport;
+
+/* CauseTransport */
+typedef long	 CauseTransport_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseTransport_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseTransport;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseTransport_specs_1;
+asn_struct_free_f CauseTransport_free;
+asn_struct_print_f CauseTransport_print;
+asn_constr_check_f CauseTransport_constraint;
+ber_type_decoder_f CauseTransport_decode_ber;
+der_type_encoder_f CauseTransport_encode_der;
+xer_type_decoder_f CauseTransport_decode_xer;
+xer_type_encoder_f CauseTransport_encode_xer;
+oer_type_decoder_f CauseTransport_decode_oer;
+oer_type_encoder_f CauseTransport_encode_oer;
+per_type_decoder_f CauseTransport_decode_uper;
+per_type_encoder_f CauseTransport_encode_uper;
+per_type_decoder_f CauseTransport_decode_aper;
+per_type_encoder_f CauseTransport_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseTransport_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/Criticality.h b/e2ap/headers/Criticality.h
new file mode 100644
index 0000000..3d32aff
--- /dev/null
+++ b/e2ap/headers/Criticality.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_Criticality_H_
+#define	_Criticality_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Criticality {
+	Criticality_reject	= 0,
+	Criticality_ignore	= 1,
+	Criticality_notify	= 2
+} e_Criticality;
+
+/* Criticality */
+typedef long	 Criticality_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_Criticality_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Criticality;
+extern const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1;
+asn_struct_free_f Criticality_free;
+asn_struct_print_f Criticality_print;
+asn_constr_check_f Criticality_constraint;
+ber_type_decoder_f Criticality_decode_ber;
+der_type_encoder_f Criticality_encode_der;
+xer_type_decoder_f Criticality_decode_xer;
+xer_type_encoder_f Criticality_encode_xer;
+oer_type_decoder_f Criticality_decode_oer;
+oer_type_encoder_f Criticality_encode_oer;
+per_type_decoder_f Criticality_decode_uper;
+per_type_encoder_f Criticality_encode_uper;
+per_type_decoder_f Criticality_decode_aper;
+per_type_encoder_f Criticality_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Criticality_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CriticalityDiagnostics-IE-Item.h b/e2ap/headers/CriticalityDiagnostics-IE-Item.h
new file mode 100644
index 0000000..5992ce7
--- /dev/null
+++ b/e2ap/headers/CriticalityDiagnostics-IE-Item.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CriticalityDiagnostics_IE_Item_H_
+#define	_CriticalityDiagnostics_IE_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "Criticality.h"
+#include "ProtocolIE-ID.h"
+#include "TypeOfError.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* CriticalityDiagnostics-IE-Item */
+typedef struct CriticalityDiagnostics_IE_Item {
+	Criticality_t	 iECriticality;
+	ProtocolIE_ID_t	 iE_ID;
+	TypeOfError_t	 typeOfError;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CriticalityDiagnostics_IE_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_IE_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_Item_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CriticalityDiagnostics_IE_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CriticalityDiagnostics-IE-List.h b/e2ap/headers/CriticalityDiagnostics-IE-List.h
new file mode 100644
index 0000000..b823da4
--- /dev/null
+++ b/e2ap/headers/CriticalityDiagnostics-IE-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CriticalityDiagnostics_IE_List_H_
+#define	_CriticalityDiagnostics_IE_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct CriticalityDiagnostics_IE_Item;
+
+/* CriticalityDiagnostics-IE-List */
+typedef struct CriticalityDiagnostics_IE_List {
+	A_SEQUENCE_OF(struct CriticalityDiagnostics_IE_Item) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CriticalityDiagnostics_IE_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_List;
+extern asn_SET_OF_specifics_t asn_SPC_CriticalityDiagnostics_IE_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_List_1[1];
+extern asn_per_constraints_t asn_PER_type_CriticalityDiagnostics_IE_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CriticalityDiagnostics_IE_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CriticalityDiagnostics.h b/e2ap/headers/CriticalityDiagnostics.h
new file mode 100644
index 0000000..ae04eef
--- /dev/null
+++ b/e2ap/headers/CriticalityDiagnostics.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CriticalityDiagnostics_H_
+#define	_CriticalityDiagnostics_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "TriggeringMessage.h"
+#include "Criticality.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RICrequestID;
+struct CriticalityDiagnostics_IE_List;
+
+/* CriticalityDiagnostics */
+typedef struct CriticalityDiagnostics {
+	ProcedureCode_t	*procedureCode;	/* OPTIONAL */
+	TriggeringMessage_t	*triggeringMessage;	/* OPTIONAL */
+	Criticality_t	*procedureCriticality;	/* OPTIONAL */
+	struct RICrequestID	*ricRequestorID;	/* OPTIONAL */
+	struct CriticalityDiagnostics_IE_List	*iEsCriticalityDiagnostics;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CriticalityDiagnostics_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics;
+extern asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_specs_1;
+extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_1[5];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CriticalityDiagnostics_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2AP-PDU.h b/e2ap/headers/E2AP-PDU.h
new file mode 100644
index 0000000..1cf3fc7
--- /dev/null
+++ b/e2ap/headers/E2AP-PDU.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2AP_PDU_H_
+#define	_E2AP_PDU_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2AP_PDU_PR {
+	E2AP_PDU_PR_NOTHING,	/* No components present */
+	E2AP_PDU_PR_initiatingMessage,
+	E2AP_PDU_PR_successfulOutcome,
+	E2AP_PDU_PR_unsuccessfulOutcome
+	/* Extensions may appear below */
+	
+} E2AP_PDU_PR;
+
+/* Forward declarations */
+struct InitiatingMessage;
+struct SuccessfulOutcome;
+struct UnsuccessfulOutcome;
+
+/* E2AP-PDU */
+typedef struct E2AP_PDU {
+	E2AP_PDU_PR present;
+	union E2AP_PDU_u {
+		struct InitiatingMessage	*initiatingMessage;
+		struct SuccessfulOutcome	*successfulOutcome;
+		struct UnsuccessfulOutcome	*unsuccessfulOutcome;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2AP_PDU_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2AP_PDU;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2AP_PDU_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2setupFailure.h b/e2ap/headers/E2setupFailure.h
new file mode 100644
index 0000000..9bfcf0b
--- /dev/null
+++ b/e2ap/headers/E2setupFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2setupFailure_H_
+#define	_E2setupFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2setupFailure */
+typedef struct E2setupFailure {
+	ProtocolIE_Container_87P13_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2setupFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2setupFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2setupRequest.h b/e2ap/headers/E2setupRequest.h
new file mode 100644
index 0000000..c70a6a5
--- /dev/null
+++ b/e2ap/headers/E2setupRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2setupRequest_H_
+#define	_E2setupRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2setupRequest */
+typedef struct E2setupRequest {
+	ProtocolIE_Container_87P11_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2setupRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2setupRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2setupResponse.h b/e2ap/headers/E2setupResponse.h
new file mode 100644
index 0000000..f8920af
--- /dev/null
+++ b/e2ap/headers/E2setupResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2setupResponse_H_
+#define	_E2setupResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2setupResponse */
+typedef struct E2setupResponse {
+	ProtocolIE_Container_87P12_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2setupResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2setupResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ENB-ID-Choice.h b/e2ap/headers/ENB-ID-Choice.h
new file mode 100644
index 0000000..0ccc3ee
--- /dev/null
+++ b/e2ap/headers/ENB-ID-Choice.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ENB_ID_Choice_H_
+#define	_ENB_ID_Choice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENB_ID_Choice_PR {
+	ENB_ID_Choice_PR_NOTHING,	/* No components present */
+	ENB_ID_Choice_PR_enb_ID_macro,
+	ENB_ID_Choice_PR_enb_ID_shortmacro,
+	ENB_ID_Choice_PR_enb_ID_longmacro
+	/* Extensions may appear below */
+	
+} ENB_ID_Choice_PR;
+
+/* ENB-ID-Choice */
+typedef struct ENB_ID_Choice {
+	ENB_ID_Choice_PR present;
+	union ENB_ID_Choice_u {
+		BIT_STRING_t	 enb_ID_macro;
+		BIT_STRING_t	 enb_ID_shortmacro;
+		BIT_STRING_t	 enb_ID_longmacro;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENB_ID_Choice_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice;
+extern asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[3];
+extern asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENB_ID_Choice_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ENB-ID.h b/e2ap/headers/ENB-ID.h
new file mode 100644
index 0000000..500a7d2
--- /dev/null
+++ b/e2ap/headers/ENB-ID.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ENB_ID_H_
+#define	_ENB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENB_ID_PR {
+	ENB_ID_PR_NOTHING,	/* No components present */
+	ENB_ID_PR_macro_eNB_ID,
+	ENB_ID_PR_home_eNB_ID,
+	/* Extensions may appear below */
+	ENB_ID_PR_short_Macro_eNB_ID,
+	ENB_ID_PR_long_Macro_eNB_ID
+} ENB_ID_PR;
+
+/* ENB-ID */
+typedef struct ENB_ID {
+	ENB_ID_PR present;
+	union ENB_ID_u {
+		BIT_STRING_t	 macro_eNB_ID;
+		BIT_STRING_t	 home_eNB_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+		BIT_STRING_t	 short_Macro_eNB_ID;
+		BIT_STRING_t	 long_Macro_eNB_ID;
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENB_ID;
+extern asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENB_ID_1[4];
+extern asn_per_constraints_t asn_PER_type_ENB_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ENGNB-ID.h b/e2ap/headers/ENGNB-ID.h
new file mode 100644
index 0000000..58a8c7c
--- /dev/null
+++ b/e2ap/headers/ENGNB-ID.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ENGNB_ID_H_
+#define	_ENGNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENGNB_ID_PR {
+	ENGNB_ID_PR_NOTHING,	/* No components present */
+	ENGNB_ID_PR_gNB_ID
+	/* Extensions may appear below */
+	
+} ENGNB_ID_PR;
+
+/* ENGNB-ID */
+typedef struct ENGNB_ID {
+	ENGNB_ID_PR present;
+	union ENGNB_ID_u {
+		BIT_STRING_t	 gNB_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENGNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENGNB_ID;
+extern asn_CHOICE_specifics_t asn_SPC_ENGNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENGNB_ID_1[1];
+extern asn_per_constraints_t asn_PER_type_ENGNB_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENGNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ErrorIndication.h b/e2ap/headers/ErrorIndication.h
new file mode 100644
index 0000000..88e402e
--- /dev/null
+++ b/e2ap/headers/ErrorIndication.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ErrorIndication_H_
+#define	_ErrorIndication_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ErrorIndication */
+typedef struct ErrorIndication {
+	ProtocolIE_Container_87P10_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ErrorIndication_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ErrorIndication;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ErrorIndication_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GNB-CU-UP-ID.h b/e2ap/headers/GNB-CU-UP-ID.h
new file mode 100644
index 0000000..d7df7d8
--- /dev/null
+++ b/e2ap/headers/GNB-CU-UP-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GNB_CU_UP_ID_H_
+#define	_GNB_CU_UP_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GNB-CU-UP-ID */
+typedef INTEGER_t	 GNB_CU_UP_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_GNB_CU_UP_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_GNB_CU_UP_ID;
+asn_struct_free_f GNB_CU_UP_ID_free;
+asn_struct_print_f GNB_CU_UP_ID_print;
+asn_constr_check_f GNB_CU_UP_ID_constraint;
+ber_type_decoder_f GNB_CU_UP_ID_decode_ber;
+der_type_encoder_f GNB_CU_UP_ID_encode_der;
+xer_type_decoder_f GNB_CU_UP_ID_decode_xer;
+xer_type_encoder_f GNB_CU_UP_ID_encode_xer;
+oer_type_decoder_f GNB_CU_UP_ID_decode_oer;
+oer_type_encoder_f GNB_CU_UP_ID_encode_oer;
+per_type_decoder_f GNB_CU_UP_ID_decode_uper;
+per_type_encoder_f GNB_CU_UP_ID_encode_uper;
+per_type_decoder_f GNB_CU_UP_ID_decode_aper;
+per_type_encoder_f GNB_CU_UP_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_CU_UP_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GNB-DU-ID.h b/e2ap/headers/GNB-DU-ID.h
new file mode 100644
index 0000000..b0889fe
--- /dev/null
+++ b/e2ap/headers/GNB-DU-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GNB_DU_ID_H_
+#define	_GNB_DU_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GNB-DU-ID */
+typedef INTEGER_t	 GNB_DU_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_GNB_DU_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_GNB_DU_ID;
+asn_struct_free_f GNB_DU_ID_free;
+asn_struct_print_f GNB_DU_ID_print;
+asn_constr_check_f GNB_DU_ID_constraint;
+ber_type_decoder_f GNB_DU_ID_decode_ber;
+der_type_encoder_f GNB_DU_ID_encode_der;
+xer_type_decoder_f GNB_DU_ID_decode_xer;
+xer_type_encoder_f GNB_DU_ID_encode_xer;
+oer_type_decoder_f GNB_DU_ID_decode_oer;
+oer_type_encoder_f GNB_DU_ID_encode_oer;
+per_type_decoder_f GNB_DU_ID_decode_uper;
+per_type_encoder_f GNB_DU_ID_encode_uper;
+per_type_decoder_f GNB_DU_ID_decode_aper;
+per_type_encoder_f GNB_DU_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_DU_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GNB-ID-Choice.h b/e2ap/headers/GNB-ID-Choice.h
new file mode 100644
index 0000000..ec65f85
--- /dev/null
+++ b/e2ap/headers/GNB-ID-Choice.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GNB_ID_Choice_H_
+#define	_GNB_ID_Choice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum GNB_ID_Choice_PR {
+	GNB_ID_Choice_PR_NOTHING,	/* No components present */
+	GNB_ID_Choice_PR_gnb_ID
+	/* Extensions may appear below */
+	
+} GNB_ID_Choice_PR;
+
+/* GNB-ID-Choice */
+typedef struct GNB_ID_Choice {
+	GNB_ID_Choice_PR present;
+	union GNB_ID_Choice_u {
+		BIT_STRING_t	 gnb_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GNB_ID_Choice_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GNB_ID_Choice;
+extern asn_CHOICE_specifics_t asn_SPC_GNB_ID_Choice_specs_1;
+extern asn_TYPE_member_t asn_MBR_GNB_ID_Choice_1[1];
+extern asn_per_constraints_t asn_PER_type_GNB_ID_Choice_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_ID_Choice_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-ID.h b/e2ap/headers/GlobalE2node-ID.h
new file mode 100644
index 0000000..843e1c2
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-ID.h
@@ -0,0 +1,67 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_ID_H_
+#define	_GlobalE2node_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum GlobalE2node_ID_PR {
+	GlobalE2node_ID_PR_NOTHING,	/* No components present */
+	GlobalE2node_ID_PR_gNB,
+	GlobalE2node_ID_PR_en_gNB,
+	GlobalE2node_ID_PR_ng_eNB,
+	GlobalE2node_ID_PR_eNB
+	/* Extensions may appear below */
+	
+} GlobalE2node_ID_PR;
+
+/* Forward declarations */
+struct GlobalE2node_gNB_ID;
+struct GlobalE2node_en_gNB_ID;
+struct GlobalE2node_ng_eNB_ID;
+struct GlobalE2node_eNB_ID;
+
+/* GlobalE2node-ID */
+typedef struct GlobalE2node_ID {
+	GlobalE2node_ID_PR present;
+	union GlobalE2node_ID_u {
+		struct GlobalE2node_gNB_ID	*gNB;
+		struct GlobalE2node_en_gNB_ID	*en_gNB;
+		struct GlobalE2node_ng_eNB_ID	*ng_eNB;
+		struct GlobalE2node_eNB_ID	*eNB;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ID;
+extern asn_CHOICE_specifics_t asn_SPC_GlobalE2node_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_ID_1[4];
+extern asn_per_constraints_t asn_PER_type_GlobalE2node_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-eNB-ID.h b/e2ap/headers/GlobalE2node-eNB-ID.h
new file mode 100644
index 0000000..c92e774
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_eNB_ID_H_
+#define	_GlobalE2node_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalENB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-eNB-ID */
+typedef struct GlobalE2node_eNB_ID {
+	GlobalENB_ID_t	 global_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-en-gNB-ID.h b/e2ap/headers/GlobalE2node-en-gNB-ID.h
new file mode 100644
index 0000000..b13588a
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-en-gNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_en_gNB_ID_H_
+#define	_GlobalE2node_en_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalenGNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-en-gNB-ID */
+typedef struct GlobalE2node_en_gNB_ID {
+	GlobalenGNB_ID_t	 global_gNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_en_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_en_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_en_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_en_gNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_en_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-gNB-ID.h b/e2ap/headers/GlobalE2node-gNB-ID.h
new file mode 100644
index 0000000..a2121b9
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-gNB-ID.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_gNB_ID_H_
+#define	_GlobalE2node_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalgNB-ID.h"
+#include "GNB-CU-UP-ID.h"
+#include "GNB-DU-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-gNB-ID */
+typedef struct GlobalE2node_gNB_ID {
+	GlobalgNB_ID_t	 global_gNB_ID;
+	GNB_CU_UP_ID_t	*gNB_CU_UP_ID;	/* OPTIONAL */
+	GNB_DU_ID_t	*gNB_DU_ID;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_gNB_ID_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-ng-eNB-ID.h b/e2ap/headers/GlobalE2node-ng-eNB-ID.h
new file mode 100644
index 0000000..7a3e0f5
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-ng-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_ng_eNB_ID_H_
+#define	_GlobalE2node_ng_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalngeNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-ng-eNB-ID */
+typedef struct GlobalE2node_ng_eNB_ID {
+	GlobalngeNB_ID_t	 global_ng_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_ng_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ng_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_ng_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_ng_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_ng_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalENB-ID.h b/e2ap/headers/GlobalENB-ID.h
new file mode 100644
index 0000000..2b6cf1c
--- /dev/null
+++ b/e2ap/headers/GlobalENB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalENB_ID_H_
+#define	_GlobalENB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalENB-ID */
+typedef struct GlobalENB_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	ENB_ID_t	 eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalENB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalENB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalENB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalENB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalENB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalRIC-ID.h b/e2ap/headers/GlobalRIC-ID.h
new file mode 100644
index 0000000..ad389c3
--- /dev/null
+++ b/e2ap/headers/GlobalRIC-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalRIC_ID_H_
+#define	_GlobalRIC_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include <BIT_STRING.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalRIC-ID */
+typedef struct GlobalRIC_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	BIT_STRING_t	 ric_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalRIC_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalRIC_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalRIC_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalRIC_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalRIC_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalenGNB-ID.h b/e2ap/headers/GlobalenGNB-ID.h
new file mode 100644
index 0000000..7df68b1
--- /dev/null
+++ b/e2ap/headers/GlobalenGNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalenGNB_ID_H_
+#define	_GlobalenGNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENGNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalenGNB-ID */
+typedef struct GlobalenGNB_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	ENGNB_ID_t	 gNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalenGNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalenGNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalenGNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalenGNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalenGNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalgNB-ID.h b/e2ap/headers/GlobalgNB-ID.h
new file mode 100644
index 0000000..242edf2
--- /dev/null
+++ b/e2ap/headers/GlobalgNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalgNB_ID_H_
+#define	_GlobalgNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "GNB-ID-Choice.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalgNB-ID */
+typedef struct GlobalgNB_ID {
+	PLMN_Identity_t	 plmn_id;
+	GNB_ID_Choice_t	 gnb_id;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalgNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalgNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalgNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalgNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalgNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalngeNB-ID.h b/e2ap/headers/GlobalngeNB-ID.h
new file mode 100644
index 0000000..8aba4cc
--- /dev/null
+++ b/e2ap/headers/GlobalngeNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalngeNB_ID_H_
+#define	_GlobalngeNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENB-ID-Choice.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalngeNB-ID */
+typedef struct GlobalngeNB_ID {
+	PLMN_Identity_t	 plmn_id;
+	ENB_ID_Choice_t	 enb_id;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalngeNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalngeNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalngeNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalngeNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalngeNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/INTEGER.h b/e2ap/headers/INTEGER.h
new file mode 100644
index 0000000..f776c07
--- /dev/null
+++ b/e2ap/headers/INTEGER.h
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_INTEGER_H_
+#define	_INTEGER_H_
+
+#include <asn_application.h>
+#include <asn_codecs_prim.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ASN__PRIMITIVE_TYPE_t INTEGER_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_INTEGER;
+extern asn_TYPE_operation_t asn_OP_INTEGER;
+
+/* Map with <tag> to integer value association */
+typedef struct asn_INTEGER_enum_map_s {
+	long		 nat_value;	/* associated native integer value */
+	size_t		 enum_len;	/* strlen("tag") */
+	const char	*enum_name;	/* "tag" */
+} asn_INTEGER_enum_map_t;
+
+/* This type describes an enumeration for INTEGER and ENUMERATED types */
+typedef struct asn_INTEGER_specifics_s {
+	const asn_INTEGER_enum_map_t *value2enum;	/* N -> "tag"; sorted by N */
+	const unsigned int *enum2value;		/* "tag" => N; sorted by tag */
+	int map_count;				/* Elements in either map */
+	int extension;				/* This map is extensible */
+	int strict_enumeration;			/* Enumeration set is fixed */
+	int field_width;			/* Size of native integer */
+	int field_unsigned;			/* Signed=0, unsigned=1 */
+} asn_INTEGER_specifics_t;
+
+#define INTEGER_free    ASN__PRIMITIVE_TYPE_free
+#define INTEGER_decode_ber	ber_decode_primitive
+#define INTEGER_constraint	asn_generic_no_constraint
+asn_struct_print_f INTEGER_print;
+asn_struct_compare_f INTEGER_compare;
+der_type_encoder_f INTEGER_encode_der;
+xer_type_decoder_f INTEGER_decode_xer;
+xer_type_encoder_f INTEGER_encode_xer;
+oer_type_decoder_f INTEGER_decode_oer;
+oer_type_encoder_f INTEGER_encode_oer;
+per_type_decoder_f INTEGER_decode_uper;
+per_type_encoder_f INTEGER_encode_uper;
+per_type_decoder_f INTEGER_decode_aper;
+per_type_encoder_f INTEGER_encode_aper;
+asn_random_fill_f  INTEGER_random_fill;
+
+/***********************************
+ * Some handy conversion routines. *
+ ***********************************/
+
+/*
+ * Natiwe size-independent conversion of native integers to/from INTEGER.
+ * (l_size) is in bytes.
+ * Returns 0 if it was possible to convert, -1 otherwise.
+ * -1/EINVAL: Mandatory argument missing
+ * -1/ERANGE: Value encoded is out of range for long representation
+ * -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()).
+ */
+int asn_INTEGER2imax(const INTEGER_t *i, intmax_t *l);
+int asn_INTEGER2umax(const INTEGER_t *i, uintmax_t *l);
+int asn_imax2INTEGER(INTEGER_t *i, intmax_t l);
+int asn_umax2INTEGER(INTEGER_t *i, uintmax_t l);
+
+/*
+ * Size-specific conversion helpers.
+ */
+int asn_INTEGER2long(const INTEGER_t *i, long *l);
+int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l);
+int asn_long2INTEGER(INTEGER_t *i, long l);
+int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l);
+int asn_int642INTEGER(INTEGER_t *i, int64_t l);
+int asn_uint642INTEGER(INTEGER_t *i, uint64_t l);
+
+/* A version of strtol/strtoimax(3) with nicer error reporting. */
+enum asn_strtox_result_e {
+    ASN_STRTOX_ERROR_RANGE = -3,  /* Input outside of supported numeric range */
+    ASN_STRTOX_ERROR_INVAL = -2,  /* Invalid data encountered (e.g., "+-") */
+    ASN_STRTOX_EXPECT_MORE = -1,  /* More data expected (e.g. "+") */
+    ASN_STRTOX_OK          =  0,  /* Conversion succeded, number ends at (*end) */
+    ASN_STRTOX_EXTRA_DATA  =  1   /* Conversion succeded, but the string has extra stuff */
+};
+enum asn_strtox_result_e asn_strtol_lim(const char *str, const char **end,
+                                        long *l);
+enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end,
+                                         unsigned long *l);
+enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end,
+                                           intmax_t *l);
+enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end,
+                                           uintmax_t *l);
+
+/*
+ * Convert the integer value into the corresponding enumeration map entry.
+ */
+const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(
+    const asn_INTEGER_specifics_t *specs, long value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _INTEGER_H_ */
diff --git a/e2ap/headers/InitiatingMessage.h b/e2ap/headers/InitiatingMessage.h
new file mode 100644
index 0000000..fd10bc7
--- /dev/null
+++ b/e2ap/headers/InitiatingMessage.h
@@ -0,0 +1,97 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_InitiatingMessage_H_
+#define	_InitiatingMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICsubscriptionRequest.h"
+#include "RICsubscriptionResponse.h"
+#include "RICsubscriptionFailure.h"
+#include "RICsubscriptionDeleteRequest.h"
+#include "RICsubscriptionDeleteResponse.h"
+#include "RICsubscriptionDeleteFailure.h"
+#include "RICserviceUpdate.h"
+#include "RICserviceUpdateAcknowledge.h"
+#include "RICserviceUpdateFailure.h"
+#include "RICcontrolRequest.h"
+#include "RICcontrolAcknowledge.h"
+#include "RICcontrolFailure.h"
+#include "E2setupRequest.h"
+#include "E2setupResponse.h"
+#include "E2setupFailure.h"
+#include "ResetRequest.h"
+#include "ResetResponse.h"
+#include "RICindication.h"
+#include "RICserviceQuery.h"
+#include "ErrorIndication.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum InitiatingMessage__value_PR {
+	InitiatingMessage__value_PR_NOTHING,	/* No components present */
+	InitiatingMessage__value_PR_RICsubscriptionRequest,
+	InitiatingMessage__value_PR_RICsubscriptionDeleteRequest,
+	InitiatingMessage__value_PR_RICserviceUpdate,
+	InitiatingMessage__value_PR_RICcontrolRequest,
+	InitiatingMessage__value_PR_E2setupRequest,
+	InitiatingMessage__value_PR_ResetRequest,
+	InitiatingMessage__value_PR_RICindication,
+	InitiatingMessage__value_PR_RICserviceQuery,
+	InitiatingMessage__value_PR_ErrorIndication
+} InitiatingMessage__value_PR;
+
+/* InitiatingMessage */
+typedef struct InitiatingMessage {
+	ProcedureCode_t	 procedureCode;
+	Criticality_t	 criticality;
+	struct InitiatingMessage__value {
+		InitiatingMessage__value_PR present;
+		union InitiatingMessage__value_u {
+			RICsubscriptionRequest_t	 RICsubscriptionRequest;
+			RICsubscriptionDeleteRequest_t	 RICsubscriptionDeleteRequest;
+			RICserviceUpdate_t	 RICserviceUpdate;
+			RICcontrolRequest_t	 RICcontrolRequest;
+			E2setupRequest_t	 E2setupRequest;
+			ResetRequest_t	 ResetRequest;
+			RICindication_t	 RICindication;
+			RICserviceQuery_t	 RICserviceQuery;
+			ErrorIndication_t	 ErrorIndication;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} InitiatingMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_InitiatingMessage;
+extern asn_SEQUENCE_specifics_t asn_SPC_InitiatingMessage_specs_1;
+extern asn_TYPE_member_t asn_MBR_InitiatingMessage_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _InitiatingMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/NativeEnumerated.h b/e2ap/headers/NativeEnumerated.h
new file mode 100644
index 0000000..459f0e6
--- /dev/null
+++ b/e2ap/headers/NativeEnumerated.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This type differs from the standard ENUMERATED in that it is modelled using
+ * the fixed machine type (long, int, short), so it can hold only values of
+ * limited length. There is no type (i.e., NativeEnumerated_t, any integer type
+ * will do).
+ * This type may be used when integer range is limited by subtype constraints.
+ */
+#ifndef	_NativeEnumerated_H_
+#define	_NativeEnumerated_H_
+
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated;
+extern asn_TYPE_operation_t asn_OP_NativeEnumerated;
+
+xer_type_encoder_f NativeEnumerated_encode_xer;
+oer_type_decoder_f NativeEnumerated_decode_oer;
+oer_type_encoder_f NativeEnumerated_encode_oer;
+per_type_decoder_f NativeEnumerated_decode_uper;
+per_type_encoder_f NativeEnumerated_encode_uper;
+per_type_decoder_f NativeEnumerated_decode_aper;
+per_type_encoder_f NativeEnumerated_encode_aper;
+
+#define NativeEnumerated_free       NativeInteger_free
+#define NativeEnumerated_print      NativeInteger_print
+#define NativeEnumerated_compare    NativeInteger_compare
+#define NativeEnumerated_random_fill NativeInteger_random_fill
+#define NativeEnumerated_constraint asn_generic_no_constraint
+#define NativeEnumerated_decode_ber NativeInteger_decode_ber
+#define NativeEnumerated_encode_der NativeInteger_encode_der
+#define NativeEnumerated_decode_xer NativeInteger_decode_xer
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NativeEnumerated_H_ */
diff --git a/e2ap/headers/NativeInteger.h b/e2ap/headers/NativeInteger.h
new file mode 100644
index 0000000..c74406a
--- /dev/null
+++ b/e2ap/headers/NativeInteger.h
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This type differs from the standard INTEGER in that it is modelled using
+ * the fixed machine type (long, int, short), so it can hold only values of
+ * limited length. There is no type (i.e., NativeInteger_t, any integer type
+ * will do).
+ * This type may be used when integer range is limited by subtype constraints.
+ */
+#ifndef	_NativeInteger_H_
+#define	_NativeInteger_H_
+
+#include <asn_application.h>
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern asn_TYPE_descriptor_t asn_DEF_NativeInteger;
+extern asn_TYPE_operation_t asn_OP_NativeInteger;
+
+asn_struct_free_f  NativeInteger_free;
+asn_struct_print_f NativeInteger_print;
+asn_struct_compare_f NativeInteger_compare;
+ber_type_decoder_f NativeInteger_decode_ber;
+der_type_encoder_f NativeInteger_encode_der;
+xer_type_decoder_f NativeInteger_decode_xer;
+xer_type_encoder_f NativeInteger_encode_xer;
+oer_type_decoder_f NativeInteger_decode_oer;
+oer_type_encoder_f NativeInteger_encode_oer;
+per_type_decoder_f NativeInteger_decode_uper;
+per_type_encoder_f NativeInteger_encode_uper;
+per_type_decoder_f NativeInteger_decode_aper;
+per_type_encoder_f NativeInteger_encode_aper;
+asn_random_fill_f  NativeInteger_random_fill;
+
+#define NativeInteger_constraint  asn_generic_no_constraint
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NativeInteger_H_ */
diff --git a/e2ap/headers/OCTET_STRING.h b/e2ap/headers/OCTET_STRING.h
new file mode 100644
index 0000000..c2f8bae
--- /dev/null
+++ b/e2ap/headers/OCTET_STRING.h
@@ -0,0 +1,102 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_OCTET_STRING_H_
+#define	_OCTET_STRING_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct OCTET_STRING {
+	uint8_t *buf;	/* Buffer with consecutive OCTET_STRING bits */
+	size_t size;	/* Size of the buffer */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} OCTET_STRING_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING;
+extern asn_TYPE_operation_t asn_OP_OCTET_STRING;
+
+asn_struct_free_f OCTET_STRING_free;
+asn_struct_print_f OCTET_STRING_print;
+asn_struct_print_f OCTET_STRING_print_utf8;
+asn_struct_compare_f OCTET_STRING_compare;
+ber_type_decoder_f OCTET_STRING_decode_ber;
+der_type_encoder_f OCTET_STRING_encode_der;
+xer_type_decoder_f OCTET_STRING_decode_xer_hex;		/* Hexadecimal */
+xer_type_decoder_f OCTET_STRING_decode_xer_binary;	/* 01010111010 */
+xer_type_decoder_f OCTET_STRING_decode_xer_utf8;	/* ASCII/UTF-8 */
+xer_type_encoder_f OCTET_STRING_encode_xer;
+xer_type_encoder_f OCTET_STRING_encode_xer_utf8;
+oer_type_decoder_f OCTET_STRING_decode_oer;
+oer_type_encoder_f OCTET_STRING_encode_oer;
+per_type_decoder_f OCTET_STRING_decode_uper;
+per_type_encoder_f OCTET_STRING_encode_uper;
+per_type_decoder_f OCTET_STRING_decode_aper;
+per_type_encoder_f OCTET_STRING_encode_aper;
+asn_random_fill_f  OCTET_STRING_random_fill;
+
+#define OCTET_STRING_constraint  asn_generic_no_constraint
+#define OCTET_STRING_decode_xer  OCTET_STRING_decode_xer_hex
+
+/******************************
+ * Handy conversion routines. *
+ ******************************/
+
+/*
+ * This function clears the previous value of the OCTET STRING (if any)
+ * and then allocates a new memory with the specified content (str/size).
+ * If size = -1, the size of the original string will be determined
+ * using strlen(str).
+ * If str equals to NULL, the function will silently clear the
+ * current contents of the OCTET STRING.
+ * Returns 0 if it was possible to perform operation, -1 otherwise.
+ */
+int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size);
+
+/* Handy conversion from the C string into the OCTET STRING. */
+#define	OCTET_STRING_fromString(s, str)	OCTET_STRING_fromBuf(s, str, -1)
+
+/*
+ * Allocate and fill the new OCTET STRING and return a pointer to the newly
+ * allocated object. NULL is permitted in str: the function will just allocate
+ * empty OCTET STRING.
+ */
+OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td,
+                                         const char *str, int size);
+
+/****************************
+ * Internally useful stuff. *
+ ****************************/
+
+typedef struct asn_OCTET_STRING_specifics_s {
+    /*
+     * Target structure description.
+     */
+    unsigned struct_size;   /* Size of the structure */
+    unsigned ctx_offset;    /* Offset of the asn_struct_ctx_t member */
+
+    enum asn_OS_Subvariant {
+        ASN_OSUBV_ANY, /* The open type (ANY) */
+        ASN_OSUBV_BIT, /* BIT STRING */
+        ASN_OSUBV_STR, /* String types, not {BMP,Universal}String  */
+        ASN_OSUBV_U16, /* 16-bit character (BMPString) */
+        ASN_OSUBV_U32  /* 32-bit character (UniversalString) */
+    } subvariant;
+} asn_OCTET_STRING_specifics_t;
+
+extern asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs;
+
+size_t OCTET_STRING_random_length_constrained(
+    const asn_TYPE_descriptor_t *, const asn_encoding_constraints_t *,
+    size_t max_length);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _OCTET_STRING_H_ */
diff --git a/e2ap/headers/OPEN_TYPE.h b/e2ap/headers/OPEN_TYPE.h
new file mode 100644
index 0000000..b0d023c
--- /dev/null
+++ b/e2ap/headers/OPEN_TYPE.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 2017-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_OPEN_TYPE_H
+#define ASN_OPEN_TYPE_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define OPEN_TYPE_free CHOICE_free
+#define OPEN_TYPE_print CHOICE_print
+#define OPEN_TYPE_compare CHOICE_compare
+#define OPEN_TYPE_constraint CHOICE_constraint
+#define OPEN_TYPE_decode_ber NULL
+#define OPEN_TYPE_encode_der CHOICE_encode_der
+#define OPEN_TYPE_decode_xer NULL
+#define OPEN_TYPE_encode_xer CHOICE_encode_xer
+#define OPEN_TYPE_decode_oer NULL
+#define OPEN_TYPE_encode_oer CHOICE_encode_oer
+#define OPEN_TYPE_decode_uper NULL
+#define OPEN_TYPE_decode_aper NULL
+
+extern asn_TYPE_operation_t asn_OP_OPEN_TYPE;
+
+/*
+ * Decode an Open Type which is potentially constraiend
+ * by the other members of the parent structure.
+ */
+asn_dec_rval_t OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 const asn_TYPE_member_t *element,
+                                 const void *ptr, size_t size);
+
+asn_dec_rval_t OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 const asn_TYPE_member_t *element,
+                                 const void *ptr, size_t size);
+
+asn_dec_rval_t OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 asn_TYPE_member_t *element, const void *ptr,
+                                 size_t size);
+
+asn_dec_rval_t OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *parent_type,
+                                  void *parent_structure,
+                                  const asn_TYPE_member_t *element,
+                                  asn_per_data_t *pd);
+
+asn_dec_rval_t OPEN_TYPE_aper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *parent_type,
+                                  void *parent_structure,
+                                  const asn_TYPE_member_t *element,
+                                  asn_per_data_t *pd);
+
+asn_enc_rval_t OPEN_TYPE_encode_uper(
+    const asn_TYPE_descriptor_t *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+asn_enc_rval_t OPEN_TYPE_encode_aper(
+    const asn_TYPE_descriptor_t *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_OPEN_TYPE_H */
diff --git a/e2ap/headers/PLMN-Identity.h b/e2ap/headers/PLMN-Identity.h
new file mode 100644
index 0000000..2fb1a85
--- /dev/null
+++ b/e2ap/headers/PLMN-Identity.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_PLMN_Identity_H_
+#define	_PLMN_Identity_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PLMN-Identity */
+typedef OCTET_STRING_t	 PLMN_Identity_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_PLMN_Identity_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_PLMN_Identity;
+asn_struct_free_f PLMN_Identity_free;
+asn_struct_print_f PLMN_Identity_print;
+asn_constr_check_f PLMN_Identity_constraint;
+ber_type_decoder_f PLMN_Identity_decode_ber;
+der_type_encoder_f PLMN_Identity_encode_der;
+xer_type_decoder_f PLMN_Identity_decode_xer;
+xer_type_encoder_f PLMN_Identity_encode_xer;
+oer_type_decoder_f PLMN_Identity_decode_oer;
+oer_type_encoder_f PLMN_Identity_encode_oer;
+per_type_decoder_f PLMN_Identity_decode_uper;
+per_type_encoder_f PLMN_Identity_encode_uper;
+per_type_decoder_f PLMN_Identity_decode_aper;
+per_type_encoder_f PLMN_Identity_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PLMN_Identity_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/Presence.h b/e2ap/headers/Presence.h
new file mode 100644
index 0000000..06713ac
--- /dev/null
+++ b/e2ap/headers/Presence.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_Presence_H_
+#define	_Presence_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Presence {
+	Presence_optional	= 0,
+	Presence_conditional	= 1,
+	Presence_mandatory	= 2
+} e_Presence;
+
+/* Presence */
+typedef long	 Presence_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_Presence_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Presence;
+extern const asn_INTEGER_specifics_t asn_SPC_Presence_specs_1;
+asn_struct_free_f Presence_free;
+asn_struct_print_f Presence_print;
+asn_constr_check_f Presence_constraint;
+ber_type_decoder_f Presence_decode_ber;
+der_type_encoder_f Presence_encode_der;
+xer_type_decoder_f Presence_decode_xer;
+xer_type_encoder_f Presence_encode_xer;
+oer_type_decoder_f Presence_decode_oer;
+oer_type_encoder_f Presence_encode_oer;
+per_type_decoder_f Presence_decode_uper;
+per_type_encoder_f Presence_encode_uper;
+per_type_decoder_f Presence_decode_aper;
+per_type_encoder_f Presence_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Presence_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProcedureCode.h b/e2ap/headers/ProcedureCode.h
new file mode 100644
index 0000000..2b76e8b
--- /dev/null
+++ b/e2ap/headers/ProcedureCode.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProcedureCode_H_
+#define	_ProcedureCode_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProcedureCode */
+typedef long	 ProcedureCode_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_ProcedureCode_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ProcedureCode;
+asn_struct_free_f ProcedureCode_free;
+asn_struct_print_f ProcedureCode_print;
+asn_constr_check_f ProcedureCode_constraint;
+ber_type_decoder_f ProcedureCode_decode_ber;
+der_type_encoder_f ProcedureCode_encode_der;
+xer_type_decoder_f ProcedureCode_decode_xer;
+xer_type_encoder_f ProcedureCode_encode_xer;
+oer_type_decoder_f ProcedureCode_decode_oer;
+oer_type_encoder_f ProcedureCode_encode_oer;
+per_type_decoder_f ProcedureCode_decode_uper;
+per_type_encoder_f ProcedureCode_encode_uper;
+per_type_decoder_f ProcedureCode_decode_aper;
+per_type_encoder_f ProcedureCode_encode_aper;
+#define ProcedureCode_id_E2setup	((ProcedureCode_t)1)
+#define ProcedureCode_id_ErrorIndication	((ProcedureCode_t)2)
+#define ProcedureCode_id_Reset	((ProcedureCode_t)3)
+#define ProcedureCode_id_RICcontrol	((ProcedureCode_t)4)
+#define ProcedureCode_id_RICindication	((ProcedureCode_t)5)
+#define ProcedureCode_id_RICserviceQuery	((ProcedureCode_t)6)
+#define ProcedureCode_id_RICserviceUpdate	((ProcedureCode_t)7)
+#define ProcedureCode_id_RICsubscription	((ProcedureCode_t)8)
+#define ProcedureCode_id_RICsubscriptionDelete	((ProcedureCode_t)9)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProcedureCode_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-Container.h b/e2ap/headers/ProtocolIE-Container.h
new file mode 100644
index 0000000..361db9c
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-Container.h
@@ -0,0 +1,253 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_Container_H_
+#define	_ProtocolIE_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RICsubscriptionRequest_IEs;
+struct RICsubscriptionResponse_IEs;
+struct RICsubscriptionFailure_IEs;
+struct RICsubscriptionDeleteRequest_IEs;
+struct RICsubscriptionDeleteResponse_IEs;
+struct RICsubscriptionDeleteFailure_IEs;
+struct RICindication_IEs;
+struct RICcontrolRequest_IEs;
+struct RICcontrolAcknowledge_IEs;
+struct RICcontrolFailure_IEs;
+struct ErrorIndication_IEs;
+struct E2setupRequestIEs;
+struct E2setupResponseIEs;
+struct E2setupFailureIEs;
+struct ResetRequestIEs;
+struct ResetResponseIEs;
+struct RICserviceUpdate_IEs;
+struct RICserviceUpdateAcknowledge_IEs;
+struct RICserviceUpdateFailure_IEs;
+struct RICserviceQuery_IEs;
+
+/* ProtocolIE-Container */
+typedef struct ProtocolIE_Container_87P0 {
+	A_SEQUENCE_OF(struct RICsubscriptionRequest_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P0_t;
+typedef struct ProtocolIE_Container_87P1 {
+	A_SEQUENCE_OF(struct RICsubscriptionResponse_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P1_t;
+typedef struct ProtocolIE_Container_87P2 {
+	A_SEQUENCE_OF(struct RICsubscriptionFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P2_t;
+typedef struct ProtocolIE_Container_87P3 {
+	A_SEQUENCE_OF(struct RICsubscriptionDeleteRequest_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P3_t;
+typedef struct ProtocolIE_Container_87P4 {
+	A_SEQUENCE_OF(struct RICsubscriptionDeleteResponse_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P4_t;
+typedef struct ProtocolIE_Container_87P5 {
+	A_SEQUENCE_OF(struct RICsubscriptionDeleteFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P5_t;
+typedef struct ProtocolIE_Container_87P6 {
+	A_SEQUENCE_OF(struct RICindication_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P6_t;
+typedef struct ProtocolIE_Container_87P7 {
+	A_SEQUENCE_OF(struct RICcontrolRequest_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P7_t;
+typedef struct ProtocolIE_Container_87P8 {
+	A_SEQUENCE_OF(struct RICcontrolAcknowledge_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P8_t;
+typedef struct ProtocolIE_Container_87P9 {
+	A_SEQUENCE_OF(struct RICcontrolFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P9_t;
+typedef struct ProtocolIE_Container_87P10 {
+	A_SEQUENCE_OF(struct ErrorIndication_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P10_t;
+typedef struct ProtocolIE_Container_87P11 {
+	A_SEQUENCE_OF(struct E2setupRequestIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P11_t;
+typedef struct ProtocolIE_Container_87P12 {
+	A_SEQUENCE_OF(struct E2setupResponseIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P12_t;
+typedef struct ProtocolIE_Container_87P13 {
+	A_SEQUENCE_OF(struct E2setupFailureIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P13_t;
+typedef struct ProtocolIE_Container_87P14 {
+	A_SEQUENCE_OF(struct ResetRequestIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P14_t;
+typedef struct ProtocolIE_Container_87P15 {
+	A_SEQUENCE_OF(struct ResetResponseIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P15_t;
+typedef struct ProtocolIE_Container_87P16 {
+	A_SEQUENCE_OF(struct RICserviceUpdate_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P16_t;
+typedef struct ProtocolIE_Container_87P17 {
+	A_SEQUENCE_OF(struct RICserviceUpdateAcknowledge_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P17_t;
+typedef struct ProtocolIE_Container_87P18 {
+	A_SEQUENCE_OF(struct RICserviceUpdateFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P18_t;
+typedef struct ProtocolIE_Container_87P19 {
+	A_SEQUENCE_OF(struct RICserviceQuery_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P19_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P0;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P0_1[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P0_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P1;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P1_specs_3;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P1_3[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P1_constr_3;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P2;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P2_specs_5;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P2_5[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P2_constr_5;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P3;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P3_specs_7;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P3_7[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P3_constr_7;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P4;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P4_specs_9;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P4_9[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P4_constr_9;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P5;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P5_specs_11;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P5_11[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P5_constr_11;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P6;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P6_specs_13;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P6_13[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P6_constr_13;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P7;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P7_specs_15;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P7_15[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P7_constr_15;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P8;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P8_specs_17;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P8_17[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P8_constr_17;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P9;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P9_specs_19;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P9_19[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P9_constr_19;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P10;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P10_specs_21;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P10_21[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P10_constr_21;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P11;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P11_specs_23;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P11_23[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P11_constr_23;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P12;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P12_specs_25;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P12_25[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P12_constr_25;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P13;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P13_specs_27;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P13_27[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P13_constr_27;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P14;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P14_specs_29;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P14_29[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P14_constr_29;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P15;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P15_specs_31;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P15_31[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P15_constr_31;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P16;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P16_specs_33;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P16_33[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P16_constr_33;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P17;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P17_specs_35;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P17_35[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P17_constr_35;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P18;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P18_specs_37;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P18_37[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P18_constr_37;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P19;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P19_specs_39;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P19_39[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P19_constr_39;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ContainerList.h b/e2ap/headers/ProtocolIE-ContainerList.h
new file mode 100644
index 0000000..44b1d2a
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ContainerList.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ContainerList_H_
+#define	_ProtocolIE_ContainerList_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ContainerList_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ContainerPair.h b/e2ap/headers/ProtocolIE-ContainerPair.h
new file mode 100644
index 0000000..cac7e26
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ContainerPair.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ContainerPair_H_
+#define	_ProtocolIE_ContainerPair_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ContainerPair_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ContainerPairList.h b/e2ap/headers/ProtocolIE-ContainerPairList.h
new file mode 100644
index 0000000..9d6a2d3
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ContainerPairList.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ContainerPairList_H_
+#define	_ProtocolIE_ContainerPairList_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ContainerPairList_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-Field.h b/e2ap/headers/ProtocolIE-Field.h
new file mode 100644
index 0000000..8bbef66
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-Field.h
@@ -0,0 +1,757 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_Field_H_
+#define	_ProtocolIE_Field_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-ID.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICaction-ToBeSetup-Item.h"
+#include "Presence.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+#include "RICaction-Admitted-Item.h"
+#include "RICaction-NotAdmitted-Item.h"
+#include "RANfunction-Item.h"
+#include "RANfunctionID-Item.h"
+#include "RANfunctionIDcause-Item.h"
+#include "RICrequestID.h"
+#include "RANfunctionID.h"
+#include "RICsubscriptionDetails.h"
+#include "RICaction-Admitted-List.h"
+#include "RICaction-NotAdmitted-List.h"
+#include "CriticalityDiagnostics.h"
+#include "Cause.h"
+#include "RICactionID.h"
+#include "RICindicationSN.h"
+#include "RICindicationType.h"
+#include "RICindicationHeader.h"
+#include "RICindicationMessage.h"
+#include "RICcallProcessID.h"
+#include "RICcontrolHeader.h"
+#include "RICcontrolMessage.h"
+#include "RICcontrolAckRequest.h"
+#include "RICcontrolStatus.h"
+#include "RICcontrolOutcome.h"
+#include "GlobalE2node-ID.h"
+#include "RANfunctions-List.h"
+#include "GlobalRIC-ID.h"
+#include "RANfunctionsID-List.h"
+#include "RANfunctionsIDcause-List.h"
+#include "TimeToWait.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICaction_ToBeSetup_ItemIEs__value_PR {
+	RICaction_ToBeSetup_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RICaction_ToBeSetup_ItemIEs__value_PR_RICaction_ToBeSetup_Item
+} RICaction_ToBeSetup_ItemIEs__value_PR;
+typedef enum RICaction_Admitted_ItemIEs__value_PR {
+	RICaction_Admitted_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RICaction_Admitted_ItemIEs__value_PR_RICaction_Admitted_Item
+} RICaction_Admitted_ItemIEs__value_PR;
+typedef enum RICaction_NotAdmitted_ItemIEs__value_PR {
+	RICaction_NotAdmitted_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RICaction_NotAdmitted_ItemIEs__value_PR_RICaction_NotAdmitted_Item
+} RICaction_NotAdmitted_ItemIEs__value_PR;
+typedef enum RANfunction_ItemIEs__value_PR {
+	RANfunction_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RANfunction_ItemIEs__value_PR_RANfunction_Item
+} RANfunction_ItemIEs__value_PR;
+typedef enum RANfunctionID_ItemIEs__value_PR {
+	RANfunctionID_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RANfunctionID_ItemIEs__value_PR_RANfunctionID_Item
+} RANfunctionID_ItemIEs__value_PR;
+typedef enum RANfunctionIDcause_ItemIEs__value_PR {
+	RANfunctionIDcause_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RANfunctionIDcause_ItemIEs__value_PR_RANfunctionIDcause_Item
+} RANfunctionIDcause_ItemIEs__value_PR;
+typedef enum RICsubscriptionRequest_IEs__value_PR {
+	RICsubscriptionRequest_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionRequest_IEs__value_PR_RICrequestID,
+	RICsubscriptionRequest_IEs__value_PR_RANfunctionID,
+	RICsubscriptionRequest_IEs__value_PR_RICsubscriptionDetails
+} RICsubscriptionRequest_IEs__value_PR;
+typedef enum RICsubscriptionResponse_IEs__value_PR {
+	RICsubscriptionResponse_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionResponse_IEs__value_PR_RICrequestID,
+	RICsubscriptionResponse_IEs__value_PR_RANfunctionID,
+	RICsubscriptionResponse_IEs__value_PR_RICaction_Admitted_List,
+	RICsubscriptionResponse_IEs__value_PR_RICaction_NotAdmitted_List
+} RICsubscriptionResponse_IEs__value_PR;
+typedef enum RICsubscriptionFailure_IEs__value_PR {
+	RICsubscriptionFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionFailure_IEs__value_PR_RICrequestID,
+	RICsubscriptionFailure_IEs__value_PR_RANfunctionID,
+	RICsubscriptionFailure_IEs__value_PR_RICaction_NotAdmitted_List,
+	RICsubscriptionFailure_IEs__value_PR_CriticalityDiagnostics
+} RICsubscriptionFailure_IEs__value_PR;
+typedef enum RICsubscriptionDeleteRequest_IEs__value_PR {
+	RICsubscriptionDeleteRequest_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionDeleteRequest_IEs__value_PR_RICrequestID,
+	RICsubscriptionDeleteRequest_IEs__value_PR_RANfunctionID
+} RICsubscriptionDeleteRequest_IEs__value_PR;
+typedef enum RICsubscriptionDeleteResponse_IEs__value_PR {
+	RICsubscriptionDeleteResponse_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionDeleteResponse_IEs__value_PR_RICrequestID,
+	RICsubscriptionDeleteResponse_IEs__value_PR_RANfunctionID
+} RICsubscriptionDeleteResponse_IEs__value_PR;
+typedef enum RICsubscriptionDeleteFailure_IEs__value_PR {
+	RICsubscriptionDeleteFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionDeleteFailure_IEs__value_PR_RICrequestID,
+	RICsubscriptionDeleteFailure_IEs__value_PR_RANfunctionID,
+	RICsubscriptionDeleteFailure_IEs__value_PR_Cause,
+	RICsubscriptionDeleteFailure_IEs__value_PR_CriticalityDiagnostics
+} RICsubscriptionDeleteFailure_IEs__value_PR;
+typedef enum RICindication_IEs__value_PR {
+	RICindication_IEs__value_PR_NOTHING,	/* No components present */
+	RICindication_IEs__value_PR_RICrequestID,
+	RICindication_IEs__value_PR_RANfunctionID,
+	RICindication_IEs__value_PR_RICactionID,
+	RICindication_IEs__value_PR_RICindicationSN,
+	RICindication_IEs__value_PR_RICindicationType,
+	RICindication_IEs__value_PR_RICindicationHeader,
+	RICindication_IEs__value_PR_RICindicationMessage,
+	RICindication_IEs__value_PR_RICcallProcessID
+} RICindication_IEs__value_PR;
+typedef enum RICcontrolRequest_IEs__value_PR {
+	RICcontrolRequest_IEs__value_PR_NOTHING,	/* No components present */
+	RICcontrolRequest_IEs__value_PR_RICrequestID,
+	RICcontrolRequest_IEs__value_PR_RANfunctionID,
+	RICcontrolRequest_IEs__value_PR_RICcallProcessID,
+	RICcontrolRequest_IEs__value_PR_RICcontrolHeader,
+	RICcontrolRequest_IEs__value_PR_RICcontrolMessage,
+	RICcontrolRequest_IEs__value_PR_RICcontrolAckRequest
+} RICcontrolRequest_IEs__value_PR;
+typedef enum RICcontrolAcknowledge_IEs__value_PR {
+	RICcontrolAcknowledge_IEs__value_PR_NOTHING,	/* No components present */
+	RICcontrolAcknowledge_IEs__value_PR_RICrequestID,
+	RICcontrolAcknowledge_IEs__value_PR_RANfunctionID,
+	RICcontrolAcknowledge_IEs__value_PR_RICcallProcessID,
+	RICcontrolAcknowledge_IEs__value_PR_RICcontrolStatus,
+	RICcontrolAcknowledge_IEs__value_PR_RICcontrolOutcome
+} RICcontrolAcknowledge_IEs__value_PR;
+typedef enum RICcontrolFailure_IEs__value_PR {
+	RICcontrolFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICcontrolFailure_IEs__value_PR_RICrequestID,
+	RICcontrolFailure_IEs__value_PR_RANfunctionID,
+	RICcontrolFailure_IEs__value_PR_RICcallProcessID,
+	RICcontrolFailure_IEs__value_PR_Cause,
+	RICcontrolFailure_IEs__value_PR_RICcontrolOutcome
+} RICcontrolFailure_IEs__value_PR;
+typedef enum ErrorIndication_IEs__value_PR {
+	ErrorIndication_IEs__value_PR_NOTHING,	/* No components present */
+	ErrorIndication_IEs__value_PR_RICrequestID,
+	ErrorIndication_IEs__value_PR_RANfunctionID,
+	ErrorIndication_IEs__value_PR_Cause,
+	ErrorIndication_IEs__value_PR_CriticalityDiagnostics
+} ErrorIndication_IEs__value_PR;
+typedef enum E2setupRequestIEs__value_PR {
+	E2setupRequestIEs__value_PR_NOTHING,	/* No components present */
+	E2setupRequestIEs__value_PR_GlobalE2node_ID,
+	E2setupRequestIEs__value_PR_RANfunctions_List
+} E2setupRequestIEs__value_PR;
+typedef enum E2setupResponseIEs__value_PR {
+	E2setupResponseIEs__value_PR_NOTHING,	/* No components present */
+	E2setupResponseIEs__value_PR_GlobalRIC_ID,
+	E2setupResponseIEs__value_PR_RANfunctionsID_List,
+	E2setupResponseIEs__value_PR_RANfunctionsIDcause_List
+} E2setupResponseIEs__value_PR;
+typedef enum E2setupFailureIEs__value_PR {
+	E2setupFailureIEs__value_PR_NOTHING,	/* No components present */
+	E2setupFailureIEs__value_PR_Cause,
+	E2setupFailureIEs__value_PR_TimeToWait,
+	E2setupFailureIEs__value_PR_CriticalityDiagnostics
+} E2setupFailureIEs__value_PR;
+typedef enum ResetRequestIEs__value_PR {
+	ResetRequestIEs__value_PR_NOTHING,	/* No components present */
+	ResetRequestIEs__value_PR_Cause
+} ResetRequestIEs__value_PR;
+typedef enum ResetResponseIEs__value_PR {
+	ResetResponseIEs__value_PR_NOTHING,	/* No components present */
+	ResetResponseIEs__value_PR_CriticalityDiagnostics
+} ResetResponseIEs__value_PR;
+typedef enum RICserviceUpdate_IEs__value_PR {
+	RICserviceUpdate_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceUpdate_IEs__value_PR_RANfunctions_List,
+	RICserviceUpdate_IEs__value_PR_RANfunctionsID_List
+} RICserviceUpdate_IEs__value_PR;
+typedef enum RICserviceUpdateAcknowledge_IEs__value_PR {
+	RICserviceUpdateAcknowledge_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceUpdateAcknowledge_IEs__value_PR_RANfunctionsID_List,
+	RICserviceUpdateAcknowledge_IEs__value_PR_RANfunctionsIDcause_List
+} RICserviceUpdateAcknowledge_IEs__value_PR;
+typedef enum RICserviceUpdateFailure_IEs__value_PR {
+	RICserviceUpdateFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceUpdateFailure_IEs__value_PR_RANfunctionsIDcause_List,
+	RICserviceUpdateFailure_IEs__value_PR_TimeToWait,
+	RICserviceUpdateFailure_IEs__value_PR_CriticalityDiagnostics
+} RICserviceUpdateFailure_IEs__value_PR;
+typedef enum RICserviceQuery_IEs__value_PR {
+	RICserviceQuery_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceQuery_IEs__value_PR_RANfunctionsID_List
+} RICserviceQuery_IEs__value_PR;
+
+/* ProtocolIE-Field */
+typedef struct RICaction_ToBeSetup_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICaction_ToBeSetup_ItemIEs__value {
+		RICaction_ToBeSetup_ItemIEs__value_PR present;
+		union RICaction_ToBeSetup_ItemIEs__value_u {
+			RICaction_ToBeSetup_Item_t	 RICaction_ToBeSetup_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_ToBeSetup_ItemIEs_t;
+typedef struct RICaction_Admitted_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICaction_Admitted_ItemIEs__value {
+		RICaction_Admitted_ItemIEs__value_PR present;
+		union RICaction_Admitted_ItemIEs__value_u {
+			RICaction_Admitted_Item_t	 RICaction_Admitted_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_Admitted_ItemIEs_t;
+typedef struct RICaction_NotAdmitted_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICaction_NotAdmitted_ItemIEs__value {
+		RICaction_NotAdmitted_ItemIEs__value_PR present;
+		union RICaction_NotAdmitted_ItemIEs__value_u {
+			RICaction_NotAdmitted_Item_t	 RICaction_NotAdmitted_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_NotAdmitted_ItemIEs_t;
+typedef struct RANfunction_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RANfunction_ItemIEs__value {
+		RANfunction_ItemIEs__value_PR present;
+		union RANfunction_ItemIEs__value_u {
+			RANfunction_Item_t	 RANfunction_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunction_ItemIEs_t;
+typedef struct RANfunctionID_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RANfunctionID_ItemIEs__value {
+		RANfunctionID_ItemIEs__value_PR present;
+		union RANfunctionID_ItemIEs__value_u {
+			RANfunctionID_Item_t	 RANfunctionID_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionID_ItemIEs_t;
+typedef struct RANfunctionIDcause_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RANfunctionIDcause_ItemIEs__value {
+		RANfunctionIDcause_ItemIEs__value_PR present;
+		union RANfunctionIDcause_ItemIEs__value_u {
+			RANfunctionIDcause_Item_t	 RANfunctionIDcause_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionIDcause_ItemIEs_t;
+typedef struct RICsubscriptionRequest_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionRequest_IEs__value {
+		RICsubscriptionRequest_IEs__value_PR present;
+		union RICsubscriptionRequest_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICsubscriptionDetails_t	 RICsubscriptionDetails;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionRequest_IEs_t;
+typedef struct RICsubscriptionResponse_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionResponse_IEs__value {
+		RICsubscriptionResponse_IEs__value_PR present;
+		union RICsubscriptionResponse_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICaction_Admitted_List_t	 RICaction_Admitted_List;
+			RICaction_NotAdmitted_List_t	 RICaction_NotAdmitted_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionResponse_IEs_t;
+typedef struct RICsubscriptionFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionFailure_IEs__value {
+		RICsubscriptionFailure_IEs__value_PR present;
+		union RICsubscriptionFailure_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICaction_NotAdmitted_List_t	 RICaction_NotAdmitted_List;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionFailure_IEs_t;
+typedef struct RICsubscriptionDeleteRequest_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionDeleteRequest_IEs__value {
+		RICsubscriptionDeleteRequest_IEs__value_PR present;
+		union RICsubscriptionDeleteRequest_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteRequest_IEs_t;
+typedef struct RICsubscriptionDeleteResponse_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionDeleteResponse_IEs__value {
+		RICsubscriptionDeleteResponse_IEs__value_PR present;
+		union RICsubscriptionDeleteResponse_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteResponse_IEs_t;
+typedef struct RICsubscriptionDeleteFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionDeleteFailure_IEs__value {
+		RICsubscriptionDeleteFailure_IEs__value_PR present;
+		union RICsubscriptionDeleteFailure_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			Cause_t	 Cause;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteFailure_IEs_t;
+typedef struct RICindication_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICindication_IEs__value {
+		RICindication_IEs__value_PR present;
+		union RICindication_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICactionID_t	 RICactionID;
+			RICindicationSN_t	 RICindicationSN;
+			RICindicationType_t	 RICindicationType;
+			RICindicationHeader_t	 RICindicationHeader;
+			RICindicationMessage_t	 RICindicationMessage;
+			RICcallProcessID_t	 RICcallProcessID;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICindication_IEs_t;
+typedef struct RICcontrolRequest_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICcontrolRequest_IEs__value {
+		RICcontrolRequest_IEs__value_PR present;
+		union RICcontrolRequest_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICcallProcessID_t	 RICcallProcessID;
+			RICcontrolHeader_t	 RICcontrolHeader;
+			RICcontrolMessage_t	 RICcontrolMessage;
+			RICcontrolAckRequest_t	 RICcontrolAckRequest;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolRequest_IEs_t;
+typedef struct RICcontrolAcknowledge_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICcontrolAcknowledge_IEs__value {
+		RICcontrolAcknowledge_IEs__value_PR present;
+		union RICcontrolAcknowledge_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICcallProcessID_t	 RICcallProcessID;
+			RICcontrolStatus_t	 RICcontrolStatus;
+			RICcontrolOutcome_t	 RICcontrolOutcome;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolAcknowledge_IEs_t;
+typedef struct RICcontrolFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICcontrolFailure_IEs__value {
+		RICcontrolFailure_IEs__value_PR present;
+		union RICcontrolFailure_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICcallProcessID_t	 RICcallProcessID;
+			Cause_t	 Cause;
+			RICcontrolOutcome_t	 RICcontrolOutcome;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolFailure_IEs_t;
+typedef struct ErrorIndication_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct ErrorIndication_IEs__value {
+		ErrorIndication_IEs__value_PR present;
+		union ErrorIndication_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			Cause_t	 Cause;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ErrorIndication_IEs_t;
+typedef struct E2setupRequestIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct E2setupRequestIEs__value {
+		E2setupRequestIEs__value_PR present;
+		union E2setupRequestIEs__value_u {
+			GlobalE2node_ID_t	 GlobalE2node_ID;
+			RANfunctions_List_t	 RANfunctions_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupRequestIEs_t;
+typedef struct E2setupResponseIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct E2setupResponseIEs__value {
+		E2setupResponseIEs__value_PR present;
+		union E2setupResponseIEs__value_u {
+			GlobalRIC_ID_t	 GlobalRIC_ID;
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+			RANfunctionsIDcause_List_t	 RANfunctionsIDcause_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupResponseIEs_t;
+typedef struct E2setupFailureIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct E2setupFailureIEs__value {
+		E2setupFailureIEs__value_PR present;
+		union E2setupFailureIEs__value_u {
+			Cause_t	 Cause;
+			TimeToWait_t	 TimeToWait;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupFailureIEs_t;
+typedef struct ResetRequestIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct ResetRequestIEs__value {
+		ResetRequestIEs__value_PR present;
+		union ResetRequestIEs__value_u {
+			Cause_t	 Cause;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetRequestIEs_t;
+typedef struct ResetResponseIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct ResetResponseIEs__value {
+		ResetResponseIEs__value_PR present;
+		union ResetResponseIEs__value_u {
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetResponseIEs_t;
+typedef struct RICserviceUpdate_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceUpdate_IEs__value {
+		RICserviceUpdate_IEs__value_PR present;
+		union RICserviceUpdate_IEs__value_u {
+			RANfunctions_List_t	 RANfunctions_List;
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdate_IEs_t;
+typedef struct RICserviceUpdateAcknowledge_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceUpdateAcknowledge_IEs__value {
+		RICserviceUpdateAcknowledge_IEs__value_PR present;
+		union RICserviceUpdateAcknowledge_IEs__value_u {
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+			RANfunctionsIDcause_List_t	 RANfunctionsIDcause_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateAcknowledge_IEs_t;
+typedef struct RICserviceUpdateFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceUpdateFailure_IEs__value {
+		RICserviceUpdateFailure_IEs__value_PR present;
+		union RICserviceUpdateFailure_IEs__value_u {
+			RANfunctionsIDcause_List_t	 RANfunctionsIDcause_List;
+			TimeToWait_t	 TimeToWait;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateFailure_IEs_t;
+typedef struct RICserviceQuery_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceQuery_IEs__value {
+		RICserviceQuery_IEs__value_PR present;
+		union RICserviceQuery_IEs__value_u {
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceQuery_IEs_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_ItemIEs_1[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_ItemIEs_specs_5;
+extern asn_TYPE_member_t asn_MBR_RICaction_Admitted_ItemIEs_5[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9;
+extern asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_ItemIEs_9[3];
+extern asn_TYPE_descriptor_t asn_DEF_RANfunction_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunction_ItemIEs_specs_13;
+extern asn_TYPE_member_t asn_MBR_RANfunction_ItemIEs_13[3];
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionID_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_ItemIEs_specs_17;
+extern asn_TYPE_member_t asn_MBR_RANfunctionID_ItemIEs_17[3];
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionIDcause_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_ItemIEs_specs_21;
+extern asn_TYPE_member_t asn_MBR_RANfunctionIDcause_ItemIEs_21[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionRequest_IEs_specs_25;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionRequest_IEs_25[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionResponse_IEs_specs_29;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionResponse_IEs_29[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionFailure_IEs_specs_33;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionFailure_IEs_33[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteRequest_IEs_specs_37;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteRequest_IEs_37[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteResponse_IEs_specs_41;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteResponse_IEs_41[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteFailure_IEs_specs_45;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteFailure_IEs_45[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICindication_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICindication_IEs_specs_49;
+extern asn_TYPE_member_t asn_MBR_RICindication_IEs_49[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICcontrolRequest_IEs_specs_53;
+extern asn_TYPE_member_t asn_MBR_RICcontrolRequest_IEs_53[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICcontrolAcknowledge_IEs_specs_57;
+extern asn_TYPE_member_t asn_MBR_RICcontrolAcknowledge_IEs_57[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICcontrolFailure_IEs_specs_61;
+extern asn_TYPE_member_t asn_MBR_RICcontrolFailure_IEs_61[3];
+extern asn_TYPE_descriptor_t asn_DEF_ErrorIndication_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_ErrorIndication_IEs_specs_65;
+extern asn_TYPE_member_t asn_MBR_ErrorIndication_IEs_65[3];
+extern asn_TYPE_descriptor_t asn_DEF_E2setupRequestIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2setupRequestIEs_specs_69;
+extern asn_TYPE_member_t asn_MBR_E2setupRequestIEs_69[3];
+extern asn_TYPE_descriptor_t asn_DEF_E2setupResponseIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2setupResponseIEs_specs_73;
+extern asn_TYPE_member_t asn_MBR_E2setupResponseIEs_73[3];
+extern asn_TYPE_descriptor_t asn_DEF_E2setupFailureIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2setupFailureIEs_specs_77;
+extern asn_TYPE_member_t asn_MBR_E2setupFailureIEs_77[3];
+extern asn_TYPE_descriptor_t asn_DEF_ResetRequestIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_ResetRequestIEs_specs_81;
+extern asn_TYPE_member_t asn_MBR_ResetRequestIEs_81[3];
+extern asn_TYPE_descriptor_t asn_DEF_ResetResponseIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_ResetResponseIEs_specs_85;
+extern asn_TYPE_member_t asn_MBR_ResetResponseIEs_85[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdate_IEs_specs_89;
+extern asn_TYPE_member_t asn_MBR_RICserviceUpdate_IEs_89[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateAcknowledge_IEs_specs_93;
+extern asn_TYPE_member_t asn_MBR_RICserviceUpdateAcknowledge_IEs_93[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateFailure_IEs_specs_97;
+extern asn_TYPE_member_t asn_MBR_RICserviceUpdateFailure_IEs_97[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceQuery_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceQuery_IEs_specs_101;
+extern asn_TYPE_member_t asn_MBR_RICserviceQuery_IEs_101[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_Field_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-FieldPair.h b/e2ap/headers/ProtocolIE-FieldPair.h
new file mode 100644
index 0000000..17a19c7
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-FieldPair.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_FieldPair_H_
+#define	_ProtocolIE_FieldPair_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_FieldPair_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ID.h b/e2ap/headers/ProtocolIE-ID.h
new file mode 100644
index 0000000..dc75633
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ID.h
@@ -0,0 +1,78 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ID_H_
+#define	_ProtocolIE_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProtocolIE-ID */
+typedef long	 ProtocolIE_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_ID;
+asn_struct_free_f ProtocolIE_ID_free;
+asn_struct_print_f ProtocolIE_ID_print;
+asn_constr_check_f ProtocolIE_ID_constraint;
+ber_type_decoder_f ProtocolIE_ID_decode_ber;
+der_type_encoder_f ProtocolIE_ID_encode_der;
+xer_type_decoder_f ProtocolIE_ID_decode_xer;
+xer_type_encoder_f ProtocolIE_ID_encode_xer;
+oer_type_decoder_f ProtocolIE_ID_decode_oer;
+oer_type_encoder_f ProtocolIE_ID_encode_oer;
+per_type_decoder_f ProtocolIE_ID_decode_uper;
+per_type_encoder_f ProtocolIE_ID_encode_uper;
+per_type_decoder_f ProtocolIE_ID_decode_aper;
+per_type_encoder_f ProtocolIE_ID_encode_aper;
+#define ProtocolIE_ID_id_Cause	((ProtocolIE_ID_t)1)
+#define ProtocolIE_ID_id_CriticalityDiagnostics	((ProtocolIE_ID_t)2)
+#define ProtocolIE_ID_id_GlobalE2node_ID	((ProtocolIE_ID_t)3)
+#define ProtocolIE_ID_id_GlobalRIC_ID	((ProtocolIE_ID_t)4)
+#define ProtocolIE_ID_id_RANfunctionID	((ProtocolIE_ID_t)5)
+#define ProtocolIE_ID_id_RANfunctionID_Item	((ProtocolIE_ID_t)6)
+#define ProtocolIE_ID_id_RANfunctionIEcause_Item	((ProtocolIE_ID_t)7)
+#define ProtocolIE_ID_id_RANfunction_Item	((ProtocolIE_ID_t)8)
+#define ProtocolIE_ID_id_RANfunctionsAccepted	((ProtocolIE_ID_t)9)
+#define ProtocolIE_ID_id_RANfunctionsAdded	((ProtocolIE_ID_t)10)
+#define ProtocolIE_ID_id_RANfunctionsDeleted	((ProtocolIE_ID_t)11)
+#define ProtocolIE_ID_id_RANfunctionsModified	((ProtocolIE_ID_t)12)
+#define ProtocolIE_ID_id_RANfunctionsRejected	((ProtocolIE_ID_t)13)
+#define ProtocolIE_ID_id_RICaction_Admitted_Item	((ProtocolIE_ID_t)14)
+#define ProtocolIE_ID_id_RICactionID	((ProtocolIE_ID_t)15)
+#define ProtocolIE_ID_id_RICaction_NotAdmitted_Item	((ProtocolIE_ID_t)16)
+#define ProtocolIE_ID_id_RICactions_Admitted	((ProtocolIE_ID_t)17)
+#define ProtocolIE_ID_id_RICactions_NotAdmitted	((ProtocolIE_ID_t)18)
+#define ProtocolIE_ID_id_RICaction_ToBeSetup_Item	((ProtocolIE_ID_t)19)
+#define ProtocolIE_ID_id_RICcallProcessID	((ProtocolIE_ID_t)20)
+#define ProtocolIE_ID_id_RICcontrolAckRequest	((ProtocolIE_ID_t)21)
+#define ProtocolIE_ID_id_RICcontrolHeader	((ProtocolIE_ID_t)22)
+#define ProtocolIE_ID_id_RICcontrolMessage	((ProtocolIE_ID_t)23)
+#define ProtocolIE_ID_id_RICcontrolStatus	((ProtocolIE_ID_t)24)
+#define ProtocolIE_ID_id_RICindicationHeader	((ProtocolIE_ID_t)25)
+#define ProtocolIE_ID_id_RICindicationMessage	((ProtocolIE_ID_t)26)
+#define ProtocolIE_ID_id_RICindicationSN	((ProtocolIE_ID_t)27)
+#define ProtocolIE_ID_id_RICindicationType	((ProtocolIE_ID_t)28)
+#define ProtocolIE_ID_id_RICrequestID	((ProtocolIE_ID_t)29)
+#define ProtocolIE_ID_id_RICsubscriptionDetails	((ProtocolIE_ID_t)30)
+#define ProtocolIE_ID_id_TimeToWait	((ProtocolIE_ID_t)31)
+#define ProtocolIE_ID_id_RICcontrolOutcome	((ProtocolIE_ID_t)32)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-SingleContainer.h b/e2ap/headers/ProtocolIE-SingleContainer.h
new file mode 100644
index 0000000..eadd741
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-SingleContainer.h
@@ -0,0 +1,120 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_SingleContainer_H_
+#define	_ProtocolIE_SingleContainer_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Field.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProtocolIE-SingleContainer */
+typedef RICaction_ToBeSetup_ItemIEs_t	 ProtocolIE_SingleContainer_90P0_t;
+typedef RICaction_Admitted_ItemIEs_t	 ProtocolIE_SingleContainer_90P1_t;
+typedef RICaction_NotAdmitted_ItemIEs_t	 ProtocolIE_SingleContainer_90P2_t;
+typedef RANfunction_ItemIEs_t	 ProtocolIE_SingleContainer_90P3_t;
+typedef RANfunctionID_ItemIEs_t	 ProtocolIE_SingleContainer_90P4_t;
+typedef RANfunctionIDcause_ItemIEs_t	 ProtocolIE_SingleContainer_90P5_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P0;
+asn_struct_free_f ProtocolIE_SingleContainer_90P0_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P0_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P0_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P1;
+asn_struct_free_f ProtocolIE_SingleContainer_90P1_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P1_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P1_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P2;
+asn_struct_free_f ProtocolIE_SingleContainer_90P2_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P2_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P2_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P3;
+asn_struct_free_f ProtocolIE_SingleContainer_90P3_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P3_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P3_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P4;
+asn_struct_free_f ProtocolIE_SingleContainer_90P4_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P4_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P4_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P5;
+asn_struct_free_f ProtocolIE_SingleContainer_90P5_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P5_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P5_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_SingleContainer_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunction-Item.h b/e2ap/headers/RANfunction-Item.h
new file mode 100644
index 0000000..38b5e97
--- /dev/null
+++ b/e2ap/headers/RANfunction-Item.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunction_Item_H_
+#define	_RANfunction_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunctionID.h"
+#include "RANfunctionDefinition.h"
+#include "RANfunctionRevision.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunction-Item */
+typedef struct RANfunction_Item {
+	RANfunctionID_t	 ranFunctionID;
+	RANfunctionDefinition_t	 ranFunctionDefinition;
+	RANfunctionRevision_t	 ranFunctionRevision;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunction_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunction_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunction_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunction_Item_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunction_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionDefinition.h b/e2ap/headers/RANfunctionDefinition.h
new file mode 100644
index 0000000..3676c45
--- /dev/null
+++ b/e2ap/headers/RANfunctionDefinition.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionDefinition_H_
+#define	_RANfunctionDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionDefinition */
+typedef OCTET_STRING_t	 RANfunctionDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionDefinition;
+asn_struct_free_f RANfunctionDefinition_free;
+asn_struct_print_f RANfunctionDefinition_print;
+asn_constr_check_f RANfunctionDefinition_constraint;
+ber_type_decoder_f RANfunctionDefinition_decode_ber;
+der_type_encoder_f RANfunctionDefinition_encode_der;
+xer_type_decoder_f RANfunctionDefinition_decode_xer;
+xer_type_encoder_f RANfunctionDefinition_encode_xer;
+oer_type_decoder_f RANfunctionDefinition_decode_oer;
+oer_type_encoder_f RANfunctionDefinition_encode_oer;
+per_type_decoder_f RANfunctionDefinition_decode_uper;
+per_type_encoder_f RANfunctionDefinition_encode_uper;
+per_type_decoder_f RANfunctionDefinition_decode_aper;
+per_type_encoder_f RANfunctionDefinition_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionID-Item.h b/e2ap/headers/RANfunctionID-Item.h
new file mode 100644
index 0000000..f4a643d
--- /dev/null
+++ b/e2ap/headers/RANfunctionID-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionID_Item_H_
+#define	_RANfunctionID_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunctionID.h"
+#include "RANfunctionRevision.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionID-Item */
+typedef struct RANfunctionID_Item {
+	RANfunctionID_t	 ranFunctionID;
+	RANfunctionRevision_t	 ranFunctionRevision;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionID_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionID_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionID_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionID_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionID.h b/e2ap/headers/RANfunctionID.h
new file mode 100644
index 0000000..00c4765
--- /dev/null
+++ b/e2ap/headers/RANfunctionID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionID_H_
+#define	_RANfunctionID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionID */
+typedef long	 RANfunctionID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RANfunctionID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionID;
+asn_struct_free_f RANfunctionID_free;
+asn_struct_print_f RANfunctionID_print;
+asn_constr_check_f RANfunctionID_constraint;
+ber_type_decoder_f RANfunctionID_decode_ber;
+der_type_encoder_f RANfunctionID_encode_der;
+xer_type_decoder_f RANfunctionID_decode_xer;
+xer_type_encoder_f RANfunctionID_encode_xer;
+oer_type_decoder_f RANfunctionID_decode_oer;
+oer_type_encoder_f RANfunctionID_encode_oer;
+per_type_decoder_f RANfunctionID_decode_uper;
+per_type_encoder_f RANfunctionID_encode_uper;
+per_type_decoder_f RANfunctionID_decode_aper;
+per_type_encoder_f RANfunctionID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionIDcause-Item.h b/e2ap/headers/RANfunctionIDcause-Item.h
new file mode 100644
index 0000000..65d1d16
--- /dev/null
+++ b/e2ap/headers/RANfunctionIDcause-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionIDcause_Item_H_
+#define	_RANfunctionIDcause_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunctionID.h"
+#include "Cause.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionIDcause-Item */
+typedef struct RANfunctionIDcause_Item {
+	RANfunctionID_t	 ranFunctionID;
+	Cause_t	 cause;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionIDcause_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionIDcause_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionIDcause_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionIDcause_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionRevision.h b/e2ap/headers/RANfunctionRevision.h
new file mode 100644
index 0000000..76f500a
--- /dev/null
+++ b/e2ap/headers/RANfunctionRevision.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionRevision_H_
+#define	_RANfunctionRevision_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionRevision */
+typedef long	 RANfunctionRevision_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RANfunctionRevision_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionRevision;
+asn_struct_free_f RANfunctionRevision_free;
+asn_struct_print_f RANfunctionRevision_print;
+asn_constr_check_f RANfunctionRevision_constraint;
+ber_type_decoder_f RANfunctionRevision_decode_ber;
+der_type_encoder_f RANfunctionRevision_encode_der;
+xer_type_decoder_f RANfunctionRevision_decode_xer;
+xer_type_encoder_f RANfunctionRevision_encode_xer;
+oer_type_decoder_f RANfunctionRevision_decode_oer;
+oer_type_encoder_f RANfunctionRevision_encode_oer;
+per_type_decoder_f RANfunctionRevision_decode_uper;
+per_type_encoder_f RANfunctionRevision_encode_uper;
+per_type_decoder_f RANfunctionRevision_decode_aper;
+per_type_encoder_f RANfunctionRevision_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionRevision_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctions-List.h b/e2ap/headers/RANfunctions-List.h
new file mode 100644
index 0000000..c3fd3e3
--- /dev/null
+++ b/e2ap/headers/RANfunctions-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctions_List_H_
+#define	_RANfunctions_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RANfunctions-List */
+typedef struct RANfunctions_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctions_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctions_List;
+extern asn_SET_OF_specifics_t asn_SPC_RANfunctions_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctions_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RANfunctions_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctions_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionsID-List.h b/e2ap/headers/RANfunctionsID-List.h
new file mode 100644
index 0000000..1a77d70
--- /dev/null
+++ b/e2ap/headers/RANfunctionsID-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionsID_List_H_
+#define	_RANfunctionsID_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RANfunctionsID-List */
+typedef struct RANfunctionsID_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionsID_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionsID_List;
+extern asn_SET_OF_specifics_t asn_SPC_RANfunctionsID_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionsID_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RANfunctionsID_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionsID_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionsIDcause-List.h b/e2ap/headers/RANfunctionsIDcause-List.h
new file mode 100644
index 0000000..3fd51d1
--- /dev/null
+++ b/e2ap/headers/RANfunctionsIDcause-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionsIDcause_List_H_
+#define	_RANfunctionsIDcause_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RANfunctionsIDcause-List */
+typedef struct RANfunctionsIDcause_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionsIDcause_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionsIDcause_List;
+extern asn_SET_OF_specifics_t asn_SPC_RANfunctionsIDcause_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionsIDcause_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RANfunctionsIDcause_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionsIDcause_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-Admitted-Item.h b/e2ap/headers/RICaction-Admitted-Item.h
new file mode 100644
index 0000000..5031b7d
--- /dev/null
+++ b/e2ap/headers/RICaction-Admitted-Item.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_Admitted_Item_H_
+#define	_RICaction_Admitted_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICactionID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICaction-Admitted-Item */
+typedef struct RICaction_Admitted_Item {
+	RICactionID_t	 ricActionID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_Admitted_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_Admitted_Item_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_Admitted_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-Admitted-List.h b/e2ap/headers/RICaction-Admitted-List.h
new file mode 100644
index 0000000..9464982
--- /dev/null
+++ b/e2ap/headers/RICaction-Admitted-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_Admitted_List_H_
+#define	_RICaction_Admitted_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RICaction-Admitted-List */
+typedef struct RICaction_Admitted_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_Admitted_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_List;
+extern asn_SET_OF_specifics_t asn_SPC_RICaction_Admitted_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_Admitted_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RICaction_Admitted_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_Admitted_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-NotAdmitted-Item.h b/e2ap/headers/RICaction-NotAdmitted-Item.h
new file mode 100644
index 0000000..b94f69c
--- /dev/null
+++ b/e2ap/headers/RICaction-NotAdmitted-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_NotAdmitted_Item_H_
+#define	_RICaction_NotAdmitted_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICactionID.h"
+#include "Cause.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICaction-NotAdmitted-Item */
+typedef struct RICaction_NotAdmitted_Item {
+	RICactionID_t	 ricActionID;
+	Cause_t	 cause;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_NotAdmitted_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_NotAdmitted_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-NotAdmitted-List.h b/e2ap/headers/RICaction-NotAdmitted-List.h
new file mode 100644
index 0000000..642683d
--- /dev/null
+++ b/e2ap/headers/RICaction-NotAdmitted-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_NotAdmitted_List_H_
+#define	_RICaction_NotAdmitted_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RICaction-NotAdmitted-List */
+typedef struct RICaction_NotAdmitted_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_NotAdmitted_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_List;
+extern asn_SET_OF_specifics_t asn_SPC_RICaction_NotAdmitted_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RICaction_NotAdmitted_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_NotAdmitted_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-ToBeSetup-Item.h b/e2ap/headers/RICaction-ToBeSetup-Item.h
new file mode 100644
index 0000000..a616014
--- /dev/null
+++ b/e2ap/headers/RICaction-ToBeSetup-Item.h
@@ -0,0 +1,52 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_ToBeSetup_Item_H_
+#define	_RICaction_ToBeSetup_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICactionID.h"
+#include "RICactionType.h"
+#include "RICactionDefinition.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RICsubsequentAction;
+
+/* RICaction-ToBeSetup-Item */
+typedef struct RICaction_ToBeSetup_Item {
+	RICactionID_t	 ricActionID;
+	RICactionType_t	 ricActionType;
+	RICactionDefinition_t	*ricActionDefinition;	/* OPTIONAL */
+	struct RICsubsequentAction	*ricSubsequentAction;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_ToBeSetup_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_Item_1[4];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_ToBeSetup_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactionDefinition.h b/e2ap/headers/RICactionDefinition.h
new file mode 100644
index 0000000..349e2a8
--- /dev/null
+++ b/e2ap/headers/RICactionDefinition.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactionDefinition_H_
+#define	_RICactionDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICactionDefinition */
+typedef OCTET_STRING_t	 RICactionDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICactionDefinition;
+asn_struct_free_f RICactionDefinition_free;
+asn_struct_print_f RICactionDefinition_print;
+asn_constr_check_f RICactionDefinition_constraint;
+ber_type_decoder_f RICactionDefinition_decode_ber;
+der_type_encoder_f RICactionDefinition_encode_der;
+xer_type_decoder_f RICactionDefinition_decode_xer;
+xer_type_encoder_f RICactionDefinition_encode_xer;
+oer_type_decoder_f RICactionDefinition_decode_oer;
+oer_type_encoder_f RICactionDefinition_encode_oer;
+per_type_decoder_f RICactionDefinition_decode_uper;
+per_type_encoder_f RICactionDefinition_encode_uper;
+per_type_decoder_f RICactionDefinition_decode_aper;
+per_type_encoder_f RICactionDefinition_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactionDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactionID.h b/e2ap/headers/RICactionID.h
new file mode 100644
index 0000000..b8f6447
--- /dev/null
+++ b/e2ap/headers/RICactionID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactionID_H_
+#define	_RICactionID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICactionID */
+typedef long	 RICactionID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICactionID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICactionID;
+asn_struct_free_f RICactionID_free;
+asn_struct_print_f RICactionID_print;
+asn_constr_check_f RICactionID_constraint;
+ber_type_decoder_f RICactionID_decode_ber;
+der_type_encoder_f RICactionID_encode_der;
+xer_type_decoder_f RICactionID_decode_xer;
+xer_type_encoder_f RICactionID_encode_xer;
+oer_type_decoder_f RICactionID_decode_oer;
+oer_type_encoder_f RICactionID_encode_oer;
+per_type_decoder_f RICactionID_decode_uper;
+per_type_encoder_f RICactionID_encode_uper;
+per_type_decoder_f RICactionID_decode_aper;
+per_type_encoder_f RICactionID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactionID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactionType.h b/e2ap/headers/RICactionType.h
new file mode 100644
index 0000000..e4349fd
--- /dev/null
+++ b/e2ap/headers/RICactionType.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactionType_H_
+#define	_RICactionType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICactionType {
+	RICactionType_report	= 0,
+	RICactionType_insert	= 1,
+	RICactionType_policy	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICactionType;
+
+/* RICactionType */
+typedef long	 RICactionType_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICactionType_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICactionType;
+extern const asn_INTEGER_specifics_t asn_SPC_RICactionType_specs_1;
+asn_struct_free_f RICactionType_free;
+asn_struct_print_f RICactionType_print;
+asn_constr_check_f RICactionType_constraint;
+ber_type_decoder_f RICactionType_decode_ber;
+der_type_encoder_f RICactionType_encode_der;
+xer_type_decoder_f RICactionType_decode_xer;
+xer_type_encoder_f RICactionType_encode_xer;
+oer_type_decoder_f RICactionType_decode_oer;
+oer_type_encoder_f RICactionType_encode_oer;
+per_type_decoder_f RICactionType_decode_uper;
+per_type_encoder_f RICactionType_encode_uper;
+per_type_decoder_f RICactionType_decode_aper;
+per_type_encoder_f RICactionType_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactionType_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactions-ToBeSetup-List.h b/e2ap/headers/RICactions-ToBeSetup-List.h
new file mode 100644
index 0000000..632b420
--- /dev/null
+++ b/e2ap/headers/RICactions-ToBeSetup-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactions_ToBeSetup_List_H_
+#define	_RICactions_ToBeSetup_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RICactions-ToBeSetup-List */
+typedef struct RICactions_ToBeSetup_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICactions_ToBeSetup_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICactions_ToBeSetup_List;
+extern asn_SET_OF_specifics_t asn_SPC_RICactions_ToBeSetup_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICactions_ToBeSetup_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RICactions_ToBeSetup_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactions_ToBeSetup_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcallProcessID.h b/e2ap/headers/RICcallProcessID.h
new file mode 100644
index 0000000..a1a4983
--- /dev/null
+++ b/e2ap/headers/RICcallProcessID.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcallProcessID_H_
+#define	_RICcallProcessID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcallProcessID */
+typedef OCTET_STRING_t	 RICcallProcessID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcallProcessID;
+asn_struct_free_f RICcallProcessID_free;
+asn_struct_print_f RICcallProcessID_print;
+asn_constr_check_f RICcallProcessID_constraint;
+ber_type_decoder_f RICcallProcessID_decode_ber;
+der_type_encoder_f RICcallProcessID_encode_der;
+xer_type_decoder_f RICcallProcessID_decode_xer;
+xer_type_encoder_f RICcallProcessID_encode_xer;
+oer_type_decoder_f RICcallProcessID_decode_oer;
+oer_type_encoder_f RICcallProcessID_encode_oer;
+per_type_decoder_f RICcallProcessID_decode_uper;
+per_type_encoder_f RICcallProcessID_encode_uper;
+per_type_decoder_f RICcallProcessID_decode_aper;
+per_type_encoder_f RICcallProcessID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcallProcessID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolAckRequest.h b/e2ap/headers/RICcontrolAckRequest.h
new file mode 100644
index 0000000..abb9553
--- /dev/null
+++ b/e2ap/headers/RICcontrolAckRequest.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolAckRequest_H_
+#define	_RICcontrolAckRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICcontrolAckRequest {
+	RICcontrolAckRequest_noAck	= 0,
+	RICcontrolAckRequest_ack	= 1,
+	RICcontrolAckRequest_nAck	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICcontrolAckRequest;
+
+/* RICcontrolAckRequest */
+typedef long	 RICcontrolAckRequest_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICcontrolAckRequest_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolAckRequest;
+extern const asn_INTEGER_specifics_t asn_SPC_RICcontrolAckRequest_specs_1;
+asn_struct_free_f RICcontrolAckRequest_free;
+asn_struct_print_f RICcontrolAckRequest_print;
+asn_constr_check_f RICcontrolAckRequest_constraint;
+ber_type_decoder_f RICcontrolAckRequest_decode_ber;
+der_type_encoder_f RICcontrolAckRequest_encode_der;
+xer_type_decoder_f RICcontrolAckRequest_decode_xer;
+xer_type_encoder_f RICcontrolAckRequest_encode_xer;
+oer_type_decoder_f RICcontrolAckRequest_decode_oer;
+oer_type_encoder_f RICcontrolAckRequest_encode_oer;
+per_type_decoder_f RICcontrolAckRequest_decode_uper;
+per_type_encoder_f RICcontrolAckRequest_encode_uper;
+per_type_decoder_f RICcontrolAckRequest_decode_aper;
+per_type_encoder_f RICcontrolAckRequest_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolAckRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolAcknowledge.h b/e2ap/headers/RICcontrolAcknowledge.h
new file mode 100644
index 0000000..361f3d6
--- /dev/null
+++ b/e2ap/headers/RICcontrolAcknowledge.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolAcknowledge_H_
+#define	_RICcontrolAcknowledge_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolAcknowledge */
+typedef struct RICcontrolAcknowledge {
+	ProtocolIE_Container_87P8_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolAcknowledge_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolAcknowledge_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolFailure.h b/e2ap/headers/RICcontrolFailure.h
new file mode 100644
index 0000000..6eb6a04
--- /dev/null
+++ b/e2ap/headers/RICcontrolFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolFailure_H_
+#define	_RICcontrolFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolFailure */
+typedef struct RICcontrolFailure {
+	ProtocolIE_Container_87P9_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolHeader.h b/e2ap/headers/RICcontrolHeader.h
new file mode 100644
index 0000000..d7cad7d
--- /dev/null
+++ b/e2ap/headers/RICcontrolHeader.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolHeader_H_
+#define	_RICcontrolHeader_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolHeader */
+typedef OCTET_STRING_t	 RICcontrolHeader_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolHeader;
+asn_struct_free_f RICcontrolHeader_free;
+asn_struct_print_f RICcontrolHeader_print;
+asn_constr_check_f RICcontrolHeader_constraint;
+ber_type_decoder_f RICcontrolHeader_decode_ber;
+der_type_encoder_f RICcontrolHeader_encode_der;
+xer_type_decoder_f RICcontrolHeader_decode_xer;
+xer_type_encoder_f RICcontrolHeader_encode_xer;
+oer_type_decoder_f RICcontrolHeader_decode_oer;
+oer_type_encoder_f RICcontrolHeader_encode_oer;
+per_type_decoder_f RICcontrolHeader_decode_uper;
+per_type_encoder_f RICcontrolHeader_encode_uper;
+per_type_decoder_f RICcontrolHeader_decode_aper;
+per_type_encoder_f RICcontrolHeader_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolHeader_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolMessage.h b/e2ap/headers/RICcontrolMessage.h
new file mode 100644
index 0000000..08fdf4a
--- /dev/null
+++ b/e2ap/headers/RICcontrolMessage.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolMessage_H_
+#define	_RICcontrolMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolMessage */
+typedef OCTET_STRING_t	 RICcontrolMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolMessage;
+asn_struct_free_f RICcontrolMessage_free;
+asn_struct_print_f RICcontrolMessage_print;
+asn_constr_check_f RICcontrolMessage_constraint;
+ber_type_decoder_f RICcontrolMessage_decode_ber;
+der_type_encoder_f RICcontrolMessage_encode_der;
+xer_type_decoder_f RICcontrolMessage_decode_xer;
+xer_type_encoder_f RICcontrolMessage_encode_xer;
+oer_type_decoder_f RICcontrolMessage_decode_oer;
+oer_type_encoder_f RICcontrolMessage_encode_oer;
+per_type_decoder_f RICcontrolMessage_decode_uper;
+per_type_encoder_f RICcontrolMessage_encode_uper;
+per_type_decoder_f RICcontrolMessage_decode_aper;
+per_type_encoder_f RICcontrolMessage_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolOutcome.h b/e2ap/headers/RICcontrolOutcome.h
new file mode 100644
index 0000000..d70b5a5
--- /dev/null
+++ b/e2ap/headers/RICcontrolOutcome.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolOutcome_H_
+#define	_RICcontrolOutcome_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolOutcome */
+typedef OCTET_STRING_t	 RICcontrolOutcome_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolOutcome;
+asn_struct_free_f RICcontrolOutcome_free;
+asn_struct_print_f RICcontrolOutcome_print;
+asn_constr_check_f RICcontrolOutcome_constraint;
+ber_type_decoder_f RICcontrolOutcome_decode_ber;
+der_type_encoder_f RICcontrolOutcome_encode_der;
+xer_type_decoder_f RICcontrolOutcome_decode_xer;
+xer_type_encoder_f RICcontrolOutcome_encode_xer;
+oer_type_decoder_f RICcontrolOutcome_decode_oer;
+oer_type_encoder_f RICcontrolOutcome_encode_oer;
+per_type_decoder_f RICcontrolOutcome_decode_uper;
+per_type_encoder_f RICcontrolOutcome_encode_uper;
+per_type_decoder_f RICcontrolOutcome_decode_aper;
+per_type_encoder_f RICcontrolOutcome_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolOutcome_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolRequest.h b/e2ap/headers/RICcontrolRequest.h
new file mode 100644
index 0000000..db5ba24
--- /dev/null
+++ b/e2ap/headers/RICcontrolRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolRequest_H_
+#define	_RICcontrolRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolRequest */
+typedef struct RICcontrolRequest {
+	ProtocolIE_Container_87P7_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolStatus.h b/e2ap/headers/RICcontrolStatus.h
new file mode 100644
index 0000000..033f5a9
--- /dev/null
+++ b/e2ap/headers/RICcontrolStatus.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolStatus_H_
+#define	_RICcontrolStatus_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICcontrolStatus {
+	RICcontrolStatus_success	= 0,
+	RICcontrolStatus_rejected	= 1,
+	RICcontrolStatus_failed	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICcontrolStatus;
+
+/* RICcontrolStatus */
+typedef long	 RICcontrolStatus_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICcontrolStatus_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolStatus;
+extern const asn_INTEGER_specifics_t asn_SPC_RICcontrolStatus_specs_1;
+asn_struct_free_f RICcontrolStatus_free;
+asn_struct_print_f RICcontrolStatus_print;
+asn_constr_check_f RICcontrolStatus_constraint;
+ber_type_decoder_f RICcontrolStatus_decode_ber;
+der_type_encoder_f RICcontrolStatus_encode_der;
+xer_type_decoder_f RICcontrolStatus_decode_xer;
+xer_type_encoder_f RICcontrolStatus_encode_xer;
+oer_type_decoder_f RICcontrolStatus_decode_oer;
+oer_type_encoder_f RICcontrolStatus_encode_oer;
+per_type_decoder_f RICcontrolStatus_decode_uper;
+per_type_encoder_f RICcontrolStatus_encode_uper;
+per_type_decoder_f RICcontrolStatus_decode_aper;
+per_type_encoder_f RICcontrolStatus_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolStatus_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICeventTriggerDefinition.h b/e2ap/headers/RICeventTriggerDefinition.h
new file mode 100644
index 0000000..58ec4d2
--- /dev/null
+++ b/e2ap/headers/RICeventTriggerDefinition.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICeventTriggerDefinition_H_
+#define	_RICeventTriggerDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICeventTriggerDefinition */
+typedef OCTET_STRING_t	 RICeventTriggerDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICeventTriggerDefinition;
+asn_struct_free_f RICeventTriggerDefinition_free;
+asn_struct_print_f RICeventTriggerDefinition_print;
+asn_constr_check_f RICeventTriggerDefinition_constraint;
+ber_type_decoder_f RICeventTriggerDefinition_decode_ber;
+der_type_encoder_f RICeventTriggerDefinition_encode_der;
+xer_type_decoder_f RICeventTriggerDefinition_decode_xer;
+xer_type_encoder_f RICeventTriggerDefinition_encode_xer;
+oer_type_decoder_f RICeventTriggerDefinition_decode_oer;
+oer_type_encoder_f RICeventTriggerDefinition_encode_oer;
+per_type_decoder_f RICeventTriggerDefinition_decode_uper;
+per_type_encoder_f RICeventTriggerDefinition_encode_uper;
+per_type_decoder_f RICeventTriggerDefinition_decode_aper;
+per_type_encoder_f RICeventTriggerDefinition_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICeventTriggerDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindication.h b/e2ap/headers/RICindication.h
new file mode 100644
index 0000000..c984ab6
--- /dev/null
+++ b/e2ap/headers/RICindication.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindication_H_
+#define	_RICindication_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindication */
+typedef struct RICindication {
+	ProtocolIE_Container_87P6_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICindication_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICindication;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindication_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationHeader.h b/e2ap/headers/RICindicationHeader.h
new file mode 100644
index 0000000..3220602
--- /dev/null
+++ b/e2ap/headers/RICindicationHeader.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationHeader_H_
+#define	_RICindicationHeader_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindicationHeader */
+typedef OCTET_STRING_t	 RICindicationHeader_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationHeader;
+asn_struct_free_f RICindicationHeader_free;
+asn_struct_print_f RICindicationHeader_print;
+asn_constr_check_f RICindicationHeader_constraint;
+ber_type_decoder_f RICindicationHeader_decode_ber;
+der_type_encoder_f RICindicationHeader_encode_der;
+xer_type_decoder_f RICindicationHeader_decode_xer;
+xer_type_encoder_f RICindicationHeader_encode_xer;
+oer_type_decoder_f RICindicationHeader_decode_oer;
+oer_type_encoder_f RICindicationHeader_encode_oer;
+per_type_decoder_f RICindicationHeader_decode_uper;
+per_type_encoder_f RICindicationHeader_encode_uper;
+per_type_decoder_f RICindicationHeader_decode_aper;
+per_type_encoder_f RICindicationHeader_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationHeader_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationMessage.h b/e2ap/headers/RICindicationMessage.h
new file mode 100644
index 0000000..f00ebe7
--- /dev/null
+++ b/e2ap/headers/RICindicationMessage.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationMessage_H_
+#define	_RICindicationMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindicationMessage */
+typedef OCTET_STRING_t	 RICindicationMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationMessage;
+asn_struct_free_f RICindicationMessage_free;
+asn_struct_print_f RICindicationMessage_print;
+asn_constr_check_f RICindicationMessage_constraint;
+ber_type_decoder_f RICindicationMessage_decode_ber;
+der_type_encoder_f RICindicationMessage_encode_der;
+xer_type_decoder_f RICindicationMessage_decode_xer;
+xer_type_encoder_f RICindicationMessage_encode_xer;
+oer_type_decoder_f RICindicationMessage_decode_oer;
+oer_type_encoder_f RICindicationMessage_encode_oer;
+per_type_decoder_f RICindicationMessage_decode_uper;
+per_type_encoder_f RICindicationMessage_encode_uper;
+per_type_decoder_f RICindicationMessage_decode_aper;
+per_type_encoder_f RICindicationMessage_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationSN.h b/e2ap/headers/RICindicationSN.h
new file mode 100644
index 0000000..498aaef
--- /dev/null
+++ b/e2ap/headers/RICindicationSN.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationSN_H_
+#define	_RICindicationSN_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindicationSN */
+typedef long	 RICindicationSN_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICindicationSN_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationSN;
+asn_struct_free_f RICindicationSN_free;
+asn_struct_print_f RICindicationSN_print;
+asn_constr_check_f RICindicationSN_constraint;
+ber_type_decoder_f RICindicationSN_decode_ber;
+der_type_encoder_f RICindicationSN_encode_der;
+xer_type_decoder_f RICindicationSN_decode_xer;
+xer_type_encoder_f RICindicationSN_encode_xer;
+oer_type_decoder_f RICindicationSN_decode_oer;
+oer_type_encoder_f RICindicationSN_encode_oer;
+per_type_decoder_f RICindicationSN_decode_uper;
+per_type_encoder_f RICindicationSN_encode_uper;
+per_type_decoder_f RICindicationSN_decode_aper;
+per_type_encoder_f RICindicationSN_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationSN_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationType.h b/e2ap/headers/RICindicationType.h
new file mode 100644
index 0000000..ffc0335
--- /dev/null
+++ b/e2ap/headers/RICindicationType.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationType_H_
+#define	_RICindicationType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICindicationType {
+	RICindicationType_report	= 0,
+	RICindicationType_insert	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICindicationType;
+
+/* RICindicationType */
+typedef long	 RICindicationType_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICindicationType_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationType;
+extern const asn_INTEGER_specifics_t asn_SPC_RICindicationType_specs_1;
+asn_struct_free_f RICindicationType_free;
+asn_struct_print_f RICindicationType_print;
+asn_constr_check_f RICindicationType_constraint;
+ber_type_decoder_f RICindicationType_decode_ber;
+der_type_encoder_f RICindicationType_encode_der;
+xer_type_decoder_f RICindicationType_decode_xer;
+xer_type_encoder_f RICindicationType_encode_xer;
+oer_type_decoder_f RICindicationType_decode_oer;
+oer_type_encoder_f RICindicationType_encode_oer;
+per_type_decoder_f RICindicationType_decode_uper;
+per_type_encoder_f RICindicationType_encode_uper;
+per_type_decoder_f RICindicationType_decode_aper;
+per_type_encoder_f RICindicationType_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationType_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICrequestID.h b/e2ap/headers/RICrequestID.h
new file mode 100644
index 0000000..b76c37c
--- /dev/null
+++ b/e2ap/headers/RICrequestID.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICrequestID_H_
+#define	_RICrequestID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICrequestID */
+typedef struct RICrequestID {
+	long	 ricRequestorID;
+	long	 ricInstanceID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICrequestID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICrequestID;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICrequestID_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICrequestID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICrequestID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceQuery.h b/e2ap/headers/RICserviceQuery.h
new file mode 100644
index 0000000..3b2c4ee
--- /dev/null
+++ b/e2ap/headers/RICserviceQuery.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceQuery_H_
+#define	_RICserviceQuery_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceQuery */
+typedef struct RICserviceQuery {
+	ProtocolIE_Container_87P19_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceQuery_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceQuery;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceQuery_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceUpdate.h b/e2ap/headers/RICserviceUpdate.h
new file mode 100644
index 0000000..9ade74f
--- /dev/null
+++ b/e2ap/headers/RICserviceUpdate.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceUpdate_H_
+#define	_RICserviceUpdate_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceUpdate */
+typedef struct RICserviceUpdate {
+	ProtocolIE_Container_87P16_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdate_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceUpdate_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceUpdateAcknowledge.h b/e2ap/headers/RICserviceUpdateAcknowledge.h
new file mode 100644
index 0000000..4b08d1a
--- /dev/null
+++ b/e2ap/headers/RICserviceUpdateAcknowledge.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceUpdateAcknowledge_H_
+#define	_RICserviceUpdateAcknowledge_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceUpdateAcknowledge */
+typedef struct RICserviceUpdateAcknowledge {
+	ProtocolIE_Container_87P17_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateAcknowledge_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceUpdateAcknowledge_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceUpdateFailure.h b/e2ap/headers/RICserviceUpdateFailure.h
new file mode 100644
index 0000000..c00559e
--- /dev/null
+++ b/e2ap/headers/RICserviceUpdateFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceUpdateFailure_H_
+#define	_RICserviceUpdateFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceUpdateFailure */
+typedef struct RICserviceUpdateFailure {
+	ProtocolIE_Container_87P18_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceUpdateFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDeleteFailure.h b/e2ap/headers/RICsubscriptionDeleteFailure.h
new file mode 100644
index 0000000..59bb7d4
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDeleteFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDeleteFailure_H_
+#define	_RICsubscriptionDeleteFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDeleteFailure */
+typedef struct RICsubscriptionDeleteFailure {
+	ProtocolIE_Container_87P5_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDeleteFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDeleteRequest.h b/e2ap/headers/RICsubscriptionDeleteRequest.h
new file mode 100644
index 0000000..5019dab
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDeleteRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDeleteRequest_H_
+#define	_RICsubscriptionDeleteRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDeleteRequest */
+typedef struct RICsubscriptionDeleteRequest {
+	ProtocolIE_Container_87P3_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDeleteRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDeleteResponse.h b/e2ap/headers/RICsubscriptionDeleteResponse.h
new file mode 100644
index 0000000..b1aeba6
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDeleteResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDeleteResponse_H_
+#define	_RICsubscriptionDeleteResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDeleteResponse */
+typedef struct RICsubscriptionDeleteResponse {
+	ProtocolIE_Container_87P4_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDeleteResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDetails.h b/e2ap/headers/RICsubscriptionDetails.h
new file mode 100644
index 0000000..9b0a03e
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDetails.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDetails_H_
+#define	_RICsubscriptionDetails_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICeventTriggerDefinition.h"
+#include "RICactions-ToBeSetup-List.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDetails */
+typedef struct RICsubscriptionDetails {
+	RICeventTriggerDefinition_t	 ricEventTriggerDefinition;
+	RICactions_ToBeSetup_List_t	 ricAction_ToBeSetup_List;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDetails_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDetails;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDetails_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDetails_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDetails_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionFailure.h b/e2ap/headers/RICsubscriptionFailure.h
new file mode 100644
index 0000000..c8c4a77
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionFailure_H_
+#define	_RICsubscriptionFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionFailure */
+typedef struct RICsubscriptionFailure {
+	ProtocolIE_Container_87P2_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionRequest.h b/e2ap/headers/RICsubscriptionRequest.h
new file mode 100644
index 0000000..9e9e0bb
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionRequest_H_
+#define	_RICsubscriptionRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionRequest */
+typedef struct RICsubscriptionRequest {
+	ProtocolIE_Container_87P0_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionResponse.h b/e2ap/headers/RICsubscriptionResponse.h
new file mode 100644
index 0000000..9b8bb17
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionResponse_H_
+#define	_RICsubscriptionResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionResponse */
+typedef struct RICsubscriptionResponse {
+	ProtocolIE_Container_87P1_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubsequentAction.h b/e2ap/headers/RICsubsequentAction.h
new file mode 100644
index 0000000..fffdc21
--- /dev/null
+++ b/e2ap/headers/RICsubsequentAction.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubsequentAction_H_
+#define	_RICsubsequentAction_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICsubsequentActionType.h"
+#include "RICtimeToWait.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubsequentAction */
+typedef struct RICsubsequentAction {
+	RICsubsequentActionType_t	 ricSubsequentActionType;
+	RICtimeToWait_t	 ricTimeToWait;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubsequentAction_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubsequentAction;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubsequentAction_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICsubsequentAction_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubsequentAction_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubsequentActionType.h b/e2ap/headers/RICsubsequentActionType.h
new file mode 100644
index 0000000..1dea790
--- /dev/null
+++ b/e2ap/headers/RICsubsequentActionType.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubsequentActionType_H_
+#define	_RICsubsequentActionType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICsubsequentActionType {
+	RICsubsequentActionType_continue	= 0,
+	RICsubsequentActionType_wait	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICsubsequentActionType;
+
+/* RICsubsequentActionType */
+typedef long	 RICsubsequentActionType_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICsubsequentActionType_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICsubsequentActionType;
+extern const asn_INTEGER_specifics_t asn_SPC_RICsubsequentActionType_specs_1;
+asn_struct_free_f RICsubsequentActionType_free;
+asn_struct_print_f RICsubsequentActionType_print;
+asn_constr_check_f RICsubsequentActionType_constraint;
+ber_type_decoder_f RICsubsequentActionType_decode_ber;
+der_type_encoder_f RICsubsequentActionType_encode_der;
+xer_type_decoder_f RICsubsequentActionType_decode_xer;
+xer_type_encoder_f RICsubsequentActionType_encode_xer;
+oer_type_decoder_f RICsubsequentActionType_decode_oer;
+oer_type_encoder_f RICsubsequentActionType_encode_oer;
+per_type_decoder_f RICsubsequentActionType_decode_uper;
+per_type_encoder_f RICsubsequentActionType_encode_uper;
+per_type_decoder_f RICsubsequentActionType_decode_aper;
+per_type_encoder_f RICsubsequentActionType_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubsequentActionType_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICtimeToWait.h b/e2ap/headers/RICtimeToWait.h
new file mode 100644
index 0000000..efe9b2a
--- /dev/null
+++ b/e2ap/headers/RICtimeToWait.h
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICtimeToWait_H_
+#define	_RICtimeToWait_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICtimeToWait {
+	RICtimeToWait_zero	= 0,
+	RICtimeToWait_w1ms	= 1,
+	RICtimeToWait_w2ms	= 2,
+	RICtimeToWait_w5ms	= 3,
+	RICtimeToWait_w10ms	= 4,
+	RICtimeToWait_w20ms	= 5,
+	RICtimeToWait_w30ms	= 6,
+	RICtimeToWait_w40ms	= 7,
+	RICtimeToWait_w50ms	= 8,
+	RICtimeToWait_w100ms	= 9,
+	RICtimeToWait_w200ms	= 10,
+	RICtimeToWait_w500ms	= 11,
+	RICtimeToWait_w1s	= 12,
+	RICtimeToWait_w2s	= 13,
+	RICtimeToWait_w5s	= 14,
+	RICtimeToWait_w10s	= 15,
+	RICtimeToWait_w20s	= 16,
+	RICtimeToWait_w60s	= 17
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICtimeToWait;
+
+/* RICtimeToWait */
+typedef long	 RICtimeToWait_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICtimeToWait_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICtimeToWait;
+extern const asn_INTEGER_specifics_t asn_SPC_RICtimeToWait_specs_1;
+asn_struct_free_f RICtimeToWait_free;
+asn_struct_print_f RICtimeToWait_print;
+asn_constr_check_f RICtimeToWait_constraint;
+ber_type_decoder_f RICtimeToWait_decode_ber;
+der_type_encoder_f RICtimeToWait_encode_der;
+xer_type_decoder_f RICtimeToWait_decode_xer;
+xer_type_encoder_f RICtimeToWait_encode_xer;
+oer_type_decoder_f RICtimeToWait_decode_oer;
+oer_type_encoder_f RICtimeToWait_encode_oer;
+per_type_decoder_f RICtimeToWait_decode_uper;
+per_type_encoder_f RICtimeToWait_encode_uper;
+per_type_decoder_f RICtimeToWait_decode_aper;
+per_type_encoder_f RICtimeToWait_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICtimeToWait_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ResetRequest.h b/e2ap/headers/ResetRequest.h
new file mode 100644
index 0000000..b8ccee4
--- /dev/null
+++ b/e2ap/headers/ResetRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ResetRequest_H_
+#define	_ResetRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ResetRequest */
+typedef struct ResetRequest {
+	ProtocolIE_Container_87P14_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResetRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResetRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ResetResponse.h b/e2ap/headers/ResetResponse.h
new file mode 100644
index 0000000..cfd7a3c
--- /dev/null
+++ b/e2ap/headers/ResetResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ResetResponse_H_
+#define	_ResetResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ResetResponse */
+typedef struct ResetResponse {
+	ProtocolIE_Container_87P15_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResetResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResetResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/SuccessfulOutcome.h b/e2ap/headers/SuccessfulOutcome.h
new file mode 100644
index 0000000..734bd7e
--- /dev/null
+++ b/e2ap/headers/SuccessfulOutcome.h
@@ -0,0 +1,91 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_SuccessfulOutcome_H_
+#define	_SuccessfulOutcome_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICsubscriptionRequest.h"
+#include "RICsubscriptionResponse.h"
+#include "RICsubscriptionFailure.h"
+#include "RICsubscriptionDeleteRequest.h"
+#include "RICsubscriptionDeleteResponse.h"
+#include "RICsubscriptionDeleteFailure.h"
+#include "RICserviceUpdate.h"
+#include "RICserviceUpdateAcknowledge.h"
+#include "RICserviceUpdateFailure.h"
+#include "RICcontrolRequest.h"
+#include "RICcontrolAcknowledge.h"
+#include "RICcontrolFailure.h"
+#include "E2setupRequest.h"
+#include "E2setupResponse.h"
+#include "E2setupFailure.h"
+#include "ResetRequest.h"
+#include "ResetResponse.h"
+#include "RICindication.h"
+#include "RICserviceQuery.h"
+#include "ErrorIndication.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum SuccessfulOutcome__value_PR {
+	SuccessfulOutcome__value_PR_NOTHING,	/* No components present */
+	SuccessfulOutcome__value_PR_RICsubscriptionResponse,
+	SuccessfulOutcome__value_PR_RICsubscriptionDeleteResponse,
+	SuccessfulOutcome__value_PR_RICserviceUpdateAcknowledge,
+	SuccessfulOutcome__value_PR_RICcontrolAcknowledge,
+	SuccessfulOutcome__value_PR_E2setupResponse,
+	SuccessfulOutcome__value_PR_ResetResponse
+} SuccessfulOutcome__value_PR;
+
+/* SuccessfulOutcome */
+typedef struct SuccessfulOutcome {
+	ProcedureCode_t	 procedureCode;
+	Criticality_t	 criticality;
+	struct SuccessfulOutcome__value {
+		SuccessfulOutcome__value_PR present;
+		union SuccessfulOutcome__value_u {
+			RICsubscriptionResponse_t	 RICsubscriptionResponse;
+			RICsubscriptionDeleteResponse_t	 RICsubscriptionDeleteResponse;
+			RICserviceUpdateAcknowledge_t	 RICserviceUpdateAcknowledge;
+			RICcontrolAcknowledge_t	 RICcontrolAcknowledge;
+			E2setupResponse_t	 E2setupResponse;
+			ResetResponse_t	 ResetResponse;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} SuccessfulOutcome_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_SuccessfulOutcome;
+extern asn_SEQUENCE_specifics_t asn_SPC_SuccessfulOutcome_specs_1;
+extern asn_TYPE_member_t asn_MBR_SuccessfulOutcome_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _SuccessfulOutcome_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/TimeToWait.h b/e2ap/headers/TimeToWait.h
new file mode 100644
index 0000000..9627535
--- /dev/null
+++ b/e2ap/headers/TimeToWait.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_TimeToWait_H_
+#define	_TimeToWait_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum TimeToWait {
+	TimeToWait_v1s	= 0,
+	TimeToWait_v2s	= 1,
+	TimeToWait_v5s	= 2,
+	TimeToWait_v10s	= 3,
+	TimeToWait_v20s	= 4,
+	TimeToWait_v60s	= 5
+	/*
+	 * Enumeration is extensible
+	 */
+} e_TimeToWait;
+
+/* TimeToWait */
+typedef long	 TimeToWait_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_TimeToWait_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_TimeToWait;
+extern const asn_INTEGER_specifics_t asn_SPC_TimeToWait_specs_1;
+asn_struct_free_f TimeToWait_free;
+asn_struct_print_f TimeToWait_print;
+asn_constr_check_f TimeToWait_constraint;
+ber_type_decoder_f TimeToWait_decode_ber;
+der_type_encoder_f TimeToWait_encode_der;
+xer_type_decoder_f TimeToWait_decode_xer;
+xer_type_encoder_f TimeToWait_encode_xer;
+oer_type_decoder_f TimeToWait_decode_oer;
+oer_type_encoder_f TimeToWait_encode_oer;
+per_type_decoder_f TimeToWait_decode_uper;
+per_type_encoder_f TimeToWait_encode_uper;
+per_type_decoder_f TimeToWait_decode_aper;
+per_type_encoder_f TimeToWait_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TimeToWait_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/TriggeringMessage.h b/e2ap/headers/TriggeringMessage.h
new file mode 100644
index 0000000..6f9f42e
--- /dev/null
+++ b/e2ap/headers/TriggeringMessage.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_TriggeringMessage_H_
+#define	_TriggeringMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum TriggeringMessage {
+	TriggeringMessage_initiating_message	= 0,
+	TriggeringMessage_successful_outcome	= 1,
+	TriggeringMessage_unsuccessfull_outcome	= 2
+} e_TriggeringMessage;
+
+/* TriggeringMessage */
+typedef long	 TriggeringMessage_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_TriggeringMessage_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_TriggeringMessage;
+extern const asn_INTEGER_specifics_t asn_SPC_TriggeringMessage_specs_1;
+asn_struct_free_f TriggeringMessage_free;
+asn_struct_print_f TriggeringMessage_print;
+asn_constr_check_f TriggeringMessage_constraint;
+ber_type_decoder_f TriggeringMessage_decode_ber;
+der_type_encoder_f TriggeringMessage_encode_der;
+xer_type_decoder_f TriggeringMessage_decode_xer;
+xer_type_encoder_f TriggeringMessage_encode_xer;
+oer_type_decoder_f TriggeringMessage_decode_oer;
+oer_type_encoder_f TriggeringMessage_encode_oer;
+per_type_decoder_f TriggeringMessage_decode_uper;
+per_type_encoder_f TriggeringMessage_encode_uper;
+per_type_decoder_f TriggeringMessage_decode_aper;
+per_type_encoder_f TriggeringMessage_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TriggeringMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/TypeOfError.h b/e2ap/headers/TypeOfError.h
new file mode 100644
index 0000000..aec2d63
--- /dev/null
+++ b/e2ap/headers/TypeOfError.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_TypeOfError_H_
+#define	_TypeOfError_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum TypeOfError {
+	TypeOfError_not_understood	= 0,
+	TypeOfError_missing	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_TypeOfError;
+
+/* TypeOfError */
+typedef long	 TypeOfError_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_TypeOfError_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_TypeOfError;
+extern const asn_INTEGER_specifics_t asn_SPC_TypeOfError_specs_1;
+asn_struct_free_f TypeOfError_free;
+asn_struct_print_f TypeOfError_print;
+asn_constr_check_f TypeOfError_constraint;
+ber_type_decoder_f TypeOfError_decode_ber;
+der_type_encoder_f TypeOfError_encode_der;
+xer_type_decoder_f TypeOfError_decode_xer;
+xer_type_encoder_f TypeOfError_encode_xer;
+oer_type_decoder_f TypeOfError_decode_oer;
+oer_type_encoder_f TypeOfError_encode_oer;
+per_type_decoder_f TypeOfError_decode_uper;
+per_type_encoder_f TypeOfError_encode_uper;
+per_type_decoder_f TypeOfError_decode_aper;
+per_type_encoder_f TypeOfError_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TypeOfError_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/UnsuccessfulOutcome.h b/e2ap/headers/UnsuccessfulOutcome.h
new file mode 100644
index 0000000..baf8838
--- /dev/null
+++ b/e2ap/headers/UnsuccessfulOutcome.h
@@ -0,0 +1,89 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_UnsuccessfulOutcome_H_
+#define	_UnsuccessfulOutcome_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICsubscriptionRequest.h"
+#include "RICsubscriptionResponse.h"
+#include "RICsubscriptionFailure.h"
+#include "RICsubscriptionDeleteRequest.h"
+#include "RICsubscriptionDeleteResponse.h"
+#include "RICsubscriptionDeleteFailure.h"
+#include "RICserviceUpdate.h"
+#include "RICserviceUpdateAcknowledge.h"
+#include "RICserviceUpdateFailure.h"
+#include "RICcontrolRequest.h"
+#include "RICcontrolAcknowledge.h"
+#include "RICcontrolFailure.h"
+#include "E2setupRequest.h"
+#include "E2setupResponse.h"
+#include "E2setupFailure.h"
+#include "ResetRequest.h"
+#include "ResetResponse.h"
+#include "RICindication.h"
+#include "RICserviceQuery.h"
+#include "ErrorIndication.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum UnsuccessfulOutcome__value_PR {
+	UnsuccessfulOutcome__value_PR_NOTHING,	/* No components present */
+	UnsuccessfulOutcome__value_PR_RICsubscriptionFailure,
+	UnsuccessfulOutcome__value_PR_RICsubscriptionDeleteFailure,
+	UnsuccessfulOutcome__value_PR_RICserviceUpdateFailure,
+	UnsuccessfulOutcome__value_PR_RICcontrolFailure,
+	UnsuccessfulOutcome__value_PR_E2setupFailure
+} UnsuccessfulOutcome__value_PR;
+
+/* UnsuccessfulOutcome */
+typedef struct UnsuccessfulOutcome {
+	ProcedureCode_t	 procedureCode;
+	Criticality_t	 criticality;
+	struct UnsuccessfulOutcome__value {
+		UnsuccessfulOutcome__value_PR present;
+		union UnsuccessfulOutcome__value_u {
+			RICsubscriptionFailure_t	 RICsubscriptionFailure;
+			RICsubscriptionDeleteFailure_t	 RICsubscriptionDeleteFailure;
+			RICserviceUpdateFailure_t	 RICserviceUpdateFailure;
+			RICcontrolFailure_t	 RICcontrolFailure;
+			E2setupFailure_t	 E2setupFailure;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} UnsuccessfulOutcome_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_UnsuccessfulOutcome;
+extern asn_SEQUENCE_specifics_t asn_SPC_UnsuccessfulOutcome_specs_1;
+extern asn_TYPE_member_t asn_MBR_UnsuccessfulOutcome_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _UnsuccessfulOutcome_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/asn_SEQUENCE_OF.h b/e2ap/headers/asn_SEQUENCE_OF.h
new file mode 100644
index 0000000..e35bc44
--- /dev/null
+++ b/e2ap/headers/asn_SEQUENCE_OF.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_SEQUENCE_OF_H
+#define	ASN_SEQUENCE_OF_H
+
+#include <asn_SET_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * SEQUENCE OF is the same as SET OF with a tiny difference:
+ * the delete operation preserves the initial order of elements
+ * and thus MAY operate in non-constant time.
+ */
+#define	A_SEQUENCE_OF(type)	A_SET_OF(type)
+
+#define	ASN_SEQUENCE_ADD(headptr, ptr)		\
+	asn_sequence_add((headptr), (ptr))
+
+/***********************************************
+ * Implementation of the SEQUENCE OF structure.
+ */
+
+#define	asn_sequence_add	asn_set_add
+#define	asn_sequence_empty	asn_set_empty
+
+/*
+ * Delete the element from the set by its number (base 0).
+ * This is NOT a constant-time operation.
+ * The order of elements is preserved.
+ * If _do_free is given AND the (*free) is initialized, the element
+ * will be freed using the custom (*free) function as well.
+ */
+void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free);
+
+/*
+ * Cope with different conversions requirements to/from void in C and C++.
+ * This is mostly useful for support library.
+ */
+typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_;
+#define _A_SEQUENCE_FROM_VOID(ptr)	((asn_anonymous_sequence_ *)(ptr))
+#define _A_CSEQUENCE_FROM_VOID(ptr) 	((const asn_anonymous_sequence_ *)(ptr))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_SEQUENCE_OF_H */
diff --git a/e2ap/headers/asn_SET_OF.h b/e2ap/headers/asn_SET_OF.h
new file mode 100644
index 0000000..882e1a4
--- /dev/null
+++ b/e2ap/headers/asn_SET_OF.h
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_SET_OF_H
+#define	ASN_SET_OF_H
+
+#ifdef __cplusplus
+#define A_SET_OF(type)                   \
+    struct {                             \
+        type **array;                    \
+        int count; /* Meaningful size */ \
+        int size;  /* Allocated size */  \
+        void (*free)(decltype(*array));  \
+    }
+#else   /* C */
+#define A_SET_OF(type)                   \
+    struct {                             \
+        type **array;                    \
+        int count; /* Meaningful size */ \
+        int size;  /* Allocated size */  \
+        void (*free)(type *);    \
+    }
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define	ASN_SET_ADD(headptr, ptr)		\
+	asn_set_add((headptr), (ptr))
+
+/*******************************************
+ * Implementation of the SET OF structure.
+ */
+
+/*
+ * Add another structure into the set by its pointer.
+ * RETURN VALUES:
+ * 0 for success and -1/errno for failure.
+ */
+int  asn_set_add(void *asn_set_of_x, void *ptr);
+
+/*
+ * Delete the element from the set by its number (base 0).
+ * This is a constant-time operation. The order of elements before the
+ * deleted ones is guaranteed, the order of elements after the deleted
+ * one is NOT guaranteed.
+ * If _do_free is given AND the (*free) is initialized, the element
+ * will be freed using the custom (*free) function as well.
+ */
+void asn_set_del(void *asn_set_of_x, int number, int _do_free);
+
+/*
+ * Empty the contents of the set. Will free the elements, if (*free) is given.
+ * Will NOT free the set itself.
+ */
+void asn_set_empty(void *asn_set_of_x);
+
+/*
+ * Cope with different conversions requirements to/from void in C and C++.
+ * This is mostly useful for support library.
+ */
+typedef A_SET_OF(void) asn_anonymous_set_;
+#define _A_SET_FROM_VOID(ptr)		((asn_anonymous_set_ *)(ptr))
+#define _A_CSET_FROM_VOID(ptr)		((const asn_anonymous_set_ *)(ptr))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_SET_OF_H */
diff --git a/e2ap/headers/asn_application.h b/e2ap/headers/asn_application.h
new file mode 100644
index 0000000..034f646
--- /dev/null
+++ b/e2ap/headers/asn_application.h
@@ -0,0 +1,171 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Application-level ASN.1 callbacks.
+ */
+#ifndef	ASN_APPLICATION_H
+#define	ASN_APPLICATION_H
+
+#include "asn_system.h"		/* for platform-dependent types */
+#include "asn_codecs.h"		/* for ASN.1 codecs specifics */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * A selection of ASN.1 Transfer Syntaxes to use with generalized
+ * encoders and decoders declared further in this .h file.
+ */
+enum asn_transfer_syntax {
+    /* Avoid appearance of a default transfer syntax. */
+    ATS_INVALID = 0,
+    /* Plaintext output (not conforming to any standard), for debugging. */
+    ATS_NONSTANDARD_PLAINTEXT,
+    /* Returns a randomly generated structure. */
+    ATS_RANDOM,
+    /*
+     * X.690:
+     * BER: Basic Encoding Rules.
+     * DER: Distinguished Encoding Rules.
+     * CER: Canonical Encoding Rules.
+     * DER and CER are more strict variants of BER.
+     */
+    ATS_BER,
+    ATS_DER,
+    ATS_CER, /* Only decoding is supported */
+    /*
+     * X.696:
+     * OER: Octet Encoding Rules.
+     * CANONICAL-OER is a more strict variant of BASIC-OER.
+     */
+    ATS_BASIC_OER,
+    ATS_CANONICAL_OER,
+    /*
+     * X.691:
+     * PER: Packed Encoding Rules.
+     * CANONICAL-PER is a more strict variant of BASIC-PER.
+     * NOTE: Produces or consumes a complete encoding (X.691 (08/2015) #11.1).
+     */
+    ATS_UNALIGNED_BASIC_PER,
+    ATS_UNALIGNED_CANONICAL_PER,
+    ATS_ALIGNED_BASIC_PER,
+    ATS_ALIGNED_CANONICAL_PER,
+    /*
+     * X.693:
+     * XER: XML Encoding Rules.
+     * CANONICAL-XER is a more strict variant of BASIC-XER.
+     */
+    ATS_BASIC_XER,
+    ATS_CANONICAL_XER
+};
+
+/*
+ * A generic encoder for any supported transfer syntax.
+ * RETURN VALUES:
+ * The (.encoded) field of the return value is REDEFINED to mean the following:
+ * >=0: The computed size of the encoded data. Can exceed the (buffer_size).
+ *  -1: Error encoding the structure. See the error code in (errno):
+ *      EINVAL: Incorrect parameters to the function, such as NULLs.
+ *      ENOENT: Encoding transfer syntax is not defined (for this type).
+ *      EBADF:  The structure has invalid form or content constraint failed.
+ *      The (.failed_type) and (.structure_ptr) MIGHT be set to the appropriate
+ *      values at the place of failure, if at all possible.
+ * WARNING: The (.encoded) field of the return value can exceed the buffer_size.
+ * This is similar to snprintf(3) contract which might return values
+ * greater than the buffer size.
+ */
+asn_enc_rval_t asn_encode_to_buffer(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode, void *buffer, size_t buffer_size);
+
+/*
+ * A variant of asn_encode_to_buffer() with automatically allocated buffer.
+ * RETURN VALUES:
+ * On success, returns a newly allocated (.buffer) containing the whole message.
+ * The message size is returned in (.result.encoded).
+ * On failure:
+ *  (.buffer) is NULL,
+ *  (.result.encoded) as in asn_encode_to_buffer(),
+ *  The errno codes as in asn_encode_to_buffer(), plus the following:
+ *      ENOMEM: Memory allocation failed due to system or internal limits.
+ * The user is responsible for freeing the (.buffer).
+ */
+typedef struct asn_encode_to_new_buffer_result_s {
+    void *buffer;   /* NULL if failed to encode. */
+    asn_enc_rval_t result;
+} asn_encode_to_new_buffer_result_t;
+asn_encode_to_new_buffer_result_t asn_encode_to_new_buffer(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode);
+
+
+/*
+ * Generic type of an application-defined callback to return various
+ * types of data to the application.
+ * EXPECTED RETURN VALUES:
+ *  -1: Failed to consume bytes. Abort the mission.
+ * Non-negative return values indicate success, and ignored.
+ */
+typedef int(asn_app_consume_bytes_f)(const void *buffer, size_t size,
+                                     void *application_specific_key);
+
+
+/*
+ * A generic encoder for any supported transfer syntax.
+ * Returns the comprehensive encoding result descriptor (see asn_codecs.h).
+ * RETURN VALUES:
+ * The negative (.encoded) field of the return values is accompanied with the
+ * following error codes (errno):
+ *      EINVAL: Incorrect parameters to the function, such as NULLs.
+ *      ENOENT: Encoding transfer syntax is not defined (for this type).
+ *      EBADF:  The structure has invalid form or content constraint failed.
+ *      EIO:    The (callback) has returned negative value during encoding.
+ */
+asn_enc_rval_t asn_encode(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode,
+    asn_app_consume_bytes_f *callback, void *callback_key);
+
+
+/*
+ * A generic decoder for any supported transfer syntax.
+ */
+asn_dec_rval_t asn_decode(
+    const asn_codec_ctx_t *opt_codec_parameters, enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_decode,
+    void **structure_ptr, /* Pointer to a target structure's pointer */
+    const void *buffer,   /* Data to be decoded */
+    size_t size           /* Size of that buffer */
+);
+
+
+/*
+ * A callback of this type is called whenever constraint validation fails
+ * on some ASN.1 type. See "constraints.h" for more details on constraint
+ * validation.
+ * This callback specifies a descriptor of the ASN.1 type which failed
+ * the constraint check, as well as human readable message on what
+ * particular constraint has failed.
+ */
+typedef void (asn_app_constraint_failed_f)(void *application_specific_key,
+	const struct asn_TYPE_descriptor_s *type_descriptor_which_failed,
+	const void *structure_which_failed_ptr,
+	const char *error_message_format, ...) CC_PRINTFLIKE(4, 5);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#include "constr_TYPE.h"	/* for asn_TYPE_descriptor_t */
+
+#endif	/* ASN_APPLICATION_H */
diff --git a/e2ap/headers/asn_bit_data.h b/e2ap/headers/asn_bit_data.h
new file mode 100644
index 0000000..59de7af
--- /dev/null
+++ b/e2ap/headers/asn_bit_data.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_BIT_DATA
+#define	ASN_BIT_DATA
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This structure describes a position inside an incoming PER bit stream.
+ */
+typedef struct asn_bit_data_s {
+  const uint8_t *buffer;  /* Pointer to the octet stream */
+         size_t  nboff;   /* Bit offset to the meaningful bit */
+         size_t  nbits;   /* Number of bits in the stream */
+         size_t  moved;   /* Number of bits moved through this bit stream */
+  int (*refill)(struct asn_bit_data_s *);
+  void *refill_key;
+} asn_bit_data_t;
+
+/*
+ * Create a contiguous non-refillable bit data structure.
+ * Can be freed by FREEMEM().
+ */
+asn_bit_data_t *asn_bit_data_new_contiguous(const void *data, size_t size_bits);
+
+/*
+ * Extract a small number of bits (<= 31) from the specified PER data pointer.
+ * This function returns -1 if the specified number of bits could not be
+ * extracted due to EOD or other conditions.
+ */
+int32_t asn_get_few_bits(asn_bit_data_t *, int get_nbits);
+
+/* Undo the immediately preceeding "get_few_bits" operation */
+void asn_get_undo(asn_bit_data_t *, int get_nbits);
+
+/*
+ * Extract a large number of bits from the specified PER data pointer.
+ * This function returns -1 if the specified number of bits could not be
+ * extracted due to EOD or other conditions.
+ */
+int asn_get_many_bits(asn_bit_data_t *, uint8_t *dst, int right_align,
+			int get_nbits);
+
+/* Non-thread-safe debugging function, don't use it */
+char *asn_bit_data_string(asn_bit_data_t *);
+
+/*
+ * This structure supports forming bit output.
+ */
+typedef struct asn_bit_outp_s {
+	uint8_t *buffer;	/* Pointer into the (tmpspace) */
+	size_t nboff;		/* Bit offset to the meaningful bit */
+	size_t nbits;		/* Number of bits left in (tmpspace) */
+	uint8_t tmpspace[32];	/* Preliminary storage to hold data */
+	int (*output)(const void *data, size_t size, void *op_key);
+	void *op_key;		/* Key for (output) data callback */
+	size_t flushed_bytes;	/* Bytes already flushed through (output) */
+} asn_bit_outp_t;
+
+/* Output a small number of bits (<= 31) */
+int asn_put_few_bits(asn_bit_outp_t *, uint32_t bits, int obits);
+
+/* Output a large number of bits */
+int asn_put_many_bits(asn_bit_outp_t *, const uint8_t *src, int put_nbits);
+
+/*
+ * Flush whole bytes (0 or more) through (outper) member.
+ * The least significant bits which are not used are guaranteed to be set to 0.
+ * Returns -1 if callback returns -1. Otherwise, 0.
+ */
+int asn_put_aligned_flush(asn_bit_outp_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_BIT_DATA */
diff --git a/e2ap/headers/asn_codecs.h b/e2ap/headers/asn_codecs.h
new file mode 100644
index 0000000..e75c270
--- /dev/null
+++ b/e2ap/headers/asn_codecs.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_CODECS_H
+#define	ASN_CODECS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * This structure defines a set of parameters that may be passed
+ * to every ASN.1 encoder or decoder function.
+ * WARNING: if max_stack_size member is set, and you are calling the
+ *   function pointers of the asn_TYPE_descriptor_t directly,
+ *   this structure must be ALLOCATED ON THE STACK!
+ *   If you can't always satisfy this requirement, use ber_decode(),
+ *   xer_decode() and uper_decode() functions instead.
+ */
+typedef struct asn_codec_ctx_s {
+	/*
+	 * Limit the decoder routines to use no (much) more stack than a given
+	 * number of bytes. Most of decoders are stack-based, and this
+	 * would protect against stack overflows if the number of nested
+	 * encodings is high.
+	 * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based,
+	 * and are safe from this kind of overflow.
+	 * A value from getrlimit(RLIMIT_STACK) may be used to initialize
+	 * this variable. Be careful in multithreaded environments, as the
+	 * stack size is rather limited.
+	 */
+	size_t  max_stack_size; /* 0 disables stack bounds checking */
+} asn_codec_ctx_t;
+
+/*
+ * Type of the return value of the encoding functions (der_encode, xer_encode).
+ */
+typedef struct asn_enc_rval_s {
+	/*
+	 * Number of bytes encoded.
+	 * -1 indicates failure to encode the structure.
+	 * In this case, the members below this one are meaningful.
+	 */
+	ssize_t encoded;
+
+	/*
+	 * Members meaningful when (encoded == -1), for post mortem analysis.
+	 */
+
+	/* Type which cannot be encoded */
+	const struct asn_TYPE_descriptor_s *failed_type;
+
+	/* Pointer to the structure of that type */
+	const void *structure_ptr;
+} asn_enc_rval_t;
+#define	ASN__ENCODE_FAILED do {					\
+	asn_enc_rval_t tmp_error;				\
+	tmp_error.encoded = -1;					\
+	tmp_error.failed_type = td;				\
+	tmp_error.structure_ptr = sptr;				\
+	ASN_DEBUG("Failed to encode element %s", td ? td->name : "");	\
+	return tmp_error;					\
+} while(0)
+#define	ASN__ENCODED_OK(rval) do {				\
+	rval.structure_ptr = 0;					\
+	rval.failed_type = 0;					\
+	return rval;						\
+} while(0)
+
+/*
+ * Type of the return value of the decoding functions (ber_decode, xer_decode)
+ * 
+ * Please note that the number of consumed bytes is ALWAYS meaningful,
+ * even if code==RC_FAIL. This is to indicate the number of successfully
+ * decoded bytes, hence providing a possibility to fail with more diagnostics
+ * (i.e., print the offending remainder of the buffer).
+ */
+enum asn_dec_rval_code_e {
+	RC_OK,		/* Decoded successfully */
+	RC_WMORE,	/* More data expected, call again */
+	RC_FAIL		/* Failure to decode data */
+};
+typedef struct asn_dec_rval_s {
+	enum asn_dec_rval_code_e code;	/* Result code */
+	size_t consumed;		/* Number of bytes consumed */
+} asn_dec_rval_t;
+#define	ASN__DECODE_FAILED do {					\
+	asn_dec_rval_t tmp_error;				\
+	tmp_error.code = RC_FAIL;				\
+	tmp_error.consumed = 0;					\
+	ASN_DEBUG("Failed to decode element %s", td ? td->name : "");	\
+	return tmp_error;					\
+} while(0)
+#define	ASN__DECODE_STARVED do {				\
+	asn_dec_rval_t tmp_error;				\
+	tmp_error.code = RC_WMORE;				\
+	tmp_error.consumed = 0;					\
+	return tmp_error;					\
+} while(0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_CODECS_H */
diff --git a/e2ap/headers/asn_codecs_prim.h b/e2ap/headers/asn_codecs_prim.h
new file mode 100644
index 0000000..fbc5576
--- /dev/null
+++ b/e2ap/headers/asn_codecs_prim.h
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_CODECS_PRIM_H
+#define	ASN_CODECS_PRIM_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct ASN__PRIMITIVE_TYPE_s {
+    uint8_t *buf;   /* Buffer with consecutive primitive encoding bytes */
+    size_t size;    /* Size of the buffer */
+} ASN__PRIMITIVE_TYPE_t;	/* Do not use this type directly! */
+
+asn_struct_free_f ASN__PRIMITIVE_TYPE_free;
+ber_type_decoder_f ber_decode_primitive;
+der_type_encoder_f der_encode_primitive;
+
+/*
+ * A callback specification for the xer_decode_primitive() function below.
+ */
+enum xer_pbd_rval {
+    XPBD_SYSTEM_FAILURE,  /* System failure (memory shortage, etc) */
+    XPBD_DECODER_LIMIT,   /* Hit some decoder limitation or deficiency */
+    XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */
+    XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */
+    XPBD_BODY_CONSUMED    /* Body is recognized and consumed */
+};
+typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)(
+    const asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf,
+    size_t chunk_size);
+
+/*
+ * Specific function to decode simple primitive types.
+ * Also see xer_decode_general() in xer_decoder.h
+ */
+asn_dec_rval_t xer_decode_primitive(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+    size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size,
+    xer_primitive_body_decoder_f *prim_body_decoder);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_CODECS_PRIM_H */
diff --git a/e2ap/headers/asn_constant.h b/e2ap/headers/asn_constant.h
new file mode 100644
index 0000000..a6f348c
--- /dev/null
+++ b/e2ap/headers/asn_constant.h
@@ -0,0 +1,22 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ */
+
+#ifndef _ASN_CONSTANT_H
+#define _ASN_CONSTANT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define maxProtocolIEs (65535)
+#define maxnoofErrors (256)
+#define maxofRANfunctionID (256)
+#define maxofRICactionID (16)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ASN_CONSTANT_H */
diff --git a/e2ap/headers/asn_internal.h b/e2ap/headers/asn_internal.h
new file mode 100644
index 0000000..c4105ad
--- /dev/null
+++ b/e2ap/headers/asn_internal.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Declarations internally useful for the ASN.1 support code.
+ */
+#ifndef	ASN_INTERNAL_H
+#define	ASN_INTERNAL_H
+#define __EXTENSIONS__          /* for Sun */
+
+#include "asn_application.h"	/* Application-visible API */
+
+#ifndef	__NO_ASSERT_H__		/* Include assert.h only for internal use. */
+#include <assert.h>		/* for assert() macro */
+#endif
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* Environment version might be used to avoid running with the old library */
+#define	ASN1C_ENVIRONMENT_VERSION	923	/* Compile-time version */
+int get_asn1c_environment_version(void);	/* Run-time version */
+
+#define	CALLOC(nmemb, size)	calloc(nmemb, size)
+#define	MALLOC(size)		malloc(size)
+#define	REALLOC(oldptr, size)	realloc(oldptr, size)
+#define	FREEMEM(ptr)		free(ptr)
+
+#define	asn_debug_indent	0
+#define ASN_DEBUG_INDENT_ADD(i) do{}while(0)
+
+#ifdef  EMIT_ASN_DEBUG
+#warning "Use ASN_EMIT_DEBUG instead of EMIT_ASN_DEBUG"
+#define ASN_EMIT_DEBUG  EMIT_ASN_DEBUG
+#endif
+
+/*
+ * A macro for debugging the ASN.1 internals.
+ * You may enable or override it.
+ */
+#ifndef	ASN_DEBUG	/* If debugging code is not defined elsewhere... */
+#if	ASN_EMIT_DEBUG == 1	/* And it was asked to emit this code... */
+#if !defined(BELL_LABS) /* Bell Labs */
+  //#if __STDC_VERSION__ >= 199901L
+#ifdef	ASN_THREAD_SAFE
+/* Thread safety requires sacrifice in output indentation:
+ * Retain empty definition of ASN_DEBUG_INDENT_ADD. */
+#else	/* !ASN_THREAD_SAFE */
+#undef  ASN_DEBUG_INDENT_ADD
+#undef  asn_debug_indent
+int asn_debug_indent;
+#define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0)
+#endif	/* ASN_THREAD_SAFE */
+#if defined(BELL_LABS) /* Bell Labs version */
+extern int logAsn1c(const char *filename, int linenumber, const char *format, ...);  
+#define	ASN_DEBUG(fmt, args...)	do {		        \
+    (void) logAsn1c(__FILE__, __LINE__, fmt, ##args);	\
+  } while(0)
+#else  
+#define	ASN_DEBUG(fmt, args...)	do {			\
+		int adi = asn_debug_indent;		\
+		while(adi--) fprintf(stderr, " ");	\
+		fprintf(stderr, fmt, ##args);		\
+		fprintf(stderr, " (%s:%d)\n",		\
+			__FILE__, __LINE__);		\
+	} while(0)
+#endif /* BELL_LABS */  
+#else	/* !C99 */
+void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...);
+#define	ASN_DEBUG	ASN_DEBUG_f
+#endif	/* C99 */
+#else	/* ASN_EMIT_DEBUG != 1 */
+#if __STDC_VERSION__ >= 199901L
+#define ASN_DEBUG(...) do{}while(0)
+#else   /* not C99 */
+static void CC_PRINTFLIKE(1, 2) ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
+#endif  /* C99 or better */
+#endif	/* ASN_EMIT_DEBUG */
+#endif	/* ASN_DEBUG */
+
+/*
+ * Print to a callback.
+ * The callback is expected to return negative values on error.
+ * 0 and positive values are treated as success.
+ * RETURN VALUES:
+ *  -1: Failed to format or invoke the callback.
+ *  >0: Size of the data that got delivered to the callback.
+ */
+ssize_t CC_PRINTFLIKE(3, 4)
+asn__format_to_callback(
+    int (*callback)(const void *, size_t, void *key), void *key,
+    const char *fmt, ...);
+
+/*
+ * Invoke the application-supplied callback and fail, if something is wrong.
+ */
+#define ASN__E_cbc(buf, size) (cb((buf), (size), app_key) < 0)
+#define ASN__E_CALLBACK(size, foo) \
+    do {                           \
+        if(foo) goto cb_failed;    \
+        er.encoded += (size);      \
+    } while(0)
+#define ASN__CALLBACK(buf, size) ASN__E_CALLBACK(size, ASN__E_cbc(buf, size))
+#define ASN__CALLBACK2(buf1, size1, buf2, size2) \
+    ASN__E_CALLBACK((size1) + (size2),           \
+                    ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2))
+#define ASN__CALLBACK3(buf1, size1, buf2, size2, buf3, size3)          \
+    ASN__E_CALLBACK((size1) + (size2) + (size3),                       \
+                    ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2) \
+                        || ASN__E_cbc(buf3, size3))
+
+#define ASN__TEXT_INDENT(nl, level)                                          \
+    do {                                                                     \
+        int tmp_level = (level);                                             \
+        int tmp_nl = ((nl) != 0);                                            \
+        int tmp_i;                                                           \
+        if(tmp_nl) ASN__CALLBACK("\n", 1);                                   \
+        if(tmp_level < 0) tmp_level = 0;                                     \
+        for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) ASN__CALLBACK("    ", 4); \
+    } while(0)
+
+#define	_i_INDENT(nl)	do {                        \
+        int tmp_i;                                  \
+        if((nl) && cb("\n", 1, app_key) < 0)        \
+            return -1;                              \
+        for(tmp_i = 0; tmp_i < ilevel; tmp_i++)     \
+            if(cb("    ", 4, app_key) < 0)          \
+                return -1;                          \
+    } while(0)
+
+/*
+ * Check stack against overflow, if limit is set.
+ */
+#define	ASN__DEFAULT_STACK_MAX	(30000)
+static int CC_NOTUSED
+ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
+	if(ctx && ctx->max_stack_size) {
+
+		/* ctx MUST be allocated on the stack */
+		ptrdiff_t usedstack = ((const char *)ctx - (const char *)&ctx);
+		if(usedstack > 0) usedstack = -usedstack; /* grows up! */
+
+		/* double negative required to avoid int wrap-around */
+		if(usedstack < -(ptrdiff_t)ctx->max_stack_size) {
+			ASN_DEBUG("Stack limit %ld reached",
+				(long)ctx->max_stack_size);
+			return -1;
+		}
+	}
+	return 0;
+}
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* ASN_INTERNAL_H */
diff --git a/e2ap/headers/asn_ioc.h b/e2ap/headers/asn_ioc.h
new file mode 100644
index 0000000..7de210e
--- /dev/null
+++ b/e2ap/headers/asn_ioc.h
@@ -0,0 +1,51 @@
+/*
+ * Run-time support for Information Object Classes.
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_IOC_H
+#define	ASN_IOC_H
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;
+struct asn_ioc_cell_s;
+
+/*
+ * X.681, #13
+ */
+typedef struct asn_ioc_set_s {
+    size_t rows_count;
+    size_t columns_count;
+    const struct asn_ioc_cell_s *rows;
+} asn_ioc_set_t;
+
+
+typedef struct asn_ioc_cell_s {
+    const char *field_name; /* Is equal to corresponding column_name */
+    enum {
+        aioc__undefined = 0,
+        aioc__value,
+        aioc__type,
+        aioc__open_type,
+    } cell_kind;
+    struct asn_TYPE_descriptor_s *type_descriptor;
+    const void *value_sptr;
+    struct {
+        size_t types_count;
+        struct {
+            unsigned choice_position;
+        } *types;
+    } open_type;
+} asn_ioc_cell_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_IOC_H */
diff --git a/e2ap/headers/asn_random_fill.h b/e2ap/headers/asn_random_fill.h
new file mode 100644
index 0000000..47f9b8a
--- /dev/null
+++ b/e2ap/headers/asn_random_fill.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_RANDOM_FILL
+#define	ASN_RANDOM_FILL
+
+/* Forward declarations */
+struct asn_TYPE_descriptor_s;
+struct asn_encoding_constraints_s;
+
+/*
+ * Initialize a structure with random data according to the type specification
+ * and optional member constraints.
+ * ARGUMENTS:
+ *  (max_length)        - See (approx_max_length_limit).
+ *  (memb_constraints)  - Member constraints, if exist.
+ *                        The type can be constrained differently according
+ *                        to PER and OER specifications, so we find a value
+ *                        at the intersection of these constraints.
+ * In case the return differs from ARFILL_OK, the (struct_ptr) contents
+ * and (current_length) value remain in their original state.
+ */
+typedef struct asn_random_fill_result_s {
+    enum {
+        ARFILL_FAILED = -1, /* System error (memory?) */
+        ARFILL_OK = 0,      /* Initialization succeeded */
+        ARFILL_SKIPPED = 1  /* Not done due to (length?) constraint */
+    } code;
+    size_t length; /* Approximate number of bytes created. */
+} asn_random_fill_result_t;
+typedef asn_random_fill_result_t(asn_random_fill_f)(
+    const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+    const struct asn_encoding_constraints_s *memb_constraints,
+    size_t max_length);
+
+/*
+ * Returns 0 if the structure was properly initialized, -1 otherwise.
+ * The (approx_max_length_limit) specifies the approximate limit of the
+ * resulting structure in units closely resembling bytes. The actual result
+ * might be several times larger or smaller than the length limit.
+ */
+int asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+                    size_t approx_max_length_limit);
+
+/*
+ * Returns a random number between min and max.
+ */
+intmax_t asn_random_between(intmax_t min, intmax_t max);
+
+#endif	/* ASN_RANDOM_FILL */
diff --git a/e2ap/headers/asn_system.h b/e2ap/headers/asn_system.h
new file mode 100644
index 0000000..cc5cead
--- /dev/null
+++ b/e2ap/headers/asn_system.h
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Miscellaneous system-dependent types.
+ */
+#ifndef	ASN_SYSTEM_H
+#define	ASN_SYSTEM_H
+
+#ifdef	HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE 1
+#endif
+
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE /* for snprintf() on some linux systems  */
+#endif
+
+#include <stdio.h>	/* For snprintf(3) */
+#include <stdlib.h>	/* For *alloc(3) */
+#include <string.h>	/* For memcpy(3) */
+#include <sys/types.h>	/* For size_t */
+#include <limits.h>	/* For LONG_MAX */
+#include <stdarg.h>	/* For va_start */
+#include <stddef.h>	/* for offsetof and ptrdiff_t */
+
+#ifdef	_WIN32
+
+#include <malloc.h>
+#define	 snprintf	_snprintf
+#define	 vsnprintf	_vsnprintf
+
+/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */
+#define sys_ntohl(l)	((((l) << 24)  & 0xff000000)	\
+			| (((l) << 8) & 0xff0000)	\
+			| (((l) >> 8)  & 0xff00)	\
+			| ((l >> 24) & 0xff))
+
+#ifdef _MSC_VER			/* MSVS.Net */
+#ifndef __cplusplus
+#define inline __inline
+#endif
+#ifndef	ASSUMESTDTYPES	/* Standard types have been defined elsewhere */
+#define	ssize_t		SSIZE_T
+#if _MSC_VER < 1600
+typedef	char		int8_t;
+typedef	short		int16_t;
+typedef	int		int32_t;
+typedef	unsigned char	uint8_t;
+typedef	unsigned short	uint16_t;
+typedef	unsigned int	uint32_t;
+#else /* _MSC_VER >= 1600 */
+#include <stdint.h>
+#endif /* _MSC_VER < 1600 */
+#endif	/* ASSUMESTDTYPES */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <float.h>
+#define isnan _isnan
+#define finite _finite
+#define copysign _copysign
+#ifdef WIN32	//MCHECK
+	#define	ilogb	ilogb
+#else
+	#define ilogb _logb
+#endif
+#else	/* !_MSC_VER */
+#include <stdint.h>
+#endif	/* _MSC_VER */
+
+#else	/* !_WIN32 */
+
+#if defined(__vxworks)
+#include <types/vxTypes.h>
+#else	/* !defined(__vxworks) */
+
+#include <inttypes.h>	/* C99 specifies this file */
+#include <netinet/in.h> /* for ntohl() */
+#define	sys_ntohl(foo)	ntohl(foo)
+#endif	/* defined(__vxworks) */
+
+#endif	/* _WIN32 */
+
+#if	__GNUC__ >= 3 || defined(__clang__)
+#define CC_ATTRIBUTE(attr)    __attribute__((attr))
+#else
+#define CC_ATTRIBUTE(attr)
+#endif
+#define CC_PRINTFLIKE(fmt, var)     CC_ATTRIBUTE(format(printf, fmt, var))
+#define	CC_NOTUSED                  CC_ATTRIBUTE(unused)
+#ifndef CC_ATTR_NO_SANITIZE
+#define CC_ATTR_NO_SANITIZE(what)   CC_ATTRIBUTE(no_sanitize(what))
+#endif
+
+/* Figure out if thread safety is requested */
+#if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT))
+#define	ASN_THREAD_SAFE
+#endif	/* Thread safety */
+
+#ifndef	offsetof	/* If not defined by <stddef.h> */
+#define	offsetof(s, m)	((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0))
+#endif	/* offsetof */
+
+#ifndef	MIN		/* Suitable for comparing primitive types (integers) */
+#if defined(__GNUC__)
+#define	MIN(a,b)	({ __typeof a _a = a; __typeof b _b = b;	\
+	((_a)<(_b)?(_a):(_b)); })
+#else	/* !__GNUC__ */
+#define	MIN(a,b)	((a)<(b)?(a):(b))	/* Unsafe variant */
+#endif /* __GNUC__ */
+#endif	/* MIN */
+
+#if __STDC_VERSION__ >= 199901L
+#ifndef SIZE_MAX
+#define SIZE_MAX   ((~((size_t)0)) >> 1)
+#endif
+
+#ifndef RSIZE_MAX   /* C11, Annex K */
+#define RSIZE_MAX   (SIZE_MAX >> 1)
+#endif
+#ifndef RSSIZE_MAX   /* Halve signed size even further than unsigned */
+#define RSSIZE_MAX   ((ssize_t)(RSIZE_MAX >> 1))
+#endif
+#else   /* Old compiler */
+#undef  SIZE_MAX
+#undef  RSIZE_MAX
+#undef  RSSIZE_MAX
+#define SIZE_MAX   ((~((size_t)0)) >> 1)
+#define RSIZE_MAX   (SIZE_MAX >> 1)
+#define RSSIZE_MAX   ((ssize_t)(RSIZE_MAX >> 1))
+#endif
+
+#if __STDC_VERSION__ >= 199901L
+#define ASN_PRI_SIZE "zu"
+#define ASN_PRI_SSIZE "zd"
+#define ASN_PRIuMAX PRIuMAX
+#define ASN_PRIdMAX PRIdMAX
+#else
+#define ASN_PRI_SIZE "lu"
+#define ASN_PRI_SSIZE "ld"
+#if LLONG_MAX > LONG_MAX
+#define ASN_PRIuMAX "llu"
+#define ASN_PRIdMAX "lld"
+#else
+#define ASN_PRIuMAX "lu"
+#define ASN_PRIdMAX "ld"
+#endif
+#endif
+
+#endif	/* ASN_SYSTEM_H */
diff --git a/e2ap/headers/ber_decoder.h b/e2ap/headers/ber_decoder.h
new file mode 100644
index 0000000..1ac2a5e
--- /dev/null
+++ b/e2ap/headers/ber_decoder.h
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_DECODER_H_
+#define	_BER_DECODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_codec_ctx_s;		/* Forward declaration */
+
+/*
+ * The BER decoder of any type.
+ * This function may be invoked directly from the application.
+ * Decodes BER, DER and CER data (DER and CER are different subsets of BER).
+ *
+ * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding
+ * which is compliant with ber_decode().
+ */
+asn_dec_rval_t ber_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of that buffer */
+);
+
+/*
+ * Type of generic function which decodes the byte stream into the structure.
+ */
+typedef asn_dec_rval_t(ber_type_decoder_f)(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const void *buf_ptr, size_t size, int tag_mode);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Check that all tags correspond to the type definition (as given in head).
+ * On return, last_length would contain either a non-negative length of the
+ * value part of the last TLV, or the negative number of expected
+ * "end of content" sequences. The number may only be negative if the
+ * head->last_tag_form is non-zero.
+ */
+asn_dec_rval_t ber_check_tags(
+    const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    asn_struct_ctx_t *opt_ctx, /* saved decoding context */
+    const void *ptr, size_t size,
+    int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+    int last_tag_form, /* {-1,0:1}: any, primitive, constr */
+    ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_DECODER_H_ */
diff --git a/e2ap/headers/ber_tlv_length.h b/e2ap/headers/ber_tlv_length.h
new file mode 100644
index 0000000..d1e4d48
--- /dev/null
+++ b/e2ap/headers/ber_tlv_length.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_TLV_LENGTH_H_
+#define	_BER_TLV_LENGTH_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ssize_t ber_tlv_len_t;
+
+/*
+ * This function tries to fetch the length of the BER TLV value and place it
+ * in *len_r.
+ * RETURN VALUES:
+ *	 0:	More data expected than bufptr contains.
+ *	-1:	Fatal error deciphering length.
+ *	>0:	Number of bytes used from bufptr.
+ * On return with >0, len_r is constrained as -1..MAX, where -1 mean
+ * that the value is of indefinite length.
+ */
+ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
+	ber_tlv_len_t *len_r);
+
+/*
+ * This function expects bufptr to be positioned over L in TLV.
+ * It returns number of bytes occupied by L and V together, suitable
+ * for skipping. The function properly handles indefinite length.
+ * RETURN VALUES:
+ * 	Standard {-1,0,>0} convention.
+ */
+ssize_t ber_skip_length(
+	const struct asn_codec_ctx_s *opt_codec_ctx,	/* optional context */
+	int _is_constructed, const void *bufptr, size_t size);
+
+/*
+ * This function serializes the length (L from TLV) in DER format.
+ * It always returns number of bytes necessary to represent the length,
+ * it is a caller's responsibility to check the return value
+ * against the supplied buffer's size.
+ */
+size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_TLV_LENGTH_H_ */
diff --git a/e2ap/headers/ber_tlv_tag.h b/e2ap/headers/ber_tlv_tag.h
new file mode 100644
index 0000000..ce227ad
--- /dev/null
+++ b/e2ap/headers/ber_tlv_tag.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_TLV_TAG_H_
+#define	_BER_TLV_TAG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum asn_tag_class {
+	ASN_TAG_CLASS_UNIVERSAL		= 0,	/* 0b00 */
+	ASN_TAG_CLASS_APPLICATION	= 1,	/* 0b01 */
+	ASN_TAG_CLASS_CONTEXT		= 2,	/* 0b10 */
+	ASN_TAG_CLASS_PRIVATE		= 3	/* 0b11 */
+};
+typedef unsigned ber_tlv_tag_t;	/* BER TAG from Tag-Length-Value */
+
+/*
+ * Tag class is encoded together with tag value for optimization purposes.
+ */
+#define	BER_TAG_CLASS(tag)	((tag) & 0x3)
+#define	BER_TAG_VALUE(tag)	((tag) >> 2)
+#define	BER_TLV_CONSTRUCTED(tagptr)	(((*(const uint8_t *)tagptr)&0x20)?1:0)
+
+#define	BER_TAGS_EQUAL(tag1, tag2)	((tag1) == (tag2))
+
+/*
+ * Several functions for printing the TAG in the canonical form
+ * (i.e. "[PRIVATE 0]").
+ * Return values correspond to their libc counterparts (if any).
+ */
+ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen);
+ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *);
+char *ber_tlv_tag_string(ber_tlv_tag_t tag);
+
+
+/*
+ * This function tries to fetch the tag from the input stream.
+ * RETURN VALUES:
+ * 	 0:	More data expected than bufptr contains.
+ * 	-1:	Fatal error deciphering tag.
+ *	>0:	Number of bytes used from bufptr. tag_r will contain the tag.
+ */
+ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r);
+
+/*
+ * This function serializes the tag (T from TLV) in BER format.
+ * It always returns number of bytes necessary to represent the tag,
+ * it is a caller's responsibility to check the return value
+ * against the supplied buffer's size.
+ */
+size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_TLV_TAG_H_ */
diff --git a/e2ap/headers/constr_CHOICE.h b/e2ap/headers/constr_CHOICE.h
new file mode 100644
index 0000000..a1999ed
--- /dev/null
+++ b/e2ap/headers/constr_CHOICE.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_CHOICE_H_
+#define	_CONSTR_CHOICE_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_CHOICE_specifics_s {
+	/*
+	 * Target structure description.
+	 */
+	unsigned struct_size;       /* Size of the target structure. */
+	unsigned ctx_offset;        /* Offset of the asn_codec_ctx_t member */
+	unsigned pres_offset;       /* Identifier of the present member */
+	unsigned pres_size;         /* Size of the identifier (enum) */
+
+	/*
+	 * Tags to members mapping table.
+	 */
+	const asn_TYPE_tag2member_t *tag2el;
+	unsigned tag2el_count;
+
+	/* Canonical ordering of CHOICE elements, for PER */
+	const unsigned *to_canonical_order;
+	const unsigned *from_canonical_order;
+
+	/*
+	 * Extensions-related stuff.
+	 */
+	signed ext_start; /* First member of extensions, or -1 */
+} asn_CHOICE_specifics_t;
+
+/*
+ * A set specialized functions dealing with the CHOICE type.
+ */
+asn_struct_free_f CHOICE_free;
+asn_struct_print_f CHOICE_print;
+asn_struct_compare_f CHOICE_compare;
+asn_constr_check_f CHOICE_constraint;
+ber_type_decoder_f CHOICE_decode_ber;
+der_type_encoder_f CHOICE_encode_der;
+xer_type_decoder_f CHOICE_decode_xer;
+xer_type_encoder_f CHOICE_encode_xer;
+oer_type_decoder_f CHOICE_decode_oer;
+oer_type_encoder_f CHOICE_encode_oer;
+per_type_decoder_f CHOICE_decode_uper;
+per_type_encoder_f CHOICE_encode_uper;
+per_type_decoder_f CHOICE_decode_aper;
+per_type_encoder_f CHOICE_encode_aper;
+asn_outmost_tag_f CHOICE_outmost_tag;
+asn_random_fill_f CHOICE_random_fill;
+extern asn_TYPE_operation_t asn_OP_CHOICE;
+
+/*
+ * Return the 1-based choice variant presence index.
+ * Returns 0 in case of error.
+ */
+unsigned CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td,
+                                     const void *structure_ptr);
+
+/*
+ * Sets or resets the 1-based choice variant presence index.
+ * In case a previous index is not zero, the currently selected structure
+ * member is freed and zeroed-out first.
+ * Returns 0 on success and -1 on error.
+ */
+int CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td,
+                                void *structure_ptr, unsigned present);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_CHOICE_H_ */
diff --git a/e2ap/headers/constr_SEQUENCE.h b/e2ap/headers/constr_SEQUENCE.h
new file mode 100644
index 0000000..a22ed3a
--- /dev/null
+++ b/e2ap/headers/constr_SEQUENCE.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_SEQUENCE_H_
+#define	_CONSTR_SEQUENCE_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_SEQUENCE_specifics_s {
+	/*
+	 * Target structure description.
+	 */
+	unsigned struct_size;	/* Size of the target structure. */
+	unsigned ctx_offset;	/* Offset of the asn_struct_ctx_t member */
+
+	/*
+	 * Tags to members mapping table (sorted).
+	 */
+	const asn_TYPE_tag2member_t *tag2el;
+	unsigned tag2el_count;
+
+	/*
+	 * Optional members of the extensions root (roms) or additions (aoms).
+	 * Meaningful for PER.
+	 */
+	const int *oms;         /* Optional MemberS */
+	unsigned roms_count;    /* Root optional members count */
+	unsigned aoms_count;    /* Additions optional members count */
+
+	/*
+	 * Description of an extensions group.
+	 * Root components are clustered at the beginning of the structure,
+	 * whereas extensions are clustered at the end. -1 means not extensible.
+	 */
+	signed first_extension;       /* First extension addition */
+} asn_SEQUENCE_specifics_t;
+
+
+/*
+ * A set specialized functions dealing with the SEQUENCE type.
+ */
+asn_struct_free_f SEQUENCE_free;
+asn_struct_print_f SEQUENCE_print;
+asn_struct_compare_f SEQUENCE_compare;
+asn_constr_check_f SEQUENCE_constraint;
+ber_type_decoder_f SEQUENCE_decode_ber;
+der_type_encoder_f SEQUENCE_encode_der;
+xer_type_decoder_f SEQUENCE_decode_xer;
+xer_type_encoder_f SEQUENCE_encode_xer;
+oer_type_decoder_f SEQUENCE_decode_oer;
+oer_type_encoder_f SEQUENCE_encode_oer;
+per_type_decoder_f SEQUENCE_decode_uper;
+per_type_encoder_f SEQUENCE_encode_uper;
+per_type_decoder_f SEQUENCE_decode_aper;
+per_type_encoder_f SEQUENCE_encode_aper;
+asn_random_fill_f  SEQUENCE_random_fill;
+extern asn_TYPE_operation_t asn_OP_SEQUENCE;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_SEQUENCE_H_ */
diff --git a/e2ap/headers/constr_SEQUENCE_OF.h b/e2ap/headers/constr_SEQUENCE_OF.h
new file mode 100644
index 0000000..6857f0f
--- /dev/null
+++ b/e2ap/headers/constr_SEQUENCE_OF.h
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_SEQUENCE_OF_H_
+#define	_CONSTR_SEQUENCE_OF_H_
+
+#include <asn_application.h>
+#include <constr_SET_OF.h>		/* Implemented using SET OF */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * A set specialized functions dealing with the SEQUENCE OF type.
+ * Generally implemented using SET OF.
+ */
+asn_struct_compare_f SEQUENCE_OF_compare;
+der_type_encoder_f SEQUENCE_OF_encode_der;
+xer_type_encoder_f SEQUENCE_OF_encode_xer;
+per_type_encoder_f SEQUENCE_OF_encode_uper;
+per_type_encoder_f SEQUENCE_OF_encode_aper;
+extern asn_TYPE_operation_t asn_OP_SEQUENCE_OF;
+
+#define	SEQUENCE_OF_free	SET_OF_free
+#define	SEQUENCE_OF_print	SET_OF_print
+#define	SEQUENCE_OF_constraint	SET_OF_constraint
+#define	SEQUENCE_OF_decode_ber	SET_OF_decode_ber
+#define	SEQUENCE_OF_decode_xer	SET_OF_decode_xer
+#define	SEQUENCE_OF_decode_oer  SET_OF_decode_oer
+#define	SEQUENCE_OF_encode_oer  SET_OF_encode_oer
+#define	SEQUENCE_OF_decode_uper	SET_OF_decode_uper
+#define	SEQUENCE_OF_decode_aper	SET_OF_decode_aper
+#define	SEQUENCE_OF_random_fill SET_OF_random_fill
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_SET_OF_H_ */
diff --git a/e2ap/headers/constr_SET_OF.h b/e2ap/headers/constr_SET_OF.h
new file mode 100644
index 0000000..7681062
--- /dev/null
+++ b/e2ap/headers/constr_SET_OF.h
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	CONSTR_SET_OF_H
+#define	CONSTR_SET_OF_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_SET_OF_specifics_s {
+    /*
+     * Target structure description.
+     */
+    unsigned struct_size;       /* Size of the target structure. */
+    unsigned ctx_offset;        /* Offset of the asn_struct_ctx_t member */
+
+    /* XER-specific stuff */
+    int as_XMLValueList; /* The member type must be encoded like this */
+} asn_SET_OF_specifics_t;
+
+/*
+ * A set specialized functions dealing with the SET OF type.
+ */
+asn_struct_free_f SET_OF_free;
+asn_struct_print_f SET_OF_print;
+asn_struct_compare_f SET_OF_compare;
+asn_constr_check_f SET_OF_constraint;
+ber_type_decoder_f SET_OF_decode_ber;
+der_type_encoder_f SET_OF_encode_der;
+xer_type_decoder_f SET_OF_decode_xer;
+xer_type_encoder_f SET_OF_encode_xer;
+oer_type_decoder_f SET_OF_decode_oer;
+oer_type_encoder_f SET_OF_encode_oer;
+per_type_decoder_f SET_OF_decode_uper;
+per_type_encoder_f SET_OF_encode_uper;
+per_type_decoder_f SET_OF_decode_aper;
+per_type_encoder_f SET_OF_encode_aper;
+asn_random_fill_f  SET_OF_random_fill;
+extern asn_TYPE_operation_t asn_OP_SET_OF;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* CONSTR_SET_OF_H */
diff --git a/e2ap/headers/constr_TYPE.h b/e2ap/headers/constr_TYPE.h
new file mode 100644
index 0000000..d80dea5
--- /dev/null
+++ b/e2ap/headers/constr_TYPE.h
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This file contains the declaration structure called "ASN.1 Type Definition",
+ * which holds all information necessary for encoding and decoding routines.
+ * This structure even contains pointer to these encoding and decoding routines
+ * for each defined ASN.1 type.
+ */
+#ifndef	_CONSTR_TYPE_H_
+#define	_CONSTR_TYPE_H_
+
+#include <ber_tlv_length.h>
+#include <ber_tlv_tag.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_TYPE_member_s;	/* Forward declaration */
+
+/*
+ * This type provides the context information for various ASN.1 routines,
+ * primarily ones doing decoding. A member _asn_ctx of this type must be
+ * included into certain target language's structures, such as compound types.
+ */
+typedef struct asn_struct_ctx_s {
+	short phase;		/* Decoding phase */
+	short step;		/* Elementary step of a phase */
+	int context;		/* Other context information */
+	void *ptr;		/* Decoder-specific stuff (stack elements) */
+	ber_tlv_len_t left;	/* Number of bytes left, -1 for indefinite */
+} asn_struct_ctx_t;
+
+#include <ber_decoder.h>	/* Basic Encoding Rules decoder */
+#include <der_encoder.h>	/* Distinguished Encoding Rules encoder */
+#include <xer_decoder.h>	/* Decoder of XER (XML, text) */
+#include <xer_encoder.h>	/* Encoder into XER (XML, text) */
+#include <per_decoder.h>	/* Packet Encoding Rules decoder */
+#include <per_encoder.h>	/* Packet Encoding Rules encoder */
+#include <constraints.h>	/* Subtype constraints support */
+#include <asn_random_fill.h>	/* Random structures support */
+
+#ifdef  ASN_DISABLE_OER_SUPPORT
+typedef void (oer_type_decoder_f)(void);
+typedef void (oer_type_encoder_f)(void);
+typedef void asn_oer_constraints_t;
+#else
+#include <oer_decoder.h>	/* Octet Encoding Rules encoder */
+#include <oer_encoder.h>	/* Octet Encoding Rules encoder */
+#endif
+
+/*
+ * Free the structure according to its specification.
+ * Use one of ASN_STRUCT_{FREE,RESET,CONTENTS_ONLY} macros instead.
+ * Do not use directly.
+ */
+enum asn_struct_free_method {
+    ASFM_FREE_EVERYTHING,   /* free(struct_ptr) and underlying members */
+    ASFM_FREE_UNDERLYING,   /* free underlying members */
+    ASFM_FREE_UNDERLYING_AND_RESET   /* FREE_UNDERLYING + memset(0) */
+};
+typedef void (asn_struct_free_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		void *struct_ptr, enum asn_struct_free_method);
+
+/*
+ * Free the structure including freeing the memory pointed to by ptr itself.
+ */
+#define ASN_STRUCT_FREE(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_EVERYTHING)
+
+/*
+ * Free the memory used by the members of the structure without freeing the
+ * the structure pointer itself.
+ * ZERO-OUT the structure to the safe clean state.
+ * (Retaining the pointer may be useful in case the structure is allocated
+ *  statically or arranged on the stack, yet its elements are dynamic.)
+ */
+#define ASN_STRUCT_RESET(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING_AND_RESET)
+
+/*
+ * Free memory used by the members of the structure without freeing
+ * the structure pointer itself.
+ * (Retaining the pointer may be useful in case the structure is allocated
+ *  statically or arranged on the stack, yet its elements are dynamic.)
+ * AVOID using it in the application code;
+ * Use a safer ASN_STRUCT_RESET() instead.
+ */
+#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING)
+
+/*
+ * Print the structure according to its specification.
+ */
+typedef int(asn_struct_print_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr,
+    int level, /* Indentation level */
+    asn_app_consume_bytes_f *callback, void *app_key);
+
+/*
+ * Compare two structs between each other.
+ * Returns <0 if struct_A is "smaller" than struct_B, >0 if "greater",
+ * and =0 if "equal to", for some type-specific, stable definition of
+ * "smaller", "greater" and "equal to".
+ */
+typedef int (asn_struct_compare_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		const void *struct_A,
+		const void *struct_B);
+
+/*
+ * Return the outmost tag of the type.
+ * If the type is untagged CHOICE, the dynamic operation is performed.
+ * NOTE: This function pointer type is only useful internally.
+ * Do not use it in your application.
+ */
+typedef ber_tlv_tag_t (asn_outmost_tag_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag);
+/* The instance of the above function type; used internally. */
+asn_outmost_tag_f asn_TYPE_outmost_tag;
+
+/*
+ * Fetch the desired type of the Open Type based on the
+ * Information Object Set driven constraints.
+ */
+typedef struct asn_type_selector_result_s {
+    const struct asn_TYPE_descriptor_s *type_descriptor; /* Type encoded. */
+    unsigned presence_index; /* Associated choice variant. */
+} asn_type_selector_result_t;
+typedef asn_type_selector_result_t(asn_type_selector_f)(
+    const struct asn_TYPE_descriptor_s *parent_type_descriptor,
+    const void *parent_structure_ptr);
+
+/*
+ * Generalized functions for dealing with the speciic type.
+ * May be directly invoked by applications.
+ */
+typedef struct asn_TYPE_operation_s {
+    asn_struct_free_f *free_struct;     /* Free the structure */
+    asn_struct_print_f *print_struct;   /* Human readable output */
+    asn_struct_compare_f *compare_struct; /* Compare two structures */
+    ber_type_decoder_f *ber_decoder;      /* Generic BER decoder */
+    der_type_encoder_f *der_encoder;      /* Canonical DER encoder */
+    xer_type_decoder_f *xer_decoder;      /* Generic XER decoder */
+    xer_type_encoder_f *xer_encoder;      /* [Canonical] XER encoder */
+    oer_type_decoder_f *oer_decoder;      /* Generic OER decoder */
+    oer_type_encoder_f *oer_encoder;      /* Canonical OER encoder */
+    per_type_decoder_f *uper_decoder;     /* Unaligned PER decoder */
+    per_type_encoder_f *uper_encoder;     /* Unaligned PER encoder */
+    per_type_decoder_f *aper_decoder;     /* Aligned PER decoder */
+    per_type_encoder_f *aper_encoder;     /* Aligned PER encoder */
+    asn_random_fill_f *random_fill;       /* Initialize with a random value */
+    asn_outmost_tag_f *outmost_tag;       /* <optional, internal> */
+} asn_TYPE_operation_t;
+
+/*
+ * A constraints tuple specifying both the OER and PER constraints.
+ */
+typedef struct asn_encoding_constraints_s {
+    const struct asn_oer_constraints_s *oer_constraints;
+    const struct asn_per_constraints_s *per_constraints;
+    asn_constr_check_f *general_constraints;
+} asn_encoding_constraints_t;
+
+/*
+ * The definitive description of the destination language's structure.
+ */
+typedef struct asn_TYPE_descriptor_s {
+    const char *name;       /* A name of the ASN.1 type. "" in some cases. */
+    const char *xml_tag;    /* Name used in XML tag */
+
+    /*
+     * Generalized functions for dealing with the specific type.
+     * May be directly invoked by applications.
+     */
+    asn_TYPE_operation_t *op;
+
+    /***********************************************************************
+     * Internally useful members. Not to be used by applications directly. *
+     **********************************************************************/
+
+    /*
+     * Tags that are expected to occur.
+     */
+    const ber_tlv_tag_t *tags;      /* Effective tags sequence for this type */
+    unsigned tags_count;            /* Number of tags which are expected */
+    const ber_tlv_tag_t *all_tags;  /* Every tag for BER/containment */
+    unsigned all_tags_count;        /* Number of tags */
+
+    /* OER, PER, and general constraints */
+    asn_encoding_constraints_t encoding_constraints;
+
+    /*
+     * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE).
+     */
+    struct asn_TYPE_member_s *elements;
+    unsigned elements_count;
+
+    /*
+     * Additional information describing the type, used by appropriate
+     * functions above.
+     */
+    const void *specifics;
+} asn_TYPE_descriptor_t;
+
+/*
+ * This type describes an element of the constructed type,
+ * i.e. SEQUENCE, SET, CHOICE, etc.
+ */
+  enum asn_TYPE_flags_e {
+    ATF_NOFLAGS,
+    ATF_POINTER = 0x01,   /* Represented by the pointer */
+    ATF_OPEN_TYPE = 0x02, /* Open Type */
+    ATF_ANY_TYPE = 0x04   /* ANY type (deprecated!) */
+  };
+typedef struct asn_TYPE_member_s {
+    enum asn_TYPE_flags_e flags; /* Element's presentation flags */
+    unsigned optional;      /* Following optional members, including current */
+    unsigned memb_offset;   /* Offset of the element */
+    ber_tlv_tag_t tag;      /* Outmost (most immediate) tag */
+    int tag_mode;           /* IMPLICIT/no/EXPLICIT tag at current level */
+    asn_TYPE_descriptor_t *type;            /* Member type descriptor */
+    asn_type_selector_f *type_selector;     /* IoS runtime type selector */
+    asn_encoding_constraints_t encoding_constraints;
+    int (*default_value_cmp)(const void *sptr); /* Compare DEFAULT <value> */
+    int (*default_value_set)(void **sptr);      /* Set DEFAULT <value> */
+    const char *name; /* ASN.1 identifier of the element */
+} asn_TYPE_member_t;
+
+/*
+ * BER tag to element number mapping.
+ */
+typedef struct asn_TYPE_tag2member_s {
+    ber_tlv_tag_t el_tag;   /* Outmost tag of the member */
+    unsigned el_no;         /* Index of the associated member, base 0 */
+    int toff_first;         /* First occurence of the el_tag, relative */
+    int toff_last;          /* Last occurence of the el_tag, relative */
+} asn_TYPE_tag2member_t;
+
+/*
+ * This function prints out the contents of the target language's structure
+ * (struct_ptr) into the file pointer (stream) in human readable form.
+ * RETURN VALUES:
+ * 	 0: The structure is printed.
+ * 	-1: Problem dumping the structure.
+ * (See also xer_fprint() in xer_encoder.h)
+ */
+int asn_fprint(FILE *stream, /* Destination stream descriptor */
+               const asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */
+               const void *struct_ptr);         /* Structure to be printed */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_TYPE_H_ */
diff --git a/e2ap/headers/constraints.h b/e2ap/headers/constraints.h
new file mode 100644
index 0000000..0bd86a9
--- /dev/null
+++ b/e2ap/headers/constraints.h
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN1_CONSTRAINTS_VALIDATOR_H
+#define	ASN1_CONSTRAINTS_VALIDATOR_H
+
+#include <asn_system.h>		/* Platform-dependent types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;		/* Forward declaration */
+
+/*
+ * Validate the structure according to the ASN.1 constraints.
+ * If errbuf and errlen are given, they shall be pointing to the appropriate
+ * buffer space and its length before calling this function. Alternatively,
+ * they could be passed as NULL's. If constraints validation fails,
+ * errlen will contain the actual number of bytes taken from the errbuf
+ * to encode an error message (properly 0-terminated).
+ * 
+ * RETURN VALUES:
+ * This function returns 0 in case all ASN.1 constraints are met
+ * and -1 if one or more constraints were failed.
+ */
+int asn_check_constraints(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Target language's structure */
+    char *errbuf,           /* Returned error description */
+    size_t *errlen          /* Length of the error description */
+);
+
+
+/*
+ * Generic type for constraint checking callback,
+ * associated with every type descriptor.
+ */
+typedef int(asn_constr_check_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr,
+    asn_app_constraint_failed_f *optional_callback, /* Log the error */
+    void *optional_app_key /* Opaque key passed to a callback */
+);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+asn_constr_check_f asn_generic_no_constraint;	/* No constraint whatsoever */
+asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */
+
+/*
+ * Invoke the callback with a complete error message.
+ */
+#define	ASN__CTFAIL	if(ctfailcb) ctfailcb
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN1_CONSTRAINTS_VALIDATOR_H */
diff --git a/e2ap/headers/der_encoder.h b/e2ap/headers/der_encoder.h
new file mode 100644
index 0000000..e93944e
--- /dev/null
+++ b/e2ap/headers/der_encoder.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_DER_ENCODER_H_
+#define	_DER_ENCODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The DER encoder of any type. May be invoked by the application.
+ * Produces DER- and BER-compliant encoding. (DER is a subset of BER).
+ *
+ * NOTE: Use the ber_decode() function (ber_decoder.h) to decode data
+ * produced by der_encode().
+ */
+asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/* A variant of der_encode() which encodes data into the pre-allocated buffer */
+asn_enc_rval_t der_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (maximum) */
+);
+
+/*
+ * Type of the generic DER encoder.
+ */
+typedef asn_enc_rval_t(der_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    int tag_mode,           /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+    ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key /* Arbitrary callback argument */
+);
+
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Write out leading TL[v] sequence according to the type definition.
+ */
+ssize_t der_write_tags(const struct asn_TYPE_descriptor_s *type_descriptor,
+                       size_t struct_length,
+                       int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+                       int last_tag_form, /* {0,!0}: prim, constructed */
+                       ber_tlv_tag_t tag,
+                       asn_app_consume_bytes_f *consume_bytes_cb,
+                       void *app_key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _DER_ENCODER_H_ */
diff --git a/e2ap/headers/oer_decoder.h b/e2ap/headers/oer_decoder.h
new file mode 100644
index 0000000..40992e9
--- /dev/null
+++ b/e2ap/headers/oer_decoder.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_DECODER_H
+#define	OER_DECODER_H
+
+#include <asn_application.h>
+#include <oer_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_codec_ctx_s;		/* Forward declaration */
+
+/*
+ * The Octet Encoding Rules (OER, X.696 08/2015) decoder for any given type.
+ * This function may be invoked directly by the application.
+ * Parses CANONICAL-OER and BASIC-OER.
+ */
+asn_dec_rval_t oer_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
+	const struct asn_TYPE_descriptor_s *type_descriptor,
+	void **struct_ptr,	/* Pointer to a target structure's pointer */
+	const void *buffer,	/* Data to be decoded */
+	size_t size		/* Size of that buffer */
+	);
+
+/*
+ * Type of generic function which decodes the byte stream into the structure.
+ */
+typedef asn_dec_rval_t(oer_type_decoder_f)(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    void **struct_ptr,
+    const void *buf_ptr,
+    size_t size);
+
+/*
+ * Swallow the Open Type (X.696 (08/2015), #30) into /dev/null.
+ * RETURN VALUES:
+ *      -1:     Fatal error deciphering length.
+ *       0:     More data expected than bufptr contains.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_open_type_skip(const void *bufptr, size_t size);
+
+/*
+ * Read the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                          const struct asn_TYPE_descriptor_s *td,
+                          const asn_oer_constraints_t *constraints,
+                          void **struct_ptr, const void *bufptr, size_t size);
+
+/*
+ * Length-prefixed buffer decoding for primitive types.
+ */
+oer_type_decoder_f oer_decode_primitive;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_DECODER_H */
diff --git a/e2ap/headers/oer_encoder.h b/e2ap/headers/oer_encoder.h
new file mode 100644
index 0000000..6a7b681
--- /dev/null
+++ b/e2ap/headers/oer_encoder.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_ENCODER_H
+#define	OER_ENCODER_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The Octet Encoding Rules (OER, X.696 08/2015) encoder for any type.
+ * This function may be invoked directly by the application.
+ * Produces CANONICAL-OER output compatible with CANONICAL-OER
+ * and BASIC-OER decoders.
+ */
+asn_enc_rval_t oer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/* A variant of oer_encode() which encodes data into the pre-allocated buffer */
+asn_enc_rval_t oer_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (maximum) */
+);
+
+/*
+ * Type of the generic OER encoder.
+ */
+typedef asn_enc_rval_t(oer_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    const void *struct_ptr,                    /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+/*
+ * Write out the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *  -1: Fatal error encoding the type.
+ *  >0: Number of bytes serialized.
+ */
+ssize_t oer_open_type_put(const struct asn_TYPE_descriptor_s *td,
+                          const asn_oer_constraints_t *constraints,
+                          const void *struct_ptr,
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key);
+
+
+/*
+ * Length-prefixed buffer encoding for primitive types.
+ */
+oer_type_encoder_f oer_encode_primitive;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_ENCODER_H */
diff --git a/e2ap/headers/oer_support.h b/e2ap/headers/oer_support.h
new file mode 100644
index 0000000..dbc9b5f
--- /dev/null
+++ b/e2ap/headers/oer_support.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_SUPPORT_H
+#define	OER_SUPPORT_H
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Pre-computed OER constraints.
+ */
+typedef struct asn_oer_constraint_number_s {
+    unsigned width;    /* ±8,4,2,1 fixed bytes */
+    unsigned positive; /* 1 for unsigned number, 0 for signed */
+} asn_oer_constraint_number_t;
+typedef struct asn_oer_constraints_s {
+    asn_oer_constraint_number_t value;
+    ssize_t size;    /* -1 (no constraint) or >= 0 */
+} asn_oer_constraints_t;
+
+
+/*
+ * Fetch the length determinant (X.696 (08/2015), #8.6) into *len_r.
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_fetch_length(const void *bufptr, size_t size, size_t *len_r);
+
+/*
+ * Serialize OER length. Returns the number of bytes serialized
+ * or -1 if a given callback returned with negative result.
+ */
+ssize_t oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, void *app_key);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_SUPPORT_H */
diff --git a/e2ap/headers/per_decoder.h b/e2ap/headers/per_decoder.h
new file mode 100644
index 0000000..eea474a
--- /dev/null
+++ b/e2ap/headers/per_decoder.h
@@ -0,0 +1,82 @@
+/*-
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_DECODER_H_
+#define	_PER_DECODER_H_
+
+#include <asn_application.h>
+#include <per_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * Unaligned PER decoder of a "complete encoding" as per X.691 (08/2015) #11.1.
+ * On success, this call always returns (.consumed >= 1), as per #11.1.3.
+ */
+asn_dec_rval_t uper_decode_complete(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of data buffer */
+);
+
+/*
+ * Unaligned PER decoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This call returns the number of BITS read from the stream. Beware.
+ */
+asn_dec_rval_t uper_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size,        /* Size of the input data buffer, in bytes */
+    int skip_bits,      /* Number of unused leading bits, 0..7 */
+    int unused_bits     /* Number of unused tailing bits, 0..7 */
+);
+
+/*
+ * Aligned PER decoder of a "complete encoding" as per X.691#10.1.
+ * On success, this call always returns (.consumed >= 1), in BITS, as per X.691#10.1.3.
+ */
+asn_dec_rval_t aper_decode_complete(
+       const struct asn_codec_ctx_s *opt_codec_ctx,
+       const struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
+       void **struct_ptr,	/* Pointer to a target structure's pointer */
+       const void *buffer,	/* Data to be decoded */
+       size_t size		/* Size of data buffer */
+									);
+
+/*
+ * Aligned PER decoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This call returns the number of BITS read from the stream. Beware.
+ */
+asn_dec_rval_t aper_decode(
+      const struct asn_codec_ctx_s *opt_codec_ctx,
+      const struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
+      void **struct_ptr,	/* Pointer to a target structure's pointer */
+      const void *buffer,	/* Data to be decoded */
+      size_t size,		/* Size of data buffer */
+      int skip_bits,		/* Number of unused leading bits, 0..7 */
+      int unused_bits		/* Number of unused tailing bits, 0..7 */
+      );
+
+/*
+ * Type of the type-specific PER decoder function.
+ */
+typedef asn_dec_rval_t(per_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints, void **struct_ptr,
+    asn_per_data_t *per_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_DECODER_H_ */
diff --git a/e2ap/headers/per_encoder.h b/e2ap/headers/per_encoder.h
new file mode 100644
index 0000000..b615ef0
--- /dev/null
+++ b/e2ap/headers/per_encoder.h
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2006-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_ENCODER_H_
+#define	_PER_ENCODER_H_
+
+#include <asn_application.h>
+#include <per_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * Unaligned PER encoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This function returns the number of encoded bits in the .encoded
+ * field of the return value. Use the following formula to convert to bytes:
+ * 	bytes = ((.encoded + 7) / 8)
+ */
+asn_enc_rval_t uper_encode(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,                    /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+asn_enc_rval_t aper_encode(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,                     /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb,  /* Data collector */
+    void *app_key                               /* Arbitrary callback argument */
+);
+
+/*
+ * A variant of uper_encode() which encodes data into the existing buffer
+ * WARNING: This function returns the number of encoded bits in the .encoded
+ * field of the return value.
+ */
+asn_enc_rval_t uper_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (max) */
+);
+
+asn_enc_rval_t aper_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,  /* Structure to be encoded */
+    void *buffer,            /* Pre-allocated buffer */
+    size_t buffer_size       /* Initial buffer size (max) */
+);
+/*
+ * A variant of uper_encode_to_buffer() which allocates buffer itself.
+ * Returns the number of bytes in the buffer or -1 in case of failure.
+ * WARNING: This function produces a "Production of the complete encoding",
+ * with length of at least one octet. Contrast this to precise bit-packing
+ * encoding of uper_encode() and uper_encode_to_buffer().
+ */
+ssize_t uper_encode_to_new_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void **buffer_r         /* Buffer allocated and returned */
+);
+
+ssize_t
+aper_encode_to_new_buffer(
+    const struct asn_TYPE_descriptor_s *td,
+    const asn_per_constraints_t *constraints,
+    const void *sptr,
+    void **buffer_r
+);
+
+/*
+ * Type of the generic PER encoder function.
+ */
+typedef asn_enc_rval_t(per_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_ENCODER_H_ */
diff --git a/e2ap/headers/per_opentype.h b/e2ap/headers/per_opentype.h
new file mode 100644
index 0000000..1493b2d
--- /dev/null
+++ b/e2ap/headers/per_opentype.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_OPENTYPE_H_
+#define	_PER_OPENTYPE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+asn_dec_rval_t uper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *td,
+                                  const asn_per_constraints_t *constraints,
+                                  void **sptr, asn_per_data_t *pd);
+
+int uper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx,
+                        asn_per_data_t *pd);
+
+/*
+ * X.691 (2015/08), #11.2
+ * Returns -1 if error is encountered. 0 if all OK.
+ */
+int uper_open_type_put(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po);
+
+asn_dec_rval_t aper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *td,
+                                  const asn_per_constraints_t *constraints,
+                                  void **sptr, asn_per_data_t *pd);
+
+
+int aper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd);
+
+int aper_open_type_put(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_OPENTYPE_H_ */
diff --git a/e2ap/headers/per_support.h b/e2ap/headers/per_support.h
new file mode 100644
index 0000000..23079c9
--- /dev/null
+++ b/e2ap/headers/per_support.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_SUPPORT_H_
+#define	_PER_SUPPORT_H_
+
+#include <asn_system.h>		/* Platform-specific types */
+#include <asn_bit_data.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Pre-computed PER constraints.
+ */
+typedef struct asn_per_constraint_s {
+	enum asn_per_constraint_flags {
+		APC_UNCONSTRAINED	= 0x0,	/* No PER visible constraints */
+		APC_SEMI_CONSTRAINED	= 0x1,	/* Constrained at "lb" */
+		APC_CONSTRAINED		= 0x2,	/* Fully constrained */
+		APC_EXTENSIBLE		= 0x4	/* May have extension */
+	} flags;
+	int  range_bits;		/* Full number of bits in the range */
+	int  effective_bits;		/* Effective bits */
+	long lower_bound;		/* "lb" value */
+	long upper_bound;		/* "ub" value */
+} asn_per_constraint_t;
+typedef struct asn_per_constraints_s {
+	asn_per_constraint_t value;
+	asn_per_constraint_t size;
+	int (*value2code)(unsigned int value);
+	int (*code2value)(unsigned int code);
+} asn_per_constraints_t;
+
+/* Temporary compatibility layer. Will get removed. */
+typedef struct asn_bit_data_s asn_per_data_t;
+#define per_get_few_bits(data, bits)   asn_get_few_bits(data, bits)
+#define per_get_undo(data, bits)   asn_get_undo(data, bits)
+#define per_get_many_bits(data, dst, align, bits) \
+    asn_get_many_bits(data, dst, align, bits)
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Get the length "n" from the Unaligned PER stream.
+ */
+ssize_t uper_get_length(asn_per_data_t *pd, int effective_bound_bits,
+                        size_t lower_bound, int *repeat);
+
+ssize_t aper_get_length(asn_per_data_t *pd, int range,
+                        int effective_bound_bits, int *repeat);
+
+/*
+ * Get the normally small length "n".
+ */
+ssize_t uper_get_nslength(asn_per_data_t *pd);
+ssize_t aper_get_nslength(asn_per_data_t *pd);
+
+/*
+ * Get the normally small non-negative whole number.
+ */
+ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
+ssize_t aper_get_nsnnwn(asn_per_data_t *pd, int range);
+
+/* X.691-2008/11, #11.5.6 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits);
+
+
+/* Temporary compatibility layer. Will get removed. */
+typedef struct asn_bit_outp_s asn_per_outp_t;
+#define per_put_few_bits(out, bits, obits) asn_put_few_bits(out, bits, obits)
+#define per_put_many_bits(out, src, nbits) asn_put_many_bits(out, src, nbits)
+#define per_put_aligned_flush(out) asn_put_aligned_flush(out)
+
+
+/*
+ * Rebase the given value as an offset into the range specified by the
+ * lower bound (lb) and upper bound (ub).
+ * RETURN VALUES:
+ *  -1: Conversion failed due to range problems.
+ *   0: Conversion was successful.
+ */
+int per_long_range_rebase(long v, long lb, long ub, unsigned long *output);
+/* The inverse operation: restores the value by the offset and its bounds. */
+int per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp);
+
+/* X.691-2008/11, #11.5 */
+int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Put the length "whole_length" to the Unaligned PER stream.
+ * If (opt_need_eom) is given, it will be set to 1 if final 0-length is needed.
+ * In that case, invoke uper_put_length(po, 0, 0) after encoding the last block.
+ * This function returns the number of units which may be flushed
+ * in the next units saving iteration.
+ */
+ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length,
+                        int *opt_need_eom);
+
+ssize_t aper_put_length(asn_per_outp_t *po, int range, size_t length);
+
+/* Align the current bit position to octet bundary */
+int aper_put_align(asn_per_outp_t *po);
+int32_t aper_get_align(asn_per_data_t *pd);
+
+/*
+ * Put the normally small length "n" to the Unaligned PER stream.
+ * Returns 0 or -1.
+ */
+int uper_put_nslength(asn_per_outp_t *po, size_t length);
+
+int aper_put_nslength(asn_per_outp_t *po, size_t length);
+
+/*
+ * Put the normally small non-negative whole number.
+ */
+int uper_put_nsnnwn(asn_per_outp_t *po, int n);
+
+int aper_put_nsnnwn(asn_per_outp_t *po, int range, int number);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_SUPPORT_H_ */
diff --git a/e2ap/headers/xer_decoder.h b/e2ap/headers/xer_decoder.h
new file mode 100644
index 0000000..b951c41
--- /dev/null
+++ b/e2ap/headers/xer_decoder.h
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_DECODER_H_
+#define	_XER_DECODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The XER decoder of any ASN.1 type. May be invoked by the application.
+ * Decodes CANONICAL-XER and BASIC-XER.
+ */
+asn_dec_rval_t xer_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of data buffer */
+);
+
+/*
+ * Type of the type-specific XER decoder function.
+ */
+typedef asn_dec_rval_t(xer_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const char *opt_mname, /* Member name */
+    const void *buf_ptr, size_t size);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Generalized function for decoding the primitive values.
+ * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8
+ * and others. This function should not be used by applications, as its API
+ * is subject to changes.
+ */
+asn_dec_rval_t xer_decode_general(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    asn_struct_ctx_t *ctx, /* Type decoder context */
+    void *struct_key,      /* Treated as opaque pointer */
+    const char *xml_tag,   /* Expected XML tag name */
+    const void *buf_ptr, size_t size,
+    int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf,
+                                      size_t chunk_size),
+    ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf,
+                             size_t chunk_size, int have_more));
+
+
+/*
+ * Fetch the next XER (XML) token from the stream.
+ * The function returns the number of bytes occupied by the chunk type,
+ * returned in the _ch_type. The _ch_type is only set (and valid) when
+ * the return value is >= 0.
+ */
+  typedef enum pxer_chunk_type {
+	PXER_WMORE,     /* Chunk type is not clear, more data expected. */
+	PXER_TAG,	    /* Complete XER tag */
+	PXER_TEXT,	    /* Plain text between XER tags */
+	PXER_COMMENT	/* A comment, may be part of */
+  } pxer_chunk_type_e;
+ssize_t xer_next_token(int *stateContext,
+	const void *buffer, size_t size, pxer_chunk_type_e *_ch_type);
+
+/*
+ * This function checks the buffer against the tag name is expected to occur.
+ */
+  typedef enum xer_check_tag {
+	XCT_BROKEN	= 0,	/* The tag is broken */
+	XCT_OPENING	= 1,	/* This is the <opening> tag */
+	XCT_CLOSING	= 2,	/* This is the </closing> tag */
+	XCT_BOTH	= 3,	/* This is the <modified/> tag */
+	XCT__UNK__MASK	= 4,	/* Mask of everything unexpected */
+	XCT_UNKNOWN_OP	= 5,	/* Unexpected <opening> tag */
+	XCT_UNKNOWN_CL	= 6,	/* Unexpected </closing> tag */
+	XCT_UNKNOWN_BO	= 7	/* Unexpected <modified/> tag */
+  } xer_check_tag_e;
+xer_check_tag_e xer_check_tag(const void *buf_ptr, int size,
+		const char *need_tag);
+
+/*
+ * Get the number of bytes consisting entirely of XER whitespace characters.
+ * RETURN VALUES:
+ * >=0:	Number of whitespace characters in the string.
+ */
+size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size);
+
+/*
+ * Skip the series of anticipated extensions.
+ */
+int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_DECODER_H_ */
diff --git a/e2ap/headers/xer_encoder.h b/e2ap/headers/xer_encoder.h
new file mode 100644
index 0000000..9d75922
--- /dev/null
+++ b/e2ap/headers/xer_encoder.h
@@ -0,0 +1,83 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_ENCODER_H_
+#define	_XER_ENCODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */
+enum xer_encoder_flags_e {
+	/* Mode of encoding */
+	XER_F_BASIC	= 0x01,	/* BASIC-XER (pretty-printing) */
+	XER_F_CANONICAL	= 0x02	/* Canonical XER (strict rules) */
+};
+
+/*
+ * The XER encoder of any type. May be invoked by the application.
+ * Produces CANONICAL-XER and BASIC-XER depending on the (xer_flags).
+ */
+asn_enc_rval_t xer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          enum xer_encoder_flags_e xer_flags,
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/*
+ * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC)
+ * output into the chosen file pointer.
+ * RETURN VALUES:
+ * 	 0: The structure is printed.
+ * 	-1: Problem printing the structure.
+ * WARNING: No sensible errno value is returned.
+ */
+int xer_fprint(FILE *stream, const struct asn_TYPE_descriptor_s *td,
+               const void *struct_ptr);
+
+/*
+ * A helper function that uses XER encoding/decoding to verify that:
+ * - Both structures encode into the same BASIC XER.
+ * - Both resulting XER byte streams can be decoded back.
+ * - Both decoded structures encode into the same BASIC XER (round-trip).
+ * All of this verifies equivalence between structures and a round-trip.
+ * ARGUMENTS:
+ *  (opt_debug_stream)  - If specified, prints ongoing details.
+ */
+enum xer_equivalence_e {
+    XEQ_SUCCESS,          /* The only completely positive return value */
+    XEQ_FAILURE,          /* General failure */
+    XEQ_ENCODE1_FAILED,   /* First sructure XER encoding failed */
+    XEQ_ENCODE2_FAILED,   /* Second structure XER encoding failed */
+    XEQ_DIFFERENT,        /* Structures encoded into different XER */
+    XEQ_DECODE_FAILED,    /* Decode of the XER data failed */
+    XEQ_ROUND_TRIP_FAILED /* Bad round-trip */
+};
+enum xer_equivalence_e xer_equivalent(
+    const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct1,
+    const void *struct2, FILE *opt_debug_stream);
+
+/*
+ * Type of the generic XER encoder.
+ */
+typedef asn_enc_rval_t(xer_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    int ilevel,             /* Level of indentation */
+    enum xer_encoder_flags_e xer_flags,
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_ENCODER_H_ */
diff --git a/e2ap/headers/xer_support.h b/e2ap/headers/xer_support.h
new file mode 100644
index 0000000..c3a36e7
--- /dev/null
+++ b/e2ap/headers/xer_support.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com.
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_SUPPORT_H_
+#define	_XER_SUPPORT_H_
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Types of data transferred to the application.
+ */
+typedef enum {
+	PXML_TEXT,	/* Plain text between XML tags. */
+	PXML_TAG,	/* A tag, starting with '<'. */
+	PXML_COMMENT,	/* An XML comment, including "<!--" and "-->". */
+	/* 
+	 * The following chunk types are reported if the chunk
+	 * terminates the specified XML element.
+	 */
+	PXML_TAG_END,		/* Tag ended */
+	PXML_COMMENT_END	/* Comment ended */
+} pxml_chunk_type_e;
+
+/*
+ * Callback function that is called by the parser when parsed data is
+ * available. The _opaque is the pointer to a field containing opaque user 
+ * data specified in pxml_create() call. The chunk type is _type and the text 
+ * data is the piece of buffer identified by _bufid (as supplied to
+ * pxml_feed() call) starting at offset _offset and of _size bytes size. 
+ * The chunk is NOT '\0'-terminated.
+ */
+typedef int (pxml_callback_f)(pxml_chunk_type_e _type,
+	const void *_chunk_data, size_t _chunk_size, void *_key);
+
+/*
+ * Parse the given buffer as it were a chunk of XML data.
+ * Invoke the specified callback each time the meaninful data is found.
+ * This function returns number of bytes consumed from the bufer.
+ * It will always be lesser than or equal to the specified _size.
+ * The next invocation of this function must account the difference.
+ */
+ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size,
+	pxml_callback_f *cb, void *_key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_SUPPORT_H_ */
diff --git a/e2ap/lib/ANY.c b/e2ap/lib/ANY.c
new file mode 100644
index 0000000..0b81557
--- /dev/null
+++ b/e2ap/lib/ANY.c
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ANY.h>
+#include <errno.h>
+
+asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
+	sizeof(ANY_t),
+	offsetof(ANY_t, _asn_ctx),
+	ASN_OSUBV_ANY
+};
+asn_TYPE_operation_t asn_OP_ANY = {
+	OCTET_STRING_free,
+	OCTET_STRING_print,
+	OCTET_STRING_compare,
+	OCTET_STRING_decode_ber,
+	OCTET_STRING_encode_der,
+	OCTET_STRING_decode_xer_hex,
+	ANY_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	0,
+	0,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0, 0, 0, 0,
+#else
+	ANY_decode_uper,
+	ANY_encode_uper,
+	ANY_decode_aper,
+	ANY_encode_aper,
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+	0,	/* Random fill is not defined for ANY type */
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_ANY = {
+	"ANY",
+	"ANY",
+	&asn_OP_ANY,
+	0, 0, 0, 0,
+	{ 0, 0, asn_generic_no_constraint },	/* No constraints */
+	0, 0,	/* No members */
+	&asn_SPC_ANY_specs,
+};
+
+#undef RETURN
+#define RETURN(_code)                       \
+    do {                                    \
+        asn_dec_rval_t tmprval;             \
+        tmprval.code = _code;               \
+        tmprval.consumed = consumed_myself; \
+        return tmprval;                     \
+    } while(0)
+
+asn_enc_rval_t
+ANY_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+               enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+               void *app_key) {
+    if(flags & XER_F_CANONICAL) {
+		/*
+		 * Canonical XER-encoding of ANY type is not supported.
+		 */
+		ASN__ENCODE_FAILED;
+	}
+
+	/* Dump as binary */
+	return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key);
+}
+
+struct _callback_arg {
+	uint8_t *buffer;
+	size_t offset;
+	size_t size;
+};
+
+static int ANY__consume_bytes(const void *buffer, size_t size, void *key);
+
+int
+ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
+	struct _callback_arg arg;
+	asn_enc_rval_t erval = {0,0,0};
+
+	if(!st || !td) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(!sptr) {
+		if(st->buf) FREEMEM(st->buf);
+		st->size = 0;
+		return 0;
+	}
+
+	arg.offset = arg.size = 0;
+	arg.buffer = 0;
+
+	erval = der_encode(td, sptr, ANY__consume_bytes, &arg);
+	if(erval.encoded == -1) {
+		if(arg.buffer) FREEMEM(arg.buffer);
+		return -1;
+	}
+	assert((size_t)erval.encoded == arg.offset);
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = arg.buffer;
+	st->size = arg.offset;
+
+	return 0;
+}
+
+int
+ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
+	uint8_t *buffer = NULL;
+	ssize_t erval;
+
+	if(!st || !td) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(!sptr) {
+		if(st->buf) FREEMEM(st->buf);
+		st->size = 0;
+		return 0;
+	}
+
+	erval = aper_encode_to_new_buffer(td, td->encoding_constraints.per_constraints, sptr, (void**)&buffer);
+
+	if(erval == -1) {
+		if(buffer) FREEMEM(buffer);
+		return -1;
+	}
+	assert((size_t)erval > 0);
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buffer;
+	st->size = erval;
+
+	return 0;
+}
+
+ANY_t *
+ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
+	ANY_t tmp;
+	ANY_t *st;
+
+	if(!td || !sptr) {
+		errno = EINVAL;
+		return 0;
+	}
+
+	memset(&tmp, 0, sizeof(tmp));
+
+	if(ANY_fromType(&tmp, td, sptr)) return 0;
+
+	st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
+	if(st) {
+		*st = tmp;
+		return st;
+	} else {
+		FREEMEM(tmp.buf);
+		return 0;
+	}
+}
+
+ANY_t *
+ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
+	ANY_t tmp;
+	ANY_t *st;
+
+	if(!td || !sptr) {
+		errno = EINVAL;
+		return 0;
+	}
+
+	memset(&tmp, 0, sizeof(tmp));
+
+	if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
+
+	st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
+	if(st) {
+		*st = tmp;
+		return st;
+	} else {
+		FREEMEM(tmp.buf);
+		return 0;
+	}
+}
+
+int
+ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
+	asn_dec_rval_t rval;
+	void *newst = 0;
+
+	if(!st || !td || !struct_ptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(st->buf == 0) {
+		/* Nothing to convert, make it empty. */
+		*struct_ptr = (void *)0;
+		return 0;
+	}
+
+	rval = ber_decode(0, td, (void **)&newst, st->buf, st->size);
+	if(rval.code == RC_OK) {
+		*struct_ptr = newst;
+		return 0;
+	} else {
+		/* Remove possibly partially decoded data. */
+		ASN_STRUCT_FREE(*td, newst);
+		return -1;
+	}
+}
+
+int
+ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
+	asn_dec_rval_t rval;
+	void *newst = 0;
+
+	if(!st || !td || !struct_ptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(st->buf == 0) {
+		/* Nothing to convert, make it empty. */
+		*struct_ptr = (void *)0;
+		return 0;
+	}
+
+	rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
+	if(rval.code == RC_OK) {
+		*struct_ptr = newst;
+		return 0;
+	} else {
+		/* Remove possibly partially decoded data. */
+		ASN_STRUCT_FREE(*td, newst);
+		return -1;
+	}
+}
+
+static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
+	struct _callback_arg *arg = (struct _callback_arg *)key;
+
+	if((arg->offset + size) >= arg->size) {
+		size_t nsize = (arg->size ? arg->size << 2 : 16) + size;
+		void *p = REALLOC(arg->buffer, nsize);
+		if(!p) return -1;
+		arg->buffer = (uint8_t *)p;
+		arg->size = nsize;
+	}
+
+	memcpy(arg->buffer + arg->offset, buffer, size);
+	arg->offset += size;
+	assert(arg->offset < arg->size);
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, void **sptr,
+                asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_ANY_specs;
+    size_t consumed_myself = 0;
+    int repeat;
+    ANY_t *st = (ANY_t *)*sptr;
+
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    /*
+     * Allocate the structure.
+     */
+    if(!st) {
+        st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) RETURN(RC_FAIL);
+    }
+
+    ASN_DEBUG("UPER Decoding ANY type");
+
+    st->size = 0;
+    do {
+        ssize_t raw_len;
+        ssize_t len_bytes;
+        ssize_t len_bits;
+        void *p;
+        int ret;
+
+        /* Get the PER length */
+        raw_len = uper_get_length(pd, -1, 0, &repeat);
+        if(raw_len < 0) RETURN(RC_WMORE);
+        if(raw_len == 0 && st->buf) break;
+
+        ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
+                  repeat ? "repeat" : "once", td->name);
+        len_bytes = raw_len;
+        len_bits = len_bytes * 8;
+
+        p = REALLOC(st->buf, st->size + len_bytes + 1);
+        if(!p) RETURN(RC_FAIL);
+        st->buf = (uint8_t *)p;
+
+        ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
+        if(ret < 0) RETURN(RC_WMORE);
+        consumed_myself += len_bits;
+        st->size += len_bytes;
+    } while(repeat);
+    st->buf[st->size] = 0; /* nul-terminate */
+
+    RETURN(RC_OK);
+}
+
+asn_enc_rval_t
+ANY_encode_uper(const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, const void *sptr,
+                asn_per_outp_t *po) {
+    const ANY_t *st = (const ANY_t *)sptr;
+    asn_enc_rval_t er = {0, 0, 0};
+    const uint8_t *buf;
+    size_t size;
+    int ret;
+
+    (void)constraints;
+
+    if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
+
+    buf = st->buf;
+    size = st->size;
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size, &need_eom);
+        if(may_save < 0) ASN__ENCODE_FAILED;
+
+        ret = per_put_many_bits(po, buf, may_save * 8);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += may_save;
+        size -= may_save;
+        assert(!(may_save & 0x07) || !size);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size);
+
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, void **sptr,
+                asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_ANY_specs;
+    size_t consumed_myself = 0;
+    int repeat;
+    ANY_t *st = (ANY_t *)*sptr;
+
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    /*
+     * Allocate the structure.
+     */
+    if(!st) {
+        st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) RETURN(RC_FAIL);
+    }
+
+    ASN_DEBUG("APER Decoding ANY type");
+
+    st->size = 0;
+    do {
+        ssize_t raw_len;
+        ssize_t len_bytes;
+        ssize_t len_bits;
+        void *p;
+        int ret;
+
+        /* Get the PER length */
+        raw_len = aper_get_length(pd, -1, 0, &repeat);
+        if(raw_len < 0) RETURN(RC_WMORE);
+        if(raw_len == 0 && st->buf) break;
+
+        ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
+                  repeat ? "repeat" : "once", td->name);
+        len_bytes = raw_len;
+        len_bits = len_bytes * 8;
+
+        p = REALLOC(st->buf, st->size + len_bytes + 1);
+        if(!p) RETURN(RC_FAIL);
+        st->buf = (uint8_t *)p;
+
+        ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
+        if(ret < 0) RETURN(RC_WMORE);
+        consumed_myself += len_bits;
+        st->size += len_bytes;
+    } while(repeat);
+    st->buf[st->size] = 0; /* nul-terminate */
+
+    RETURN(RC_OK);
+}
+
+asn_enc_rval_t
+ANY_encode_aper(const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, const void *sptr,
+                asn_per_outp_t *po) {
+    const ANY_t *st = (const ANY_t *)sptr;
+    asn_enc_rval_t er = {0, 0, 0};
+    const uint8_t *buf;
+    size_t size;
+    int ret;
+
+    (void)constraints;
+
+    if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
+
+    buf = st->buf;
+    size = st->size;
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size, &need_eom);
+        if(may_save < 0) ASN__ENCODE_FAILED;
+
+        ret = per_put_many_bits(po, buf, may_save * 8);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += may_save;
+        size -= may_save;
+        assert(!(may_save & 0x07) || !size);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size);
+
+    ASN__ENCODED_OK(er);
+}
+#endif /* ASN_DISABLE_PER_SUPPORT */
+
diff --git a/e2ap/lib/BIT_STRING.c b/e2ap/lib/BIT_STRING.c
new file mode 100644
index 0000000..e8d7354
--- /dev/null
+++ b/e2ap/lib/BIT_STRING.c
@@ -0,0 +1,656 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <BIT_STRING.h>
+#include <asn_internal.h>
+
+/*
+ * BIT STRING basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
+};
+asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
+	sizeof(BIT_STRING_t),
+	offsetof(BIT_STRING_t, _asn_ctx),
+	ASN_OSUBV_BIT
+};
+asn_TYPE_operation_t asn_OP_BIT_STRING = {
+	OCTET_STRING_free,         /* Implemented in terms of OCTET STRING */
+	BIT_STRING_print,
+	BIT_STRING_compare,
+	OCTET_STRING_decode_ber,   /* Implemented in terms of OCTET STRING */
+	OCTET_STRING_encode_der,   /* Implemented in terms of OCTET STRING */
+	OCTET_STRING_decode_xer_binary,
+	BIT_STRING_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	BIT_STRING_decode_oer,
+	BIT_STRING_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	BIT_STRING_decode_uper,	/* Unaligned PER decoder */
+	BIT_STRING_encode_uper,	/* Unaligned PER encoder */
+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+	BIT_STRING_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
+	"BIT STRING",
+	"BIT_STRING",
+	&asn_OP_BIT_STRING,
+	asn_DEF_BIT_STRING_tags,
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
+	asn_DEF_BIT_STRING_tags,	/* Same as above */
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
+	{ 0, 0, BIT_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_BIT_STRING_specs
+};
+
+/*
+ * BIT STRING generic constraint.
+ */
+int
+BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+
+	if(st && st->buf) {
+		if((st->size == 0 && st->bits_unused)
+		|| st->bits_unused < 0 || st->bits_unused > 7) {
+			ASN__CTFAIL(app_key, td, sptr,
+				"%s: invalid padding byte (%s:%d)",
+				td->name, __FILE__, __LINE__);
+			return -1;
+		}
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	return 0;
+}
+
+static const char *_bit_pattern[16] = {
+	"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
+	"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
+};
+
+asn_enc_rval_t
+BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      int ilevel, enum xer_encoder_flags_e flags,
+                      asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_enc_rval_t er = {0, 0, 0};
+	char scratch[128];
+	char *p = scratch;
+	char *scend = scratch + (sizeof(scratch) - 10);
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	int xcan = (flags & XER_F_CANONICAL);
+	uint8_t *buf;
+	uint8_t *end;
+
+	if(!st || !st->buf)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	buf = st->buf;
+	end = buf + st->size - 1;	/* Last byte is special */
+
+	/*
+	 * Binary dump
+	 */
+	for(; buf < end; buf++) {
+		int v = *buf;
+		int nline = xcan?0:(((buf - st->buf) % 8) == 0);
+		if(p >= scend || nline) {
+			ASN__CALLBACK(scratch, p - scratch);
+			p = scratch;
+			if(nline) ASN__TEXT_INDENT(1, ilevel);
+		}
+		memcpy(p + 0, _bit_pattern[v >> 4], 4);
+		memcpy(p + 4, _bit_pattern[v & 0x0f], 4);
+		p += 8;
+	}
+
+	if(!xcan && ((buf - st->buf) % 8) == 0)
+		ASN__TEXT_INDENT(1, ilevel);
+	ASN__CALLBACK(scratch, p - scratch);
+	p = scratch;
+
+	if(buf == end) {
+		int v = *buf;
+		int ubits = st->bits_unused;
+		int i;
+		for(i = 7; i >= ubits; i--)
+			*p++ = (v & (1 << i)) ? 0x31 : 0x30;
+		ASN__CALLBACK(scratch, p - scratch);
+	}
+
+	if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+
+/*
+ * BIT STRING specific contents printer.
+ */
+int
+BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                 asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	char scratch[64];
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	uint8_t *buf;
+	uint8_t *end;
+	char *p = scratch;
+
+	(void)td;	/* Unused argument */
+
+	if(!st || !st->buf)
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	ilevel++;
+	buf = st->buf;
+	end = buf + st->size;
+
+	/*
+	 * Hexadecimal dump.
+	 */
+	for(; buf < end; buf++) {
+		if((buf - st->buf) % 16 == 0 && (st->size > 16)
+				&& buf != st->buf) {
+			_i_INDENT(1);
+			/* Dump the string */
+			if(cb(scratch, p - scratch, app_key) < 0) return -1;
+			p = scratch;
+		}
+		*p++ = h2c[*buf >> 4];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x20;
+	}
+
+	if(p > scratch) {
+		p--;	/* Eat the tailing space */
+
+		if((st->size > 16)) {
+			_i_INDENT(1);
+		}
+
+		/* Dump the incomplete 16-bytes row */
+		if(cb(scratch, p - scratch, app_key) < 0)
+			return -1;
+	}
+
+    if(st->bits_unused) {
+        int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
+                           st->bits_unused, st->bits_unused == 1 ? "" : "s");
+        assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
+        if(ret > 0 && ret < (ssize_t)sizeof(scratch)
+           && cb(scratch, ret, app_key) < 0)
+            return -1;
+    }
+
+	return 0;
+}
+
+/*
+ * Non-destructively remove the trailing 0-bits from the given bit string.
+ */
+static const BIT_STRING_t *
+BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
+    const uint8_t *b;
+    union {
+        const uint8_t *c_buf;
+        uint8_t *nc_buf;
+    } unconst;
+
+    if(st->size == 0) {
+        assert(st->bits_unused == 0);
+        return st;
+    } else {
+        for(b = &st->buf[st->size - 1]; b > st->buf && *b == 0; b--) {
+            ;
+        }
+        /* b points to the last byte which may contain data */
+        if(*b) {
+            int unused = 7;
+            uint8_t v = *b;
+            v &= -(int8_t)v;
+            if(v & 0x0F) unused -= 4;
+            if(v & 0x33) unused -= 2;
+            if(v & 0x55) unused -= 1;
+            tmp->size = b-st->buf + 1;
+            tmp->bits_unused = unused;
+        } else {
+            tmp->size = b-st->buf;
+            tmp->bits_unused = 0;
+        }
+
+        assert(b >= st->buf);
+    }
+
+    unconst.c_buf = st->buf;
+    tmp->buf = unconst.nc_buf;
+    return tmp;
+}
+
+/*
+ * Lexicographically compare the common prefix of both strings,
+ * and if it is the same return -1 for the smallest string.
+ */
+int
+BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                   const void *bptr) {
+    /*
+     * Remove information about trailing bits, since
+     * X.680 (08/2015) #22.7 "ensure that different semantics are not"
+     * "associated with [values that differ only in] the trailing 0 bits."
+     */
+    BIT_STRING_t compact_a, compact_b;
+    const BIT_STRING_t *a = BIT_STRING__compactify(aptr, &compact_a);
+    const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics;
+
+    assert(specs && specs->subvariant == ASN_OSUBV_BIT);
+
+    if(a && b) {
+        size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
+        int ret = memcmp(a->buf, b->buf, common_prefix_size);
+        if(ret == 0) {
+            /* Figure out which string with equal prefixes is longer. */
+            if(a->size < b->size) {
+                return -1;
+            } else if(a->size > b->size) {
+                return 1;
+            } else {
+                /* Figure out how many unused bits */
+                if(a->bits_unused > b->bits_unused) {
+                    return -1;
+                } else if(a->bits_unused < b->bits_unused) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+        } else {
+            return ret;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+#undef  RETURN
+#define RETURN(_code)                       \
+    do {                                    \
+        asn_dec_rval_t tmprval;             \
+        tmprval.code = _code;               \
+        tmprval.consumed = consumed_myself; \
+        return tmprval;                     \
+    } while(0)
+
+static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = {
+    APC_SEMI_CONSTRAINED, -1, -1, 0, 0};
+
+asn_dec_rval_t
+BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                       const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints, void **sptr,
+                       asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_BIT_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		csiz = &pc->size;
+	} else {
+		csiz = &asn_DEF_BIT_STRING_constraint_size;
+	}
+
+	if(specs->subvariant != ASN_OSUBV_BIT) {
+		ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant);
+		RETURN(RC_FAIL);
+    }
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_BIT_STRING_constraint_size;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+        st->size = (csiz->upper_bound + 7) >> 3;
+        st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+        ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound);
+        ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound);
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += csiz->upper_bound;
+		st->buf[st->size] = 0;
+        st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7;
+        RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		ssize_t len_bits;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
+		                          &repeat);
+		if(raw_len < 0) RETURN(RC_WMORE);
+        if(raw_len == 0 && st->buf) break;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+        len_bits = raw_len;
+        len_bytes = (len_bits + 7) >> 3;
+        if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7);
+        /* len_bits be multiple of 16K if repeat is set */
+        p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+        ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
+        if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_BIT_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *csiz;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	BIT_STRING_t compact_bstr;  /* Do not modify this directly! */
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;		/* Lies not within extension root */
+	size_t size_in_bits;
+	const uint8_t *buf;
+	int ret;
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(specs->subvariant == ASN_OSUBV_BIT) {
+        if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7))
+            ASN__ENCODE_FAILED;
+    } else {
+		ASN__ENCODE_FAILED;
+    }
+
+	if(pc) {
+        csiz = &pc->size;
+    } else {
+		csiz = &asn_DEF_BIT_STRING_constraint_size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+    /* Figure out the size without the trailing bits */
+    st = BIT_STRING__compactify(st, &compact_bstr);
+    size_in_bits = 8 * st->size - st->bits_unused;
+
+    ASN_DEBUG(
+        "Encoding %s into %" ASN_PRI_SIZE " bits"
+        " (%ld..%ld, effective %d)%s",
+        td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound,
+        csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+    /* Figure out whether size lies within PER visible constraint */
+
+    if(csiz->effective_bits >= 0) {
+        if((ssize_t)size_in_bits > csiz->upper_bound) {
+            if(ct_extensible) {
+                csiz = &asn_DEF_BIT_STRING_constraint_size;
+                inext = 1;
+            } else {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    } else {
+        inext = 0;
+    }
+
+    if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+    if(csiz->effective_bits >= 0 && !inext) {
+        int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
+        ASN_DEBUG(
+            "Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual "
+            "value %" ASN_PRI_SSIZE "",
+            st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits,
+            add_trailer,
+            add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound);
+        ret = per_put_few_bits(
+            po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound,
+            csiz->effective_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        ret = per_put_many_bits(po, st->buf, size_in_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        if(add_trailer) {
+            static const uint8_t zeros[16];
+            size_t trailing_zero_bits = csiz->lower_bound - size_in_bits;
+            while(trailing_zero_bits > 0) {
+                if(trailing_zero_bits > 8 * sizeof(zeros)) {
+                    ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros));
+                    trailing_zero_bits -= 8 * sizeof(zeros);
+                } else {
+                    ret = per_put_many_bits(po, zeros, trailing_zero_bits);
+                    trailing_zero_bits = 0;
+                }
+                if(ret) ASN__ENCODE_FAILED;
+            }
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
+
+    buf = st->buf;
+    do {
+        int need_eom = 0;
+        ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom);
+        if(maySave < 0) ASN__ENCODE_FAILED;
+
+        ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits);
+
+        ret = per_put_many_bits(po, buf, maySave);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += maySave >> 3;
+        size_in_bits -= maySave;
+        assert(!(maySave & 0x07) || !size_in_bits);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size_in_bits);
+
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+asn_random_fill_result_t
+BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                       const asn_encoding_constraints_t *constraints,
+                       size_t max_length) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_BIT_STRING_specs;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    static unsigned lengths[] = {0,     1,     2,     3,     4,     8,
+                                 126,   127,   128,   16383, 16384, 16385,
+                                 65534, 65535, 65536, 65537};
+    uint8_t *buf;
+    uint8_t *bend;
+    uint8_t *b;
+    size_t rnd_bits, rnd_len;
+    BIT_STRING_t *st;
+
+    if(max_length == 0) return result_skipped;
+
+    switch(specs->subvariant) {
+    case ASN_OSUBV_ANY:
+        return result_failed;
+    case ASN_OSUBV_BIT:
+        break;
+    default:
+        break;
+    }
+
+    /* Figure out how far we should go */
+    rnd_bits = lengths[asn_random_between(
+        0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_CONSTRAINED) {
+            long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
+                                             ? pc->upper_bound
+                                             : (ssize_t)max_length;
+            if(max_length < (size_t)pc->lower_bound) {
+                return result_skipped;
+            }
+            if(pc->flags & APC_EXTENSIBLE) {
+                switch(asn_random_between(0, 5)) {
+                case 0:
+                    if(pc->lower_bound > 0) {
+                        rnd_bits = pc->lower_bound - 1;
+                        break;
+                    }
+                    /* Fall through */
+                case 1:
+                    rnd_bits = pc->upper_bound + 1;
+                    break;
+                case 2:
+                    /* Keep rnd_bits from the table */
+                    if(rnd_bits < max_length) {
+                        break;
+                    }
+                    /* Fall through */
+                default:
+                    rnd_bits = asn_random_between(pc->lower_bound,
+                                                  suggested_upper_bound);
+                }
+            } else {
+                rnd_bits =
+                    asn_random_between(pc->lower_bound, suggested_upper_bound);
+            }
+        } else {
+            rnd_bits = asn_random_between(0, max_length - 1);
+        }
+    } else if(rnd_bits >= max_length) {
+        rnd_bits = asn_random_between(0, max_length - 1);
+    }
+
+    rnd_len = (rnd_bits + 7) / 8;
+    buf = CALLOC(1, rnd_len + 1);
+    if(!buf) return result_failed;
+
+    bend = &buf[rnd_len];
+
+    for(b = buf; b < bend; b++) {
+        *(uint8_t *)b = asn_random_between(0, 255);
+    }
+    *b = 0; /* Zero-terminate just in case. */
+
+    if(*sptr) {
+        st = *sptr;
+        FREEMEM(st->buf);
+    } else {
+        st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) {
+            FREEMEM(buf);
+            return result_failed;
+        }
+    }
+
+    st->buf = buf;
+    st->size = rnd_len;
+    st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
+    if(st->bits_unused) {
+        assert(st->size > 0);
+        st->buf[st->size-1] &= 0xff << st->bits_unused;
+    }
+
+    result_ok.length = st->size;
+    return result_ok;
+}
diff --git a/e2ap/lib/BIT_STRING_oer.c b/e2ap/lib/BIT_STRING_oer.c
new file mode 100644
index 0000000..aff5075
--- /dev/null
+++ b/e2ap/lib/BIT_STRING_oer.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <BIT_STRING.h>
+#include <errno.h>
+
+asn_dec_rval_t
+BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                      const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints, void **sptr,
+                      const void *ptr, size_t size) {
+    BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+
+    (void)opt_codec_ctx;
+
+    if(!st) {
+        st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        expected_length = (ct_size + 7) >> 3;
+        st->bits_unused = (8 - (ct_size & 7)) & 7;
+    } else {
+        /*
+         * X.696 (08/2015) #13.3.1
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
+        if(len_len > 0) {
+            ptr = (const char *)ptr + len_len;
+            size -= len_len;
+        } else if(len_len == 0) {
+            ASN__DECODE_STARVED;
+        } else if(len_len < 0) {
+            ASN__DECODE_FAILED;
+        }
+
+        if(expected_length < 1) {
+            ASN__DECODE_FAILED;
+        } else if(expected_length > size) {
+            ASN__DECODE_STARVED;
+        }
+
+        st->bits_unused = ((const uint8_t *)ptr)[0];
+        if(st->bits_unused & ~7) {
+            ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name);
+            ASN__DECODE_FAILED;
+        }
+        ptr = (const char *)ptr + 1;
+        size--;
+        expected_length--;
+        rval.consumed = len_len + 1;
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+        if(expected_length > 0) {
+            buf[expected_length - 1] &= (0xff << st->bits_unused);
+        }
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints,
+                      const void *sptr, asn_app_consume_bytes_f *cb,
+                      void *app_key) {
+    const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+    asn_enc_rval_t erval = {0, 0, 0};
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    size_t trailing_zeros = 0;
+    int fix_last_byte = 0;
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    if(st->bits_unused & ~7) {
+        ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range",
+                  st->bits_unused);
+        ASN__ENCODE_FAILED;
+    }
+    if(st->bits_unused && !(st->size && st->buf)) {
+        ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name,
+                  st->bits_unused);
+        ASN__ENCODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        size_t ct_bytes = (ct_size + 7) >> 3;
+        if(st->size > ct_bytes) {
+            ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "",
+                      td->name, 8 * st->size - st->bits_unused, ct_size);
+            ASN__ENCODE_FAILED;
+        }
+        trailing_zeros = ct_bytes - st->size;   /* Allow larger constraint */
+    } else {
+        uint8_t ub = st->bits_unused & 7;
+        ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key);
+        if(len_len < 0) ASN__ENCODE_FAILED;
+        if(cb(&ub, 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        erval.encoded += len_len + 1;
+    }
+
+    if(st->bits_unused) {
+        if(st->buf[st->size - 1] & (0xff << st->bits_unused)) {
+            fix_last_byte = 1;
+        }
+    }
+
+    if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    if(fix_last_byte) {
+        uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused);
+        if(cb(&b, 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+    erval.encoded += st->size;
+
+    if(trailing_zeros) {
+        static uint8_t zeros[16];
+        while(trailing_zeros > 0) {
+            int ret;
+            if(trailing_zeros < sizeof(zeros)) {
+                ret = cb(zeros, trailing_zeros, app_key);
+                erval.encoded += trailing_zeros;
+            } else {
+                ret = cb(zeros, sizeof(zeros), app_key);
+                erval.encoded += sizeof(zeros);
+            }
+            if(ret < 0) ASN__ENCODE_FAILED;
+        }
+    }
+
+    return erval;
+}
+
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/Cause.c b/e2ap/lib/Cause.c
new file mode 100644
index 0000000..bdb51be
--- /dev/null
+++ b/e2ap/lib/Cause.c
@@ -0,0 +1,95 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "Cause.h"
+
+static asn_oer_constraints_t asn_OER_type_Cause_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_Cause_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  4 }	/* (0..4,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_Cause_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.ricRequest),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseRIC,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.ricService),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseRICservice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricService"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.transport),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseTransport,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"transport"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.protocol),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseProtocol,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocol"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.misc),
+		(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseMisc,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"misc"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_Cause_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* misc */
+};
+asn_CHOICE_specifics_t asn_SPC_Cause_specs_1 = {
+	sizeof(struct Cause),
+	offsetof(struct Cause, _asn_ctx),
+	offsetof(struct Cause, present),
+	sizeof(((struct Cause *)0)->present),
+	asn_MAP_Cause_tag2el_1,
+	5,	/* Count of tags in the map */
+	0, 0,
+	5	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Cause = {
+	"Cause",
+	"Cause",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_Cause_constr_1, &asn_PER_type_Cause_constr_1, CHOICE_constraint },
+	asn_MBR_Cause_1,
+	5,	/* Elements count */
+	&asn_SPC_Cause_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseMisc.c b/e2ap/lib/CauseMisc.c
new file mode 100644
index 0000000..e09c0b1
--- /dev/null
+++ b/e2ap/lib/CauseMisc.c
@@ -0,0 +1,62 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseMisc.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseMisc_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseMisc_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseMisc_value2enum_1[] = {
+	{ 0,	27,	"control-processing-overload" },
+	{ 1,	16,	"hardware-failure" },
+	{ 2,	15,	"om-intervention" },
+	{ 3,	11,	"unspecified" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseMisc_enum2value_1[] = {
+	0,	/* control-processing-overload(0) */
+	1,	/* hardware-failure(1) */
+	2,	/* om-intervention(2) */
+	3	/* unspecified(3) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseMisc_specs_1 = {
+	asn_MAP_CauseMisc_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseMisc_enum2value_1,	/* N => "tag"; sorted by N */
+	4,	/* Number of elements in the maps */
+	5,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseMisc_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseMisc = {
+	"CauseMisc",
+	"CauseMisc",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseMisc_tags_1,
+	sizeof(asn_DEF_CauseMisc_tags_1)
+		/sizeof(asn_DEF_CauseMisc_tags_1[0]), /* 1 */
+	asn_DEF_CauseMisc_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseMisc_tags_1)
+		/sizeof(asn_DEF_CauseMisc_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseMisc_constr_1, &asn_PER_type_CauseMisc_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseMisc_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseProtocol.c b/e2ap/lib/CauseProtocol.c
new file mode 100644
index 0000000..66bb383
--- /dev/null
+++ b/e2ap/lib/CauseProtocol.c
@@ -0,0 +1,68 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseProtocol.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseProtocol_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseProtocol_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  6 }	/* (0..6,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseProtocol_value2enum_1[] = {
+	{ 0,	21,	"transfer-syntax-error" },
+	{ 1,	28,	"abstract-syntax-error-reject" },
+	{ 2,	39,	"abstract-syntax-error-ignore-and-notify" },
+	{ 3,	42,	"message-not-compatible-with-receiver-state" },
+	{ 4,	14,	"semantic-error" },
+	{ 5,	49,	"abstract-syntax-error-falsely-constructed-message" },
+	{ 6,	11,	"unspecified" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseProtocol_enum2value_1[] = {
+	5,	/* abstract-syntax-error-falsely-constructed-message(5) */
+	2,	/* abstract-syntax-error-ignore-and-notify(2) */
+	1,	/* abstract-syntax-error-reject(1) */
+	3,	/* message-not-compatible-with-receiver-state(3) */
+	4,	/* semantic-error(4) */
+	0,	/* transfer-syntax-error(0) */
+	6	/* unspecified(6) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseProtocol_specs_1 = {
+	asn_MAP_CauseProtocol_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseProtocol_enum2value_1,	/* N => "tag"; sorted by N */
+	7,	/* Number of elements in the maps */
+	8,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseProtocol_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseProtocol = {
+	"CauseProtocol",
+	"CauseProtocol",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseProtocol_tags_1,
+	sizeof(asn_DEF_CauseProtocol_tags_1)
+		/sizeof(asn_DEF_CauseProtocol_tags_1[0]), /* 1 */
+	asn_DEF_CauseProtocol_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseProtocol_tags_1)
+		/sizeof(asn_DEF_CauseProtocol_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseProtocol_constr_1, &asn_PER_type_CauseProtocol_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseProtocol_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseRIC.c b/e2ap/lib/CauseRIC.c
new file mode 100644
index 0000000..7d94696
--- /dev/null
+++ b/e2ap/lib/CauseRIC.c
@@ -0,0 +1,76 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseRIC.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseRIC_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseRIC_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  10 }	/* (0..10,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseRIC_value2enum_1[] = {
+	{ 0,	23,	"ran-function-id-Invalid" },
+	{ 1,	20,	"action-not-supported" },
+	{ 2,	17,	"excessive-actions" },
+	{ 3,	16,	"duplicate-action" },
+	{ 4,	15,	"duplicate-event" },
+	{ 5,	23,	"function-resource-limit" },
+	{ 6,	18,	"request-id-unknown" },
+	{ 7,	46,	"inconsistent-action-subsequent-action-sequence" },
+	{ 8,	23,	"control-message-invalid" },
+	{ 9,	23,	"call-process-id-invalid" },
+	{ 10,	11,	"unspecified" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseRIC_enum2value_1[] = {
+	1,	/* action-not-supported(1) */
+	9,	/* call-process-id-invalid(9) */
+	8,	/* control-message-invalid(8) */
+	3,	/* duplicate-action(3) */
+	4,	/* duplicate-event(4) */
+	2,	/* excessive-actions(2) */
+	5,	/* function-resource-limit(5) */
+	7,	/* inconsistent-action-subsequent-action-sequence(7) */
+	0,	/* ran-function-id-Invalid(0) */
+	6,	/* request-id-unknown(6) */
+	10	/* unspecified(10) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseRIC_specs_1 = {
+	asn_MAP_CauseRIC_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseRIC_enum2value_1,	/* N => "tag"; sorted by N */
+	11,	/* Number of elements in the maps */
+	12,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseRIC_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseRIC = {
+	"CauseRIC",
+	"CauseRIC",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseRIC_tags_1,
+	sizeof(asn_DEF_CauseRIC_tags_1)
+		/sizeof(asn_DEF_CauseRIC_tags_1[0]), /* 1 */
+	asn_DEF_CauseRIC_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseRIC_tags_1)
+		/sizeof(asn_DEF_CauseRIC_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseRIC_constr_1, &asn_PER_type_CauseRIC_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseRIC_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseRICservice.c b/e2ap/lib/CauseRICservice.c
new file mode 100644
index 0000000..c2cbccb
--- /dev/null
+++ b/e2ap/lib/CauseRICservice.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseRICservice.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseRICservice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseRICservice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseRICservice_value2enum_1[] = {
+	{ 0,	21,	"function-not-required" },
+	{ 1,	19,	"excessive-functions" },
+	{ 2,	18,	"ric-resource-limit" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseRICservice_enum2value_1[] = {
+	1,	/* excessive-functions(1) */
+	0,	/* function-not-required(0) */
+	2	/* ric-resource-limit(2) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseRICservice_specs_1 = {
+	asn_MAP_CauseRICservice_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseRICservice_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseRICservice_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseRICservice = {
+	"CauseRICservice",
+	"CauseRICservice",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseRICservice_tags_1,
+	sizeof(asn_DEF_CauseRICservice_tags_1)
+		/sizeof(asn_DEF_CauseRICservice_tags_1[0]), /* 1 */
+	asn_DEF_CauseRICservice_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseRICservice_tags_1)
+		/sizeof(asn_DEF_CauseRICservice_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseRICservice_constr_1, &asn_PER_type_CauseRICservice_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseRICservice_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseTransport.c b/e2ap/lib/CauseTransport.c
new file mode 100644
index 0000000..a0a5f38
--- /dev/null
+++ b/e2ap/lib/CauseTransport.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseTransport.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseTransport_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseTransport_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseTransport_value2enum_1[] = {
+	{ 0,	11,	"unspecified" },
+	{ 1,	30,	"transport-resource-unavailable" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseTransport_enum2value_1[] = {
+	1,	/* transport-resource-unavailable(1) */
+	0	/* unspecified(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseTransport_specs_1 = {
+	asn_MAP_CauseTransport_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseTransport_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseTransport_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseTransport = {
+	"CauseTransport",
+	"CauseTransport",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseTransport_tags_1,
+	sizeof(asn_DEF_CauseTransport_tags_1)
+		/sizeof(asn_DEF_CauseTransport_tags_1[0]), /* 1 */
+	asn_DEF_CauseTransport_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseTransport_tags_1)
+		/sizeof(asn_DEF_CauseTransport_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseTransport_constr_1, &asn_PER_type_CauseTransport_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseTransport_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/Criticality.c b/e2ap/lib/Criticality.c
new file mode 100644
index 0000000..9bfe1ca
--- /dev/null
+++ b/e2ap/lib/Criticality.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "Criticality.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_Criticality_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_Criticality_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_Criticality_value2enum_1[] = {
+	{ 0,	6,	"reject" },
+	{ 1,	6,	"ignore" },
+	{ 2,	6,	"notify" }
+};
+static const unsigned int asn_MAP_Criticality_enum2value_1[] = {
+	1,	/* ignore(1) */
+	2,	/* notify(2) */
+	0	/* reject(0) */
+};
+const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1 = {
+	asn_MAP_Criticality_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_Criticality_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	0,	/* Enumeration is not extensible */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_Criticality_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Criticality = {
+	"Criticality",
+	"Criticality",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_Criticality_tags_1,
+	sizeof(asn_DEF_Criticality_tags_1)
+		/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
+	asn_DEF_Criticality_tags_1,	/* Same as above */
+	sizeof(asn_DEF_Criticality_tags_1)
+		/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
+	{ &asn_OER_type_Criticality_constr_1, &asn_PER_type_Criticality_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_Criticality_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CriticalityDiagnostics-IE-Item.c b/e2ap/lib/CriticalityDiagnostics-IE-Item.c
new file mode 100644
index 0000000..d950a0c
--- /dev/null
+++ b/e2ap/lib/CriticalityDiagnostics-IE-Item.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CriticalityDiagnostics-IE-Item.h"
+
+asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, iECriticality),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"iECriticality"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, iE_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"iE-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, typeOfError),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_TypeOfError,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"typeOfError"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_CriticalityDiagnostics_IE_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iECriticality */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* iE-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* typeOfError */
+};
+asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_IE_Item_specs_1 = {
+	sizeof(struct CriticalityDiagnostics_IE_Item),
+	offsetof(struct CriticalityDiagnostics_IE_Item, _asn_ctx),
+	asn_MAP_CriticalityDiagnostics_IE_Item_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_Item = {
+	"CriticalityDiagnostics-IE-Item",
+	"CriticalityDiagnostics-IE-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_CriticalityDiagnostics_IE_Item_tags_1,
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[0]), /* 1 */
+	asn_DEF_CriticalityDiagnostics_IE_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_CriticalityDiagnostics_IE_Item_1,
+	3,	/* Elements count */
+	&asn_SPC_CriticalityDiagnostics_IE_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CriticalityDiagnostics-IE-List.c b/e2ap/lib/CriticalityDiagnostics-IE-List.c
new file mode 100644
index 0000000..29ae2dd
--- /dev/null
+++ b/e2ap/lib/CriticalityDiagnostics-IE-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CriticalityDiagnostics-IE-List.h"
+
+#include "CriticalityDiagnostics-IE-Item.h"
+static asn_oer_constraints_t asn_OER_type_CriticalityDiagnostics_IE_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..256)) */};
+asn_per_constraints_t asn_PER_type_CriticalityDiagnostics_IE_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 8,  8,  1,  256 }	/* (SIZE(1..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics_IE_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_IE_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_CriticalityDiagnostics_IE_List_specs_1 = {
+	sizeof(struct CriticalityDiagnostics_IE_List),
+	offsetof(struct CriticalityDiagnostics_IE_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_List = {
+	"CriticalityDiagnostics-IE-List",
+	"CriticalityDiagnostics-IE-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_CriticalityDiagnostics_IE_List_tags_1,
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1[0]), /* 1 */
+	asn_DEF_CriticalityDiagnostics_IE_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CriticalityDiagnostics_IE_List_constr_1, &asn_PER_type_CriticalityDiagnostics_IE_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_CriticalityDiagnostics_IE_List_1,
+	1,	/* Single element */
+	&asn_SPC_CriticalityDiagnostics_IE_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CriticalityDiagnostics.c b/e2ap/lib/CriticalityDiagnostics.c
new file mode 100644
index 0000000..c07926c
--- /dev/null
+++ b/e2ap/lib/CriticalityDiagnostics.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CriticalityDiagnostics.h"
+
+#include "RICrequestID.h"
+#include "CriticalityDiagnostics-IE-List.h"
+asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_1[] = {
+	{ ATF_POINTER, 5, offsetof(struct CriticalityDiagnostics, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_POINTER, 4, offsetof(struct CriticalityDiagnostics, triggeringMessage),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_TriggeringMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"triggeringMessage"
+		},
+	{ ATF_POINTER, 3, offsetof(struct CriticalityDiagnostics, procedureCriticality),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"procedureCriticality"
+		},
+	{ ATF_POINTER, 2, offsetof(struct CriticalityDiagnostics, ricRequestorID),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricRequestorID"
+		},
+	{ ATF_POINTER, 1, offsetof(struct CriticalityDiagnostics, iEsCriticalityDiagnostics),
+		(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CriticalityDiagnostics_IE_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"iEsCriticalityDiagnostics"
+		},
+};
+static const int asn_MAP_CriticalityDiagnostics_oms_1[] = { 0, 1, 2, 3, 4 };
+static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_CriticalityDiagnostics_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* triggeringMessage */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* procedureCriticality */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ricRequestorID */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iEsCriticalityDiagnostics */
+};
+asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_specs_1 = {
+	sizeof(struct CriticalityDiagnostics),
+	offsetof(struct CriticalityDiagnostics, _asn_ctx),
+	asn_MAP_CriticalityDiagnostics_tag2el_1,
+	5,	/* Count of tags in the map */
+	asn_MAP_CriticalityDiagnostics_oms_1,	/* Optional members */
+	5, 0,	/* Root/Additions */
+	5,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics = {
+	"CriticalityDiagnostics",
+	"CriticalityDiagnostics",
+	&asn_OP_SEQUENCE,
+	asn_DEF_CriticalityDiagnostics_tags_1,
+	sizeof(asn_DEF_CriticalityDiagnostics_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_tags_1[0]), /* 1 */
+	asn_DEF_CriticalityDiagnostics_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CriticalityDiagnostics_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_CriticalityDiagnostics_1,
+	5,	/* Elements count */
+	&asn_SPC_CriticalityDiagnostics_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2AP-PDU.c b/e2ap/lib/E2AP-PDU.c
new file mode 100644
index 0000000..c8386c2
--- /dev/null
+++ b/e2ap/lib/E2AP-PDU.c
@@ -0,0 +1,78 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2AP-PDU.h"
+
+#include "InitiatingMessage.h"
+#include "SuccessfulOutcome.h"
+#include "UnsuccessfulOutcome.h"
+static asn_oer_constraints_t asn_OER_type_E2AP_PDU_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_E2AP_PDU_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_E2AP_PDU_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.initiatingMessage),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_InitiatingMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"initiatingMessage"
+		},
+	{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.successfulOutcome),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_SuccessfulOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"successfulOutcome"
+		},
+	{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.unsuccessfulOutcome),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_UnsuccessfulOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"unsuccessfulOutcome"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2AP_PDU_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* initiatingMessage */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* successfulOutcome */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* unsuccessfulOutcome */
+};
+static asn_CHOICE_specifics_t asn_SPC_E2AP_PDU_specs_1 = {
+	sizeof(struct E2AP_PDU),
+	offsetof(struct E2AP_PDU, _asn_ctx),
+	offsetof(struct E2AP_PDU, present),
+	sizeof(((struct E2AP_PDU *)0)->present),
+	asn_MAP_E2AP_PDU_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0,
+	3	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_E2AP_PDU = {
+	"E2AP-PDU",
+	"E2AP-PDU",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_E2AP_PDU_constr_1, &asn_PER_type_E2AP_PDU_constr_1, CHOICE_constraint },
+	asn_MBR_E2AP_PDU_1,
+	3,	/* Elements count */
+	&asn_SPC_E2AP_PDU_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2setupFailure.c b/e2ap/lib/E2setupFailure.c
new file mode 100644
index 0000000..1b0bd35
--- /dev/null
+++ b/e2ap/lib/E2setupFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2setupFailure.h"
+
+static asn_TYPE_member_t asn_MBR_E2setupFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P13,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2setupFailure_specs_1 = {
+	sizeof(struct E2setupFailure),
+	offsetof(struct E2setupFailure, _asn_ctx),
+	asn_MAP_E2setupFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupFailure = {
+	"E2setupFailure",
+	"E2setupFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupFailure_tags_1,
+	sizeof(asn_DEF_E2setupFailure_tags_1)
+		/sizeof(asn_DEF_E2setupFailure_tags_1[0]), /* 1 */
+	asn_DEF_E2setupFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2setupFailure_tags_1)
+		/sizeof(asn_DEF_E2setupFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_E2setupFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2setupRequest.c b/e2ap/lib/E2setupRequest.c
new file mode 100644
index 0000000..92fd09b
--- /dev/null
+++ b/e2ap/lib/E2setupRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2setupRequest.h"
+
+static asn_TYPE_member_t asn_MBR_E2setupRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P11,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2setupRequest_specs_1 = {
+	sizeof(struct E2setupRequest),
+	offsetof(struct E2setupRequest, _asn_ctx),
+	asn_MAP_E2setupRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupRequest = {
+	"E2setupRequest",
+	"E2setupRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupRequest_tags_1,
+	sizeof(asn_DEF_E2setupRequest_tags_1)
+		/sizeof(asn_DEF_E2setupRequest_tags_1[0]), /* 1 */
+	asn_DEF_E2setupRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2setupRequest_tags_1)
+		/sizeof(asn_DEF_E2setupRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_E2setupRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2setupResponse.c b/e2ap/lib/E2setupResponse.c
new file mode 100644
index 0000000..b08bc06
--- /dev/null
+++ b/e2ap/lib/E2setupResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2setupResponse.h"
+
+static asn_TYPE_member_t asn_MBR_E2setupResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P12,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2setupResponse_specs_1 = {
+	sizeof(struct E2setupResponse),
+	offsetof(struct E2setupResponse, _asn_ctx),
+	asn_MAP_E2setupResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupResponse = {
+	"E2setupResponse",
+	"E2setupResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupResponse_tags_1,
+	sizeof(asn_DEF_E2setupResponse_tags_1)
+		/sizeof(asn_DEF_E2setupResponse_tags_1[0]), /* 1 */
+	asn_DEF_E2setupResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2setupResponse_tags_1)
+		/sizeof(asn_DEF_E2setupResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_E2setupResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ENB-ID-Choice.c b/e2ap/lib/ENB-ID-Choice.c
new file mode 100644
index 0000000..b95e5eb
--- /dev/null
+++ b/e2ap/lib/ENB-ID-Choice.c
@@ -0,0 +1,192 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ENB-ID-Choice.h"
+
+static int
+memb_enb_ID_macro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_enb_ID_shortmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 18)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_enb_ID_longmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 21)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	18	/* (SIZE(18..18)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  18,  18 }	/* (SIZE(18..18)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	21	/* (SIZE(21..21)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  21,  21 }	/* (SIZE(21..21)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_macro),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_macro_constr_2, &asn_PER_memb_enb_ID_macro_constr_2,  memb_enb_ID_macro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-macro"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_shortmacro),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_shortmacro_constr_3, &asn_PER_memb_enb_ID_shortmacro_constr_3,  memb_enb_ID_shortmacro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-shortmacro"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_longmacro),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_longmacro_constr_4, &asn_PER_memb_enb_ID_longmacro_constr_4,  memb_enb_ID_longmacro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-longmacro"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_Choice_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* enb-ID-macro */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* enb-ID-shortmacro */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* enb-ID-longmacro */
+};
+asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1 = {
+	sizeof(struct ENB_ID_Choice),
+	offsetof(struct ENB_ID_Choice, _asn_ctx),
+	offsetof(struct ENB_ID_Choice, present),
+	sizeof(((struct ENB_ID_Choice *)0)->present),
+	asn_MAP_ENB_ID_Choice_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0,
+	3	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice = {
+	"ENB-ID-Choice",
+	"ENB-ID-Choice",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENB_ID_Choice_constr_1, &asn_PER_type_ENB_ID_Choice_constr_1, CHOICE_constraint },
+	asn_MBR_ENB_ID_Choice_1,
+	3,	/* Elements count */
+	&asn_SPC_ENB_ID_Choice_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ENB-ID.c b/e2ap/lib/ENB-ID.c
new file mode 100644
index 0000000..96b8cb5
--- /dev/null
+++ b/e2ap/lib/ENB-ID.c
@@ -0,0 +1,241 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ENB-ID.h"
+
+static int
+memb_macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_home_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 28)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_short_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 18)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_long_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 21)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	28	/* (SIZE(28..28)) */};
+static asn_per_constraints_t asn_PER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  28,  28 }	/* (SIZE(28..28)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	18	/* (SIZE(18..18)) */};
+static asn_per_constraints_t asn_PER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  18,  18 }	/* (SIZE(18..18)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
+	{ 0, 0 },
+	21	/* (SIZE(21..21)) */};
+static asn_per_constraints_t asn_PER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  21,  21 }	/* (SIZE(21..21)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENB_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENB_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_macro_eNB_ID_constr_2, &asn_PER_memb_macro_eNB_ID_constr_2,  memb_macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"macro-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.home_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_home_eNB_ID_constr_3, &asn_PER_memb_home_eNB_ID_constr_3,  memb_home_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"home-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.short_Macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_short_Macro_eNB_ID_constr_5, &asn_PER_memb_short_Macro_eNB_ID_constr_5,  memb_short_Macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"short-Macro-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.long_Macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_long_Macro_eNB_ID_constr_6, &asn_PER_memb_long_Macro_eNB_ID_constr_6,  memb_long_Macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"long-Macro-eNB-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* macro-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* home-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* short-Macro-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* long-Macro-eNB-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1 = {
+	sizeof(struct ENB_ID),
+	offsetof(struct ENB_ID, _asn_ctx),
+	offsetof(struct ENB_ID, present),
+	sizeof(((struct ENB_ID *)0)->present),
+	asn_MAP_ENB_ID_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	2	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENB_ID = {
+	"ENB-ID",
+	"ENB-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENB_ID_constr_1, &asn_PER_type_ENB_ID_constr_1, CHOICE_constraint },
+	asn_MBR_ENB_ID_1,
+	4,	/* Elements count */
+	&asn_SPC_ENB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ENGNB-ID.c b/e2ap/lib/ENGNB-ID.c
new file mode 100644
index 0000000..4bfdbd8
--- /dev/null
+++ b/e2ap/lib/ENGNB-ID.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ENGNB-ID.h"
+
+static int
+memb_gNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size >= 22 && size <= 32)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_gNB_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(22..32)) */};
+static asn_per_constraints_t asn_PER_memb_gNB_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  22,  32 }	/* (SIZE(22..32)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENGNB_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENGNB_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENGNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENGNB_ID, choice.gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_gNB_ID_constr_2, &asn_PER_memb_gNB_ID_constr_2,  memb_gNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"gNB-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENGNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gNB-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_ENGNB_ID_specs_1 = {
+	sizeof(struct ENGNB_ID),
+	offsetof(struct ENGNB_ID, _asn_ctx),
+	offsetof(struct ENGNB_ID, present),
+	sizeof(((struct ENGNB_ID *)0)->present),
+	asn_MAP_ENGNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENGNB_ID = {
+	"ENGNB-ID",
+	"ENGNB-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENGNB_ID_constr_1, &asn_PER_type_ENGNB_ID_constr_1, CHOICE_constraint },
+	asn_MBR_ENGNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_ENGNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ErrorIndication.c b/e2ap/lib/ErrorIndication.c
new file mode 100644
index 0000000..a47c6e0
--- /dev/null
+++ b/e2ap/lib/ErrorIndication.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ErrorIndication.h"
+
+static asn_TYPE_member_t asn_MBR_ErrorIndication_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P10,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ErrorIndication_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ErrorIndication_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ErrorIndication_specs_1 = {
+	sizeof(struct ErrorIndication),
+	offsetof(struct ErrorIndication, _asn_ctx),
+	asn_MAP_ErrorIndication_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ErrorIndication = {
+	"ErrorIndication",
+	"ErrorIndication",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ErrorIndication_tags_1,
+	sizeof(asn_DEF_ErrorIndication_tags_1)
+		/sizeof(asn_DEF_ErrorIndication_tags_1[0]), /* 1 */
+	asn_DEF_ErrorIndication_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ErrorIndication_tags_1)
+		/sizeof(asn_DEF_ErrorIndication_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ErrorIndication_1,
+	1,	/* Elements count */
+	&asn_SPC_ErrorIndication_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GNB-CU-UP-ID.c b/e2ap/lib/GNB-CU-UP-ID.c
new file mode 100644
index 0000000..8f960e2
--- /dev/null
+++ b/e2ap/lib/GNB-CU-UP-ID.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GNB-CU-UP-ID.h"
+
+int
+GNB_CU_UP_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 68719476735)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_GNB_CU_UP_ID_constr_1 CC_NOTUSED = {
+	{ 8, 1 }	/* (0..68719476735) */,
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_CU_UP_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 36, -1,  0,  68719476735 }	/* (0..68719476735) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_GNB_CU_UP_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_CU_UP_ID = {
+	"GNB-CU-UP-ID",
+	"GNB-CU-UP-ID",
+	&asn_OP_INTEGER,
+	asn_DEF_GNB_CU_UP_ID_tags_1,
+	sizeof(asn_DEF_GNB_CU_UP_ID_tags_1)
+		/sizeof(asn_DEF_GNB_CU_UP_ID_tags_1[0]), /* 1 */
+	asn_DEF_GNB_CU_UP_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GNB_CU_UP_ID_tags_1)
+		/sizeof(asn_DEF_GNB_CU_UP_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_GNB_CU_UP_ID_constr_1, &asn_PER_type_GNB_CU_UP_ID_constr_1, GNB_CU_UP_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/GNB-DU-ID.c b/e2ap/lib/GNB-DU-ID.c
new file mode 100644
index 0000000..6c0940d
--- /dev/null
+++ b/e2ap/lib/GNB-DU-ID.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GNB-DU-ID.h"
+
+int
+GNB_DU_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 68719476735)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_GNB_DU_ID_constr_1 CC_NOTUSED = {
+	{ 8, 1 }	/* (0..68719476735) */,
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_DU_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 36, -1,  0,  68719476735 }	/* (0..68719476735) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_GNB_DU_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_DU_ID = {
+	"GNB-DU-ID",
+	"GNB-DU-ID",
+	&asn_OP_INTEGER,
+	asn_DEF_GNB_DU_ID_tags_1,
+	sizeof(asn_DEF_GNB_DU_ID_tags_1)
+		/sizeof(asn_DEF_GNB_DU_ID_tags_1[0]), /* 1 */
+	asn_DEF_GNB_DU_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GNB_DU_ID_tags_1)
+		/sizeof(asn_DEF_GNB_DU_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_GNB_DU_ID_constr_1, &asn_PER_type_GNB_DU_ID_constr_1, GNB_DU_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/GNB-ID-Choice.c b/e2ap/lib/GNB-ID-Choice.c
new file mode 100644
index 0000000..085a942
--- /dev/null
+++ b/e2ap/lib/GNB-ID-Choice.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GNB-ID-Choice.h"
+
+static int
+memb_gnb_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size >= 22 && size <= 32)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_gnb_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(22..32)) */};
+static asn_per_constraints_t asn_PER_memb_gnb_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  22,  32 }	/* (SIZE(22..32)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_GNB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GNB_ID_Choice_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GNB_ID_Choice, choice.gnb_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_gnb_ID_constr_2, &asn_PER_memb_gnb_ID_constr_2,  memb_gnb_ID_constraint_1 },
+		0, 0, /* No default value */
+		"gnb-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_GNB_ID_Choice_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gnb-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_GNB_ID_Choice_specs_1 = {
+	sizeof(struct GNB_ID_Choice),
+	offsetof(struct GNB_ID_Choice, _asn_ctx),
+	offsetof(struct GNB_ID_Choice, present),
+	sizeof(((struct GNB_ID_Choice *)0)->present),
+	asn_MAP_GNB_ID_Choice_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_ID_Choice = {
+	"GNB-ID-Choice",
+	"GNB-ID-Choice",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_GNB_ID_Choice_constr_1, &asn_PER_type_GNB_ID_Choice_constr_1, CHOICE_constraint },
+	asn_MBR_GNB_ID_Choice_1,
+	1,	/* Elements count */
+	&asn_SPC_GNB_ID_Choice_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-ID.c b/e2ap/lib/GlobalE2node-ID.c
new file mode 100644
index 0000000..13a8295
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-ID.c
@@ -0,0 +1,89 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-ID.h"
+
+#include "GlobalE2node-gNB-ID.h"
+#include "GlobalE2node-en-gNB-ID.h"
+#include "GlobalE2node-ng-eNB-ID.h"
+#include "GlobalE2node-eNB-ID.h"
+static asn_oer_constraints_t asn_OER_type_GlobalE2node_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_GlobalE2node_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GlobalE2node_ID_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.gNB),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.en_gNB),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_en_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"en-gNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.ng_eNB),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_ng_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ng-eNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.eNB),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eNB"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* en-gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ng-eNB */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* eNB */
+};
+asn_CHOICE_specifics_t asn_SPC_GlobalE2node_ID_specs_1 = {
+	sizeof(struct GlobalE2node_ID),
+	offsetof(struct GlobalE2node_ID, _asn_ctx),
+	offsetof(struct GlobalE2node_ID, present),
+	sizeof(((struct GlobalE2node_ID *)0)->present),
+	asn_MAP_GlobalE2node_ID_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	4	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ID = {
+	"GlobalE2node-ID",
+	"GlobalE2node-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_GlobalE2node_ID_constr_1, &asn_PER_type_GlobalE2node_ID_constr_1, CHOICE_constraint },
+	asn_MBR_GlobalE2node_ID_1,
+	4,	/* Elements count */
+	&asn_SPC_GlobalE2node_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-eNB-ID.c b/e2ap/lib/GlobalE2node-eNB-ID.c
new file mode 100644
index 0000000..7cb93f1
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-eNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_eNB_ID, global_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalENB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_eNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_eNB_ID),
+	offsetof(struct GlobalE2node_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_eNB_ID = {
+	"GlobalE2node-eNB-ID",
+	"GlobalE2node-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-en-gNB-ID.c b/e2ap/lib/GlobalE2node-en-gNB-ID.c
new file mode 100644
index 0000000..6444325
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-en-gNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-en-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_en_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_en_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalenGNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_en_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_en_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-gNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_en_gNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_en_gNB_ID),
+	offsetof(struct GlobalE2node_en_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_en_gNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_en_gNB_ID = {
+	"GlobalE2node-en-gNB-ID",
+	"GlobalE2node-en-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_en_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_en_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_en_gNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_en_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-gNB-ID.c b/e2ap/lib/GlobalE2node-gNB-ID.c
new file mode 100644
index 0000000..31bf024
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-gNB-ID.c
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalgNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+	{ ATF_POINTER, 2, offsetof(struct GlobalE2node_gNB_ID, gNB_CU_UP_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_CU_UP_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-CU-UP-ID"
+		},
+	{ ATF_POINTER, 1, offsetof(struct GlobalE2node_gNB_ID, gNB_DU_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_DU_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-DU-ID"
+		},
+};
+static const int asn_MAP_GlobalE2node_gNB_ID_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* global-gNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gNB-CU-UP-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* gNB-DU-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_gNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_gNB_ID),
+	offsetof(struct GlobalE2node_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_gNB_ID_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_GlobalE2node_gNB_ID_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_gNB_ID = {
+	"GlobalE2node-gNB-ID",
+	"GlobalE2node-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_gNB_ID_1,
+	3,	/* Elements count */
+	&asn_SPC_GlobalE2node_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-ng-eNB-ID.c b/e2ap/lib/GlobalE2node-ng-eNB-ID.c
new file mode 100644
index 0000000..b3bb491
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-ng-eNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-ng-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_ng_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_ng_eNB_ID, global_ng_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalngeNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-ng-eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_ng_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-ng-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_ng_eNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_ng_eNB_ID),
+	offsetof(struct GlobalE2node_ng_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_ng_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ng_eNB_ID = {
+	"GlobalE2node-ng-eNB-ID",
+	"GlobalE2node-ng-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_ng_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_ng_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_ng_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_ng_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalENB-ID.c b/e2ap/lib/GlobalENB-ID.c
new file mode 100644
index 0000000..9c34820
--- /dev/null
+++ b/e2ap/lib/GlobalENB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalENB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalENB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalENB_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalENB_ID, eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalENB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalENB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalENB_ID_specs_1 = {
+	sizeof(struct GlobalENB_ID),
+	offsetof(struct GlobalENB_ID, _asn_ctx),
+	asn_MAP_GlobalENB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalENB_ID = {
+	"GlobalENB-ID",
+	"GlobalENB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalENB_ID_tags_1,
+	sizeof(asn_DEF_GlobalENB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalENB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalENB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalENB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalENB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalENB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalENB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalRIC-ID.c b/e2ap/lib/GlobalRIC-ID.c
new file mode 100644
index 0000000..c027c79
--- /dev/null
+++ b/e2ap/lib/GlobalRIC-ID.c
@@ -0,0 +1,99 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalRIC-ID.h"
+
+static int
+memb_ric_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_ric_ID_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_ric_ID_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GlobalRIC_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalRIC_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalRIC_ID, ric_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_ric_ID_constr_3, &asn_PER_memb_ric_ID_constr_3,  memb_ric_ID_constraint_1 },
+		0, 0, /* No default value */
+		"ric-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalRIC_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalRIC_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ric-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalRIC_ID_specs_1 = {
+	sizeof(struct GlobalRIC_ID),
+	offsetof(struct GlobalRIC_ID, _asn_ctx),
+	asn_MAP_GlobalRIC_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalRIC_ID = {
+	"GlobalRIC-ID",
+	"GlobalRIC-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalRIC_ID_tags_1,
+	sizeof(asn_DEF_GlobalRIC_ID_tags_1)
+		/sizeof(asn_DEF_GlobalRIC_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalRIC_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalRIC_ID_tags_1)
+		/sizeof(asn_DEF_GlobalRIC_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalRIC_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalRIC_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalenGNB-ID.c b/e2ap/lib/GlobalenGNB-ID.c
new file mode 100644
index 0000000..2599aae
--- /dev/null
+++ b/e2ap/lib/GlobalenGNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalenGNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalenGNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalenGNB_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalenGNB_ID, gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENGNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalenGNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalenGNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* gNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalenGNB_ID_specs_1 = {
+	sizeof(struct GlobalenGNB_ID),
+	offsetof(struct GlobalenGNB_ID, _asn_ctx),
+	asn_MAP_GlobalenGNB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalenGNB_ID = {
+	"GlobalenGNB-ID",
+	"GlobalenGNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalenGNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalenGNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalenGNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalenGNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalenGNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalenGNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalenGNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalenGNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalgNB-ID.c b/e2ap/lib/GlobalgNB-ID.c
new file mode 100644
index 0000000..2150089
--- /dev/null
+++ b/e2ap/lib/GlobalgNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalgNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalgNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalgNB_ID, plmn_id),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"plmn-id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalgNB_ID, gnb_id),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_GNB_ID_Choice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gnb-id"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalgNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalgNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-id */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* gnb-id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalgNB_ID_specs_1 = {
+	sizeof(struct GlobalgNB_ID),
+	offsetof(struct GlobalgNB_ID, _asn_ctx),
+	asn_MAP_GlobalgNB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalgNB_ID = {
+	"GlobalgNB-ID",
+	"GlobalgNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalgNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalgNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalgNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalgNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalgNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalgNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalgNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalgNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalngeNB-ID.c b/e2ap/lib/GlobalngeNB-ID.c
new file mode 100644
index 0000000..97d1f41
--- /dev/null
+++ b/e2ap/lib/GlobalngeNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalngeNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalngeNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalngeNB_ID, plmn_id),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"plmn-id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalngeNB_ID, enb_id),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENB_ID_Choice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"enb-id"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalngeNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalngeNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-id */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* enb-id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalngeNB_ID_specs_1 = {
+	sizeof(struct GlobalngeNB_ID),
+	offsetof(struct GlobalngeNB_ID, _asn_ctx),
+	asn_MAP_GlobalngeNB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalngeNB_ID = {
+	"GlobalngeNB-ID",
+	"GlobalngeNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalngeNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalngeNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalngeNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalngeNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalngeNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalngeNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalngeNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalngeNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/INTEGER.c b/e2ap/lib/INTEGER.c
new file mode 100644
index 0000000..2a2f4d7
--- /dev/null
+++ b/e2ap/lib/INTEGER.c
@@ -0,0 +1,1735 @@
+/*-
+ * Copyright (c) 2003-2014 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <INTEGER.h>
+#include <asn_codecs_prim.h>	/* Encoder and decoder of a primitive type */
+#include <errno.h>
+
+/*
+ * INTEGER basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_INTEGER_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_operation_t asn_OP_INTEGER = {
+	INTEGER_free,
+	INTEGER_print,
+	INTEGER_compare,
+	ber_decode_primitive,
+	INTEGER_encode_der,
+	INTEGER_decode_xer,
+	INTEGER_encode_xer,
+#ifdef  ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	INTEGER_decode_oer,     /* OER decoder */
+	INTEGER_encode_oer,     /* Canonical OER encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	INTEGER_decode_uper,	/* Unaligned PER decoder */
+	INTEGER_encode_uper,	/* Unaligned PER encoder */
+	INTEGER_decode_aper,	/* Aligned PER decoder */
+	INTEGER_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	INTEGER_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_INTEGER = {
+	"INTEGER",
+	"INTEGER",
+	&asn_OP_INTEGER,
+	asn_DEF_INTEGER_tags,
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
+	asn_DEF_INTEGER_tags,	/* Same as above */
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+/*
+ * Encode INTEGER type using DER.
+ */
+asn_enc_rval_t
+INTEGER_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                   void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+    asn_enc_rval_t rval;
+    INTEGER_t effective_integer;
+
+	ASN_DEBUG("%s %s as INTEGER (tm=%d)",
+		cb?"Encoding":"Estimating", td->name, tag_mode);
+
+	/*
+	 * Canonicalize integer in the buffer.
+	 * (Remove too long sign extension, remove some first 0x00 bytes)
+	 */
+	if(st->buf) {
+		uint8_t *buf = st->buf;
+		uint8_t *end1 = buf + st->size - 1;
+		int shift;
+
+		/* Compute the number of superfluous leading bytes */
+		for(; buf < end1; buf++) {
+			/*
+			 * If the contents octets of an integer value encoding
+			 * consist of more than one octet, then the bits of the
+			 * first octet and bit 8 of the second octet:
+			 * a) shall not all be ones; and
+			 * b) shall not all be zero.
+			 */
+			switch(*buf) {
+			case 0x00: if((buf[1] & 0x80) == 0)
+					continue;
+				break;
+			case 0xff: if((buf[1] & 0x80))
+					continue;
+				break;
+			}
+			break;
+		}
+
+		/* Remove leading superfluous bytes from the integer */
+		shift = buf - st->buf;
+		if(shift) {
+            union {
+                const uint8_t *c_buf;
+                uint8_t *nc_buf;
+            } unconst;
+            unconst.c_buf = st->buf;
+            effective_integer.buf = unconst.nc_buf + shift;
+            effective_integer.size = st->size - shift;
+
+            st = &effective_integer;
+        }
+    }
+
+    rval = der_encode_primitive(td, st, tag_mode, tag, cb, app_key);
+    if(rval.structure_ptr == &effective_integer) {
+        rval.structure_ptr = sptr;
+    }
+    return rval;
+}
+
+static const asn_INTEGER_enum_map_t *INTEGER_map_enum2value(
+    const asn_INTEGER_specifics_t *specs, const char *lstart,
+    const char *lstop);
+
+/*
+ * INTEGER specific human-readable output.
+ */
+static ssize_t
+INTEGER__dump(const asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+	char scratch[32];
+	uint8_t *buf = st->buf;
+	uint8_t *buf_end = st->buf + st->size;
+	intmax_t value;
+	ssize_t wrote = 0;
+	char *p;
+	int ret;
+
+	if(specs && specs->field_unsigned)
+		ret = asn_INTEGER2umax(st, (uintmax_t *)&value);
+	else
+		ret = asn_INTEGER2imax(st, &value);
+
+	/* Simple case: the integer size is small */
+	if(ret == 0) {
+		const asn_INTEGER_enum_map_t *el;
+		el = (value >= 0 || !specs || !specs->field_unsigned)
+			? INTEGER_map_value2enum(specs, value) : 0;
+		if(el) {
+			if(plainOrXER == 0)
+				return asn__format_to_callback(cb, app_key,
+					"%" ASN_PRIdMAX " (%s)", value, el->enum_name);
+			else
+				return asn__format_to_callback(cb, app_key,
+					"<%s/>", el->enum_name);
+		} else if(plainOrXER && specs && specs->strict_enumeration) {
+			ASN_DEBUG("ASN.1 forbids dealing with "
+				"unknown value of ENUMERATED type");
+			errno = EPERM;
+			return -1;
+		} else {
+            return asn__format_to_callback(cb, app_key,
+                                           (specs && specs->field_unsigned)
+                                               ? "%" ASN_PRIuMAX
+                                               : "%" ASN_PRIdMAX,
+                                           value);
+        }
+	} else if(plainOrXER && specs && specs->strict_enumeration) {
+		/*
+		 * Here and earlier, we cannot encode the ENUMERATED values
+		 * if there is no corresponding identifier.
+		 */
+		ASN_DEBUG("ASN.1 forbids dealing with "
+			"unknown value of ENUMERATED type");
+		errno = EPERM;
+		return -1;
+	}
+
+	/* Output in the long xx:yy:zz... format */
+	/* TODO: replace with generic algorithm (Knuth TAOCP Vol 2, 4.3.1) */
+	for(p = scratch; buf < buf_end; buf++) {
+		const char * const h2c = "0123456789ABCDEF";
+		if((p - scratch) >= (ssize_t)(sizeof(scratch) - 4)) {
+			/* Flush buffer */
+			if(cb(scratch, p - scratch, app_key) < 0)
+				return -1;
+			wrote += p - scratch;
+			p = scratch;
+		}
+		*p++ = h2c[*buf >> 4];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x3a;	/* ":" */
+	}
+	if(p != scratch)
+		p--;	/* Remove the last ":" */
+
+	wrote += p - scratch;
+	return (cb(scratch, p - scratch, app_key) < 0) ? -1 : wrote;
+}
+
+/*
+ * INTEGER specific human-readable output.
+ */
+int
+INTEGER_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+              asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+	ssize_t ret;
+
+	(void)ilevel;
+
+	if(!st || !st->buf)
+		ret = cb("<absent>", 8, app_key);
+	else
+		ret = INTEGER__dump(td, st, cb, app_key, 0);
+
+	return (ret < 0) ? -1 : 0;
+}
+
+struct e2v_key {
+	const char *start;
+	const char *stop;
+	const asn_INTEGER_enum_map_t *vemap;
+	const unsigned int *evmap;
+};
+static int
+INTEGER__compar_enum2value(const void *kp, const void *am) {
+	const struct e2v_key *key = (const struct e2v_key *)kp;
+	const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
+	const char *ptr, *end, *name;
+
+	/* Remap the element (sort by different criterion) */
+	el = key->vemap + key->evmap[el - key->vemap];
+
+	/* Compare strings */
+	for(ptr = key->start, end = key->stop, name = el->enum_name;
+			ptr < end; ptr++, name++) {
+		if(*ptr != *name || !*name)
+			return *(const unsigned char *)ptr
+				- *(const unsigned char *)name;
+	}
+	return name[0] ? -1 : 0;
+}
+
+static const asn_INTEGER_enum_map_t *
+INTEGER_map_enum2value(const asn_INTEGER_specifics_t *specs, const char *lstart,
+                       const char *lstop) {
+    const asn_INTEGER_enum_map_t *el_found;
+	int count = specs ? specs->map_count : 0;
+	struct e2v_key key;
+	const char *lp;
+
+	if(!count) return NULL;
+
+	/* Guaranteed: assert(lstart < lstop); */
+	/* Figure out the tag name */
+	for(lstart++, lp = lstart; lp < lstop; lp++) {
+		switch(*lp) {
+		case 9: case 10: case 11: case 12: case 13: case 32: /* WSP */
+		case 0x2f: /* '/' */ case 0x3e: /* '>' */
+			break;
+		default:
+			continue;
+		}
+		break;
+	}
+	if(lp == lstop) return NULL;	/* No tag found */
+	lstop = lp;
+
+	key.start = lstart;
+	key.stop = lstop;
+	key.vemap = specs->value2enum;
+	key.evmap = specs->enum2value;
+	el_found = (asn_INTEGER_enum_map_t *)bsearch(&key,
+		specs->value2enum, count, sizeof(specs->value2enum[0]),
+		INTEGER__compar_enum2value);
+	if(el_found) {
+		/* Remap enum2value into value2enum */
+		el_found = key.vemap + key.evmap[el_found - key.vemap];
+	}
+	return el_found;
+}
+
+static int
+INTEGER__compar_value2enum(const void *kp, const void *am) {
+	long a = *(const long *)kp;
+	const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
+	long b = el->nat_value;
+	if(a < b) return -1;
+	else if(a == b) return 0;
+	else return 1;
+}
+
+const asn_INTEGER_enum_map_t *
+INTEGER_map_value2enum(const asn_INTEGER_specifics_t *specs, long value) {
+	int count = specs ? specs->map_count : 0;
+	if(!count) return 0;
+	return (asn_INTEGER_enum_map_t *)bsearch(&value, specs->value2enum,
+		count, sizeof(specs->value2enum[0]),
+		INTEGER__compar_value2enum);
+}
+
+static int
+INTEGER_st_prealloc(INTEGER_t *st, int min_size) {
+	void *p = MALLOC(min_size + 1);
+	if(p) {
+		void *b = st->buf;
+		st->size = 0;
+		st->buf = p;
+		FREEMEM(b);
+		return 0;
+	} else {
+		return -1;
+	}
+}
+
+/*
+ * Decode the chunk of XML text encoding INTEGER.
+ */
+static enum xer_pbd_rval
+INTEGER__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
+                         const void *chunk_buf, size_t chunk_size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    INTEGER_t *st = (INTEGER_t *)sptr;
+	intmax_t dec_value;
+	intmax_t hex_value = 0;
+	const char *lp;
+	const char *lstart = (const char *)chunk_buf;
+	const char *lstop = lstart + chunk_size;
+	enum {
+		ST_LEADSPACE,
+		ST_SKIPSPHEX,
+		ST_WAITDIGITS,
+		ST_DIGITS,
+		ST_DIGITS_TRAILSPACE,
+		ST_HEXDIGIT1,
+		ST_HEXDIGIT2,
+		ST_HEXDIGITS_TRAILSPACE,
+		ST_HEXCOLON,
+		ST_END_ENUM,
+		ST_UNEXPECTED
+	} state = ST_LEADSPACE;
+	const char *dec_value_start = 0; /* INVARIANT: always !0 in ST_DIGITS */
+	const char *dec_value_end = 0;
+
+	if(chunk_size)
+		ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x",
+			(long)chunk_size, *lstart, lstop[-1]);
+
+	if(INTEGER_st_prealloc(st, (chunk_size/3) + 1))
+		return XPBD_SYSTEM_FAILURE;
+
+	/*
+	 * We may have received a tag here. It will be processed inline.
+	 * Use strtoul()-like code and serialize the result.
+	 */
+	for(lp = lstart; lp < lstop; lp++) {
+		int lv = *lp;
+		switch(lv) {
+		case 0x09: case 0x0a: case 0x0d: case 0x20:
+			switch(state) {
+			case ST_LEADSPACE:
+			case ST_DIGITS_TRAILSPACE:
+			case ST_HEXDIGITS_TRAILSPACE:
+			case ST_SKIPSPHEX:
+				continue;
+			case ST_DIGITS:
+				dec_value_end = lp;
+				state = ST_DIGITS_TRAILSPACE;
+				continue;
+			case ST_HEXCOLON:
+				state = ST_HEXDIGITS_TRAILSPACE;
+				continue;
+			default:
+				break;
+			}
+			break;
+		case 0x2d:	/* '-' */
+			if(state == ST_LEADSPACE) {
+				dec_value = 0;
+				dec_value_start = lp;
+				state = ST_WAITDIGITS;
+				continue;
+			}
+			break;
+		case 0x2b:	/* '+' */
+			if(state == ST_LEADSPACE) {
+				dec_value = 0;
+				dec_value_start = lp;
+				state = ST_WAITDIGITS;
+				continue;
+			}
+			break;
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39:
+			switch(state) {
+			case ST_DIGITS: continue;
+			case ST_SKIPSPHEX:	/* Fall through */
+			case ST_HEXDIGIT1:
+				hex_value = (lv - 0x30) << 4;
+				state = ST_HEXDIGIT2;
+				continue;
+			case ST_HEXDIGIT2:
+				hex_value += (lv - 0x30);
+				state = ST_HEXCOLON;
+				st->buf[st->size++] = (uint8_t)hex_value;
+				continue;
+			case ST_HEXCOLON:
+				return XPBD_BROKEN_ENCODING;
+			case ST_LEADSPACE:
+				dec_value = 0;
+				dec_value_start = lp;
+				/* FALL THROUGH */
+			case ST_WAITDIGITS:
+				state = ST_DIGITS;
+				continue;
+			default:
+				break;
+			}
+			break;
+		case 0x3c:	/* '<', start of XML encoded enumeration */
+			if(state == ST_LEADSPACE) {
+				const asn_INTEGER_enum_map_t *el;
+				el = INTEGER_map_enum2value(
+					(const asn_INTEGER_specifics_t *)
+					td->specifics, lstart, lstop);
+				if(el) {
+					ASN_DEBUG("Found \"%s\" => %ld",
+						el->enum_name, el->nat_value);
+					dec_value = el->nat_value;
+					state = ST_END_ENUM;
+					lp = lstop - 1;
+					continue;
+				}
+				ASN_DEBUG("Unknown identifier for INTEGER");
+			}
+			return XPBD_BROKEN_ENCODING;
+		case 0x3a:	/* ':' */
+			if(state == ST_HEXCOLON) {
+				/* This colon is expected */
+				state = ST_HEXDIGIT1;
+				continue;
+			} else if(state == ST_DIGITS) {
+				/* The colon here means that we have
+				 * decoded the first two hexadecimal
+				 * places as a decimal value.
+				 * Switch decoding mode. */
+				ASN_DEBUG("INTEGER re-evaluate as hex form");
+				state = ST_SKIPSPHEX;
+				dec_value_start = 0;
+				lp = lstart - 1;
+				continue;
+			} else {
+				ASN_DEBUG("state %d at %ld", state, (long)(lp - lstart));
+				break;
+			}
+		/* [A-Fa-f] */
+		case 0x41:case 0x42:case 0x43:case 0x44:case 0x45:case 0x46:
+		case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:case 0x66:
+			switch(state) {
+			case ST_SKIPSPHEX:
+			case ST_LEADSPACE: /* Fall through */
+			case ST_HEXDIGIT1:
+				hex_value = lv - ((lv < 0x61) ? 0x41 : 0x61);
+				hex_value += 10;
+				hex_value <<= 4;
+				state = ST_HEXDIGIT2;
+				continue;
+			case ST_HEXDIGIT2:
+				hex_value += lv - ((lv < 0x61) ? 0x41 : 0x61);
+				hex_value += 10;
+				st->buf[st->size++] = (uint8_t)hex_value;
+				state = ST_HEXCOLON;
+				continue;
+			case ST_DIGITS:
+				ASN_DEBUG("INTEGER re-evaluate as hex form");
+				state = ST_SKIPSPHEX;
+				dec_value_start = 0;
+				lp = lstart - 1;
+				continue;
+			default:
+				break;
+			}
+			break;
+		}
+
+		/* Found extra non-numeric stuff */
+		ASN_DEBUG("INTEGER :: Found non-numeric 0x%2x at %ld",
+			lv, (long)(lp - lstart));
+		state = ST_UNEXPECTED;
+		break;
+	}
+
+	switch(state) {
+	case ST_END_ENUM:
+		/* Got a complete and valid enumeration encoded as a tag. */
+		break;
+	case ST_DIGITS:
+		dec_value_end = lstop;
+		/* FALL THROUGH */
+	case ST_DIGITS_TRAILSPACE:
+		/* The last symbol encountered was a digit. */
+        switch(asn_strtoimax_lim(dec_value_start, &dec_value_end, &dec_value)) {
+        case ASN_STRTOX_OK:
+            if(specs && specs->field_unsigned && (uintmax_t) dec_value <= ULONG_MAX) {
+                break;
+            } else if(dec_value >= LONG_MIN && dec_value <= LONG_MAX) {
+                break;
+            } else {
+                /*
+                 * We model INTEGER on long for XER,
+                 * to avoid rewriting all the tests at once.
+                 */
+                ASN_DEBUG("INTEGER exceeds long range");
+            }
+            /* Fall through */
+        case ASN_STRTOX_ERROR_RANGE:
+            ASN_DEBUG("INTEGER decode %s hit range limit", td->name);
+            return XPBD_DECODER_LIMIT;
+		case ASN_STRTOX_ERROR_INVAL:
+		case ASN_STRTOX_EXPECT_MORE:
+		case ASN_STRTOX_EXTRA_DATA:
+			return XPBD_BROKEN_ENCODING;
+		}
+		break;
+	case ST_HEXCOLON:
+	case ST_HEXDIGITS_TRAILSPACE:
+		st->buf[st->size] = 0;	/* Just in case termination */
+		return XPBD_BODY_CONSUMED;
+	case ST_HEXDIGIT1:
+	case ST_HEXDIGIT2:
+	case ST_SKIPSPHEX:
+		return XPBD_BROKEN_ENCODING;
+	case ST_LEADSPACE:
+		/* Content not found */
+		return XPBD_NOT_BODY_IGNORE;
+	case ST_WAITDIGITS:
+	case ST_UNEXPECTED:
+		ASN_DEBUG("INTEGER: No useful digits (state %d)", state);
+		return XPBD_BROKEN_ENCODING;	/* No digits */
+	}
+
+	/*
+	 * Convert the result of parsing of enumeration or a straight
+	 * decimal value into a BER representation.
+	 */
+	if(asn_imax2INTEGER(st, dec_value)) {
+                ASN_DEBUG("INTEGER decode %s conversion failed", td->name);
+		return XPBD_SYSTEM_FAILURE;
+        }
+
+	return XPBD_BODY_CONSUMED;
+}
+
+asn_dec_rval_t
+INTEGER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void **sptr,
+                   const char *opt_mname, const void *buf_ptr, size_t size) {
+    return xer_decode_primitive(opt_codec_ctx, td,
+		sptr, sizeof(INTEGER_t), opt_mname,
+		buf_ptr, size, INTEGER__xer_body_decode);
+}
+
+asn_enc_rval_t
+INTEGER_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int ilevel, enum xer_encoder_flags_e flags,
+                   asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+	asn_enc_rval_t er = {0,0,0};
+
+	(void)ilevel;
+	(void)flags;
+	
+	if(!st || !st->buf)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = INTEGER__dump(td, st, cb, app_key, 1);
+	if(er.encoded < 0) ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#ifndef	ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr,
+                    asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = { RC_OK, 0 };
+	INTEGER_t *st = (INTEGER_t *)*sptr;
+	const asn_per_constraint_t *ct;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(!st) {
+		st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	FREEMEM(st->buf);
+	st->buf = 0;
+	st->size = 0;
+	if(ct) {
+		if(ct->flags & APC_SEMI_CONSTRAINED) {
+			st->buf = (uint8_t *)CALLOC(1, 2);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = 1;
+		} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
+			size_t size = (ct->range_bits + 7) >> 3;
+			st->buf = (uint8_t *)MALLOC(1 + size + 1);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = size;
+		}
+	}
+
+	/* X.691-2008/11, #13.2.2, constrained whole number */
+	if(ct && ct->flags != APC_UNCONSTRAINED) {
+		/* #11.5.6 */
+		ASN_DEBUG("Integer with range %d bits", ct->range_bits);
+		if(ct->range_bits >= 0) {
+			if((size_t)ct->range_bits > 8 * sizeof(unsigned long))
+				ASN__DECODE_FAILED;
+
+			if(specs && specs->field_unsigned) {
+				unsigned long uvalue = 0;
+				if(uper_get_constrained_whole_number(pd,
+					&uvalue, ct->range_bits))
+					ASN__DECODE_STARVED;
+				ASN_DEBUG("Got value %lu + low %ld",
+					uvalue, ct->lower_bound);
+				uvalue += ct->lower_bound;
+				if(asn_ulong2INTEGER(st, uvalue))
+					ASN__DECODE_FAILED;
+			} else {
+				unsigned long uvalue = 0;
+				long svalue;
+				if(uper_get_constrained_whole_number(pd,
+					&uvalue, ct->range_bits))
+					ASN__DECODE_STARVED;
+				ASN_DEBUG("Got value %lu + low %ld",
+					uvalue, ct->lower_bound);
+                if(per_long_range_unrebase(uvalue, ct->lower_bound,
+                                           ct->upper_bound, &svalue)
+                   || asn_long2INTEGER(st, svalue)) {
+                    ASN__DECODE_FAILED;
+                }
+			}
+			return rval;
+		}
+	} else {
+		ASN_DEBUG("Decoding unconstrained integer %s", td->name);
+	}
+
+	/* X.691, #12.2.3, #12.2.4 */
+	do {
+		ssize_t len = 0;
+		void *p = NULL;
+		int ret = 0;
+
+		/* Get the PER length */
+		len = uper_get_length(pd, -1, 0, &repeat);
+		if(len < 0) ASN__DECODE_STARVED;
+
+		p = REALLOC(st->buf, st->size + len + 1);
+		if(!p) ASN__DECODE_FAILED;
+		st->buf = (uint8_t *)p;
+
+		ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
+		if(ret < 0) ASN__DECODE_STARVED;
+		st->size += len;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* JIC */
+
+	/* #12.2.3 */
+	if(ct && ct->lower_bound) {
+		/*
+		 * TODO: replace by in-place arithmetics.
+		 */
+		long value = 0;
+		if(asn_INTEGER2long(st, &value))
+			ASN__DECODE_FAILED;
+		if(asn_imax2INTEGER(st, value + ct->lower_bound))
+			ASN__DECODE_FAILED;
+	}
+
+	return rval;
+}
+
+asn_enc_rval_t
+INTEGER_encode_uper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, const void *sptr,
+                    asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs =
+        	(const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	const uint8_t *buf;
+	const uint8_t *end;
+	const asn_per_constraint_t *ct;
+	long value = 0;
+
+	if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	er.encoded = 0;
+
+	if(ct) {
+		int inext = 0;
+		if(specs && specs->field_unsigned) {
+			unsigned long uval;
+			if(asn_INTEGER2ulong(st, &uval))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(uval < (unsigned long)ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(uval < (unsigned long)ct->lower_bound
+				|| uval > (unsigned long)ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%" ASN_PRI_SIZE ") lb %lu ub %lu %s",
+				uval, st->buf[0], st->size,
+				ct->lower_bound, ct->upper_bound,
+				inext ? "ext" : "fix");
+			value = uval;
+		} else {
+			if(asn_INTEGER2long(st, &value))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(value < ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(value < ct->lower_bound
+				|| value > ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %ld (%02x/%" ASN_PRI_SIZE ") lb %ld ub %ld %s",
+				value, st->buf[0], st->size,
+				ct->lower_bound, ct->upper_bound,
+				inext ? "ext" : "fix");
+		}
+		if(ct->flags & APC_EXTENSIBLE) {
+			if(per_put_few_bits(po, inext, 1))
+				ASN__ENCODE_FAILED;
+			if(inext) ct = 0;
+		} else if(inext) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+
+	/* X.691-11/2008, #13.2.2, test if constrained whole number */
+	if(ct && ct->range_bits >= 0) {
+        unsigned long v;
+		/* #11.5.6 -> #11.3 */
+		ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
+			value, value - ct->lower_bound, ct->range_bits);
+	if(specs && specs->field_unsigned) {
+		if (  ((unsigned long)ct->lower_bound > (unsigned long)(ct->upper_bound)
+		   || ((unsigned long)value < (unsigned long)ct->lower_bound))
+		   || ((unsigned long)value > (unsigned long)ct->upper_bound)
+		) {
+			ASN_DEBUG("Value %lu to-be-encoded is outside the bounds [%lu, %lu]!",
+				value, ct->lower_bound, ct->upper_bound);
+			ASN__ENCODE_FAILED;
+		}
+ 		v = (unsigned long)value - (unsigned long)ct->lower_bound;
+ 	} else {
+ 		if(per_long_range_rebase(value, ct->lower_bound, ct->upper_bound, &v)) {
+ 			ASN__ENCODE_FAILED;
+ 		}
+	}
+        if(uper_put_constrained_whole_number_u(po, v, ct->range_bits))
+		ASN__ENCODE_FAILED;
+	ASN__ENCODED_OK(er);
+	}
+
+	if(ct && ct->lower_bound) {
+		ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
+		/* TODO: adjust lower bound */
+		ASN__ENCODE_FAILED;
+	}
+
+	for(buf = st->buf, end = st->buf + st->size; buf < end;) {
+        int need_eom = 0;
+        ssize_t mayEncode = uper_put_length(po, end - buf, &need_eom);
+        if(mayEncode < 0)
+			ASN__ENCODE_FAILED;
+		if(per_put_many_bits(po, buf, 8 * mayEncode))
+			ASN__ENCODE_FAILED;
+		buf += mayEncode;
+        if(need_eom && uper_put_length(po, 0, 0)) ASN__ENCODE_FAILED;
+    }
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	INTEGER_t *st = (INTEGER_t *)*sptr;
+	const asn_per_constraint_t *ct;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(!st) {
+		st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	FREEMEM(st->buf);
+	st->buf = 0;
+	st->size = 0;
+	if(ct) {
+		if(ct->flags & APC_SEMI_CONSTRAINED) {
+			st->buf = (uint8_t *)CALLOC(1, 2);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = 1;
+		} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
+			size_t size = (ct->range_bits + 7) >> 3;
+			st->buf = (uint8_t *)MALLOC(1 + size + 1);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = size;
+		}
+	}
+
+	/* X.691, #12.2.2 */
+	if(ct && ct->flags != APC_UNCONSTRAINED) {
+		/* #10.5.6 */
+		ASN_DEBUG("Integer with range %d bits", ct->range_bits);
+		if(ct->range_bits >= 0) {
+			if (ct->range_bits > 16) {
+				int max_range_bytes = (ct->range_bits >> 3) +
+				                      (((ct->range_bits % 8) > 0) ? 1 : 0);
+				int length = 0, i;
+				long value = 0;
+
+				for (i = 1; ; i++) {
+					int upper = 1 << i;
+					if (upper >= max_range_bytes)
+						break;
+				}
+				ASN_DEBUG("Can encode %d (%d bytes) in %d bits", ct->range_bits,
+				          max_range_bytes, i);
+
+				if ((length = per_get_few_bits(pd, i)) < 0)
+					ASN__DECODE_FAILED;
+
+				/* X.691 #12.2.6 length determinant + lb (1) */
+				length += 1;
+				ASN_DEBUG("Got length %d", length);
+				if (aper_get_align(pd) != 0)
+					ASN__DECODE_FAILED;
+				while (length--) {
+					int buf = per_get_few_bits(pd, 8);
+					if (buf < 0)
+						ASN__DECODE_FAILED;
+					value += (((long)buf) << (8 * length));
+				}
+
+				value += ct->lower_bound;
+				if((specs && specs->field_unsigned)
+				        ? asn_uint642INTEGER(st, (unsigned long)value)
+				        : asn_int642INTEGER(st, value))
+					ASN__DECODE_FAILED;
+				ASN_DEBUG("Got value %ld + low %ld",
+				          value, ct->lower_bound);
+			} else {
+				long value = 0;
+				if (ct->range_bits < 8) {
+					value = per_get_few_bits(pd, ct->range_bits);
+					if(value < 0) ASN__DECODE_STARVED;
+				} else if (ct->range_bits == 8) {
+					if (aper_get_align(pd) < 0)
+						ASN__DECODE_FAILED;
+					value = per_get_few_bits(pd, ct->range_bits);
+					if(value < 0) ASN__DECODE_STARVED;
+				} else {
+					/* Align */
+					if (aper_get_align(pd) < 0)
+						ASN__DECODE_FAILED;
+					value = per_get_few_bits(pd, 16);
+					if(value < 0) ASN__DECODE_STARVED;
+				}
+				value += ct->lower_bound;
+				if((specs && specs->field_unsigned)
+				        ? asn_ulong2INTEGER(st, value)
+				        : asn_long2INTEGER(st, value))
+					ASN__DECODE_FAILED;
+				ASN_DEBUG("Got value %ld + low %ld",
+				          value, ct->lower_bound);
+			}
+			return rval;
+		} else {
+			ASN__DECODE_FAILED;
+		}
+	} else {
+		ASN_DEBUG("Decoding unconstrained integer %s", td->name);
+	}
+
+	/* X.691, #12.2.3, #12.2.4 */
+	do {
+		ssize_t len;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		len = aper_get_length(pd, -1, -1, &repeat);
+		if(len < 0) ASN__DECODE_STARVED;
+
+		p = REALLOC(st->buf, st->size + len + 1);
+		if(!p) ASN__DECODE_FAILED;
+		st->buf = (uint8_t *)p;
+
+		ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
+		if(ret < 0) ASN__DECODE_STARVED;
+		st->size += len;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* JIC */
+
+	/* #12.2.3 */
+	if(ct && ct->lower_bound) {
+		/*
+		 * TODO: replace by in-place arithmetics.
+		 */
+		long value;
+		if(asn_INTEGER2long(st, &value))
+			ASN__DECODE_FAILED;
+		if(asn_long2INTEGER(st, value + ct->lower_bound))
+			ASN__DECODE_FAILED;
+	}
+
+	return rval;
+}
+
+asn_enc_rval_t
+INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints,
+                    const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	const uint8_t *buf;
+	const uint8_t *end;
+	const asn_per_constraint_t *ct;
+	long value = 0;
+
+	if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	er.encoded = 0;
+
+	if(ct) {
+		int inext = 0;
+		if(specs && specs->field_unsigned) {
+			unsigned long uval;
+			if(asn_INTEGER2ulong(st, &uval))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(uval < (unsigned long)ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(uval < (unsigned long)ct->lower_bound
+				        || uval > (unsigned long)ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+			          uval, st->buf[0], st->size,
+			          ct->lower_bound, ct->upper_bound,
+			          inext ? "ext" : "fix");
+			value = uval;
+		} else {
+			if(asn_INTEGER2long(st, &value)) ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(value < ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(value < ct->lower_bound
+				        || value > ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+			          value, st->buf[0], st->size,
+			          ct->lower_bound, ct->upper_bound,
+			          inext ? "ext" : "fix");
+		}
+		if(ct->flags & APC_EXTENSIBLE) {
+			if(per_put_few_bits(po, inext, 1))
+				ASN__ENCODE_FAILED;
+			if(inext) ct = 0;
+		} else if(inext) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+	/* X.691, #12.2.2 */
+	if(ct && ct->range_bits >= 0) {
+		unsigned long v;
+
+		/* #10.5.6 */
+		ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
+		          value, value - ct->lower_bound, ct->range_bits);
+
+		v = value - ct->lower_bound;
+
+		/* #12 <= 8 -> alignment ? */
+		if (ct->range_bits < 8) {
+			if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
+				ASN__ENCODE_FAILED;
+		} else if (ct->range_bits == 8) {
+			if(aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
+				ASN__ENCODE_FAILED;
+		} else if (ct->range_bits <= 16) {
+			/* Consume the bytes to align on octet */
+			if(aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			if(per_put_few_bits(po, 0x0000 | v,
+			                    16))
+				ASN__ENCODE_FAILED;
+		} else {
+			/* TODO: extend to >64 bits */
+			int64_t v64 = v;
+			int i, j;
+			int max_range_bytes = (ct->range_bits >> 3) +
+			                      (((ct->range_bits % 8) > 0) ? 1 : 0);
+
+			for (i = 1; ; i++) {
+				int upper = 1 << i;
+				if (upper >= max_range_bytes)
+					break;
+			}
+
+			for (j = sizeof(int64_t) -1; j != 0; j--) {
+				int64_t val;
+				val = v64 >> (j * 8);
+				if (val != 0)
+					break;
+			}
+
+			/* Putting length in the minimum number of bits ex: 5 = 3bits */
+			if (per_put_few_bits(po, j, i))
+				ASN__ENCODE_FAILED;
+
+			/* Consume the bits to align on octet */
+			if (aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			/* Put the value */
+			for (i = 0; i <= j; i++) {
+				if(per_put_few_bits(po, (v64 >> (8 * (j - i))) & 0xff, 8))
+					ASN__ENCODE_FAILED;
+			}
+		}
+		ASN__ENCODED_OK(er);
+	}
+
+	if(ct && ct->lower_bound) {
+		ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
+		/* TODO: adjust lower bound */
+		ASN__ENCODE_FAILED;
+	}
+
+	for(buf = st->buf, end = st->buf + st->size; buf < end;) {
+		ssize_t mayEncode = aper_put_length(po, -1, end - buf);
+		if(mayEncode < 0)
+			ASN__ENCODE_FAILED;
+		if(per_put_many_bits(po, buf, 8 * mayEncode))
+			ASN__ENCODE_FAILED;
+		buf += mayEncode;
+	}
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+
+static intmax_t
+asn__integer_convert(const uint8_t *b, const uint8_t *end) {
+    uintmax_t value;
+
+    /* Perform the sign initialization */
+    /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
+    if((*b >> 7)) {
+        value = (uintmax_t)(-1);
+    } else {
+        value = 0;
+    }
+
+    /* Conversion engine */
+    for(; b < end; b++) {
+        value = (value << 8) | *b;
+    }
+
+    return value;
+}
+
+int
+asn_INTEGER2imax(const INTEGER_t *iptr, intmax_t *lptr) {
+	uint8_t *b, *end;
+	size_t size;
+
+	/* Sanity checking */
+	if(!iptr || !iptr->buf || !lptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	/* Cache the begin/end of the buffer */
+	b = iptr->buf;	/* Start of the INTEGER buffer */
+	size = iptr->size;
+	end = b + size;	/* Where to stop */
+
+	if(size > sizeof(intmax_t)) {
+		uint8_t *end1 = end - 1;
+		/*
+		 * Slightly more advanced processing,
+		 * able to process INTEGERs with >sizeof(intmax_t) bytes
+		 * when the actual value is small, e.g. for intmax_t == int32_t
+		 * (0x0000000000abcdef INTEGER would yield a fine 0x00abcdef int32_t)
+		 */
+		/* Skip out the insignificant leading bytes */
+		for(; b < end1; b++) {
+			switch(*b) {
+				case 0x00: if((b[1] & 0x80) == 0) continue; break;
+				case 0xff: if((b[1] & 0x80) != 0) continue; break;
+			}
+			break;
+		}
+
+		size = end - b;
+		if(size > sizeof(intmax_t)) {
+			/* Still cannot fit the sizeof(intmax_t) */
+			errno = ERANGE;
+			return -1;
+		}
+	}
+
+	/* Shortcut processing of a corner case */
+	if(end == b) {
+		*lptr = 0;
+		return 0;
+	}
+
+	*lptr = asn__integer_convert(b, end);
+	return 0;
+}
+
+/* FIXME: negative INTEGER values are silently interpreted as large unsigned ones. */
+int
+asn_INTEGER2umax(const INTEGER_t *iptr, uintmax_t *lptr) {
+	uint8_t *b, *end;
+	uintmax_t value;
+	size_t size;
+
+	if(!iptr || !iptr->buf || !lptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	b = iptr->buf;
+	size = iptr->size;
+	end = b + size;
+
+	/* If all extra leading bytes are zeroes, ignore them */
+	for(; size > sizeof(value); b++, size--) {
+		if(*b) {
+			/* Value won't fit into uintmax_t */
+			errno = ERANGE;
+			return -1;
+		}
+	}
+
+	/* Conversion engine */
+	for(value = 0; b < end; b++)
+		value = (value << 8) | *b;
+
+	*lptr = value;
+	return 0;
+}
+
+int
+asn_umax2INTEGER(INTEGER_t *st, uintmax_t value) {
+    uint8_t *buf;
+    uint8_t *end;
+    uint8_t *b;
+    int shr;
+
+    if(value <= ((~(uintmax_t)0) >> 1)) {
+        return asn_imax2INTEGER(st, value);
+    }
+
+    buf = (uint8_t *)MALLOC(1 + sizeof(value));
+    if(!buf) return -1;
+
+    end = buf + (sizeof(value) + 1);
+    buf[0] = 0; /* INTEGERs are signed. 0-byte indicates positive. */
+    for(b = buf + 1, shr = (sizeof(value) - 1) * 8; b < end; shr -= 8, b++)
+        *b = (uint8_t)(value >> shr);
+
+    if(st->buf) FREEMEM(st->buf);
+    st->buf = buf;
+    st->size = 1 + sizeof(value);
+
+	return 0;
+}
+
+int
+asn_imax2INTEGER(INTEGER_t *st, intmax_t value) {
+	uint8_t *buf, *bp;
+	uint8_t *p;
+	uint8_t *pstart;
+	uint8_t *pend1;
+	int littleEndian = 1;	/* Run-time detection */
+	int add;
+
+	if(!st) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	buf = (uint8_t *)(long *)MALLOC(sizeof(value));
+	if(!buf) return -1;
+
+	if(*(char *)&littleEndian) {
+		pstart = (uint8_t *)&value + sizeof(value) - 1;
+		pend1 = (uint8_t *)&value;
+		add = -1;
+	} else {
+		pstart = (uint8_t *)&value;
+		pend1 = pstart + sizeof(value) - 1;
+		add = 1;
+	}
+
+	/*
+	 * If the contents octet consists of more than one octet,
+	 * then bits of the first octet and bit 8 of the second octet:
+	 * a) shall not all be ones; and
+	 * b) shall not all be zero.
+	 */
+	for(p = pstart; p != pend1; p += add) {
+		switch(*p) {
+		case 0x00: if((*(p+add) & 0x80) == 0)
+				continue;
+			break;
+		case 0xff: if((*(p+add) & 0x80))
+				continue;
+			break;
+		}
+		break;
+	}
+	/* Copy the integer body */
+	for(bp = buf, pend1 += add; p != pend1; p += add)
+		*bp++ = *p;
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = bp - buf;
+
+	return 0;
+}
+
+int
+asn_INTEGER2long(const INTEGER_t *iptr, long *l) {
+    intmax_t v;
+    if(asn_INTEGER2imax(iptr, &v) == 0) {
+        if(v < LONG_MIN || v > LONG_MAX) {
+            errno = ERANGE;
+            return -1;
+        }
+        *l = v;
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
+int
+asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *l) {
+    uintmax_t v;
+    if(asn_INTEGER2umax(iptr, &v) == 0) {
+        if(v > ULONG_MAX) {
+            errno = ERANGE;
+            return -1;
+        }
+        *l = v;
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
+int
+asn_long2INTEGER(INTEGER_t *st, long value) {
+    return asn_imax2INTEGER(st, value);
+}
+
+int
+asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
+    return asn_imax2INTEGER(st, value);
+}
+
+
+int
+asn_uint642INTEGER(INTEGER_t *st, uint64_t value) {
+	uint8_t *buf;
+	uint8_t *end;
+	uint8_t *b;
+	int shr;
+
+	if(value <= INT64_MAX)
+		return asn_int642INTEGER(st, value);
+
+	buf = (uint8_t *)MALLOC(1 + sizeof(value));
+	if(!buf) return -1;
+
+	end = buf + (sizeof(value) + 1);
+	buf[0] = 0;
+	for(b = buf + 1, shr = (sizeof(value)-1)*8; b < end; shr -= 8, b++)
+		*b = (uint8_t)(value >> shr);
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = 1 + sizeof(value);
+
+	return 0;
+}
+
+int
+asn_int642INTEGER(INTEGER_t *st, int64_t value) {
+	uint8_t *buf, *bp;
+	uint8_t *p;
+	uint8_t *pstart;
+	uint8_t *pend1;
+	int littleEndian = 1;	/* Run-time detection */
+	int add;
+
+	if(!st) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	buf = (uint8_t *)MALLOC(sizeof(value));
+	if(!buf) return -1;
+
+	if(*(char *)&littleEndian) {
+		pstart = (uint8_t *)&value + sizeof(value) - 1;
+		pend1 = (uint8_t *)&value;
+		add = -1;
+	} else {
+		pstart = (uint8_t *)&value;
+		pend1 = pstart + sizeof(value) - 1;
+		add = 1;
+	}
+
+	/*
+	 * If the contents octet consists of more than one octet,
+	 * then bits of the first octet and bit 8 of the second octet:
+	 * a) shall not all be ones; and
+	 * b) shall not all be zero.
+	 */
+	for(p = pstart; p != pend1; p += add) {
+		switch(*p) {
+		case 0x00: if((*(p+add) & 0x80) == 0)
+				continue;
+			break;
+		case 0xff: if((*(p+add) & 0x80))
+				continue;
+			break;
+		}
+		break;
+	}
+	/* Copy the integer body */
+	for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add)
+		*bp++ = *p;
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = bp - buf;
+
+	return 0;
+}
+
+/*
+ * Parse the number in the given string until the given *end position,
+ * returning the position after the last parsed character back using the
+ * same (*end) pointer.
+ * WARNING: This behavior is different from the standard strtol/strtoimax(3).
+ */
+enum asn_strtox_result_e
+asn_strtoimax_lim(const char *str, const char **end, intmax_t *intp) {
+	int sign = 1;
+	intmax_t value;
+
+#define ASN1_INTMAX_MAX ((~(uintmax_t)0) >> 1)
+    const intmax_t upper_boundary = ASN1_INTMAX_MAX / 10;
+	intmax_t last_digit_max = ASN1_INTMAX_MAX % 10;
+#undef  ASN1_INTMAX_MAX
+
+	if(str >= *end) return ASN_STRTOX_ERROR_INVAL;
+
+	switch(*str) {
+	case '-':
+		last_digit_max++;
+		sign = -1;
+		/* FALL THROUGH */
+	case '+':
+		str++;
+		if(str >= *end) {
+			*end = str;
+			return ASN_STRTOX_EXPECT_MORE;
+		}
+	}
+
+	for(value = 0; str < (*end); str++) {
+		switch(*str) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
+			int d = *str - '0';
+			if(value < upper_boundary) {
+				value = value * 10 + d;
+			} else if(value == upper_boundary) {
+				if(d <= last_digit_max) {
+					if(sign > 0) {
+						value = value * 10 + d;
+					} else {
+						sign = 1;
+						value = -value * 10 - d;
+					}
+				} else {
+					*end = str;
+					return ASN_STRTOX_ERROR_RANGE;
+				}
+			} else {
+				*end = str;
+				return ASN_STRTOX_ERROR_RANGE;
+			}
+		    }
+		    continue;
+		default:
+		    *end = str;
+		    *intp = sign * value;
+		    return ASN_STRTOX_EXTRA_DATA;
+		}
+	}
+
+	*end = str;
+	*intp = sign * value;
+	return ASN_STRTOX_OK;
+}
+
+/*
+ * Parse the number in the given string until the given *end position,
+ * returning the position after the last parsed character back using the
+ * same (*end) pointer.
+ * WARNING: This behavior is different from the standard strtoul/strtoumax(3).
+ */
+enum asn_strtox_result_e
+asn_strtoumax_lim(const char *str, const char **end, uintmax_t *uintp) {
+	uintmax_t value;
+
+#define ASN1_UINTMAX_MAX ((~(uintmax_t)0))
+    const uintmax_t upper_boundary = ASN1_UINTMAX_MAX / 10;
+    uintmax_t last_digit_max = ASN1_UINTMAX_MAX % 10;
+#undef ASN1_UINTMAX_MAX
+
+    if(str >= *end) return ASN_STRTOX_ERROR_INVAL;
+
+	switch(*str) {
+	case '-':
+        return ASN_STRTOX_ERROR_INVAL;
+	case '+':
+		str++;
+		if(str >= *end) {
+			*end = str;
+			return ASN_STRTOX_EXPECT_MORE;
+		}
+	}
+
+	for(value = 0; str < (*end); str++) {
+		switch(*str) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
+			unsigned int d = *str - '0';
+			if(value < upper_boundary) {
+				value = value * 10 + d;
+			} else if(value == upper_boundary) {
+				if(d <= last_digit_max) {
+                    value = value * 10 + d;
+                } else {
+					*end = str;
+					return ASN_STRTOX_ERROR_RANGE;
+				}
+			} else {
+				*end = str;
+				return ASN_STRTOX_ERROR_RANGE;
+			}
+		    }
+		    continue;
+		default:
+		    *end = str;
+		    *uintp = value;
+		    return ASN_STRTOX_EXTRA_DATA;
+		}
+	}
+
+	*end = str;
+	*uintp = value;
+	return ASN_STRTOX_OK;
+}
+
+enum asn_strtox_result_e
+asn_strtol_lim(const char *str, const char **end, long *lp) {
+    intmax_t value;
+    switch(asn_strtoimax_lim(str, end, &value)) {
+    case ASN_STRTOX_ERROR_RANGE:
+        return ASN_STRTOX_ERROR_RANGE;
+    case ASN_STRTOX_ERROR_INVAL:
+        return ASN_STRTOX_ERROR_INVAL;
+    case ASN_STRTOX_EXPECT_MORE:
+        return ASN_STRTOX_EXPECT_MORE;
+    case ASN_STRTOX_OK:
+        if(value >= LONG_MIN && value <= LONG_MAX) {
+            *lp = value;
+            return ASN_STRTOX_OK;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    case ASN_STRTOX_EXTRA_DATA:
+        if(value >= LONG_MIN && value <= LONG_MAX) {
+            *lp = value;
+            return ASN_STRTOX_EXTRA_DATA;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    }
+
+    assert(!"Unreachable");
+    return ASN_STRTOX_ERROR_INVAL;
+}
+
+enum asn_strtox_result_e
+asn_strtoul_lim(const char *str, const char **end, unsigned long *ulp) {
+    uintmax_t value;
+    switch(asn_strtoumax_lim(str, end, &value)) {
+    case ASN_STRTOX_ERROR_RANGE:
+        return ASN_STRTOX_ERROR_RANGE;
+    case ASN_STRTOX_ERROR_INVAL:
+        return ASN_STRTOX_ERROR_INVAL;
+    case ASN_STRTOX_EXPECT_MORE:
+        return ASN_STRTOX_EXPECT_MORE;
+    case ASN_STRTOX_OK:
+        if(value <= ULONG_MAX) {
+            *ulp = value;
+            return ASN_STRTOX_OK;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    case ASN_STRTOX_EXTRA_DATA:
+        if(value <= ULONG_MAX) {
+            *ulp = value;
+            return ASN_STRTOX_EXTRA_DATA;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    }
+
+    assert(!"Unreachable");
+    return ASN_STRTOX_ERROR_INVAL;
+}
+
+int
+INTEGER_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                     const void *bptr) {
+    const INTEGER_t *a = aptr;
+    const INTEGER_t *b = bptr;
+
+    (void)td;
+
+    if(a && b) {
+        if(a->size && b->size) {
+            int sign_a = (a->buf[0] & 0x80) ? -1 : 1;
+            int sign_b = (b->buf[0] & 0x80) ? -1 : 1;
+
+            if(sign_a < sign_b) return -1;
+            if(sign_a > sign_b) return 1;
+
+            /* The shortest integer wins, unless comparing negatives */
+            if(a->size < b->size) {
+                return -1 * sign_a;
+            } else if(a->size > b->size) {
+                return 1 * sign_b;
+            }
+
+            return sign_a * memcmp(a->buf, b->buf, a->size);
+        } else if(a->size) {
+            int sign = (a->buf[0] & 0x80) ? -1 : 1;
+            return (1) * sign;
+        } else if(b->size) {
+            int sign = (a->buf[0] & 0x80) ? -1 : 1;
+            return (-1) * sign;
+        } else {
+            return 0;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+
+}
+
+asn_random_fill_result_t
+INTEGER_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                    const asn_encoding_constraints_t *constraints,
+                    size_t max_length) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    INTEGER_t *st = *sptr;
+    const asn_INTEGER_enum_map_t *emap;
+    size_t emap_len;
+    intmax_t value;
+    int find_inside_map;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (INTEGER_t *)CALLOC(1, sizeof(*st));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    if(specs) {
+        emap = specs->value2enum;
+        emap_len = specs->map_count;
+        if(specs->strict_enumeration) {
+            find_inside_map = emap_len > 0;
+        } else {
+            find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
+        }
+    } else {
+        emap = 0;
+        emap_len = 0;
+        find_inside_map = 0;
+    }
+
+    if(find_inside_map) {
+        assert(emap_len > 0);
+        value = emap[asn_random_between(0, emap_len - 1)].nat_value;
+    } else {
+        const asn_per_constraints_t *ct;
+
+        static const long variants[] = {
+            -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
+            -16383, -257,   -256,   -255,   -254,   -129,   -128,   -127,
+            -126,   -1,     0,      1,      126,    127,    128,    129,
+            254,    255,    256,    257,    16383,  16384,  16385,  32767,
+            32768,  32769,  65534,  65535,  65536,  65537};
+        if(specs && specs->field_unsigned) {
+            assert(variants[18] == 0);
+            value = variants[asn_random_between(
+                18, sizeof(variants) / sizeof(variants[0]) - 1)];
+        } else {
+            value = variants[asn_random_between(
+                0, sizeof(variants) / sizeof(variants[0]) - 1)];
+        }
+
+        if(!constraints) constraints = &td->encoding_constraints;
+        ct = constraints ? constraints->per_constraints : 0;
+        if(ct && (ct->value.flags & APC_CONSTRAINED)) {
+            if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
+                value = asn_random_between(ct->value.lower_bound,
+                                           ct->value.upper_bound);
+            }
+        }
+    }
+
+    if(asn_imax2INTEGER(st, value)) {
+        if(st == *sptr) {
+            ASN_STRUCT_RESET(*td, st);
+        } else {
+            ASN_STRUCT_FREE(*td, st);
+        }
+        return result_failed;
+    } else {
+        *sptr = st;
+        result_ok.length = st->size;
+        return result_ok;
+    }
+}
diff --git a/e2ap/lib/INTEGER_oer.c b/e2ap/lib/INTEGER_oer.c
new file mode 100644
index 0000000..110689b
--- /dev/null
+++ b/e2ap/lib/INTEGER_oer.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <INTEGER.h>
+#include <errno.h>
+
+asn_dec_rval_t
+INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, void **sptr,
+                   const void *ptr, size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    INTEGER_t *st = (INTEGER_t *)*sptr;
+    struct asn_oer_constraint_number_s ct = {0, 0};
+    size_t req_bytes;
+
+    (void)opt_codec_ctx;
+    (void)specs;
+
+    if(!st) {
+        st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    FREEMEM(st->buf);
+    st->buf = 0;
+    st->size = 0;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints) ct = constraints->value;
+
+    if(ct.width) {
+        req_bytes = ct.width;
+    } else {
+        /* No lower bound and no upper bound, effectively */
+
+        ssize_t consumed = oer_fetch_length(ptr, size, &req_bytes);
+        if(consumed == 0) {
+            ASN__DECODE_STARVED;
+        } else if(consumed == -1) {
+            ASN__DECODE_FAILED;
+        }
+        rval.consumed += consumed;
+        ptr = (const char *)ptr + consumed;
+        size -= consumed;
+    }
+
+    if(req_bytes > size) {
+        ASN__DECODE_STARVED;
+    }
+
+    if(ct.positive) {
+        /* X.969 08/2015 10.2(a) */
+        unsigned msb;   /* Most significant bit */
+        size_t useful_size;
+
+        /* Check most significant bit */
+        msb = *(const uint8_t *)ptr >> 7; /* yields 0 or 1 */
+        useful_size = msb + req_bytes;
+        st->buf = (uint8_t *)MALLOC(useful_size + 1);
+        if(!st->buf) {
+            ASN__DECODE_FAILED;
+        }
+
+        /*
+         * Record a large unsigned in a way not to confuse it
+         * with signed value.
+         */
+        st->buf[0] = '\0';
+        memcpy(st->buf + msb, ptr, req_bytes);
+        st->buf[useful_size] = '\0';    /* Just in case, 0-terminate */
+        st->size = useful_size;
+
+        rval.consumed += req_bytes;
+        return rval;
+    } else {
+        /* X.969 08/2015 10.2(b) */
+        st->buf = (uint8_t *)MALLOC(req_bytes + 1);
+        if(!st->buf) {
+            ASN__DECODE_FAILED;
+        }
+
+        memcpy(st->buf, ptr, req_bytes);
+        st->buf[req_bytes] = '\0'; /* Just in case, 0-terminate */
+        st->size = req_bytes;
+
+        rval.consumed += req_bytes;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+INTEGER_encode_oer(const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, const void *sptr,
+                   asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = sptr;
+    asn_enc_rval_t er = {0,0,0};
+    struct asn_oer_constraint_number_s ct = {0, 0};
+    const uint8_t *buf;
+    const uint8_t *end;
+    size_t useful_bytes;
+    size_t req_bytes = 0;
+    int sign = 0;
+
+    if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints) ct = constraints->value;
+
+    er.encoded = 0;
+
+    buf = st->buf;
+    end = buf + st->size;
+
+    sign = (buf && buf < end) ? buf[0] & 0x80 : 0;
+
+    /* Ignore 9 leading zeroes or ones */
+    if(ct.positive) {
+        if(sign) {
+            /* The value given is a signed value. Can't proceed. */
+            ASN__ENCODE_FAILED;
+        }
+        /* Remove leading zeros. */
+        for(; buf + 1 < end; buf++) {
+            if(buf[0] != 0x0) break;
+        }
+    } else {
+        for(; buf + 1 < end; buf++) {
+            if(buf[0] == 0x0 && (buf[1] & 0x80) == 0) {
+                continue;
+            } else if(buf[0] == 0xff && (buf[1] & 0x80) != 0) {
+                continue;
+            }
+            break;
+        }
+    }
+
+    useful_bytes = end - buf;
+    if(ct.width) {
+        req_bytes = ct.width;
+    } else {
+        ssize_t r = oer_serialize_length(useful_bytes, cb, app_key);
+        if(r < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        er.encoded += r;
+        req_bytes = useful_bytes;
+    }
+
+    if(req_bytes < useful_bytes) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded += req_bytes;
+
+    for(; req_bytes > useful_bytes; req_bytes--) {
+        if(cb(sign?"\xff":"\0", 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+    if(cb(buf, useful_bytes, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/InitiatingMessage.c b/e2ap/lib/InitiatingMessage.c
new file mode 100644
index 0000000..6a6bfdb
--- /dev/null
+++ b/e2ap/lib/InitiatingMessage.c
@@ -0,0 +1,398 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "InitiatingMessage.h"
+
+static const long asn_VAL_1_id_RICsubscription = 8;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_3_id_RICserviceUpdate = 7;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_4_id_RICcontrol = 4;
+static const long asn_VAL_4_reject = 0;
+static const long asn_VAL_5_id_E2setup = 1;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_6_id_Reset = 3;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_7_id_RICindication = 5;
+static const long asn_VAL_7_ignore = 1;
+static const long asn_VAL_8_id_RICserviceQuery = 6;
+static const long asn_VAL_8_ignore = 1;
+static const long asn_VAL_9_id_ErrorIndication = 2;
+static const long asn_VAL_9_ignore = 1;
+static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_RICsubscription },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_2_id_RICsubscriptionDelete },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceUpdate },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_3_id_RICserviceUpdate },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICcontrolRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_4_id_RICcontrol },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_E2setupRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_E2setupResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2setupFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_5_id_E2setup },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ResetRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_ResetResponse },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_6_id_Reset },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICindication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_7_id_RICindication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceQuery },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_8_id_RICserviceQuery },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ErrorIndication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_9_id_ErrorIndication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore }
+};
+static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
+	{ 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
+};
+static int
+memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_InitiatingMessage_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 4; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct InitiatingMessage, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_InitiatingMessage_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 0; /* &InitiatingMessage */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct InitiatingMessage, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICsubscriptionRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICsubscriptionDeleteRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDeleteRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICserviceUpdate),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdate,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceUpdate"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICcontrolRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.E2setupRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"E2setupRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.ResetRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ResetRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICindication),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICindication,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindication"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICserviceQuery),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceQuery,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceQuery"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.ErrorIndication),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ErrorIndication,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ErrorIndication"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 8 }, /* RICsubscriptionRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 7 }, /* RICsubscriptionDeleteRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 6 }, /* RICserviceUpdate */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 5 }, /* RICcontrolRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 4 }, /* E2setupRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 5, -5, 3 }, /* ResetRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 6, -6, 2 }, /* RICindication */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 7, -7, 1 }, /* RICserviceQuery */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 8, -8, 0 } /* ErrorIndication */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct InitiatingMessage__value),
+	offsetof(struct InitiatingMessage__value, _asn_ctx),
+	offsetof(struct InitiatingMessage__value, present),
+	sizeof(((struct InitiatingMessage__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	9,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	9,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_InitiatingMessage_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ &asn_OER_memb_procedureCode_constr_2, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage, criticality),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		select_InitiatingMessage_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage, value),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_value_4,
+		select_InitiatingMessage_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_InitiatingMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_InitiatingMessage_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
+};
+asn_SEQUENCE_specifics_t asn_SPC_InitiatingMessage_specs_1 = {
+	sizeof(struct InitiatingMessage),
+	offsetof(struct InitiatingMessage, _asn_ctx),
+	asn_MAP_InitiatingMessage_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_InitiatingMessage = {
+	"InitiatingMessage",
+	"InitiatingMessage",
+	&asn_OP_SEQUENCE,
+	asn_DEF_InitiatingMessage_tags_1,
+	sizeof(asn_DEF_InitiatingMessage_tags_1)
+		/sizeof(asn_DEF_InitiatingMessage_tags_1[0]), /* 1 */
+	asn_DEF_InitiatingMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_InitiatingMessage_tags_1)
+		/sizeof(asn_DEF_InitiatingMessage_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_InitiatingMessage_1,
+	3,	/* Elements count */
+	&asn_SPC_InitiatingMessage_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/NativeEnumerated.c b/e2ap/lib/NativeEnumerated.c
new file mode 100644
index 0000000..50ffb1d
--- /dev/null
+++ b/e2ap/lib/NativeEnumerated.c
@@ -0,0 +1,367 @@
+/*-
+ * Copyright (c) 2004, 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Read the NativeInteger.h for the explanation wrt. differences between
+ * INTEGER and NativeInteger.
+ * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
+ * implementation deals with the standard (machine-specific) representation
+ * of them instead of using the platform-independent buffer.
+ */
+#include <asn_internal.h>
+#include <NativeEnumerated.h>
+
+/*
+ * NativeEnumerated basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_operation_t asn_OP_NativeEnumerated = {
+	NativeInteger_free,
+	NativeInteger_print,
+	NativeInteger_compare,
+	NativeInteger_decode_ber,
+	NativeInteger_encode_der,
+	NativeInteger_decode_xer,
+	NativeEnumerated_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NativeEnumerated_decode_oer,
+	NativeEnumerated_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NativeEnumerated_decode_uper,
+	NativeEnumerated_encode_uper,
+	NativeEnumerated_decode_aper,
+	NativeEnumerated_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NativeEnumerated_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
+	"ENUMERATED",			/* The ASN.1 type is still ENUMERATED */
+	"ENUMERATED",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_NativeEnumerated_tags,
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
+	asn_DEF_NativeEnumerated_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+asn_enc_rval_t
+NativeEnumerated_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                            int ilevel, enum xer_encoder_flags_e flags,
+                            asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_enc_rval_t er = {0,0,0};
+    const long *native = (const long *)sptr;
+    const asn_INTEGER_enum_map_t *el;
+
+    (void)ilevel;
+    (void)flags;
+
+    if(!native) ASN__ENCODE_FAILED;
+
+    el = INTEGER_map_value2enum(specs, *native);
+    if(el) {
+        er.encoded =
+            asn__format_to_callback(cb, app_key, "<%s/>", el->enum_name);
+        if(er.encoded < 0) ASN__ENCODE_FAILED;
+        ASN__ENCODED_OK(er);
+    } else {
+        ASN_DEBUG(
+            "ASN.1 forbids dealing with "
+            "unknown value of ENUMERATED type");
+        ASN__ENCODE_FAILED;
+    }
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             void **sptr, asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs = td->specifics;
+    asn_dec_rval_t rval = { RC_OK, 0 };
+	long *native = (long *)*sptr;
+	const asn_per_constraint_t *ct = NULL;
+	long value;
+
+	(void)opt_codec_ctx;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__DECODE_FAILED;	/* Mandatory! */
+	if(!specs) ASN__DECODE_FAILED;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value >= (specs->extension
+			? specs->extension - 1 : specs->map_count))
+			ASN__DECODE_FAILED;
+	} else {
+		if(!specs->extension)
+			ASN__DECODE_FAILED;
+		/*
+		 * X.691, #10.6: normally small non-negative whole number;
+		 */
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->extension - 1;
+		if(value >= specs->map_count)
+			ASN__DECODE_FAILED;
+	}
+
+	*native = specs->value2enum[value].nat_value;
+	ASN_DEBUG("Decoded %s = %ld", td->name, *native);
+
+	return rval;
+}
+
+static int
+NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
+	const asn_INTEGER_enum_map_t *a = ap;
+	const asn_INTEGER_enum_map_t *b = bp;
+	if(a->nat_value == b->nat_value)
+		return 0;
+	if(a->nat_value < b->nat_value)
+		return -1;
+	return 1;
+}
+
+asn_enc_rval_t
+NativeEnumerated_encode_uper(const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native, value;
+	const asn_per_constraint_t *ct = NULL;
+	int inext = 0;
+	asn_INTEGER_enum_map_t key;
+	const asn_INTEGER_enum_map_t *kf;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	if(!specs) ASN__ENCODE_FAILED;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__ENCODE_FAILED;	/* Mandatory! */
+
+	ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
+
+	er.encoded = 0;
+
+	native = *(const long *)sptr;
+
+	key.nat_value = native;
+	kf = bsearch(&key, specs->value2enum, specs->map_count,
+		sizeof(key), NativeEnumerated__compar_value2enum);
+	if(!kf) {
+		ASN_DEBUG("No element corresponds to %ld", native);
+		ASN__ENCODE_FAILED;
+	}
+	value = kf - specs->value2enum;
+
+	if(ct && ct->range_bits >= 0) {
+		int cmpWith = specs->extension
+				? specs->extension - 1 : specs->map_count;
+		if(value >= cmpWith)
+			inext = 1;
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+		if(inext) ct = 0;
+	} else if(inext) {
+		ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		if(per_put_few_bits(po, value, ct->range_bits))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	if(!specs->extension)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * X.691, #10.6: normally small non-negative whole number;
+	 */
+	ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
+		value, specs->extension, inext,
+		value - (inext ? (specs->extension - 1) : 0));
+	if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             void **sptr, asn_per_data_t *pd) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	long *native = (long *)*sptr;
+	const asn_per_constraint_t *ct = NULL;
+	long value;
+
+	(void)opt_codec_ctx;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__DECODE_FAILED;	/* Mandatory! */
+	if(!specs) ASN__DECODE_FAILED;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	/* Deal with APER padding */
+	if(ct && ct->upper_bound >= 255) {
+		int padding = 0;
+		padding = (8 - (pd->moved % 8)) % 8;
+		ASN_DEBUG("For NativeEnumerated %s,offset= %lu Padding bits = %d", td->name, pd->moved, padding);
+		ASN_DEBUG("For NativeEnumerated %s, upper bound = %lu", td->name, ct->upper_bound);
+		if(padding > 0)
+			per_get_few_bits(pd, padding);
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value >= (specs->extension
+		             ? specs->extension - 1 : specs->map_count))
+			ASN__DECODE_FAILED;
+	} else {
+		if(!specs->extension)
+			ASN__DECODE_FAILED;
+		/*
+		 * X.691, #10.6: normally small non-negative whole number;
+		 */
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->extension - 1;
+		if(value >= specs->map_count)
+			ASN__DECODE_FAILED;
+	}
+
+	*native = specs->value2enum[value].nat_value;
+	ASN_DEBUG("Decoded %s = %ld", td->name, *native);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeEnumerated_encode_aper(const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native, value;
+	const asn_per_constraint_t *ct = NULL;
+	int inext = 0;
+	asn_INTEGER_enum_map_t key;
+	asn_INTEGER_enum_map_t *kf;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	if(!specs) ASN__ENCODE_FAILED;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__ENCODE_FAILED;        /* Mandatory! */
+
+	ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
+
+	er.encoded = 0;
+
+	native = *(const long *)sptr;
+	if(native < 0) ASN__ENCODE_FAILED;
+
+	key.nat_value = native;
+	kf = bsearch(&key, specs->value2enum, specs->map_count,
+	             sizeof(key), NativeEnumerated__compar_value2enum);
+	if(!kf) {
+		ASN_DEBUG("No element corresponds to %ld", native);
+		ASN__ENCODE_FAILED;
+	}
+	value = kf - specs->value2enum;
+
+	if(ct && ct->range_bits >= 0) {
+		int cmpWith = specs->extension
+		              ? specs->extension - 1 : specs->map_count;
+		if(value >= cmpWith)
+			inext = 1;
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+		if(inext) ct = 0;
+	} else if(inext) {
+		ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		if(per_put_few_bits(po, value, ct->range_bits))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	if(!specs->extension)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * X.691, #10.6: normally small non-negative whole number;
+	 */
+	ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
+	          value, specs->extension, inext,
+	          value - (inext ? (specs->extension - 1) : 0));
+	if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
diff --git a/e2ap/lib/NativeEnumerated_oer.c b/e2ap/lib/NativeEnumerated_oer.c
new file mode 100644
index 0000000..ee3c189
--- /dev/null
+++ b/e2ap/lib/NativeEnumerated_oer.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <NativeEnumerated.h>
+#include <errno.h>
+
+static long
+asn__nativeenumerated_convert(const uint8_t *b, const uint8_t *end) {
+    unsigned long value;
+
+    /* Perform the sign initialization */
+    /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
+    if((*b >> 7)) {
+        value = (unsigned long)(-1);
+    } else {
+        value = 0;
+    }
+
+    /* Conversion engine */
+    for(; b < end; b++) {
+        value = (value << 8) | *b;
+    }
+
+    return value;
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                            const asn_TYPE_descriptor_t *td,
+                            const asn_oer_constraints_t *constraints,
+                            void **nint_ptr, const void *ptr, size_t size) {
+    asn_dec_rval_t rval = {RC_OK, 0};
+    long *native = (long *)*nint_ptr;
+    const uint8_t *b = ptr;
+
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    if(size < 1) {
+        ASN__DECODE_STARVED;
+    }
+
+    if((*b & 0x80) == 0) {
+        /*
+         * X.696 (08/2015) #11.2 Short form for Enumerated.
+         */
+        if(!native) {
+            native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+            if(!native) ASN__DECODE_FAILED;
+        }
+
+        *native = *b;
+        rval.consumed = 1;
+    } else {
+        /*
+         * X.696 (08/2015) #11.4 Long form for Enumerated.
+         */
+        size_t length = *b & 0x7f;
+        const uint8_t *bend;
+        long value;
+
+        if(length < 1 || length > sizeof(*native)) {
+            ASN__DECODE_FAILED;
+        }
+        if((1 + length) > size) {
+            ASN__DECODE_STARVED;
+        }
+        b++;
+        bend = b + length;
+
+        value = asn__nativeenumerated_convert(b, bend);
+        if(value < 0) {
+            const asn_INTEGER_specifics_t *specs =
+                (const asn_INTEGER_specifics_t *)td->specifics;
+            if(specs && specs->field_unsigned) {
+                ASN__DECODE_FAILED;
+            }
+        }
+
+        if(!native) {
+            native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+            if(!native) ASN__DECODE_FAILED;
+        }
+
+        *native = value;
+
+        rval.consumed = (1 + length);
+    }
+
+    return rval;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+NativeEnumerated_encode_oer(const asn_TYPE_descriptor_t *td,
+                            const asn_oer_constraints_t *constraints,
+                            const void *sptr, asn_app_consume_bytes_f *cb,
+                            void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    long native;
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+
+    if(native >= 0 && native <= 127) {
+        /* #11.2 Short form */
+        uint8_t b = native;
+        er.encoded = 1;
+        if(cb(&b, er.encoded, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    } else {
+        /* #11.2 Long form */
+        uint8_t buf[1 + sizeof(native)];
+        uint8_t *b = &buf[sizeof(native)];  /* Last addressable */
+        long final_pattern = -1 * (native < 0);
+
+        for(;;) {
+            *b-- = native;
+            native >>= 8;
+            if(native == final_pattern) {
+                if(final_pattern) {
+                    if((b[1] & 0x80)) break;
+                } else {
+                    if(!(b[1] & 0x80)) break;
+                }
+            }
+        }
+        *b = 0x80 | (&buf[sizeof(native)] - b);
+        er.encoded = 1 + (&buf[sizeof(native)] - b);
+        if(cb(b, er.encoded, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/NativeInteger.c b/e2ap/lib/NativeInteger.c
new file mode 100644
index 0000000..316e872
--- /dev/null
+++ b/e2ap/lib/NativeInteger.c
@@ -0,0 +1,550 @@
+/*-
+ * Copyright (c) 2004, 2005, 2006 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Read the NativeInteger.h for the explanation wrt. differences between
+ * INTEGER and NativeInteger.
+ * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
+ * implementation deals with the standard (machine-specific) representation
+ * of them instead of using the platform-independent buffer.
+ */
+#include <asn_internal.h>
+#include <NativeInteger.h>
+
+/*
+ * NativeInteger basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_operation_t asn_OP_NativeInteger = {
+	NativeInteger_free,
+	NativeInteger_print,
+	NativeInteger_compare,
+	NativeInteger_decode_ber,
+	NativeInteger_encode_der,
+	NativeInteger_decode_xer,
+	NativeInteger_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NativeInteger_decode_oer,	/* OER decoder */
+	NativeInteger_encode_oer,	/* Canonical OER encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NativeInteger_decode_uper,	/* Unaligned PER decoder */
+	NativeInteger_encode_uper,	/* Unaligned PER encoder */
+	NativeInteger_decode_aper,	/* Aligned PER decoder */
+	NativeInteger_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NativeInteger_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
+	"INTEGER",			/* The ASN.1 type is still INTEGER */
+	"INTEGER",
+	&asn_OP_NativeInteger,
+	asn_DEF_NativeInteger_tags,
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
+	asn_DEF_NativeInteger_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+/*
+ * Decode INTEGER type.
+ */
+asn_dec_rval_t
+NativeInteger_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td, void **nint_ptr,
+                         const void *buf_ptr, size_t size, int tag_mode) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    long *native = (long *)*nint_ptr;
+	asn_dec_rval_t rval;
+	ber_tlv_len_t length;
+
+	/*
+	 * If the structure is not there, allocate it.
+	 */
+	if(native == NULL) {
+		native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+		if(native == NULL) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+			return rval;
+		}
+	}
+
+	ASN_DEBUG("Decoding %s as INTEGER (tm=%d)",
+		td->name, tag_mode);
+
+	/*
+	 * Check tags.
+	 */
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
+	if(rval.code != RC_OK)
+		return rval;
+
+	ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
+
+	/*
+	 * Make sure we have this length.
+	 */
+	buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+	size -= rval.consumed;
+	if(length > (ber_tlv_len_t)size) {
+		rval.code = RC_WMORE;
+		rval.consumed = 0;
+		return rval;
+	}
+
+	/*
+	 * ASN.1 encoded INTEGER: buf_ptr, length
+	 * Fill the native, at the same time checking for overflow.
+	 * If overflow occured, return with RC_FAIL.
+	 */
+	{
+		INTEGER_t tmp;
+		union {
+			const void *constbuf;
+			void *nonconstbuf;
+		} unconst_buf;
+		long l;
+
+		unconst_buf.constbuf = buf_ptr;
+		tmp.buf = (uint8_t *)unconst_buf.nonconstbuf;
+		tmp.size = length;
+
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */
+			: asn_INTEGER2long(&tmp, &l)) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+			return rval;
+		}
+
+		*native = l;
+	}
+
+	rval.code = RC_OK;
+	rval.consumed += length;
+
+	ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
+		(long)rval.consumed, (long)length, td->name, (long)*native);
+
+	return rval;
+}
+
+/*
+ * Encode the NativeInteger using the standard INTEGER type DER encoder.
+ */
+asn_enc_rval_t
+NativeInteger_encode_der(const asn_TYPE_descriptor_t *sd, const void *ptr,
+                         int tag_mode, ber_tlv_tag_t tag,
+                         asn_app_consume_bytes_f *cb, void *app_key) {
+	unsigned long native = *(const unsigned long *)ptr; /* Disable sign ext. */
+	asn_enc_rval_t erval = {0,0,0};
+	INTEGER_t tmp;
+
+#ifdef	WORDS_BIGENDIAN		/* Opportunistic optimization */
+
+	tmp.buf = (uint8_t *)&native;
+	tmp.size = sizeof(native);
+
+#else	/* Works even if WORDS_BIGENDIAN is not set where should've been */
+	uint8_t buf[sizeof(native)];
+	uint8_t *p;
+
+	/* Prepare a fake INTEGER */
+	for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8)
+		*p = (uint8_t)native;
+
+	tmp.buf = buf;
+	tmp.size = sizeof(buf);
+#endif	/* WORDS_BIGENDIAN */
+	
+	/* Encode fake INTEGER */
+	erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key);
+    if(erval.structure_ptr == &tmp) {
+        erval.structure_ptr = ptr;
+    }
+	return erval;
+}
+
+/*
+ * Decode the chunk of XML text encoding INTEGER.
+ */
+asn_dec_rval_t
+NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td, void **sptr,
+                         const char *opt_mname, const void *buf_ptr,
+                         size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval;
+	INTEGER_t st;
+	void *st_ptr = (void *)&st;
+	long *native = (long *)*sptr;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&st, 0, sizeof(st));
+	rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, 
+		opt_mname, buf_ptr, size);
+	if(rval.code == RC_OK) {
+		long l;
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */
+			: asn_INTEGER2long(&st, &l)) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+		} else {
+			*native = l;
+		}
+	} else {
+		/*
+		 * Cannot restart from the middle;
+		 * there is no place to save state in the native type.
+		 * Request a continuation from the very beginning.
+		 */
+		rval.consumed = 0;
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st);
+	return rval;
+}
+
+
+asn_enc_rval_t
+NativeInteger_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                         int ilevel, enum xer_encoder_flags_e flags,
+                         asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    char scratch[32];	/* Enough for 64-bit int */
+	asn_enc_rval_t er = {0,0,0};
+	const long *native = (const long *)sptr;
+
+	(void)ilevel;
+	(void)flags;
+
+	if(!native) ASN__ENCODE_FAILED;
+
+	er.encoded = snprintf(scratch, sizeof(scratch),
+			(specs && specs->field_unsigned)
+			? "%lu" : "%ld", *native);
+	if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch)
+		|| cb(scratch, er.encoded, app_key) < 0)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+NativeInteger_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr,
+                          asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval;
+	long *native = (long *)*sptr;
+	INTEGER_t tmpint;
+	void *tmpintptr = &tmpint;
+
+	(void)opt_codec_ctx;
+	ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name);
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&tmpint, 0, sizeof tmpint);
+	rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints,
+				   &tmpintptr, pd);
+	if(rval.code == RC_OK) {
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
+			: asn_INTEGER2long(&tmpint, native))
+			rval.code = RC_FAIL;
+		else
+			ASN_DEBUG("NativeInteger %s got value %ld",
+				td->name, *native);
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeInteger_encode_uper(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, asn_per_outp_t *po) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_enc_rval_t er = {0,0,0};
+	long native;
+	INTEGER_t tmpint;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+
+    ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native);
+
+	memset(&tmpint, 0, sizeof(tmpint));
+	if((specs&&specs->field_unsigned)
+		? asn_ulong2INTEGER(&tmpint, native)
+		: asn_long2INTEGER(&tmpint, native))
+		ASN__ENCODE_FAILED;
+	er = INTEGER_encode_uper(td, constraints, &tmpint, po);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+	return er;
+}
+
+asn_dec_rval_t
+NativeInteger_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval;
+	long *native = (long *)*sptr;
+	INTEGER_t tmpint;
+	void *tmpintptr = &tmpint;
+
+	(void)opt_codec_ctx;
+	ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name);
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&tmpint, 0, sizeof tmpint);
+	rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints,
+	                           &tmpintptr, pd);
+	if(rval.code == RC_OK) {
+		if((specs&&specs->field_unsigned)
+		        ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
+		        : asn_INTEGER2long(&tmpint, native))
+			rval.code = RC_FAIL;
+		else
+			ASN_DEBUG("NativeInteger %s got value %ld",
+			          td->name, *native);
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeInteger_encode_aper(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, asn_per_outp_t *po) {
+
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native;
+	INTEGER_t tmpint;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	native = *(const long *)sptr;
+
+	ASN_DEBUG("Encoding NativeInteger %s %ld (APER)", td->name, native);
+
+	memset(&tmpint, 0, sizeof(tmpint));
+	if((specs&&specs->field_unsigned)
+	        ? asn_ulong2INTEGER(&tmpint, (unsigned long)native)
+	        : asn_long2INTEGER(&tmpint, native))
+		ASN__ENCODE_FAILED;
+	er = INTEGER_encode_aper(td, constraints, &tmpint, po);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+	return er;
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+/*
+ * INTEGER specific human-readable output.
+ */
+int
+NativeInteger_print(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    const long *native = (const long *)sptr;
+    char scratch[32]; /* Enough for 64-bit int */
+    int ret;
+
+    (void)td;       /* Unused argument */
+    (void)ilevel;   /* Unused argument */
+
+    if(native) {
+        long value = *native;
+        ret = snprintf(scratch, sizeof(scratch),
+                       (specs && specs->field_unsigned) ? "%lu" : "%ld", value);
+        assert(ret > 0 && (size_t)ret < sizeof(scratch));
+        if(cb(scratch, ret, app_key) < 0) return -1;
+        if(specs && (value >= 0 || !specs->field_unsigned)) {
+            const asn_INTEGER_enum_map_t *el =
+                INTEGER_map_value2enum(specs, value);
+            if(el) {
+                if(cb(" (", 2, app_key) < 0) return -1;
+                if(cb(el->enum_name, el->enum_len, app_key) < 0) return -1;
+                if(cb(")", 1, app_key) < 0) return -1;
+            }
+        }
+        return 0;
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+NativeInteger_free(const asn_TYPE_descriptor_t *td, void *ptr,
+                   enum asn_struct_free_method method) {
+    if(!td || !ptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)",
+		td->name, method, ptr);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(ptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(ptr, 0, sizeof(long));
+        break;
+    }
+}
+
+int
+NativeInteger_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) {
+    (void)td;
+
+    if(aptr && bptr) {
+        const asn_INTEGER_specifics_t *specs =
+            (const asn_INTEGER_specifics_t *)td->specifics;
+        if(specs && specs->field_unsigned) {
+            const unsigned long *a = aptr;
+            const unsigned long *b = bptr;
+            if(*a < *b) {
+                return -1;
+            } else if(*a > *b) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            const long *a = aptr;
+            const long *b = bptr;
+            if(*a < *b) {
+                return -1;
+            } else if(*a > *b) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    } else if(!aptr) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+asn_random_fill_result_t
+NativeInteger_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                          const asn_encoding_constraints_t *constraints,
+                          size_t max_length) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    long *st = *sptr;
+    const asn_INTEGER_enum_map_t *emap;
+    size_t emap_len;
+    intmax_t value;
+    int find_inside_map;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (long *)CALLOC(1, sizeof(*st));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    if(specs) {
+        emap = specs->value2enum;
+        emap_len = specs->map_count;
+        if(specs->strict_enumeration) {
+            find_inside_map = emap_len > 0;
+        } else {
+            find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
+        }
+    } else {
+        emap = 0;
+        emap_len = 0;
+        find_inside_map = 0;
+    }
+
+    if(find_inside_map) {
+        assert(emap_len > 0);
+        value = emap[asn_random_between(0, emap_len - 1)].nat_value;
+    } else {
+        const asn_per_constraints_t *ct;
+
+        static const long variants[] = {
+            -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
+            -16383, -257,   -256,   -255,   -254,   -129,   -128,   -127,
+            -126,   -1,     0,      1,      126,    127,    128,    129,
+            254,    255,    256,    257,    16383,  16384,  16385,  32767,
+            32768,  32769,  65534,  65535,  65536,  65537};
+        if(specs && specs->field_unsigned) {
+            assert(variants[18] == 0);
+            value = variants[asn_random_between(
+                18, sizeof(variants) / sizeof(variants[0]) - 1)];
+        } else {
+            value = variants[asn_random_between(
+                0, sizeof(variants) / sizeof(variants[0]) - 1)];
+        }
+
+        if(!constraints) constraints = &td->encoding_constraints;
+        ct = constraints ? constraints->per_constraints : 0;
+        if(ct && (ct->value.flags & APC_CONSTRAINED)) {
+            if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
+                value = asn_random_between(ct->value.lower_bound,
+                                           ct->value.upper_bound);
+            }
+        }
+    }
+
+    *sptr = st;
+    *st = value;
+    return result_ok;
+}
diff --git a/e2ap/lib/NativeInteger_oer.c b/e2ap/lib/NativeInteger_oer.c
new file mode 100644
index 0000000..411413a
--- /dev/null
+++ b/e2ap/lib/NativeInteger_oer.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <NativeInteger.h>
+#include <errno.h>
+
+asn_dec_rval_t
+NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_oer_constraints_t *constraints,
+                         void **nint_ptr, const void *ptr, size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    long *native = (long *)*nint_ptr;
+    INTEGER_t tmpint;
+    INTEGER_t *tmpintptr = &tmpint;
+
+    memset(&tmpint, 0, sizeof(tmpint));
+
+    if(!native) {
+        native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+        if(!native) ASN__DECODE_FAILED;
+    }
+
+    /*
+     * OPTIMIZATION: Encode directly rather than passing through INTEGER.
+     * Saves a memory allocation.
+     */
+    rval = INTEGER_decode_oer(opt_codec_ctx, td, constraints,
+                              (void **)&tmpintptr, ptr, size);
+    if(rval.code != RC_OK) {
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        return rval;
+    }
+
+    if(specs && specs->field_unsigned) {
+        unsigned long ul;
+        int ok = asn_INTEGER2ulong(&tmpint, &ul) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
+            *native = ul;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
+        }
+    } else {
+        long l;
+        int ok = asn_INTEGER2long(&tmpint, &l) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
+            *native = l;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
+        }
+    }
+
+    return rval;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+NativeInteger_encode_oer(const asn_TYPE_descriptor_t *td,
+                         const asn_oer_constraints_t *constraints,
+                         const void *sptr, asn_app_consume_bytes_f *cb,
+                         void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    INTEGER_t tmpint;
+    long native;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+    memset(&tmpint, 0, sizeof(tmpint));
+
+    ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native);
+
+    if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native)
+                                        : asn_long2INTEGER(&tmpint, native)) {
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        ASN__ENCODE_FAILED;
+    } else {
+        asn_enc_rval_t er =
+            INTEGER_encode_oer(td, constraints, &tmpint, cb, app_key);
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        return er;
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/OCTET_STRING.c b/e2ap/lib/OCTET_STRING.c
new file mode 100644
index 0000000..ae34c96
--- /dev/null
+++ b/e2ap/lib/OCTET_STRING.c
@@ -0,0 +1,2411 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OCTET_STRING.h>
+#include <BIT_STRING.h>	/* for .bits_unused member */
+#include <errno.h>
+
+/*
+ * OCTET STRING basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs = {
+	sizeof(OCTET_STRING_t),
+	offsetof(OCTET_STRING_t, _asn_ctx),
+	ASN_OSUBV_STR
+};
+
+asn_TYPE_operation_t asn_OP_OCTET_STRING = {
+	OCTET_STRING_free,
+	OCTET_STRING_print,	/* OCTET STRING generally means a non-ascii sequence */
+	OCTET_STRING_compare,
+	OCTET_STRING_decode_ber,
+	OCTET_STRING_encode_der,
+	OCTET_STRING_decode_xer_hex,
+	OCTET_STRING_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	OCTET_STRING_decode_oer,
+	OCTET_STRING_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	OCTET_STRING_decode_uper,	/* Unaligned PER decoder */
+	OCTET_STRING_encode_uper,	/* Unaligned PER encoder */
+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	OCTET_STRING_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = {
+	"OCTET STRING",		/* Canonical name */
+	"OCTET_STRING",		/* XML tag name */
+	&asn_OP_OCTET_STRING,
+	asn_DEF_OCTET_STRING_tags,
+	sizeof(asn_DEF_OCTET_STRING_tags)
+	  / sizeof(asn_DEF_OCTET_STRING_tags[0]),
+	asn_DEF_OCTET_STRING_tags,	/* Same as above */
+	sizeof(asn_DEF_OCTET_STRING_tags)
+	  / sizeof(asn_DEF_OCTET_STRING_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs
+};
+
+#undef	_CH_PHASE
+#undef	NEXT_PHASE
+#undef	PREV_PHASE
+#define	_CH_PHASE(ctx, inc) do {					\
+		if(ctx->phase == 0)					\
+			ctx->context = 0;				\
+		ctx->phase += inc;					\
+	} while(0)
+#define	NEXT_PHASE(ctx)	_CH_PHASE(ctx, +1)
+#define	PREV_PHASE(ctx)	_CH_PHASE(ctx, -1)
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {					\
+		size_t num = (num_bytes);				\
+		buf_ptr = ((const char *)buf_ptr) + num;		\
+		size -= num;						\
+		consumed_myself += num;					\
+	} while(0)
+
+#undef	RETURN
+#define	RETURN(_code)	do {						\
+		asn_dec_rval_t tmprval;					\
+		tmprval.code = _code;					\
+		tmprval.consumed = consumed_myself;			\
+		return tmprval;						\
+	} while(0)
+
+#undef	APPEND
+#define	APPEND(bufptr, bufsize)	do {					\
+		size_t _bs = (bufsize);		/* Append size */	\
+		size_t _ns = ctx->context;	/* Allocated now */	\
+		size_t _es = st->size + _bs;	/* Expected size */	\
+		/* int is really a typeof(st->size): */			\
+		if((int)_es < 0) RETURN(RC_FAIL);			\
+		if(_ns <= _es) {					\
+			void *ptr;					\
+			/* Be nice and round to the memory allocator */	\
+			do { _ns = _ns ? _ns << 1 : 16; }		\
+			    while(_ns <= _es);				\
+			/* int is really a typeof(st->size): */		\
+			if((int)_ns < 0) RETURN(RC_FAIL);		\
+			ptr = REALLOC(st->buf, _ns);			\
+			if(ptr) {					\
+				st->buf = (uint8_t *)ptr;		\
+				ctx->context = _ns;			\
+			} else {					\
+				RETURN(RC_FAIL);			\
+			}						\
+			ASN_DEBUG("Reallocating into %ld", (long)_ns);	\
+		}							\
+		memcpy(st->buf + st->size, bufptr, _bs);		\
+		/* Convenient nul-termination */			\
+		st->buf[_es] = '\0';					\
+		st->size = _es;						\
+	} while(0)
+
+/*
+ * The main reason why ASN.1 is still alive is that too much time and effort
+ * is necessary for learning it more or less adequately, thus creating a gut
+ * necessity to demonstrate that aquired skill everywhere afterwards.
+ * No, I am not going to explain what the following stuff is.
+ */
+struct _stack_el {
+    ber_tlv_len_t left;     /* What's left to read (or -1) */
+    ber_tlv_len_t got;      /* What was actually processed */
+    unsigned cont_level;    /* Depth of subcontainment */
+    int want_nulls;         /* Want null "end of content" octets? */
+    int bits_chopped;       /* Flag in BIT STRING mode */
+    ber_tlv_tag_t tag;      /* For debugging purposes */
+    struct _stack_el *prev;
+    struct _stack_el *next;
+};
+struct _stack {
+	struct _stack_el *tail;
+	struct _stack_el *cur_ptr;
+};
+
+static struct _stack_el *
+OS__add_stack_el(struct _stack *st) {
+	struct _stack_el *nel;
+
+	/*
+	 * Reuse the old stack frame or allocate a new one.
+	 */
+	if(st->cur_ptr && st->cur_ptr->next) {
+		nel = st->cur_ptr->next;
+		nel->bits_chopped = 0;
+		nel->got = 0;
+		/* Retain the nel->cont_level, it's correct. */
+	} else {
+		nel = (struct _stack_el *)CALLOC(1, sizeof(struct _stack_el));
+		if(nel == NULL)
+			return NULL;
+
+		if(st->tail) {
+			/* Increase a subcontainment depth */
+			nel->cont_level = st->tail->cont_level + 1;
+			st->tail->next = nel;
+		}
+		nel->prev = st->tail;
+		st->tail = nel;
+	}
+
+	st->cur_ptr = nel;
+
+	return nel;
+}
+
+static struct _stack *
+_new_stack(void) {
+	return (struct _stack *)CALLOC(1, sizeof(struct _stack));
+}
+
+/*
+ * Decode OCTET STRING type.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                        const asn_TYPE_descriptor_t *td, void **sptr,
+                        const void *buf_ptr, size_t size, int tag_mode) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	asn_dec_rval_t rval;
+	asn_struct_ctx_t *ctx;
+	ssize_t consumed_myself = 0;
+	struct _stack *stck;		/* Expectations stack structure */
+	struct _stack_el *sel = 0;	/* Stack element */
+	int tlv_constr;
+	enum asn_OS_Subvariant type_variant = specs->subvariant;
+
+	ASN_DEBUG("Decoding %s as %s (frame %ld)",
+		td->name,
+		(type_variant == ASN_OSUBV_STR) ?
+			"OCTET STRING" : "OS-SpecialCase",
+		(long)size);
+
+	/*
+	 * Create the string if does not exist.
+	 */
+	if(st == NULL) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(st == NULL) RETURN(RC_FAIL);
+	}
+
+	/* Restore parsing context */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * Check tags.
+		 */
+		rval = ber_check_tags(opt_codec_ctx, td, ctx,
+			buf_ptr, size, tag_mode, -1,
+			&ctx->left, &tlv_constr);
+		if(rval.code != RC_OK)
+			return rval;
+
+		if(tlv_constr) {
+			/*
+			 * Complex operation, requires stack of expectations.
+			 */
+			ctx->ptr = _new_stack();
+			if(!ctx->ptr) {
+				RETURN(RC_FAIL);
+			}
+		} else {
+			/*
+			 * Jump into stackless primitive decoding.
+			 */
+			_CH_PHASE(ctx, 3);
+			if(type_variant == ASN_OSUBV_ANY && tag_mode != 1)
+				APPEND(buf_ptr, rval.consumed);
+			ADVANCE(rval.consumed);
+			goto phase3;
+		}
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 1:
+	phase1:
+		/*
+		 * Fill the stack with expectations.
+		 */
+		stck = (struct _stack *)ctx->ptr;
+		sel = stck->cur_ptr;
+	  do {
+		ber_tlv_tag_t tlv_tag;
+		ber_tlv_len_t tlv_len;
+		ber_tlv_tag_t expected_tag;
+		ssize_t tl, ll, tlvl;
+				/* This one works even if (sel->left == -1) */
+		size_t Left = ((!sel||(size_t)sel->left >= size)
+					?size:(size_t)sel->left);
+
+
+		ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", (void *)sel,
+			(long)(sel?sel->left:0),
+			(long)(sel?sel->want_nulls:0),
+			(long)(sel?sel->got:0)
+		);
+		if(sel && sel->left <= 0 && sel->want_nulls == 0) {
+			if(sel->prev) {
+				struct _stack_el *prev = sel->prev;
+				if(prev->left != -1) {
+					if(prev->left < sel->got)
+						RETURN(RC_FAIL);
+					prev->left -= sel->got;
+				}
+				prev->got += sel->got;
+				sel = stck->cur_ptr = prev;
+				if(!sel) break;
+				tlv_constr = 1;
+				continue;
+			} else {
+				sel = stck->cur_ptr = 0;
+				break;	/* Nothing to wait */
+			}
+		}
+
+		tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag);
+		ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld",
+			(long)size, (long)Left, sel?"":"!",
+			(long)(sel?sel->left:0),
+			(long)(sel?sel->want_nulls:0),
+			(long)tl);
+		switch(tl) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		tlv_constr = BER_TLV_CONSTRUCTED(buf_ptr);
+
+		ll = ber_fetch_length(tlv_constr,
+				(const char *)buf_ptr + tl,Left - tl,&tlv_len);
+		ASN_DEBUG("Got tag=%s, tc=%d, left=%ld, tl=%ld, len=%ld, ll=%ld",
+			ber_tlv_tag_string(tlv_tag), tlv_constr,
+				(long)Left, (long)tl, (long)tlv_len, (long)ll);
+		switch(ll) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		if(sel && sel->want_nulls
+			&& ((const uint8_t *)buf_ptr)[0] == 0
+			&& ((const uint8_t *)buf_ptr)[1] == 0)
+		{
+
+			ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls);
+
+			if(type_variant == ASN_OSUBV_ANY
+			&& (tag_mode != 1 || sel->cont_level))
+				APPEND("\0\0", 2);
+
+			ADVANCE(2);
+			sel->got += 2;
+			if(sel->left != -1) {
+				sel->left -= 2;	/* assert(sel->left >= 2) */
+			}
+
+			sel->want_nulls--;
+			if(sel->want_nulls == 0) {
+				/* Move to the next expectation */
+				sel->left = 0;
+				tlv_constr = 1;
+			}
+
+			continue;
+		}
+
+		/*
+		 * Set up expected tags,
+		 * depending on ASN.1 type being decoded.
+		 */
+		switch(type_variant) {
+		case ASN_OSUBV_BIT:
+			/* X.690: 8.6.4.1, NOTE 2 */
+			/* Fall through */
+		case ASN_OSUBV_STR:
+		default:
+			if(sel) {
+				unsigned level = sel->cont_level;
+				if(level < td->all_tags_count) {
+					expected_tag = td->all_tags[level];
+					break;
+				} else if(td->all_tags_count) {
+					expected_tag = td->all_tags
+						[td->all_tags_count - 1];
+					break;
+				}
+				/* else, Fall through */
+			}
+			/* Fall through */
+		case ASN_OSUBV_ANY:
+			expected_tag = tlv_tag;
+			break;
+		}
+
+
+		if(tlv_tag != expected_tag) {
+			char buf[2][32];
+			ber_tlv_tag_snprint(tlv_tag,
+				buf[0], sizeof(buf[0]));
+			ber_tlv_tag_snprint(td->tags[td->tags_count-1],
+				buf[1], sizeof(buf[1]));
+			ASN_DEBUG("Tag does not match expectation: %s != %s",
+				buf[0], buf[1]);
+			RETURN(RC_FAIL);
+		}
+
+		tlvl = tl + ll;	/* Combined length of T and L encoding */
+		if((tlv_len + tlvl) < 0) {
+			/* tlv_len value is too big */
+			ASN_DEBUG("TLV encoding + length (%ld) is too big",
+				(long)tlv_len);
+			RETURN(RC_FAIL);
+		}
+
+		/*
+		 * Append a new expectation.
+		 */
+		sel = OS__add_stack_el(stck);
+		if(!sel) RETURN(RC_FAIL);
+
+		sel->tag = tlv_tag;
+
+		sel->want_nulls = (tlv_len==-1);
+		if(sel->prev && sel->prev->left != -1) {
+			/* Check that the parent frame is big enough */
+			if(sel->prev->left < tlvl + (tlv_len==-1?0:tlv_len))
+				RETURN(RC_FAIL);
+			if(tlv_len == -1)
+				sel->left = sel->prev->left - tlvl;
+			else
+				sel->left = tlv_len;
+		} else {
+			sel->left = tlv_len;
+		}
+		if(type_variant == ASN_OSUBV_ANY
+		&& (tag_mode != 1 || sel->cont_level))
+			APPEND(buf_ptr, tlvl);
+		sel->got += tlvl;
+		ADVANCE(tlvl);
+
+		ASN_DEBUG("+EXPECT2 got=%ld left=%ld, wn=%d, clvl=%u",
+			(long)sel->got, (long)sel->left,
+			sel->want_nulls, sel->cont_level);
+
+	  } while(tlv_constr);
+		if(sel == NULL) {
+			/* Finished operation, "phase out" */
+			ASN_DEBUG("Phase out");
+			_CH_PHASE(ctx, +3);
+			break;
+		}
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 2:
+		stck = (struct _stack *)ctx->ptr;
+		sel = stck->cur_ptr;
+		ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d",
+			(long)sel->left, (long)size, (long)sel->got,
+				sel->want_nulls);
+	    {
+		ber_tlv_len_t len;
+
+		assert(sel->left >= 0);
+
+		len = ((ber_tlv_len_t)size < sel->left)
+				? (ber_tlv_len_t)size : sel->left;
+		if(len > 0) {
+			if(type_variant == ASN_OSUBV_BIT
+			&& sel->bits_chopped == 0) {
+				/* Put the unused-bits-octet away */
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				APPEND(((const char *)buf_ptr+1), (len - 1));
+				sel->bits_chopped = 1;
+			} else {
+				APPEND(buf_ptr, len);
+			}
+			ADVANCE(len);
+			sel->left -= len;
+			sel->got += len;
+		}
+
+		if(sel->left) {
+			ASN_DEBUG("OS left %ld, size = %ld, wn=%d\n",
+				(long)sel->left, (long)size, sel->want_nulls);
+			RETURN(RC_WMORE);
+		}
+
+		PREV_PHASE(ctx);
+		goto phase1;
+	    }
+		break;
+	case 3:
+	phase3:
+		/*
+		 * Primitive form, no stack required.
+		 */
+		assert(ctx->left >= 0);
+
+		if(size < (size_t)ctx->left) {
+			if(!size) RETURN(RC_WMORE);
+			if(type_variant == ASN_OSUBV_BIT && !ctx->context) {
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				ctx->left--;
+				ADVANCE(1);
+			}
+			APPEND(buf_ptr, size);
+			assert(ctx->context > 0);
+			ctx->left -= size;
+			ADVANCE(size);
+			RETURN(RC_WMORE);
+		} else {
+			if(type_variant == ASN_OSUBV_BIT
+			&& !ctx->context && ctx->left) {
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				ctx->left--;
+				ADVANCE(1);
+			}
+			APPEND(buf_ptr, ctx->left);
+			ADVANCE(ctx->left);
+			ctx->left = 0;
+
+			NEXT_PHASE(ctx);
+		}
+		break;
+	}
+
+	if(sel) {
+		ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld",
+			(void *)sel->prev, sel->want_nulls,
+			(long)sel->left, (long)sel->got, (long)size);
+		if(sel->prev || sel->want_nulls > 1 || sel->left > 0) {
+			RETURN(RC_WMORE);
+		}
+	}
+
+	/*
+	 * BIT STRING-specific processing.
+	 */
+	if(type_variant == ASN_OSUBV_BIT) {
+        if(st->size) {
+			if(st->bits_unused < 0 || st->bits_unused > 7) {
+				RETURN(RC_FAIL);
+			}
+			/* Finalize BIT STRING: zero out unused bits. */
+			st->buf[st->size-1] &= 0xff << st->bits_unused;
+		} else {
+			if(st->bits_unused) {
+				RETURN(RC_FAIL);
+			}
+		}
+	}
+
+	ASN_DEBUG("Took %ld bytes to encode %s: [%s]:%ld",
+		(long)consumed_myself, td->name,
+		(type_variant == ASN_OSUBV_STR) ? (char *)st->buf : "<data>",
+		(long)st->size);
+
+
+	RETURN(RC_OK);
+}
+
+/*
+ * Encode OCTET STRING type using DER.
+ */
+asn_enc_rval_t
+OCTET_STRING_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int tag_mode, ber_tlv_tag_t tag,
+                        asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = { 0, 0, 0 };
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	enum asn_OS_Subvariant type_variant = specs->subvariant;
+	int fix_last_byte = 0;
+
+	ASN_DEBUG("%s %s as OCTET STRING",
+		cb?"Estimating":"Encoding", td->name);
+
+	/*
+	 * Write tags.
+	 */
+	if(type_variant != ASN_OSUBV_ANY || tag_mode == 1) {
+		er.encoded = der_write_tags(td,
+				(type_variant == ASN_OSUBV_BIT) + st->size,
+			tag_mode, type_variant == ASN_OSUBV_ANY, tag,
+			cb, app_key);
+		if(er.encoded == -1) {
+			er.failed_type = td;
+			er.structure_ptr = sptr;
+			return er;
+		}
+	} else {
+		/* Disallow: [<tag>] IMPLICIT ANY */
+		assert(type_variant != ASN_OSUBV_ANY || tag_mode != -1);
+		er.encoded = 0;
+	}
+
+	if(!cb) {
+		er.encoded += (type_variant == ASN_OSUBV_BIT) + st->size;
+		ASN__ENCODED_OK(er);
+	}
+
+	/*
+	 * Prepare to deal with the last octet of BIT STRING.
+	 */
+	if(type_variant == ASN_OSUBV_BIT) {
+		uint8_t b = st->bits_unused & 0x07;
+		if(b && st->size) fix_last_byte = 1;
+		ASN__CALLBACK(&b, 1);
+	}
+
+	/* Invoke callback for the main part of the buffer */
+	ASN__CALLBACK(st->buf, st->size - fix_last_byte);
+
+	/* The last octet should be stripped off the unused bits */
+	if(fix_last_byte) {
+		uint8_t b = st->buf[st->size-1] & (0xff << st->bits_unused);
+		ASN__CALLBACK(&b, 1);
+	}
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int ilevel, enum xer_encoder_flags_e flags,
+                        asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	char scratch[16 * 3 + 4];
+	char *p = scratch;
+	uint8_t *buf;
+	uint8_t *end;
+	size_t i;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	/*
+	 * Dump the contents of the buffer in hexadecimal.
+	 */
+	buf = st->buf;
+	end = buf + st->size;
+	if(flags & XER_F_CANONICAL) {
+		char *scend = scratch + (sizeof(scratch) - 2);
+		for(; buf < end; buf++) {
+			if(p >= scend) {
+				ASN__CALLBACK(scratch, p - scratch);
+				p = scratch;
+			}
+			*p++ = h2c[(*buf >> 4) & 0x0F];
+			*p++ = h2c[*buf & 0x0F];
+		}
+
+		ASN__CALLBACK(scratch, p-scratch);	/* Dump the rest */
+	} else {
+		for(i = 0; buf < end; buf++, i++) {
+			if(!(i % 16) && (i || st->size > 16)) {
+				ASN__CALLBACK(scratch, p-scratch);
+				p = scratch;
+				ASN__TEXT_INDENT(1, ilevel);
+			}
+			*p++ = h2c[(*buf >> 4) & 0x0F];
+			*p++ = h2c[*buf & 0x0F];
+			*p++ = 0x20;
+		}
+		if(p - scratch) {
+			p--;	/* Remove the tail space */
+			ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */
+			if(st->size > 16)
+				ASN__TEXT_INDENT(1, ilevel-1);
+		}
+	}
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+static const struct OCTET_STRING__xer_escape_table_s {
+	const char *string;
+	int size;
+} OCTET_STRING__xer_escape_table[] = {
+#define	OSXET(s)	{ s, sizeof(s) - 1 }
+	OSXET("\074\156\165\154\057\076"),	/* <nul/> */
+	OSXET("\074\163\157\150\057\076"),	/* <soh/> */
+	OSXET("\074\163\164\170\057\076"),	/* <stx/> */
+	OSXET("\074\145\164\170\057\076"),	/* <etx/> */
+	OSXET("\074\145\157\164\057\076"),	/* <eot/> */
+	OSXET("\074\145\156\161\057\076"),	/* <enq/> */
+	OSXET("\074\141\143\153\057\076"),	/* <ack/> */
+	OSXET("\074\142\145\154\057\076"),	/* <bel/> */
+	OSXET("\074\142\163\057\076"),		/* <bs/> */
+	OSXET("\011"),				/* \t */
+	OSXET("\012"),				/* \n */
+	OSXET("\074\166\164\057\076"),		/* <vt/> */
+	OSXET("\074\146\146\057\076"),		/* <ff/> */
+	OSXET("\015"),				/* \r */
+	OSXET("\074\163\157\057\076"),		/* <so/> */
+	OSXET("\074\163\151\057\076"),		/* <si/> */
+	OSXET("\074\144\154\145\057\076"),	/* <dle/> */
+	OSXET("\074\144\143\061\057\076"),	/* <de1/> */
+	OSXET("\074\144\143\062\057\076"),	/* <de2/> */
+	OSXET("\074\144\143\063\057\076"),	/* <de3/> */
+	OSXET("\074\144\143\064\057\076"),	/* <de4/> */
+	OSXET("\074\156\141\153\057\076"),	/* <nak/> */
+	OSXET("\074\163\171\156\057\076"),	/* <syn/> */
+	OSXET("\074\145\164\142\057\076"),	/* <etb/> */
+	OSXET("\074\143\141\156\057\076"),	/* <can/> */
+	OSXET("\074\145\155\057\076"),		/* <em/> */
+	OSXET("\074\163\165\142\057\076"),	/* <sub/> */
+	OSXET("\074\145\163\143\057\076"),	/* <esc/> */
+	OSXET("\074\151\163\064\057\076"),	/* <is4/> */
+	OSXET("\074\151\163\063\057\076"),	/* <is3/> */
+	OSXET("\074\151\163\062\057\076"),	/* <is2/> */
+	OSXET("\074\151\163\061\057\076"),	/* <is1/> */
+	{ 0, 0 },	/* " " */
+	{ 0, 0 },	/* ! */
+	{ 0, 0 },	/* \" */
+	{ 0, 0 },	/* # */
+	{ 0, 0 },	/* $ */
+	{ 0, 0 },	/* % */
+	OSXET("\046\141\155\160\073"),	/* &amp; */
+	{ 0, 0 },	/* ' */
+	{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* ()*+,-./ */
+	{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* 01234567 */
+	{0,0},{0,0},{0,0},{0,0},			 /* 89:; */
+	OSXET("\046\154\164\073"),	/* &lt; */
+	{ 0, 0 },	/* = */
+	OSXET("\046\147\164\073"),	/* &gt; */
+};
+
+static int
+OS__check_escaped_control_char(const void *buf, int size) {
+	size_t i;
+	/*
+	 * Inefficient algorithm which translates the escape sequences
+	 * defined above into characters. Returns -1 if not found.
+	 * TODO: replace by a faster algorithm (bsearch(), hash or
+	 * nested table lookups).
+	 */
+	for(i = 0; i < 32 /* Don't spend time on the bottom half */; i++) {
+		const struct OCTET_STRING__xer_escape_table_s *el;
+		el = &OCTET_STRING__xer_escape_table[i];
+		if(el->size == size && memcmp(buf, el->string, size) == 0)
+			return i;
+	}
+	return -1;
+}
+
+static int
+OCTET_STRING__handle_control_chars(void *struct_ptr, const void *chunk_buf, size_t chunk_size) {
+	/*
+	 * This might be one of the escape sequences
+	 * for control characters. Check it out.
+	 * #11.15.5
+	 */
+	int control_char = OS__check_escaped_control_char(chunk_buf,chunk_size);
+	if(control_char >= 0) {
+		OCTET_STRING_t *st = (OCTET_STRING_t *)struct_ptr;
+		void *p = REALLOC(st->buf, st->size + 2);
+		if(p) {
+			st->buf = (uint8_t *)p;
+			st->buf[st->size++] = control_char;
+			st->buf[st->size] = '\0';	/* nul-termination */
+			return 0;
+		}
+	}
+
+	return -1;	/* No, it's not */
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_xer_utf8(const asn_TYPE_descriptor_t *td, const void *sptr,
+                             int ilevel, enum xer_encoder_flags_e flags,
+                             asn_app_consume_bytes_f *cb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	uint8_t *buf, *end;
+	uint8_t *ss;	/* Sequence start */
+	ssize_t encoded_len = 0;
+
+	(void)ilevel;	/* Unused argument */
+	(void)flags;	/* Unused argument */
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	buf = st->buf;
+	end = buf + st->size;
+	for(ss = buf; buf < end; buf++) {
+		unsigned int ch = *buf;
+		int s_len;	/* Special encoding sequence length */
+
+		/*
+		 * Escape certain characters: X.680/11.15
+		 */
+		if(ch < sizeof(OCTET_STRING__xer_escape_table)
+			/sizeof(OCTET_STRING__xer_escape_table[0])
+		&& (s_len = OCTET_STRING__xer_escape_table[ch].size)) {
+			if(((buf - ss) && cb(ss, buf - ss, app_key) < 0)
+			|| cb(OCTET_STRING__xer_escape_table[ch].string, s_len,
+					app_key) < 0)
+				ASN__ENCODE_FAILED;
+			encoded_len += (buf - ss) + s_len;
+			ss = buf + 1;
+		}
+	}
+
+	encoded_len += (buf - ss);
+	if((buf - ss) && cb(ss, buf - ss, app_key) < 0)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = encoded_len;
+	ASN__ENCODED_OK(er);
+}
+
+/*
+ * Convert from hexadecimal format (cstring): "AB CD EF"
+ */
+static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) {
+	OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const char *chunk_stop = (const char *)chunk_buf;
+	const char *p = chunk_stop;
+	const char *pend = p + chunk_size;
+	unsigned int clv = 0;
+	int half = 0;	/* Half bit */
+	uint8_t *buf;
+
+	/* Reallocate buffer according to high cap estimation */
+	size_t new_size = st->size + (chunk_size + 1) / 2;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	/*
+	 * If something like " a b c " appears here, the " a b":3 will be
+	 * converted, and the rest skipped. That is, unless buf_size is greater
+	 * than chunk_size, then it'll be equivalent to "ABC0".
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		switch(ch) {
+		case 0x09: case 0x0a: case 0x0c: case 0x0d:
+		case 0x20:
+			/* Ignore whitespace */
+			continue;
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/
+			clv = (clv << 4) + (ch - 0x30);
+			break;
+		case 0x41: case 0x42: case 0x43:	/* ABC */
+		case 0x44: case 0x45: case 0x46:	/* DEF */
+			clv = (clv << 4) + (ch - 0x41 + 10);
+			break;
+		case 0x61: case 0x62: case 0x63:	/* abc */
+		case 0x64: case 0x65: case 0x66:	/* def */
+			clv = (clv << 4) + (ch - 0x61 + 10);
+			break;
+		default:
+			*buf = 0;	/* JIC */
+			return -1;
+		}
+		if(half++) {
+			half = 0;
+			*buf++ = clv;
+			chunk_stop = p + 1;
+		}
+	}
+
+	/*
+	 * Check partial decoding.
+	 */
+	if(half) {
+		if(have_more) {
+			/*
+			 * Partial specification is fine,
+			 * because no more more PXER_TEXT data is available.
+			 */
+			*buf++ = clv << 4;
+			chunk_stop = p;
+		}
+	} else {
+		chunk_stop = p;
+	}
+
+	st->size = buf - st->buf;	/* Adjust the buffer size */
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return (chunk_stop - (const char *)chunk_buf);	/* Converted size */
+}
+
+/*
+ * Convert from binary format: "00101011101"
+ */
+static ssize_t OCTET_STRING__convert_binary(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) {
+	BIT_STRING_t *st = (BIT_STRING_t *)sptr;
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+	int bits_unused = st->bits_unused & 0x7;
+	uint8_t *buf;
+
+	/* Reallocate buffer according to high cap estimation */
+	size_t new_size = st->size + (chunk_size + 7) / 8;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	(void)have_more;
+
+	if(bits_unused == 0)
+		bits_unused = 8;
+	else if(st->size)
+		buf--;
+
+	/*
+	 * Convert series of 0 and 1 into the octet string.
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		switch(ch) {
+		case 0x09: case 0x0a: case 0x0c: case 0x0d:
+		case 0x20:
+			/* Ignore whitespace */
+			break;
+		case 0x30:
+		case 0x31:
+			if(bits_unused-- <= 0) {
+				*++buf = 0;	/* Clean the cell */
+				bits_unused = 7;
+			}
+			*buf |= (ch&1) << bits_unused;
+			break;
+		default:
+			st->bits_unused = bits_unused;
+			return -1;
+		}
+	}
+
+	if(bits_unused == 8) {
+		st->size = buf - st->buf;
+		st->bits_unused = 0;
+	} else {
+		st->size = buf - st->buf + 1;
+		st->bits_unused = bits_unused;
+	}
+
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return chunk_size;	/* Converted in full */
+}
+
+/*
+ * Something like strtod(), but with stricter rules.
+ */
+static int
+OS__strtoent(int base, const char *buf, const char *end, int32_t *ret_value) {
+	const int32_t last_unicode_codepoint = 0x10ffff;
+	int32_t val = 0;
+	const char *p;
+
+	for(p = buf; p < end; p++) {
+		int ch = *p;
+
+		switch(ch) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/
+			val = val * base + (ch - 0x30);
+			break;
+		case 0x41: case 0x42: case 0x43:	/* ABC */
+		case 0x44: case 0x45: case 0x46:	/* DEF */
+			val = val * base + (ch - 0x41 + 10);
+			break;
+		case 0x61: case 0x62: case 0x63:	/* abc */
+		case 0x64: case 0x65: case 0x66:	/* def */
+			val = val * base + (ch - 0x61 + 10);
+			break;
+		case 0x3b:	/* ';' */
+			*ret_value = val;
+			return (p - buf) + 1;
+		default:
+			return -1;	/* Character set error */
+		}
+
+		/* Value exceeds the Unicode range. */
+		if(val > last_unicode_codepoint) {
+			return -1;
+		}
+	}
+
+	*ret_value = -1;
+	return (p - buf);
+}
+
+/*
+ * Convert from the plain UTF-8 format, expanding entity references: "2 &lt; 3"
+ */
+static ssize_t
+OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf,
+                              size_t chunk_size, int have_more) {
+    OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+	uint8_t *buf;
+
+	/* Reallocate buffer */
+	size_t new_size = st->size + chunk_size;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	/*
+	 * Convert series of 0 and 1 into the octet string.
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		int len;	/* Length of the rest of the chunk */
+
+		if(ch != 0x26 /* '&' */) {
+			*buf++ = ch;
+			continue;	/* That was easy... */
+		}
+
+		/*
+		 * Process entity reference.
+		 */
+		len = chunk_size - (p - (const char *)chunk_buf);
+		if(len == 1 /* "&" */) goto want_more;
+		if(p[1] == 0x23 /* '#' */) {
+			const char *pval;	/* Pointer to start of digits */
+			int32_t val = 0;	/* Entity reference value */
+			int base;
+
+			if(len == 2 /* "&#" */) goto want_more;
+			if(p[2] == 0x78 /* 'x' */)
+				pval = p + 3, base = 16;
+			else
+				pval = p + 2, base = 10;
+			len = OS__strtoent(base, pval, p + len, &val);
+			if(len == -1) {
+				/* Invalid charset. Just copy verbatim. */
+				*buf++ = ch;
+				continue;
+			}
+			if(!len || pval[len-1] != 0x3b) goto want_more;
+			assert(val > 0);
+			p += (pval - p) + len - 1; /* Advance past entref */
+
+			if(val < 0x80) {
+				*buf++ = (char)val;
+			} else if(val < 0x800) {
+				*buf++ = 0xc0 | ((val >> 6));
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x10000) {
+				*buf++ = 0xe0 | ((val >> 12));
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x200000) {
+				*buf++ = 0xf0 | ((val >> 18));
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x4000000) {
+				*buf++ = 0xf8 | ((val >> 24));
+				*buf++ = 0x80 | ((val >> 18) & 0x3f);
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else {
+				*buf++ = 0xfc | ((val >> 30) & 0x1);
+				*buf++ = 0x80 | ((val >> 24) & 0x3f);
+				*buf++ = 0x80 | ((val >> 18) & 0x3f);
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			}
+		} else {
+			/*
+			 * Ugly, limited parsing of &amp; &gt; &lt;
+			 */
+			char *sc = (char *)memchr(p, 0x3b, len > 5 ? 5 : len);
+			if(!sc) goto want_more;
+			if((sc - p) == 4
+				&& p[1] == 0x61	/* 'a' */
+				&& p[2] == 0x6d	/* 'm' */
+				&& p[3] == 0x70	/* 'p' */) {
+				*buf++ = 0x26;
+				p = sc;
+				continue;
+			}
+			if((sc - p) == 3) {
+				if(p[1] == 0x6c) {
+					*buf = 0x3c;	/* '<' */
+				} else if(p[1] == 0x67) {
+					*buf = 0x3e;	/* '>' */
+				} else {
+					/* Unsupported entity reference */
+					*buf++ = ch;
+					continue;
+				}
+				if(p[2] != 0x74) {
+					/* Unsupported entity reference */
+					*buf++ = ch;
+					continue;
+				}
+				buf++;
+				p = sc;
+				continue;
+			}
+			/* Unsupported entity reference */
+			*buf++ = ch;
+		}
+
+		continue;
+	want_more:
+		if(have_more) {
+			/*
+			 * We know that no more data (of the same type)
+			 * is coming. Copy the rest verbatim.
+			 */
+			*buf++ = ch;
+			continue;
+		}
+		chunk_size = (p - (const char *)chunk_buf);
+		/* Processing stalled: need more data */
+		break;
+	}
+
+	st->size = buf - st->buf;
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return chunk_size;	/* Converted in full */
+}
+
+/*
+ * Decode OCTET STRING from the XML element's body.
+ */
+static asn_dec_rval_t
+OCTET_STRING__decode_xer(
+    const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td,
+    void **sptr, const char *opt_mname, const void *buf_ptr, size_t size,
+    int (*opt_unexpected_tag_decoder)(void *struct_ptr, const void *chunk_buf,
+                                      size_t chunk_size),
+    ssize_t (*body_receiver)(void *struct_ptr, const void *chunk_buf,
+                             size_t chunk_size, int have_more)) {
+    OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+	asn_struct_ctx_t *ctx;		/* Per-structure parser context */
+	asn_dec_rval_t rval;		/* Return value from the decoder */
+	int st_allocated;
+
+	/*
+	 * Create the string if does not exist.
+	 */
+	if(!st) {
+		st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
+		*sptr = (void *)st;
+		if(!st) goto sta_failed;
+		st_allocated = 1;
+	} else {
+		st_allocated = 0;
+	}
+	if(!st->buf) {
+		/* This is separate from above section */
+		st->buf = (uint8_t *)CALLOC(1, 1);
+		if(!st->buf) {
+			if(st_allocated) {
+				*sptr = 0;
+				goto stb_failed;
+			} else {
+				goto sta_failed;
+			}
+		}
+	}
+
+	/* Restore parsing context */
+	ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset);
+
+	return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag,
+		buf_ptr, size, opt_unexpected_tag_decoder, body_receiver);
+
+stb_failed:
+	FREEMEM(st);
+sta_failed:
+	rval.code = RC_FAIL;
+	rval.consumed = 0;
+	return rval;
+}
+
+/*
+ * Decode OCTET STRING from the hexadecimal data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_hex(const asn_codec_ctx_t *opt_codec_ctx,
+                            const asn_TYPE_descriptor_t *td, void **sptr,
+                            const char *opt_mname, const void *buf_ptr,
+                            size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size, 0, OCTET_STRING__convert_hexadecimal);
+}
+
+/*
+ * Decode OCTET STRING from the binary (0/1) data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_binary(const asn_codec_ctx_t *opt_codec_ctx,
+                               const asn_TYPE_descriptor_t *td, void **sptr,
+                               const char *opt_mname, const void *buf_ptr,
+                               size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size, 0, OCTET_STRING__convert_binary);
+}
+
+/*
+ * Decode OCTET STRING from the string (ASCII/UTF-8) data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_utf8(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td, void **sptr,
+                             const char *opt_mname, const void *buf_ptr,
+                             size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size,
+		OCTET_STRING__handle_control_chars,
+		OCTET_STRING__convert_entrefs);
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+static int
+OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf,
+		size_t units, unsigned int bpc, unsigned int unit_bits,
+		long lb, long ub, const asn_per_constraints_t *pc) {
+	uint8_t *end = buf + units * bpc;
+
+	ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d",
+		(int)units, lb, ub, unit_bits);
+
+	/* X.691: 27.5.4 */
+	if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) {
+		/* Decode without translation */
+		lb = 0;
+	} else if(pc && pc->code2value) {
+		if(unit_bits > 16)
+			return 1;	/* FATAL: can't have constrained
+					 * UniversalString with more than
+					 * 16 million code points */
+		for(; buf < end; buf += bpc) {
+			int value;
+			int code = per_get_few_bits(po, unit_bits);
+			if(code < 0) return -1;	/* WMORE */
+			value = pc->code2value(code);
+			if(value < 0) {
+				ASN_DEBUG("Code %d (0x%02x) is"
+					" not in map (%ld..%ld)",
+					code, code, lb, ub);
+				return 1;	/* FATAL */
+			}
+			switch(bpc) {
+			case 1: *buf = value; break;
+			case 2: buf[0] = value >> 8; buf[1] = value; break;
+			case 4: buf[0] = value >> 24; buf[1] = value >> 16;
+				buf[2] = value >> 8; buf[3] = value; break;
+			}
+		}
+		return 0;
+	}
+
+	/* Shortcut the no-op copying to the aligned structure */
+	if(lb == 0 && (unit_bits == 8 * bpc)) {
+		return per_get_many_bits(po, buf, 0, unit_bits * units);
+	}
+
+	for(; buf < end; buf += bpc) {
+		int32_t code = per_get_few_bits(po, unit_bits);
+		int32_t ch = code + lb;
+		if(code < 0) return -1;	/* WMORE */
+		if(ch > ub) {
+			ASN_DEBUG("Code %d is out of range (%ld..%ld)",
+				ch, lb, ub);
+			return 1;	/* FATAL */
+		}
+		switch(bpc) {
+		case 1: *buf = ch; break;
+		case 2: buf[0] = ch >> 8; buf[1] = ch; break;
+		case 4: buf[0] = ch >> 24; buf[1] = ch >> 16;
+			buf[2] = ch >> 8; buf[3] = ch; break;
+		}
+	}
+
+	return 0;
+}
+
+static int
+OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
+		size_t units, unsigned int bpc, unsigned int unit_bits,
+		long lb, long ub, const asn_per_constraints_t *pc) {
+	const uint8_t *end = buf + units * bpc;
+
+	ASN_DEBUG("Squeezing %d characters into (%ld..%ld):%d (%d bpc)",
+		(int)units, lb, ub, unit_bits, bpc);
+
+	/* X.691: 27.5.4 */
+	if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) {
+		/* Encode as is */
+		lb = 0;
+	} else if(pc && pc->value2code) {
+		for(; buf < end; buf += bpc) {
+			int code;
+			uint32_t value;
+			switch(bpc) {
+			case 1: value = *(const uint8_t *)buf; break;
+			case 2: value = (buf[0] << 8) | buf[1]; break;
+			case 4: value = (buf[0] << 24) | (buf[1] << 16)
+					| (buf[2] << 8) | buf[3]; break;
+			default: return -1;
+			}
+			code = pc->value2code(value);
+			if(code < 0) {
+				ASN_DEBUG("Character %d (0x%02x) is"
+					" not in map (%ld..%ld)",
+					*buf, *buf, lb, ub);
+				return -1;
+			}
+			if(per_put_few_bits(po, code, unit_bits))
+				return -1;
+		}
+	}
+
+	/* Shortcut the no-op copying to the aligned structure */
+	if(lb == 0 && (unit_bits == 8 * bpc)) {
+		return per_put_many_bits(po, buf, unit_bits * units);
+	}
+
+    for(ub -= lb; buf < end; buf += bpc) {
+        int ch;
+        uint32_t value;
+        switch(bpc) {
+        case 1:
+            value = *(const uint8_t *)buf;
+            break;
+        case 2:
+            value = (buf[0] << 8) | buf[1];
+            break;
+        case 4:
+            value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+            break;
+        default:
+            return -1;
+        }
+        ch = value - lb;
+        if(ch < 0 || ch > ub) {
+            ASN_DEBUG("Character %d (0x%02x) is out of range (%ld..%ld)", *buf,
+                      value, lb, ub + lb);
+            return -1;
+        }
+        if(per_put_few_bits(po, ch, unit_bits)) return -1;
+    }
+
+    return 0;
+}
+
+static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = {
+	{ APC_CONSTRAINED, 8, 8, 0, 255 },
+	{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 },
+	0, 0
+};
+
+asn_dec_rval_t
+OCTET_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints, void **sptr,
+                         asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+    const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+	enum {
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+
+	switch(specs->subvariant) {
+	default:
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_BIT:
+		ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
+		RETURN(RC_FAIL);
+		break;
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_CHAR;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		break;
+	}
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_OCTET_STRING_constraints.size;
+			unit_bits = canonical_unit_bits;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+		if(bpc) {
+			st->size = csiz->upper_bound * bpc;
+		} else {
+			st->size = (csiz->upper_bound + 7) >> 3;
+		}
+		st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+		if(bpc) {
+			ASN_DEBUG("Encoding OCTET STRING size %ld",
+				csiz->upper_bound);
+			ret = OCTET_STRING_per_get_characters(pd, st->buf,
+				csiz->upper_bound, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ASN_DEBUG("Encoding BIT STRING size %ld",
+				csiz->upper_bound);
+			ret = per_get_many_bits(pd, st->buf, 0,
+					    unit_bits * csiz->upper_bound);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += unit_bits * csiz->upper_bound;
+		st->buf[st->size] = 0;
+		RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
+		                          &repeat);
+		if(raw_len < 0) RETURN(RC_WMORE);
+		if(raw_len == 0 && st->buf) break;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+        len_bytes = raw_len * bpc;
+		p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+        ret = OCTET_STRING_per_get_characters(pd, &st->buf[st->size], raw_len,
+                                              bpc, unit_bits, cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret > 0) RETURN(RC_FAIL);
+		if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         const void *sptr, asn_per_outp_t *po) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+				: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;		/* Lies not within extension root */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+	size_t size_in_units;
+	const uint8_t *buf;
+	int ret;
+	enum {
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+	switch(specs->subvariant) {
+	default:
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_BIT:
+		ASN__ENCODE_FAILED;
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_CHAR;
+		size_in_units = st->size;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		size_in_units = st->size >> 1;
+		if(st->size & 1) {
+			ASN_DEBUG("%s string size is not modulo 2", td->name);
+			ASN__ENCODE_FAILED;
+		}
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		size_in_units = st->size >> 2;
+		if(st->size & 3) {
+			ASN_DEBUG("%s string size is not modulo 4", td->name);
+			ASN__ENCODE_FAILED;
+		}
+		break;
+	}
+
+	ASN_DEBUG("Encoding %s into %" ASN_PRI_SIZE " units of %d bits"
+		" (%ld..%ld, effective %d)%s",
+		td->name, size_in_units, unit_bits,
+		csiz->lower_bound, csiz->upper_bound,
+		csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+	/* Figure out whether size lies within PER visible constraint */
+
+    if(csiz->effective_bits >= 0) {
+        if((ssize_t)size_in_units < csiz->lower_bound
+           || (ssize_t)size_in_units > csiz->upper_bound) {
+            if(ct_extensible) {
+                csiz = &asn_DEF_OCTET_STRING_constraints.size;
+                unit_bits = canonical_unit_bits;
+                inext = 1;
+            } else {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    } else {
+        inext = 0;
+    }
+
+    if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+    if(csiz->effective_bits >= 0 && !inext) {
+        ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes (%ld), length in %d bits", st->size,
+                  size_in_units - csiz->lower_bound, csiz->effective_bits);
+        ret = per_put_few_bits(po, size_in_units - csiz->lower_bound,
+                               csiz->effective_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        ret = OCTET_STRING_per_put_characters(po, st->buf, size_in_units, bpc,
+                                              unit_bits, cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret) ASN__ENCODE_FAILED;
+        ASN__ENCODED_OK(er);
+    }
+
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
+
+    buf = st->buf;
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " in units", size_in_units);
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size_in_units, &need_eom);
+        if(may_save < 0) ASN__ENCODE_FAILED;
+
+        ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "%s", may_save, size_in_units,
+                  need_eom ? ",+EOM" : "");
+
+        ret = OCTET_STRING_per_put_characters(po, buf, may_save, bpc, unit_bits,
+                                              cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += may_save * bpc;
+        size_in_units -= may_save;
+        assert(!(may_save & 0x07) || !size_in_units);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size_in_units);
+
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         void **sptr, asn_per_data_t *pd) {
+
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+				: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+	enum {
+		OS__BPC_BIT	= 0,
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+
+	switch(specs->subvariant) {
+	default:
+/* 	case ASN_OSUBV_ANY:
+		ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
+		RETURN(RC_FAIL);
+*/
+	case ASN_OSUBV_BIT:
+		canonical_unit_bits = unit_bits = 1;
+		bpc = OS__BPC_BIT;
+		break;
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+/* 		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+*/
+		bpc = OS__BPC_CHAR;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		break;
+	}
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_OCTET_STRING_constraints.size;
+			cval = &asn_DEF_OCTET_STRING_constraints.value;
+			unit_bits = canonical_unit_bits;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+		if(bpc) {
+			st->size = csiz->upper_bound * bpc;
+		} else {
+			st->size = (csiz->upper_bound + 7) >> 3;
+		}
+		st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+		if (st->size > 2) { /* X.691 #16 NOTE 1 */
+			if (aper_get_align(pd) < 0)
+				RETURN(RC_FAIL);
+		}
+		if(bpc) {
+			ASN_DEBUG("Decoding OCTET STRING size %ld",
+				csiz->upper_bound);
+			ret = OCTET_STRING_per_get_characters(pd, st->buf,
+				csiz->upper_bound, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ASN_DEBUG("Decoding BIT STRING size %ld",
+				csiz->upper_bound);
+			ret = per_get_many_bits(pd, st->buf, 0,
+					    unit_bits * csiz->upper_bound);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += unit_bits * csiz->upper_bound;
+		st->buf[st->size] = 0;
+		if(bpc == 0) {
+			int ubs = (csiz->upper_bound & 0x7);
+			st->bits_unused = ubs ? 8 - ubs : 0;
+		}
+		RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		ssize_t len_bits;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		if (csiz->upper_bound - csiz->lower_bound == 0)
+			/* Indefinite length case */
+			raw_len = aper_get_length(pd, -1, csiz->effective_bits, &repeat);
+		else
+			raw_len = aper_get_length(pd, csiz->upper_bound - csiz->lower_bound + 1, csiz->effective_bits, &repeat);
+		repeat = 0;
+		if(raw_len < 0) RETURN(RC_WMORE);
+		raw_len += csiz->lower_bound;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+
+		if (raw_len > 2) { /* X.691 #16 NOTE 1 */
+			if (aper_get_align(pd) < 0)
+				RETURN(RC_FAIL);
+		}
+
+		if(bpc) {
+			len_bytes = raw_len * bpc;
+			len_bits = len_bytes * unit_bits;
+		} else {
+			len_bits = raw_len;
+			len_bytes = (len_bits + 7) >> 3;
+			if(len_bits & 0x7)
+				st->bits_unused = 8 - (len_bits & 0x7);
+			/* len_bits be multiple of 16K if repeat is set */
+		}
+		p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+		if(bpc) {
+			ret = OCTET_STRING_per_get_characters(pd,
+				&st->buf[st->size], raw_len, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ret = per_get_many_bits(pd, &st->buf[st->size],
+				0, len_bits);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         const void *sptr, asn_per_outp_t *po) {
+
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+	: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;          /* Lies not within extension root */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+	unsigned int sizeinunits;
+	const uint8_t *buf;
+	int ret;
+	enum {
+		OS__BPC_BIT     = 0,
+		OS__BPC_CHAR    = 1,
+		OS__BPC_U16     = 2,
+		OS__BPC_U32     = 4
+	} bpc;  /* Bytes per character */
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+	switch(specs->subvariant) {
+		default:
+			/*         case ASN_OSUBV_ANY:
+			                 ASN__ENCODE_FAILED;
+			*/
+		case ASN_OSUBV_BIT:
+			canonical_unit_bits = unit_bits = 1;
+			bpc = OS__BPC_BIT;
+			sizeinunits = st->size * 8 - (st->bits_unused & 0x07);
+			ASN_DEBUG("BIT STRING of %d bytes",
+								sizeinunits);
+		break;
+        case ASN_OSUBV_ANY:
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+/* 		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = 8;
+*/
+		bpc = OS__BPC_CHAR;
+		sizeinunits = st->size;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		sizeinunits = st->size / 2;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		sizeinunits = st->size / 4;
+		break;
+	}
+
+	ASN_DEBUG("Encoding %s into %d units of %d bits"
+		" (%ld..%ld, effective %d)%s",
+		td->name, sizeinunits, unit_bits,
+		csiz->lower_bound, csiz->upper_bound,
+		csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+	/* Figure out wheter size lies within PER visible constraint */
+
+	if(csiz->effective_bits >= 0) {
+		if((int)sizeinunits < csiz->lower_bound
+		|| (int)sizeinunits > csiz->upper_bound) {
+			if(ct_extensible) {
+				cval = &asn_DEF_OCTET_STRING_constraints.value;
+				csiz = &asn_DEF_OCTET_STRING_constraints.size;
+				unit_bits = canonical_unit_bits;
+				inext = 1;
+			} else
+				ASN__ENCODE_FAILED;
+		}
+	} else {
+		inext = 0;
+	}
+
+
+	if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits >= 0) {
+		ASN_DEBUG("Encoding %lu bytes (%ld), length in %d bits",
+				st->size, sizeinunits - csiz->lower_bound,
+				csiz->effective_bits);
+		if (csiz->effective_bits > 0) {
+		        ret = aper_put_length(po, csiz->upper_bound - csiz->lower_bound + 1, sizeinunits - csiz->lower_bound);
+		        if(ret) ASN__ENCODE_FAILED;
+		}
+		/* EB MOD
+                   AFAIU if lb != ub it is aligned whatever the number of bits */
+		if ((st->size > 2) || (csiz->lower_bound != csiz->upper_bound)) { /* X.691 #16.11 */
+			if (aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+		}
+		if(bpc) {
+			ret = OCTET_STRING_per_put_characters(po, st->buf,
+				sizeinunits, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+		} else {
+			ret = per_put_many_bits(po, st->buf,
+				sizeinunits * unit_bits);
+		}
+		if(ret) ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	ASN_DEBUG("Encoding %lu bytes", st->size);
+
+	if(sizeinunits == 0) {
+		if(aper_put_length(po, -1, 0))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	buf = st->buf;
+	while(sizeinunits) {
+		ssize_t maySave = aper_put_length(po, -1, sizeinunits);
+
+		if(maySave < 0) ASN__ENCODE_FAILED;
+
+		ASN_DEBUG("Encoding %ld of %ld",
+			(long)maySave, (long)sizeinunits);
+
+		if(bpc) {
+			ret = OCTET_STRING_per_put_characters(po, buf,
+				maySave, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+		} else {
+			ret = per_put_many_bits(po, buf, maySave * unit_bits);
+		}
+		if(ret) ASN__ENCODE_FAILED;
+
+		if(bpc)
+			buf += maySave * bpc;
+		else
+			buf += maySave >> 3;
+		sizeinunits -= maySave;
+		assert(!(maySave & 0x07) || !sizeinunits);
+	}
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+OCTET_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	char scratch[16 * 3 + 4];
+	char *p = scratch;
+	uint8_t *buf;
+	uint8_t *end;
+	size_t i;
+
+	(void)td;	/* Unused argument */
+
+	if(!st || (!st->buf && st->size))
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/*
+	 * Dump the contents of the buffer in hexadecimal.
+	 */
+	buf = st->buf;
+	end = buf + st->size;
+	for(i = 0; buf < end; buf++, i++) {
+		if(!(i % 16) && (i || st->size > 16)) {
+			if(cb(scratch, p - scratch, app_key) < 0)
+				return -1;
+			_i_INDENT(1);
+			p = scratch;
+		}
+		*p++ = h2c[(*buf >> 4) & 0x0F];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x20;
+	}
+
+	if(p > scratch) {
+		p--;	/* Remove the tail space */
+		if(cb(scratch, p - scratch, app_key) < 0)
+			return -1;
+	}
+
+	return 0;
+}
+
+int
+OCTET_STRING_print_utf8(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int ilevel, asn_app_consume_bytes_f *cb,
+                        void *app_key) {
+    const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+
+	(void)td;	/* Unused argument */
+	(void)ilevel;	/* Unused argument */
+
+	if(st && (st->buf || !st->size)) {
+		return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0;
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
+                  enum asn_struct_free_method method) {
+	OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const asn_OCTET_STRING_specifics_t *specs;
+	asn_struct_ctx_t *ctx;
+	struct _stack *stck;
+
+	if(!td || !st)
+		return;
+
+	specs = td->specifics
+		    ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		    : &asn_SPC_OCTET_STRING_specs;
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	ASN_DEBUG("Freeing %s as OCTET STRING", td->name);
+
+	if(st->buf) {
+		FREEMEM(st->buf);
+		st->buf = 0;
+	}
+
+	/*
+	 * Remove decode-time stack.
+	 */
+	stck = (struct _stack *)ctx->ptr;
+	if(stck) {
+		while(stck->tail) {
+			struct _stack_el *sel = stck->tail;
+			stck->tail = sel->prev;
+			FREEMEM(sel);
+		}
+		FREEMEM(stck);
+	}
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(sptr, 0,
+               td->specifics
+                   ? ((const asn_OCTET_STRING_specifics_t *)(td->specifics))
+                         ->struct_size
+                   : sizeof(OCTET_STRING_t));
+        break;
+    }
+}
+
+/*
+ * Conversion routines.
+ */
+int
+OCTET_STRING_fromBuf(OCTET_STRING_t *st, const char *str, int len) {
+	void *buf;
+
+	if(st == 0 || (str == 0 && len)) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	/*
+	 * Clear the OCTET STRING.
+	 */
+	if(str == NULL) {
+		FREEMEM(st->buf);
+		st->buf = 0;
+		st->size = 0;
+		return 0;
+	}
+
+	/* Determine the original string size, if not explicitly given */
+	if(len < 0)
+		len = strlen(str);
+
+	/* Allocate and fill the memory */
+	buf = MALLOC(len + 1);
+	if(buf == NULL)
+		return -1;
+
+	memcpy(buf, str, len);
+	((uint8_t *)buf)[len] = '\0';	/* Couldn't use memcpy(len+1)! */
+	FREEMEM(st->buf);
+	st->buf = (uint8_t *)buf;
+	st->size = len;
+
+	return 0;
+}
+
+OCTET_STRING_t *
+OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td, const char *str,
+                         int len) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    OCTET_STRING_t *st;
+
+	st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
+	if(st && str && OCTET_STRING_fromBuf(st, str, len)) {
+		FREEMEM(st);
+		st = NULL;
+	}
+
+	return st;
+}
+
+/*
+ * Lexicographically compare the common prefix of both strings,
+ * and if it is the same return -1 for the smallest string.
+ */
+int
+OCTET_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                     const void *bptr) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics;
+    const OCTET_STRING_t *a = aptr;
+    const OCTET_STRING_t *b = bptr;
+
+    assert(!specs || specs->subvariant != ASN_OSUBV_BIT);
+
+    if(a && b) {
+        size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
+        int ret = memcmp(a->buf, b->buf, common_prefix_size);
+        if(ret == 0) {
+            /* Figure out which string with equal prefixes is longer. */
+            if(a->size < b->size) {
+                return -1;
+            } else if(a->size > b->size) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            return ret < 0 ? -1 : 1;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+
+}
+
+/*
+ * Biased function for randomizing character values around their limits.
+ */
+static uint32_t
+OCTET_STRING__random_char(unsigned long lb, unsigned long ub) {
+    assert(lb <= ub);
+    switch(asn_random_between(0, 16)) {
+    case 0:
+        if(lb < ub) return lb + 1;
+        /* Fall through */
+    case 1:
+        return lb;
+    case 2:
+        if(lb < ub) return ub - 1;
+        /* Fall through */
+    case 3:
+        return ub;
+    default:
+        return asn_random_between(lb, ub);
+    }
+}
+
+
+size_t
+OCTET_STRING_random_length_constrained(
+    const asn_TYPE_descriptor_t *td,
+    const asn_encoding_constraints_t *constraints, size_t max_length) {
+    const unsigned lengths[] = {0,     1,     2,     3,     4,     8,
+                                126,   127,   128,   16383, 16384, 16385,
+                                65534, 65535, 65536, 65537};
+    size_t rnd_len;
+
+    /* Figure out how far we should go */
+    rnd_len = lengths[asn_random_between(
+        0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_CONSTRAINED) {
+            long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
+                                             ? pc->upper_bound
+                                             : (ssize_t)max_length;
+            if(max_length <= (size_t)pc->lower_bound) {
+                return pc->lower_bound;
+            }
+            if(pc->flags & APC_EXTENSIBLE) {
+                switch(asn_random_between(0, 5)) {
+                case 0:
+                    if(pc->lower_bound > 0) {
+                        rnd_len = pc->lower_bound - 1;
+                        break;
+                    }
+                    /* Fall through */
+                case 1:
+                    rnd_len = pc->upper_bound + 1;
+                    break;
+                case 2:
+                    /* Keep rnd_len from the table */
+                    if(rnd_len <= max_length) {
+                        break;
+                    }
+                    /* Fall through */
+                default:
+                    rnd_len = asn_random_between(pc->lower_bound,
+                                                 suggested_upper_bound);
+                }
+            } else {
+                rnd_len =
+                    asn_random_between(pc->lower_bound, suggested_upper_bound);
+            }
+        } else {
+            rnd_len = asn_random_between(0, max_length);
+        }
+    } else if(rnd_len > max_length) {
+        rnd_len = asn_random_between(0, max_length);
+    }
+
+    return rnd_len;
+}
+
+asn_random_fill_result_t
+OCTET_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                         const asn_encoding_constraints_t *constraints,
+                         size_t max_length) {
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    unsigned int unit_bytes = 1;
+    unsigned long clb = 0;  /* Lower bound on char */
+    unsigned long cub = 255;  /* Higher bound on char value */
+    uint8_t *buf;
+    uint8_t *bend;
+    uint8_t *b;
+    size_t rnd_len;
+    OCTET_STRING_t *st;
+
+    if(max_length == 0 && !*sptr) return result_skipped;
+
+    switch(specs->subvariant) {
+    default:
+    case ASN_OSUBV_ANY:
+        return result_failed;
+    case ASN_OSUBV_BIT:
+        /* Handled by BIT_STRING itself. */
+        return result_failed;
+    case ASN_OSUBV_STR:
+        unit_bytes = 1;
+        clb = 0;
+        cub = 255;
+        break;
+    case ASN_OSUBV_U16:
+        unit_bytes = 2;
+        clb = 0;
+        cub = 65535;
+        break;
+    case ASN_OSUBV_U32:
+        unit_bytes = 4;
+        clb = 0;
+        cub = 0x10FFFF;
+        break;
+    }
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->value;
+        if(pc->flags & APC_SEMI_CONSTRAINED) {
+            clb = pc->lower_bound;
+        } else if(pc->flags & APC_CONSTRAINED) {
+            clb = pc->lower_bound;
+            cub = pc->upper_bound;
+        }
+    }
+
+    rnd_len =
+        OCTET_STRING_random_length_constrained(td, constraints, max_length);
+
+    buf = CALLOC(unit_bytes, rnd_len + 1);
+    if(!buf) return result_failed;
+
+    bend = &buf[unit_bytes * rnd_len];
+
+    switch(unit_bytes) {
+    case 1:
+        for(b = buf; b < bend; b += unit_bytes) {
+            *(uint8_t *)b = OCTET_STRING__random_char(clb, cub);
+        }
+        *(uint8_t *)b = 0;
+        break;
+    case 2:
+        for(b = buf; b < bend; b += unit_bytes) {
+            uint32_t code = OCTET_STRING__random_char(clb, cub);
+            b[0] = code >> 8;
+            b[1] = code;
+        }
+        *(uint16_t *)b = 0;
+        break;
+    case 4:
+        for(b = buf; b < bend; b += unit_bytes) {
+            uint32_t code = OCTET_STRING__random_char(clb, cub);
+            b[0] = code >> 24;
+            b[1] = code >> 16;
+            b[2] = code >> 8;
+            b[3] = code;
+        }
+        *(uint32_t *)b = 0;
+        break;
+    }
+
+    if(*sptr) {
+        st = *sptr;
+        FREEMEM(st->buf);
+    } else {
+        st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) {
+            FREEMEM(buf);
+            return result_failed;
+        }
+    }
+
+    st->buf = buf;
+    st->size = unit_bytes * rnd_len;
+
+    result_ok.length = st->size;
+    return result_ok;
+}
diff --git a/e2ap/lib/OCTET_STRING_oer.c b/e2ap/lib/OCTET_STRING_oer.c
new file mode 100644
index 0000000..c16faea
--- /dev/null
+++ b/e2ap/lib/OCTET_STRING_oer.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <OCTET_STRING.h>
+#include <errno.h>
+
+asn_dec_rval_t
+OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                        const asn_TYPE_descriptor_t *td,
+                        const asn_oer_constraints_t *constraints, void **sptr,
+                        const void *ptr, size_t size) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+
+    size_t unit_bytes;
+    switch(specs->subvariant) {
+    default:
+    case ASN_OSUBV_BIT:
+        ASN_DEBUG("Invalid use of OCTET STRING to decode BIT STRING");
+        ASN__DECODE_FAILED;
+    case ASN_OSUBV_ANY:
+        /* Fall through */
+    case ASN_OSUBV_STR:
+        unit_bytes = 1;
+        break;
+    case ASN_OSUBV_U16:
+        unit_bytes = 2;
+        break;
+    case ASN_OSUBV_U32:
+        unit_bytes = 4;
+        break;
+    }
+
+    (void)opt_codec_ctx;
+
+    if(!st) {
+        st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        expected_length = unit_bytes * ct_size;
+    } else {
+        /*
+         * X.696 (08/2015) #27.2
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
+        if(len_len > 0) {
+            rval.consumed = len_len;
+            ptr = (const char *)ptr + len_len;
+            size -= len_len;
+        } else if(len_len == 0) {
+            ASN__DECODE_STARVED;
+        } else if(len_len < 0) {
+            ASN__DECODE_FAILED;
+        }
+
+        if(expected_length % unit_bytes != 0) {
+            ASN_DEBUG(
+                "Data size %" ASN_PRI_SIZE " bytes is not consistent with multiplier %" ASN_PRI_SIZE "",
+                expected_length, unit_bytes);
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+OCTET_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
+                        const asn_oer_constraints_t *constraints,
+                        const void *sptr, asn_app_consume_bytes_f *cb,
+                        void *app_key) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_enc_rval_t er = {0, 0, 0};
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("Encoding %s %" ASN_PRI_SIZE " as OCTET STRING", td ? td->name : "", st->size);
+
+    if(ct_size >= 0) {
+        /*
+         * Check that available data matches the constraint
+         */
+        size_t unit_bytes;
+        switch(specs->subvariant) {
+        default:
+        case ASN_OSUBV_BIT:
+            ASN_DEBUG("Invalid use of OCTET STRING to encode BIT STRING");
+            ASN__ENCODE_FAILED;
+        case ASN_OSUBV_ANY:
+            /* Fall through */
+        case ASN_OSUBV_STR:
+            unit_bytes = 1;
+            break;
+        case ASN_OSUBV_U16:
+            unit_bytes = 2;
+            break;
+        case ASN_OSUBV_U32:
+            unit_bytes = 4;
+            break;
+        }
+
+        if(st->size != unit_bytes * (size_t)ct_size) {
+            ASN_DEBUG(
+                "Trying to encode %s (%" ASN_PRI_SIZE " bytes) which doesn't fit SIZE "
+                "constraint (%" ASN_PRI_SIZE ")",
+                td->name, st->size, ct_size);
+            ASN__ENCODE_FAILED;
+        }
+    } else {
+        /*
+         * X.696 (08/2015) #27.2
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t ret = oer_serialize_length(st->size, cb, app_key);
+        if(ret < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        er.encoded += ret;
+    }
+
+    er.encoded += st->size;
+    if(cb(st->buf, st->size, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/OPEN_TYPE.c b/e2ap/lib/OPEN_TYPE.c
new file mode 100644
index 0000000..a54e99c
--- /dev/null
+++ b/e2ap/lib/OPEN_TYPE.c
@@ -0,0 +1,509 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <per_opentype.h>
+#include <errno.h>
+
+asn_TYPE_operation_t asn_OP_OPEN_TYPE = {
+	OPEN_TYPE_free,
+	OPEN_TYPE_print,
+	OPEN_TYPE_compare,
+	OPEN_TYPE_decode_ber,
+	OPEN_TYPE_encode_der,
+	OPEN_TYPE_decode_xer,
+	OPEN_TYPE_encode_xer,
+#ifdef ASN_DISABLE_OER_SUPPORT
+ 	0, 0,	/* No OER support, use "-gen-OER" to enable */
+#else
+	OPEN_TYPE_decode_oer,
+	OPEN_TYPE_encode_oer,
+#endif
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0, 0, 0, 0,
+#else
+	OPEN_TYPE_decode_uper,
+	OPEN_TYPE_encode_uper,
+	OPEN_TYPE_decode_aper,
+	OPEN_TYPE_encode_aper,
+#endif
+	0,  /* Random fill is not supported for open type */
+	0	/* Use generic outmost tag fetcher */
+};
+
+#undef  ADVANCE
+#define ADVANCE(num_bytes)               \
+    do {                                 \
+        size_t num = num_bytes;          \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+asn_dec_rval_t
+OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    size_t consumed_myself = 0;
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    ASN_DEBUG("presence %d\n", selected.presence_index);
+
+    rv = selected.type_descriptor->op->ber_decoder(
+        opt_codec_ctx, selected.type_descriptor, &inner_value, ptr, size,
+        elm->tag_mode);
+    ADVANCE(rv.consumed);
+    rv.consumed = 0;
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            rv.code = RC_OK;
+            rv.consumed = consumed_myself;
+            return rv;
+        } else {
+            /* Oh, now a full-blown failure failure */
+        }
+        /* Fall through */
+    case RC_FAIL:
+        rv.consumed = consumed_myself;
+        /* Fall through */
+    case RC_WMORE:
+        break;
+    }
+
+    if(*memb_ptr2) {
+        if(elm->flags & ATF_POINTER) {
+            ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+            *memb_ptr2 = NULL;
+        } else {
+            ASN_STRUCT_RESET(*selected.type_descriptor,
+                                          inner_value);
+        }
+    }
+    return rv;
+}
+
+asn_dec_rval_t
+OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    size_t consumed_myself = 0;
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    int xer_context = 0;
+    ssize_t ch_size;
+    pxer_chunk_type_e ch_type;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    /*
+     * Confirm wrapper.
+     */
+    for(;;) {
+        ch_size = xer_next_token(&xer_context, ptr, size, &ch_type);
+        if(ch_size < 0) {
+            ASN__DECODE_FAILED;
+        } else {
+            switch(ch_type) {
+            case PXER_WMORE:
+                ASN__DECODE_STARVED;
+            case PXER_COMMENT:
+            case PXER_TEXT:
+                ADVANCE(ch_size);
+                continue;
+            case PXER_TAG:
+                break;
+            }
+            break;
+        }
+    }
+
+    /*
+     * Wrapper value confirmed.
+     */
+    switch(xer_check_tag(ptr, ch_size, elm->name)) {
+    case XCT_OPENING:
+        ADVANCE(ch_size);
+        break;
+    case XCT_BROKEN:
+    default:
+        ASN__DECODE_FAILED;
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = selected.type_descriptor->op->xer_decoder(
+        opt_codec_ctx, selected.type_descriptor, &inner_value, NULL, ptr, size);
+    ADVANCE(rv.consumed);
+    rv.consumed = 0;
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_FAIL:
+        /* Point to a best position where failure occurred */
+        rv.consumed = consumed_myself;
+        /* Fall through */
+    case RC_WMORE:
+        /* Wrt. rv.consumed==0:
+         * In case a genuine RC_WMORE, the whole Open Type decoding
+         * will have to be restarted.
+         */
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+        return rv;
+    }
+
+    /*
+     * Finalize wrapper.
+     */
+    for(;;) {
+        ch_size = xer_next_token(&xer_context, ptr, size, &ch_type);
+        if(ch_size < 0) {
+            ASN__DECODE_FAILED;
+        } else {
+            switch(ch_type) {
+            case PXER_WMORE:
+                ASN__DECODE_STARVED;
+            case PXER_COMMENT:
+            case PXER_TEXT:
+                ADVANCE(ch_size);
+                continue;
+            case PXER_TAG:
+                break;
+            }
+            break;
+        }
+    }
+
+    /*
+     * Wrapper value confirmed.
+     */
+    switch(xer_check_tag(ptr, ch_size, elm->name)) {
+    case XCT_CLOSING:
+        ADVANCE(ch_size);
+        break;
+    case XCT_BROKEN:
+    default:
+        ASN__DECODE_FAILED;
+    }
+
+    rv.consumed += consumed_myself;
+
+    return rv;
+}
+
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void *sptr,
+                   const asn_TYPE_member_t *elm, asn_per_data_t *pd) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = uper_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                            &inner_value, pd);
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_WMORE:
+    case RC_FAIL:
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+    }
+    return rv;
+}
+
+asn_enc_rval_t
+OPEN_TYPE_encode_uper(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, asn_per_outp_t *po) {
+    const void *memb_ptr;   /* Pointer to the member */
+    asn_TYPE_member_t *elm; /* CHOICE's element */
+    asn_enc_rval_t er = {0,0,0};
+    unsigned present;
+
+    (void)constraints;
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN__ENCODE_FAILED;
+    } else {
+        present--;
+    }
+
+    ASN_DEBUG("Encoding %s OPEN TYPE element %d", td->name, present);
+
+    elm = &td->elements[present];
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+    } else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(uper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded = 0;
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+OPEN_TYPE_aper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void *sptr,
+                   const asn_TYPE_member_t *elm, asn_per_data_t *pd) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = aper_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                            &inner_value, pd);
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_WMORE:
+    case RC_FAIL:
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+    }
+    return rv;
+}
+
+asn_enc_rval_t
+OPEN_TYPE_encode_aper(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, asn_per_outp_t *po) {
+    const void *memb_ptr;   /* Pointer to the member */
+    asn_TYPE_member_t *elm; /* CHOICE's element */
+    asn_enc_rval_t er = {0,0,0};
+    unsigned present;
+
+    (void)constraints;
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN__ENCODE_FAILED;
+    } else {
+        present--;
+    }
+
+    ASN_DEBUG("Encoding %s OPEN TYPE element %d", td->name, present);
+
+    elm = &td->elements[present];
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+    } else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(aper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded = 0;
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
diff --git a/e2ap/lib/OPEN_TYPE_oer.c b/e2ap/lib/OPEN_TYPE_oer.c
new file mode 100644
index 0000000..dd2f5c6
--- /dev/null
+++ b/e2ap/lib/OPEN_TYPE_oer.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <errno.h>
+
+asn_dec_rval_t
+OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+    size_t ot_ret;
+
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    ot_ret = oer_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                               &inner_value, ptr, size);
+    switch(ot_ret) {
+    default:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            rv.code = RC_OK;
+            rv.consumed = ot_ret;
+            return rv;
+        } else {
+            /* Oh, now a full-blown failure failure */
+        }
+        /* Fall through */
+    case -1:
+        rv.code = RC_FAIL;
+        rv.consumed = ot_ret;
+        break;
+    case 0:
+        rv.code = RC_WMORE;
+        rv.consumed = 0;
+        break;
+    }
+
+    if(*memb_ptr2) {
+        const asn_CHOICE_specifics_t *specs =
+            selected.type_descriptor->specifics;
+        if(elm->flags & ATF_POINTER) {
+            ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+            *memb_ptr2 = NULL;
+        } else {
+            ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor,
+                                          inner_value);
+            memset(*memb_ptr2, 0, specs->struct_size);
+        }
+    }
+    return rv;
+}
diff --git a/e2ap/lib/PLMN-Identity.c b/e2ap/lib/PLMN-Identity.c
new file mode 100644
index 0000000..24f3043
--- /dev/null
+++ b/e2ap/lib/PLMN-Identity.c
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "PLMN-Identity.h"
+
+int
+PLMN_Identity_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size == 3)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_PLMN_Identity_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	3	/* (SIZE(3..3)) */};
+asn_per_constraints_t asn_PER_type_PLMN_Identity_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  3,  3 }	/* (SIZE(3..3)) */,
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_PLMN_Identity_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PLMN_Identity = {
+	"PLMN-Identity",
+	"PLMN-Identity",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_PLMN_Identity_tags_1,
+	sizeof(asn_DEF_PLMN_Identity_tags_1)
+		/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
+	asn_DEF_PLMN_Identity_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PLMN_Identity_tags_1)
+		/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
+	{ &asn_OER_type_PLMN_Identity_constr_1, &asn_PER_type_PLMN_Identity_constr_1, PLMN_Identity_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/Presence.c b/e2ap/lib/Presence.c
new file mode 100644
index 0000000..c32f9e0
--- /dev/null
+++ b/e2ap/lib/Presence.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "Presence.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_Presence_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_Presence_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_Presence_value2enum_1[] = {
+	{ 0,	8,	"optional" },
+	{ 1,	11,	"conditional" },
+	{ 2,	9,	"mandatory" }
+};
+static const unsigned int asn_MAP_Presence_enum2value_1[] = {
+	1,	/* conditional(1) */
+	2,	/* mandatory(2) */
+	0	/* optional(0) */
+};
+const asn_INTEGER_specifics_t asn_SPC_Presence_specs_1 = {
+	asn_MAP_Presence_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_Presence_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	0,	/* Enumeration is not extensible */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_Presence_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Presence = {
+	"Presence",
+	"Presence",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_Presence_tags_1,
+	sizeof(asn_DEF_Presence_tags_1)
+		/sizeof(asn_DEF_Presence_tags_1[0]), /* 1 */
+	asn_DEF_Presence_tags_1,	/* Same as above */
+	sizeof(asn_DEF_Presence_tags_1)
+		/sizeof(asn_DEF_Presence_tags_1[0]), /* 1 */
+	{ &asn_OER_type_Presence_constr_1, &asn_PER_type_Presence_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_Presence_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ProcedureCode.c b/e2ap/lib/ProcedureCode.c
new file mode 100644
index 0000000..8678080
--- /dev/null
+++ b/e2ap/lib/ProcedureCode.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProcedureCode.h"
+
+int
+ProcedureCode_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_ProcedureCode_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+asn_per_constraints_t asn_PER_type_ProcedureCode_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_ProcedureCode_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProcedureCode = {
+	"ProcedureCode",
+	"ProcedureCode",
+	&asn_OP_NativeInteger,
+	asn_DEF_ProcedureCode_tags_1,
+	sizeof(asn_DEF_ProcedureCode_tags_1)
+		/sizeof(asn_DEF_ProcedureCode_tags_1[0]), /* 1 */
+	asn_DEF_ProcedureCode_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProcedureCode_tags_1)
+		/sizeof(asn_DEF_ProcedureCode_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProcedureCode_constr_1, &asn_PER_type_ProcedureCode_constr_1, ProcedureCode_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/ProtocolIE-Container.c b/e2ap/lib/ProtocolIE-Container.c
new file mode 100644
index 0000000..05014c6
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-Container.c
@@ -0,0 +1,870 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-Container.h"
+
+#include "ProtocolIE-Field.h"
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P0_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P0_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P1_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P1_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P2_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P2_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P3_constr_7 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P3_constr_7 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P4_constr_9 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P4_constr_9 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P5_constr_11 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P5_constr_11 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P6_constr_13 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P6_constr_13 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P7_constr_15 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P7_constr_15 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P8_constr_17 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P8_constr_17 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P9_constr_19 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P9_constr_19 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P10_constr_21 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P10_constr_21 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P11_constr_23 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P11_constr_23 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P12_constr_25 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P12_constr_25 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P13_constr_27 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P13_constr_27 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P14_constr_29 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P14_constr_29 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P15_constr_31 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P15_constr_31 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P16_constr_33 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P16_constr_33 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P17_constr_35 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P17_constr_35 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P18_constr_37 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P18_constr_37 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P19_constr_39 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P19_constr_39 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P0_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionRequest_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P0_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P0_specs_1 = {
+	sizeof(struct ProtocolIE_Container_87P0),
+	offsetof(struct ProtocolIE_Container_87P0, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P0 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P0_tags_1,
+	sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P0_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P0_constr_1, &asn_PER_type_ProtocolIE_Container_87P0_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P0_1,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P0_specs_1	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P1_3[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionResponse_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P1_tags_3[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P1_specs_3 = {
+	sizeof(struct ProtocolIE_Container_87P1),
+	offsetof(struct ProtocolIE_Container_87P1, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P1 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P1_tags_3,
+	sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P1_tags_3,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P1_constr_3, &asn_PER_type_ProtocolIE_Container_87P1_constr_3, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P1_3,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P1_specs_3	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P2_5[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P2_tags_5[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P2_specs_5 = {
+	sizeof(struct ProtocolIE_Container_87P2),
+	offsetof(struct ProtocolIE_Container_87P2, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P2 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P2_tags_5,
+	sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P2_tags_5,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P2_constr_5, &asn_PER_type_ProtocolIE_Container_87P2_constr_5, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P2_5,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P2_specs_5	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P3_7[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteRequest_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P3_tags_7[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P3_specs_7 = {
+	sizeof(struct ProtocolIE_Container_87P3),
+	offsetof(struct ProtocolIE_Container_87P3, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P3 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P3_tags_7,
+	sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P3_tags_7,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P3_constr_7, &asn_PER_type_ProtocolIE_Container_87P3_constr_7, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P3_7,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P3_specs_7	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P4_9[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteResponse_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P4_tags_9[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P4_specs_9 = {
+	sizeof(struct ProtocolIE_Container_87P4),
+	offsetof(struct ProtocolIE_Container_87P4, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P4 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P4_tags_9,
+	sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P4_tags_9,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P4_constr_9, &asn_PER_type_ProtocolIE_Container_87P4_constr_9, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P4_9,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P4_specs_9	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P5_11[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P5_tags_11[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P5_specs_11 = {
+	sizeof(struct ProtocolIE_Container_87P5),
+	offsetof(struct ProtocolIE_Container_87P5, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P5 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P5_tags_11,
+	sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P5_tags_11,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P5_constr_11, &asn_PER_type_ProtocolIE_Container_87P5_constr_11, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P5_11,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P5_specs_11	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P6_13[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICindication_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P6_tags_13[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P6_specs_13 = {
+	sizeof(struct ProtocolIE_Container_87P6),
+	offsetof(struct ProtocolIE_Container_87P6, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P6 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P6_tags_13,
+	sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P6_tags_13,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P6_constr_13, &asn_PER_type_ProtocolIE_Container_87P6_constr_13, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P6_13,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P6_specs_13	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P7_15[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolRequest_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P7_tags_15[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P7_specs_15 = {
+	sizeof(struct ProtocolIE_Container_87P7),
+	offsetof(struct ProtocolIE_Container_87P7, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P7 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P7_tags_15,
+	sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P7_tags_15,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P7_constr_15, &asn_PER_type_ProtocolIE_Container_87P7_constr_15, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P7_15,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P7_specs_15	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P8_17[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolAcknowledge_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P8_tags_17[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P8_specs_17 = {
+	sizeof(struct ProtocolIE_Container_87P8),
+	offsetof(struct ProtocolIE_Container_87P8, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P8 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P8_tags_17,
+	sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P8_tags_17,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P8_constr_17, &asn_PER_type_ProtocolIE_Container_87P8_constr_17, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P8_17,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P8_specs_17	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P9_19[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P9_tags_19[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P9_specs_19 = {
+	sizeof(struct ProtocolIE_Container_87P9),
+	offsetof(struct ProtocolIE_Container_87P9, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P9 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P9_tags_19,
+	sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P9_tags_19,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P9_constr_19, &asn_PER_type_ProtocolIE_Container_87P9_constr_19, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P9_19,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P9_specs_19	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P10_21[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ErrorIndication_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P10_tags_21[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P10_specs_21 = {
+	sizeof(struct ProtocolIE_Container_87P10),
+	offsetof(struct ProtocolIE_Container_87P10, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P10 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P10_tags_21,
+	sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P10_tags_21,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P10_constr_21, &asn_PER_type_ProtocolIE_Container_87P10_constr_21, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P10_21,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P10_specs_21	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P11_23[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupRequestIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P11_tags_23[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P11_specs_23 = {
+	sizeof(struct ProtocolIE_Container_87P11),
+	offsetof(struct ProtocolIE_Container_87P11, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P11 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P11_tags_23,
+	sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P11_tags_23,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P11_constr_23, &asn_PER_type_ProtocolIE_Container_87P11_constr_23, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P11_23,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P11_specs_23	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P12_25[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupResponseIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P12_tags_25[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P12_specs_25 = {
+	sizeof(struct ProtocolIE_Container_87P12),
+	offsetof(struct ProtocolIE_Container_87P12, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P12 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P12_tags_25,
+	sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P12_tags_25,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P12_constr_25, &asn_PER_type_ProtocolIE_Container_87P12_constr_25, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P12_25,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P12_specs_25	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P13_27[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupFailureIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P13_tags_27[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P13_specs_27 = {
+	sizeof(struct ProtocolIE_Container_87P13),
+	offsetof(struct ProtocolIE_Container_87P13, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P13 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P13_tags_27,
+	sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P13_tags_27,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P13_constr_27, &asn_PER_type_ProtocolIE_Container_87P13_constr_27, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P13_27,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P13_specs_27	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P14_29[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetRequestIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P14_tags_29[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P14_specs_29 = {
+	sizeof(struct ProtocolIE_Container_87P14),
+	offsetof(struct ProtocolIE_Container_87P14, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P14 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P14_tags_29,
+	sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P14_tags_29,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P14_constr_29, &asn_PER_type_ProtocolIE_Container_87P14_constr_29, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P14_29,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P14_specs_29	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P15_31[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetResponseIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P15_tags_31[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P15_specs_31 = {
+	sizeof(struct ProtocolIE_Container_87P15),
+	offsetof(struct ProtocolIE_Container_87P15, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P15 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P15_tags_31,
+	sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P15_tags_31,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P15_constr_31, &asn_PER_type_ProtocolIE_Container_87P15_constr_31, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P15_31,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P15_specs_31	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P16_33[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdate_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P16_tags_33[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P16_specs_33 = {
+	sizeof(struct ProtocolIE_Container_87P16),
+	offsetof(struct ProtocolIE_Container_87P16, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P16 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P16_tags_33,
+	sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P16_tags_33,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P16_constr_33, &asn_PER_type_ProtocolIE_Container_87P16_constr_33, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P16_33,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P16_specs_33	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P17_35[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateAcknowledge_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P17_tags_35[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P17_specs_35 = {
+	sizeof(struct ProtocolIE_Container_87P17),
+	offsetof(struct ProtocolIE_Container_87P17, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P17 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P17_tags_35,
+	sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P17_tags_35,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P17_constr_35, &asn_PER_type_ProtocolIE_Container_87P17_constr_35, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P17_35,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P17_specs_35	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P18_37[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P18_tags_37[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P18_specs_37 = {
+	sizeof(struct ProtocolIE_Container_87P18),
+	offsetof(struct ProtocolIE_Container_87P18, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P18 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P18_tags_37,
+	sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P18_tags_37,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P18_constr_37, &asn_PER_type_ProtocolIE_Container_87P18_constr_37, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P18_37,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P18_specs_37	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P19_39[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceQuery_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P19_tags_39[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P19_specs_39 = {
+	sizeof(struct ProtocolIE_Container_87P19),
+	offsetof(struct ProtocolIE_Container_87P19, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P19 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P19_tags_39,
+	sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P19_tags_39,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P19_constr_39, &asn_PER_type_ProtocolIE_Container_87P19_constr_39, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P19_39,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P19_specs_39	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ProtocolIE-ContainerList.c b/e2ap/lib/ProtocolIE-ContainerList.c
new file mode 100644
index 0000000..b43b010
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ContainerList.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ContainerList.h"
+
diff --git a/e2ap/lib/ProtocolIE-ContainerPair.c b/e2ap/lib/ProtocolIE-ContainerPair.c
new file mode 100644
index 0000000..0bf1a47
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ContainerPair.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ContainerPair.h"
+
diff --git a/e2ap/lib/ProtocolIE-ContainerPairList.c b/e2ap/lib/ProtocolIE-ContainerPairList.c
new file mode 100644
index 0000000..dba4ec4
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ContainerPairList.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ContainerPairList.h"
+
diff --git a/e2ap/lib/ProtocolIE-Field.c b/e2ap/lib/ProtocolIE-Field.c
new file mode 100644
index 0000000..80336e8
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-Field.c
@@ -0,0 +1,7398 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-Field.h"
+
+static const long asn_VAL_4_id_RICaction_ToBeSetup_Item = 19;
+static const long asn_VAL_4_ignore = 1;
+static const long asn_VAL_4_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICaction_ToBeSetup_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_4_id_RICaction_ToBeSetup_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_ToBeSetup_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_4_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICaction_ToBeSetup_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RICaction_ToBeSetup_ItemIEs_1_rows }
+};
+static const long asn_VAL_9_id_RICaction_Admitted_Item = 14;
+static const long asn_VAL_9_ignore = 1;
+static const long asn_VAL_9_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICaction_Admitted_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_9_id_RICaction_Admitted_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_Admitted_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_9_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICaction_Admitted_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RICaction_Admitted_ItemIEs_1_rows }
+};
+static const long asn_VAL_10_id_RICaction_NotAdmitted_Item = 16;
+static const long asn_VAL_10_ignore = 1;
+static const long asn_VAL_10_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICaction_NotAdmitted_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_10_id_RICaction_NotAdmitted_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_10_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_NotAdmitted_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_10_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICaction_NotAdmitted_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RICaction_NotAdmitted_ItemIEs_1_rows }
+};
+static const long asn_VAL_64_id_RANfunction_Item = 8;
+static const long asn_VAL_64_ignore = 1;
+static const long asn_VAL_64_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RANfunction_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_64_id_RANfunction_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_64_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunction_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_64_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RANfunction_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RANfunction_ItemIEs_1_rows }
+};
+static const long asn_VAL_65_id_RANfunctionID_Item = 6;
+static const long asn_VAL_65_ignore = 1;
+static const long asn_VAL_65_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RANfunctionID_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_65_id_RANfunctionID_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_65_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_65_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RANfunctionID_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RANfunctionID_ItemIEs_1_rows }
+};
+static const long asn_VAL_68_id_RANfunctionIEcause_Item = 7;
+static const long asn_VAL_68_ignore = 1;
+static const long asn_VAL_68_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RANfunctionIDcause_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_68_id_RANfunctionIEcause_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_68_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionIDcause_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_68_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RANfunctionIDcause_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RANfunctionIDcause_ItemIEs_1_rows }
+};
+static const long asn_VAL_1_id_RICrequestID = 29;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_1_mandatory = 2;
+static const long asn_VAL_2_id_RANfunctionID = 5;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_2_mandatory = 2;
+static const long asn_VAL_3_id_RICsubscriptionDetails = 30;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_3_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionRequest_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_1_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_1_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_2_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_2_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_3_id_RICsubscriptionDetails },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICsubscriptionDetails },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_3_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionRequest_IEs_1[] = {
+	{ 3, 4, asn_IOS_RICsubscriptionRequest_IEs_1_rows }
+};
+static const long asn_VAL_5_id_RICrequestID = 29;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_5_mandatory = 2;
+static const long asn_VAL_6_id_RANfunctionID = 5;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_6_mandatory = 2;
+static const long asn_VAL_7_id_RICactions_Admitted = 17;
+static const long asn_VAL_7_reject = 0;
+static const long asn_VAL_7_mandatory = 2;
+static const long asn_VAL_8_id_RICactions_NotAdmitted = 18;
+static const long asn_VAL_8_reject = 0;
+static const long asn_VAL_8_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionResponse_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_5_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_5_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_6_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_6_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_7_id_RICactions_Admitted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_Admitted_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_7_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_8_id_RICactions_NotAdmitted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_NotAdmitted_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_8_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionResponse_IEs_1[] = {
+	{ 4, 4, asn_IOS_RICsubscriptionResponse_IEs_1_rows }
+};
+static const long asn_VAL_11_id_RICrequestID = 29;
+static const long asn_VAL_11_reject = 0;
+static const long asn_VAL_11_mandatory = 2;
+static const long asn_VAL_12_id_RANfunctionID = 5;
+static const long asn_VAL_12_reject = 0;
+static const long asn_VAL_12_mandatory = 2;
+static const long asn_VAL_13_id_RICactions_NotAdmitted = 18;
+static const long asn_VAL_13_reject = 0;
+static const long asn_VAL_13_mandatory = 2;
+static const long asn_VAL_14_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_14_ignore = 1;
+static const long asn_VAL_14_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_11_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_11_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_11_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_12_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_12_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_12_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_13_id_RICactions_NotAdmitted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_13_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_NotAdmitted_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_13_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_14_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_14_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_14_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionFailure_IEs_1[] = {
+	{ 4, 4, asn_IOS_RICsubscriptionFailure_IEs_1_rows }
+};
+static const long asn_VAL_15_id_RICrequestID = 29;
+static const long asn_VAL_15_reject = 0;
+static const long asn_VAL_15_mandatory = 2;
+static const long asn_VAL_16_id_RANfunctionID = 5;
+static const long asn_VAL_16_reject = 0;
+static const long asn_VAL_16_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionDeleteRequest_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_15_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_15_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_15_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_16_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_16_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_16_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionDeleteRequest_IEs_1[] = {
+	{ 2, 4, asn_IOS_RICsubscriptionDeleteRequest_IEs_1_rows }
+};
+static const long asn_VAL_17_id_RICrequestID = 29;
+static const long asn_VAL_17_reject = 0;
+static const long asn_VAL_17_mandatory = 2;
+static const long asn_VAL_18_id_RANfunctionID = 5;
+static const long asn_VAL_18_reject = 0;
+static const long asn_VAL_18_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionDeleteResponse_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_17_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_17_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_17_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_18_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_18_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_18_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionDeleteResponse_IEs_1[] = {
+	{ 2, 4, asn_IOS_RICsubscriptionDeleteResponse_IEs_1_rows }
+};
+static const long asn_VAL_19_id_RICrequestID = 29;
+static const long asn_VAL_19_reject = 0;
+static const long asn_VAL_19_mandatory = 2;
+static const long asn_VAL_20_id_RANfunctionID = 5;
+static const long asn_VAL_20_reject = 0;
+static const long asn_VAL_20_mandatory = 2;
+static const long asn_VAL_21_id_Cause = 1;
+static const long asn_VAL_21_ignore = 1;
+static const long asn_VAL_21_mandatory = 2;
+static const long asn_VAL_22_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_22_ignore = 1;
+static const long asn_VAL_22_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionDeleteFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_19_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_19_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_19_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_20_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_20_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_20_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_21_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_21_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_21_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_22_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_22_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_22_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionDeleteFailure_IEs_1[] = {
+	{ 4, 4, asn_IOS_RICsubscriptionDeleteFailure_IEs_1_rows }
+};
+static const long asn_VAL_23_id_RICrequestID = 29;
+static const long asn_VAL_23_reject = 0;
+static const long asn_VAL_23_mandatory = 2;
+static const long asn_VAL_24_id_RANfunctionID = 5;
+static const long asn_VAL_24_reject = 0;
+static const long asn_VAL_24_mandatory = 2;
+static const long asn_VAL_25_id_RICactionID = 15;
+static const long asn_VAL_25_reject = 0;
+static const long asn_VAL_25_mandatory = 2;
+static const long asn_VAL_26_id_RICindicationSN = 27;
+static const long asn_VAL_26_reject = 0;
+static const long asn_VAL_26_optional = 0;
+static const long asn_VAL_27_id_RICindicationType = 28;
+static const long asn_VAL_27_reject = 0;
+static const long asn_VAL_27_mandatory = 2;
+static const long asn_VAL_28_id_RICindicationHeader = 25;
+static const long asn_VAL_28_reject = 0;
+static const long asn_VAL_28_mandatory = 2;
+static const long asn_VAL_29_id_RICindicationMessage = 26;
+static const long asn_VAL_29_reject = 0;
+static const long asn_VAL_29_mandatory = 2;
+static const long asn_VAL_30_id_RICcallProcessID = 20;
+static const long asn_VAL_30_reject = 0;
+static const long asn_VAL_30_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICindication_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_23_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_23_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_23_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_24_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_24_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_24_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_25_id_RICactionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_25_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICactionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_25_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_26_id_RICindicationSN },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_26_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationSN },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_26_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_27_id_RICindicationType },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_27_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationType },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_27_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_28_id_RICindicationHeader },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_28_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationHeader },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_28_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_29_id_RICindicationMessage },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_29_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationMessage },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_29_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_30_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_30_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_30_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICindication_IEs_1[] = {
+	{ 8, 4, asn_IOS_RICindication_IEs_1_rows }
+};
+static const long asn_VAL_31_id_RICrequestID = 29;
+static const long asn_VAL_31_reject = 0;
+static const long asn_VAL_31_mandatory = 2;
+static const long asn_VAL_32_id_RANfunctionID = 5;
+static const long asn_VAL_32_reject = 0;
+static const long asn_VAL_32_mandatory = 2;
+static const long asn_VAL_33_id_RICcallProcessID = 20;
+static const long asn_VAL_33_reject = 0;
+static const long asn_VAL_33_optional = 0;
+static const long asn_VAL_34_id_RICcontrolHeader = 22;
+static const long asn_VAL_34_reject = 0;
+static const long asn_VAL_34_mandatory = 2;
+static const long asn_VAL_35_id_RICcontrolMessage = 23;
+static const long asn_VAL_35_reject = 0;
+static const long asn_VAL_35_mandatory = 2;
+static const long asn_VAL_36_id_RICcontrolAckRequest = 21;
+static const long asn_VAL_36_reject = 0;
+static const long asn_VAL_36_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICcontrolRequest_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_31_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_31_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_31_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_32_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_32_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_32_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_33_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_33_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_33_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_34_id_RICcontrolHeader },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_34_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolHeader },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_34_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_35_id_RICcontrolMessage },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_35_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolMessage },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_35_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_36_id_RICcontrolAckRequest },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_36_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolAckRequest },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_36_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICcontrolRequest_IEs_1[] = {
+	{ 6, 4, asn_IOS_RICcontrolRequest_IEs_1_rows }
+};
+static const long asn_VAL_37_id_RICrequestID = 29;
+static const long asn_VAL_37_reject = 0;
+static const long asn_VAL_37_mandatory = 2;
+static const long asn_VAL_38_id_RANfunctionID = 5;
+static const long asn_VAL_38_reject = 0;
+static const long asn_VAL_38_mandatory = 2;
+static const long asn_VAL_39_id_RICcallProcessID = 20;
+static const long asn_VAL_39_reject = 0;
+static const long asn_VAL_39_optional = 0;
+static const long asn_VAL_40_id_RICcontrolStatus = 24;
+static const long asn_VAL_40_reject = 0;
+static const long asn_VAL_40_mandatory = 2;
+static const long asn_VAL_41_id_RICcontrolOutcome = 32;
+static const long asn_VAL_41_reject = 0;
+static const long asn_VAL_41_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICcontrolAcknowledge_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_37_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_37_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_37_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_38_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_38_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_38_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_39_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_39_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_39_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_40_id_RICcontrolStatus },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_40_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolStatus },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_40_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_41_id_RICcontrolOutcome },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_41_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolOutcome },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_41_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICcontrolAcknowledge_IEs_1[] = {
+	{ 5, 4, asn_IOS_RICcontrolAcknowledge_IEs_1_rows }
+};
+static const long asn_VAL_42_id_RICrequestID = 29;
+static const long asn_VAL_42_reject = 0;
+static const long asn_VAL_42_mandatory = 2;
+static const long asn_VAL_43_id_RANfunctionID = 5;
+static const long asn_VAL_43_reject = 0;
+static const long asn_VAL_43_mandatory = 2;
+static const long asn_VAL_44_id_RICcallProcessID = 20;
+static const long asn_VAL_44_reject = 0;
+static const long asn_VAL_44_optional = 0;
+static const long asn_VAL_45_id_Cause = 1;
+static const long asn_VAL_45_ignore = 1;
+static const long asn_VAL_45_mandatory = 2;
+static const long asn_VAL_46_id_RICcontrolOutcome = 32;
+static const long asn_VAL_46_reject = 0;
+static const long asn_VAL_46_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICcontrolFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_42_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_42_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_42_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_43_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_43_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_43_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_44_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_44_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_44_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_45_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_45_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_45_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_46_id_RICcontrolOutcome },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_46_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolOutcome },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_46_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICcontrolFailure_IEs_1[] = {
+	{ 5, 4, asn_IOS_RICcontrolFailure_IEs_1_rows }
+};
+static const long asn_VAL_47_id_RICrequestID = 29;
+static const long asn_VAL_47_reject = 0;
+static const long asn_VAL_47_optional = 0;
+static const long asn_VAL_48_id_RANfunctionID = 5;
+static const long asn_VAL_48_reject = 0;
+static const long asn_VAL_48_optional = 0;
+static const long asn_VAL_49_id_Cause = 1;
+static const long asn_VAL_49_ignore = 1;
+static const long asn_VAL_49_optional = 0;
+static const long asn_VAL_50_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_50_ignore = 1;
+static const long asn_VAL_50_optional = 0;
+static const asn_ioc_cell_t asn_IOS_ErrorIndication_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_47_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_47_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_47_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_48_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_48_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_48_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_49_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_49_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_49_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_50_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_50_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_50_optional }
+};
+static const asn_ioc_set_t asn_IOS_ErrorIndication_IEs_1[] = {
+	{ 4, 4, asn_IOS_ErrorIndication_IEs_1_rows }
+};
+static const long asn_VAL_51_id_GlobalE2node_ID = 3;
+static const long asn_VAL_51_reject = 0;
+static const long asn_VAL_51_mandatory = 2;
+static const long asn_VAL_52_id_RANfunctionsAdded = 10;
+static const long asn_VAL_52_reject = 0;
+static const long asn_VAL_52_optional = 0;
+static const asn_ioc_cell_t asn_IOS_E2setupRequestIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_51_id_GlobalE2node_ID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_51_reject },
+	{ "&Value", aioc__type, &asn_DEF_GlobalE2node_ID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_51_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_52_id_RANfunctionsAdded },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_52_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctions_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_52_optional }
+};
+static const asn_ioc_set_t asn_IOS_E2setupRequestIEs_1[] = {
+	{ 2, 4, asn_IOS_E2setupRequestIEs_1_rows }
+};
+static const long asn_VAL_53_id_GlobalRIC_ID = 4;
+static const long asn_VAL_53_reject = 0;
+static const long asn_VAL_53_mandatory = 2;
+static const long asn_VAL_54_id_RANfunctionsAccepted = 9;
+static const long asn_VAL_54_reject = 0;
+static const long asn_VAL_54_optional = 0;
+static const long asn_VAL_55_id_RANfunctionsRejected = 13;
+static const long asn_VAL_55_reject = 0;
+static const long asn_VAL_55_optional = 0;
+static const asn_ioc_cell_t asn_IOS_E2setupResponseIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_53_id_GlobalRIC_ID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_53_reject },
+	{ "&Value", aioc__type, &asn_DEF_GlobalRIC_ID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_53_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_54_id_RANfunctionsAccepted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_54_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_54_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_55_id_RANfunctionsRejected },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_55_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsIDcause_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_55_optional }
+};
+static const asn_ioc_set_t asn_IOS_E2setupResponseIEs_1[] = {
+	{ 3, 4, asn_IOS_E2setupResponseIEs_1_rows }
+};
+static const long asn_VAL_56_id_Cause = 1;
+static const long asn_VAL_56_ignore = 1;
+static const long asn_VAL_56_mandatory = 2;
+static const long asn_VAL_57_id_TimeToWait = 31;
+static const long asn_VAL_57_ignore = 1;
+static const long asn_VAL_57_optional = 0;
+static const long asn_VAL_58_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_58_ignore = 1;
+static const long asn_VAL_58_optional = 0;
+static const asn_ioc_cell_t asn_IOS_E2setupFailureIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_56_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_56_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_56_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_57_id_TimeToWait },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_57_ignore },
+	{ "&Value", aioc__type, &asn_DEF_TimeToWait },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_57_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_58_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_58_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_58_optional }
+};
+static const asn_ioc_set_t asn_IOS_E2setupFailureIEs_1[] = {
+	{ 3, 4, asn_IOS_E2setupFailureIEs_1_rows }
+};
+static const long asn_VAL_59_id_Cause = 1;
+static const long asn_VAL_59_ignore = 1;
+static const long asn_VAL_59_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_ResetRequestIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_59_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_59_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_59_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_ResetRequestIEs_1[] = {
+	{ 1, 4, asn_IOS_ResetRequestIEs_1_rows }
+};
+static const long asn_VAL_60_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_60_ignore = 1;
+static const long asn_VAL_60_optional = 0;
+static const asn_ioc_cell_t asn_IOS_ResetResponseIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_60_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_60_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_60_optional }
+};
+static const asn_ioc_set_t asn_IOS_ResetResponseIEs_1[] = {
+	{ 1, 4, asn_IOS_ResetResponseIEs_1_rows }
+};
+static const long asn_VAL_61_id_RANfunctionsAdded = 10;
+static const long asn_VAL_61_reject = 0;
+static const long asn_VAL_61_optional = 0;
+static const long asn_VAL_62_id_RANfunctionsModified = 12;
+static const long asn_VAL_62_reject = 0;
+static const long asn_VAL_62_optional = 0;
+static const long asn_VAL_63_id_RANfunctionsDeleted = 11;
+static const long asn_VAL_63_reject = 0;
+static const long asn_VAL_63_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceUpdate_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_61_id_RANfunctionsAdded },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_61_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctions_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_61_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_62_id_RANfunctionsModified },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_62_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctions_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_62_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_63_id_RANfunctionsDeleted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_63_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_63_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceUpdate_IEs_1[] = {
+	{ 3, 4, asn_IOS_RICserviceUpdate_IEs_1_rows }
+};
+static const long asn_VAL_66_id_RANfunctionsAccepted = 9;
+static const long asn_VAL_66_reject = 0;
+static const long asn_VAL_66_optional = 0;
+static const long asn_VAL_67_id_RANfunctionsRejected = 13;
+static const long asn_VAL_67_reject = 0;
+static const long asn_VAL_67_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceUpdateAcknowledge_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_66_id_RANfunctionsAccepted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_66_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_66_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_67_id_RANfunctionsRejected },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_67_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsIDcause_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_67_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceUpdateAcknowledge_IEs_1[] = {
+	{ 2, 4, asn_IOS_RICserviceUpdateAcknowledge_IEs_1_rows }
+};
+static const long asn_VAL_69_id_RANfunctionsRejected = 13;
+static const long asn_VAL_69_ignore = 1;
+static const long asn_VAL_69_optional = 0;
+static const long asn_VAL_70_id_TimeToWait = 31;
+static const long asn_VAL_70_ignore = 1;
+static const long asn_VAL_70_optional = 0;
+static const long asn_VAL_71_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_71_ignore = 1;
+static const long asn_VAL_71_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceUpdateFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_69_id_RANfunctionsRejected },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_69_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsIDcause_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_69_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_70_id_TimeToWait },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_70_ignore },
+	{ "&Value", aioc__type, &asn_DEF_TimeToWait },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_70_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_71_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_71_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_71_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceUpdateFailure_IEs_1[] = {
+	{ 3, 4, asn_IOS_RICserviceUpdateFailure_IEs_1_rows }
+};
+static const long asn_VAL_72_id_RANfunctionsAccepted = 9;
+static const long asn_VAL_72_reject = 0;
+static const long asn_VAL_72_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceQuery_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_72_id_RANfunctionsAccepted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_72_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_72_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceQuery_IEs_1[] = {
+	{ 1, 4, asn_IOS_RICserviceQuery_IEs_1_rows }
+};
+static int
+memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICaction_ToBeSetup_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_ToBeSetup_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_ToBeSetup_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICaction_ToBeSetup_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_ToBeSetup_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_ToBeSetup_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_5(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICaction_Admitted_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_Admitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_Admitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_5(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICaction_Admitted_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_Admitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_Admitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_5(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICaction_NotAdmitted_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_NotAdmitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_NotAdmitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICaction_NotAdmitted_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_NotAdmitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_NotAdmitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RANfunction_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunction_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunction_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RANfunction_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunction_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunction_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_17(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RANfunctionID_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionID_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionID_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_17(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RANfunctionID_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionID_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionID_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_17(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_21(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RANfunctionIDcause_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionIDcause_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionIDcause_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_21(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RANfunctionIDcause_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionIDcause_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionIDcause_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_21(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_25(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionRequest_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_25(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionRequest_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_25(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_29(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionResponse_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_29(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionResponse_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_29(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_33(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_33(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_33(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_37(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteRequest_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_37(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteRequest_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_37(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_41(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteResponse_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_41(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteResponse_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_41(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_45(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_45(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_45(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_49(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICindication_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICindication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICindication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_49(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICindication_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICindication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICindication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_49(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_53(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICcontrolRequest_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_53(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICcontrolRequest_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_53(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_57(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICcontrolAcknowledge_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_57(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICcontrolAcknowledge_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_57(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_61(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICcontrolFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_61(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICcontrolFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_61(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_65(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_ErrorIndication_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ErrorIndication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ErrorIndication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_65(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_ErrorIndication_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ErrorIndication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ErrorIndication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_65(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_69(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_E2setupRequestIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_69(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_E2setupRequestIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_69(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_73(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_E2setupResponseIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_73(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_E2setupResponseIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_73(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_77(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_E2setupFailureIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupFailureIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupFailureIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_77(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_E2setupFailureIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupFailureIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupFailureIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_77(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_81(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_ResetRequestIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_81(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_ResetRequestIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_81(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_85(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_ResetResponseIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_85(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_ResetResponseIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_85(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_89(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdate_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdate_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdate_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_89(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdate_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdate_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdate_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_89(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_93(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateAcknowledge_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_93(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateAcknowledge_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_93(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_97(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_97(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_97(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_101(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceQuery_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceQuery_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceQuery_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_101(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceQuery_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceQuery_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceQuery_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_101(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_id_constr_2 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_6 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_6 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_7 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_7 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_8 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_8 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_10 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_10 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_11 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_11 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_12 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_12 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_14 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_14 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_15 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_15 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_16 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_16 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_18 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_18 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_19 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_19 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_20 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_20 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_22 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_22 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_23 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_23 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_24 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_24 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_26 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_26 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_27 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_27 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_28 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_28 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_30 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_30 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_31 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_31 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_32 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_32 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_34 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_34 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_35 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_35 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_36 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_36 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_38 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_38 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_39 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_39 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_40 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_40 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_42 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_42 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_43 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_43 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_44 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_44 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_46 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_46 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_47 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_47 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_48 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_48 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_50 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_50 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_51 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_51 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_52 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_52 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_54 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_54 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_55 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_55 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_56 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_56 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_58 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_58 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_59 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_59 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_60 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_60 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_62 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_62 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_63 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_63 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_64 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_64 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_66 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_66 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_67 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_67 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_68 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_68 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_70 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_70 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_71 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_71 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_72 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_72 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_74 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_74 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_75 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_75 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_76 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_76 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_78 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_78 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_79 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_79 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_80 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_80 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_82 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_82 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_83 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_83 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_84 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_84 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_86 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_86 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_87 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_87 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_88 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_88 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_90 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_90 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_91 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_91 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_92 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_92 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_94 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_94 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_95 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_95 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_96 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_96 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_98 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_98 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_99 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_99 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_100 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_100 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_102 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_102 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_103 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_103 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_104 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_104 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs__value, choice.RICaction_ToBeSetup_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_ToBeSetup_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-ToBeSetup-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICaction-ToBeSetup-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct RICaction_ToBeSetup_ItemIEs__value),
+	offsetof(struct RICaction_ToBeSetup_ItemIEs__value, _asn_ctx),
+	offsetof(struct RICaction_ToBeSetup_ItemIEs__value, present),
+	sizeof(((struct RICaction_ToBeSetup_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_ItemIEs_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_2, &asn_PER_memb_id_constr_2,  memb_id_constraint_1 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICaction_ToBeSetup_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_4,
+		select_RICaction_ToBeSetup_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_ToBeSetup_ItemIEs_tag2el_1[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1 = {
+	sizeof(struct RICaction_ToBeSetup_ItemIEs),
+	offsetof(struct RICaction_ToBeSetup_ItemIEs, _asn_ctx),
+	asn_MAP_RICaction_ToBeSetup_ItemIEs_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_ItemIEs = {
+	"RICaction-ToBeSetup-ItemIEs",
+	"RICaction-ToBeSetup-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1,
+	sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_ToBeSetup_ItemIEs_1,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_8[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs__value, choice.RICaction_Admitted_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_Admitted_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-Admitted-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_8[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICaction-Admitted-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_8 = {
+	sizeof(struct RICaction_Admitted_ItemIEs__value),
+	offsetof(struct RICaction_Admitted_ItemIEs__value, _asn_ctx),
+	offsetof(struct RICaction_Admitted_ItemIEs__value, present),
+	sizeof(((struct RICaction_Admitted_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_8,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_8 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_8,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_8	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICaction_Admitted_ItemIEs_5[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_6, &asn_PER_memb_id_constr_6,  memb_id_constraint_5 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICaction_Admitted_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_7, &asn_PER_memb_criticality_constr_7,  memb_criticality_constraint_5 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_8,
+		select_RICaction_Admitted_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_8, &asn_PER_memb_value_constr_8,  memb_value_constraint_5 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_Admitted_ItemIEs_tags_5[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_Admitted_ItemIEs_tag2el_5[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_ItemIEs_specs_5 = {
+	sizeof(struct RICaction_Admitted_ItemIEs),
+	offsetof(struct RICaction_Admitted_ItemIEs, _asn_ctx),
+	asn_MAP_RICaction_Admitted_ItemIEs_tag2el_5,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_ItemIEs = {
+	"RICaction-Admitted-ItemIEs",
+	"RICaction-Admitted-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_Admitted_ItemIEs_tags_5,
+	sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5)
+		/sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5[0]), /* 1 */
+	asn_DEF_RICaction_Admitted_ItemIEs_tags_5,	/* Same as above */
+	sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5)
+		/sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_Admitted_ItemIEs_5,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_Admitted_ItemIEs_specs_5	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_12[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs__value, choice.RICaction_NotAdmitted_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_NotAdmitted_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-NotAdmitted-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_12[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICaction-NotAdmitted-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_12 = {
+	sizeof(struct RICaction_NotAdmitted_ItemIEs__value),
+	offsetof(struct RICaction_NotAdmitted_ItemIEs__value, _asn_ctx),
+	offsetof(struct RICaction_NotAdmitted_ItemIEs__value, present),
+	sizeof(((struct RICaction_NotAdmitted_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_12,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_12 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_12,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_12	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_ItemIEs_9[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_10, &asn_PER_memb_id_constr_10,  memb_id_constraint_9 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICaction_NotAdmitted_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_11, &asn_PER_memb_criticality_constr_11,  memb_criticality_constraint_9 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_12,
+		select_RICaction_NotAdmitted_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_12, &asn_PER_memb_value_constr_12,  memb_value_constraint_9 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_NotAdmitted_ItemIEs_tag2el_9[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9 = {
+	sizeof(struct RICaction_NotAdmitted_ItemIEs),
+	offsetof(struct RICaction_NotAdmitted_ItemIEs, _asn_ctx),
+	asn_MAP_RICaction_NotAdmitted_ItemIEs_tag2el_9,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_ItemIEs = {
+	"RICaction-NotAdmitted-ItemIEs",
+	"RICaction-NotAdmitted-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9,
+	sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9[0]), /* 1 */
+	asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9,	/* Same as above */
+	sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_NotAdmitted_ItemIEs_9,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_16[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs__value, choice.RANfunction_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunction_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunction-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_16[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunction-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_16 = {
+	sizeof(struct RANfunction_ItemIEs__value),
+	offsetof(struct RANfunction_ItemIEs__value, _asn_ctx),
+	offsetof(struct RANfunction_ItemIEs__value, present),
+	sizeof(((struct RANfunction_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_16,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_16 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_16,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_16	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANfunction_ItemIEs_13[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_14, &asn_PER_memb_id_constr_14,  memb_id_constraint_13 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RANfunction_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_15, &asn_PER_memb_criticality_constr_15,  memb_criticality_constraint_13 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_16,
+		select_RANfunction_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_16, &asn_PER_memb_value_constr_16,  memb_value_constraint_13 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunction_ItemIEs_tags_13[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunction_ItemIEs_tag2el_13[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunction_ItemIEs_specs_13 = {
+	sizeof(struct RANfunction_ItemIEs),
+	offsetof(struct RANfunction_ItemIEs, _asn_ctx),
+	asn_MAP_RANfunction_ItemIEs_tag2el_13,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunction_ItemIEs = {
+	"RANfunction-ItemIEs",
+	"RANfunction-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunction_ItemIEs_tags_13,
+	sizeof(asn_DEF_RANfunction_ItemIEs_tags_13)
+		/sizeof(asn_DEF_RANfunction_ItemIEs_tags_13[0]), /* 1 */
+	asn_DEF_RANfunction_ItemIEs_tags_13,	/* Same as above */
+	sizeof(asn_DEF_RANfunction_ItemIEs_tags_13)
+		/sizeof(asn_DEF_RANfunction_ItemIEs_tags_13[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunction_ItemIEs_13,
+	3,	/* Elements count */
+	&asn_SPC_RANfunction_ItemIEs_specs_13	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_20[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs__value, choice.RANfunctionID_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionID_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_20[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunctionID-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_20 = {
+	sizeof(struct RANfunctionID_ItemIEs__value),
+	offsetof(struct RANfunctionID_ItemIEs__value, _asn_ctx),
+	offsetof(struct RANfunctionID_ItemIEs__value, present),
+	sizeof(((struct RANfunctionID_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_20,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_20 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_20,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_20	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANfunctionID_ItemIEs_17[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_18, &asn_PER_memb_id_constr_18,  memb_id_constraint_17 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RANfunctionID_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_19, &asn_PER_memb_criticality_constr_19,  memb_criticality_constraint_17 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_20,
+		select_RANfunctionID_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_20, &asn_PER_memb_value_constr_20,  memb_value_constraint_17 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionID_ItemIEs_tags_17[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionID_ItemIEs_tag2el_17[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_ItemIEs_specs_17 = {
+	sizeof(struct RANfunctionID_ItemIEs),
+	offsetof(struct RANfunctionID_ItemIEs, _asn_ctx),
+	asn_MAP_RANfunctionID_ItemIEs_tag2el_17,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionID_ItemIEs = {
+	"RANfunctionID-ItemIEs",
+	"RANfunctionID-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionID_ItemIEs_tags_17,
+	sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17)
+		/sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17[0]), /* 1 */
+	asn_DEF_RANfunctionID_ItemIEs_tags_17,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17)
+		/sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionID_ItemIEs_17,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionID_ItemIEs_specs_17	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_24[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs__value, choice.RANfunctionIDcause_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionIDcause_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionIDcause-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_24[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunctionIDcause-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_24 = {
+	sizeof(struct RANfunctionIDcause_ItemIEs__value),
+	offsetof(struct RANfunctionIDcause_ItemIEs__value, _asn_ctx),
+	offsetof(struct RANfunctionIDcause_ItemIEs__value, present),
+	sizeof(((struct RANfunctionIDcause_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_24,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_24 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_24,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_24	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANfunctionIDcause_ItemIEs_21[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_22, &asn_PER_memb_id_constr_22,  memb_id_constraint_21 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RANfunctionIDcause_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_23, &asn_PER_memb_criticality_constr_23,  memb_criticality_constraint_21 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_24,
+		select_RANfunctionIDcause_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_24, &asn_PER_memb_value_constr_24,  memb_value_constraint_21 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionIDcause_ItemIEs_tags_21[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionIDcause_ItemIEs_tag2el_21[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_ItemIEs_specs_21 = {
+	sizeof(struct RANfunctionIDcause_ItemIEs),
+	offsetof(struct RANfunctionIDcause_ItemIEs, _asn_ctx),
+	asn_MAP_RANfunctionIDcause_ItemIEs_tag2el_21,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionIDcause_ItemIEs = {
+	"RANfunctionIDcause-ItemIEs",
+	"RANfunctionIDcause-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionIDcause_ItemIEs_tags_21,
+	sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21)
+		/sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21[0]), /* 1 */
+	asn_DEF_RANfunctionIDcause_ItemIEs_tags_21,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21)
+		/sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionIDcause_ItemIEs_21,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionIDcause_ItemIEs_specs_21	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_28[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs__value, choice.RICsubscriptionDetails),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDetails,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDetails"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_28[] = { 1, 0, 2 };
+static const unsigned asn_MAP_value_from_canonical_28[] = { 1, 0, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_28[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 } /* RICsubscriptionDetails */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_28 = {
+	sizeof(struct RICsubscriptionRequest_IEs__value),
+	offsetof(struct RICsubscriptionRequest_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionRequest_IEs__value, present),
+	sizeof(((struct RICsubscriptionRequest_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_28,
+	3,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_28,
+	asn_MAP_value_from_canonical_28,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_28 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_28,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_28	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionRequest_IEs_25[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_26, &asn_PER_memb_id_constr_26,  memb_id_constraint_25 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionRequest_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_27, &asn_PER_memb_criticality_constr_27,  memb_criticality_constraint_25 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_28,
+		select_RICsubscriptionRequest_IEs_value_type,
+		{ &asn_OER_memb_value_constr_28, &asn_PER_memb_value_constr_28,  memb_value_constraint_25 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionRequest_IEs_tags_25[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionRequest_IEs_tag2el_25[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionRequest_IEs_specs_25 = {
+	sizeof(struct RICsubscriptionRequest_IEs),
+	offsetof(struct RICsubscriptionRequest_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionRequest_IEs_tag2el_25,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest_IEs = {
+	"RICsubscriptionRequest-IEs",
+	"RICsubscriptionRequest-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionRequest_IEs_tags_25,
+	sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25)
+		/sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25[0]), /* 1 */
+	asn_DEF_RICsubscriptionRequest_IEs_tags_25,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25)
+		/sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionRequest_IEs_25,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionRequest_IEs_specs_25	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_32[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RICaction_Admitted_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_Admitted_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-Admitted-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RICaction_NotAdmitted_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_NotAdmitted_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-NotAdmitted-List"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_32[] = { 1, 0, 2, 3 };
+static const unsigned asn_MAP_value_from_canonical_32[] = { 1, 0, 2, 3 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_32[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 1 }, /* RICaction-Admitted-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -2, 0 } /* RICaction-NotAdmitted-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_32 = {
+	sizeof(struct RICsubscriptionResponse_IEs__value),
+	offsetof(struct RICsubscriptionResponse_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionResponse_IEs__value, present),
+	sizeof(((struct RICsubscriptionResponse_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_32,
+	4,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_32,
+	asn_MAP_value_from_canonical_32,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_32 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_32,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_32	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionResponse_IEs_29[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_30, &asn_PER_memb_id_constr_30,  memb_id_constraint_29 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionResponse_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_31, &asn_PER_memb_criticality_constr_31,  memb_criticality_constraint_29 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_32,
+		select_RICsubscriptionResponse_IEs_value_type,
+		{ &asn_OER_memb_value_constr_32, &asn_PER_memb_value_constr_32,  memb_value_constraint_29 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionResponse_IEs_tags_29[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionResponse_IEs_tag2el_29[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionResponse_IEs_specs_29 = {
+	sizeof(struct RICsubscriptionResponse_IEs),
+	offsetof(struct RICsubscriptionResponse_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionResponse_IEs_tag2el_29,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse_IEs = {
+	"RICsubscriptionResponse-IEs",
+	"RICsubscriptionResponse-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionResponse_IEs_tags_29,
+	sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29)
+		/sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29[0]), /* 1 */
+	asn_DEF_RICsubscriptionResponse_IEs_tags_29,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29)
+		/sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionResponse_IEs_29,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionResponse_IEs_specs_29	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_36[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.RICaction_NotAdmitted_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_NotAdmitted_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-NotAdmitted-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_36[] = { 1, 0, 2, 3 };
+static const unsigned asn_MAP_value_from_canonical_36[] = { 1, 0, 2, 3 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_36[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 1 }, /* RICaction-NotAdmitted-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -2, 0 } /* CriticalityDiagnostics */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_36 = {
+	sizeof(struct RICsubscriptionFailure_IEs__value),
+	offsetof(struct RICsubscriptionFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionFailure_IEs__value, present),
+	sizeof(((struct RICsubscriptionFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_36,
+	4,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_36,
+	asn_MAP_value_from_canonical_36,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_36 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_36,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_36	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionFailure_IEs_33[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_34, &asn_PER_memb_id_constr_34,  memb_id_constraint_33 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_35, &asn_PER_memb_criticality_constr_35,  memb_criticality_constraint_33 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_36,
+		select_RICsubscriptionFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_36, &asn_PER_memb_value_constr_36,  memb_value_constraint_33 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionFailure_IEs_tags_33[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionFailure_IEs_tag2el_33[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionFailure_IEs_specs_33 = {
+	sizeof(struct RICsubscriptionFailure_IEs),
+	offsetof(struct RICsubscriptionFailure_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionFailure_IEs_tag2el_33,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure_IEs = {
+	"RICsubscriptionFailure-IEs",
+	"RICsubscriptionFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionFailure_IEs_tags_33,
+	sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33)
+		/sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33[0]), /* 1 */
+	asn_DEF_RICsubscriptionFailure_IEs_tags_33,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33)
+		/sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionFailure_IEs_33,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionFailure_IEs_specs_33	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_40[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_40[] = { 1, 0 };
+static const unsigned asn_MAP_value_from_canonical_40[] = { 1, 0 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_40[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_40 = {
+	sizeof(struct RICsubscriptionDeleteRequest_IEs__value),
+	offsetof(struct RICsubscriptionDeleteRequest_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionDeleteRequest_IEs__value, present),
+	sizeof(((struct RICsubscriptionDeleteRequest_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_40,
+	2,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_40,
+	asn_MAP_value_from_canonical_40,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_40 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_40,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_40	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteRequest_IEs_37[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_38, &asn_PER_memb_id_constr_38,  memb_id_constraint_37 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionDeleteRequest_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_39, &asn_PER_memb_criticality_constr_39,  memb_criticality_constraint_37 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_40,
+		select_RICsubscriptionDeleteRequest_IEs_value_type,
+		{ &asn_OER_memb_value_constr_40, &asn_PER_memb_value_constr_40,  memb_value_constraint_37 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteRequest_IEs_tag2el_37[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteRequest_IEs_specs_37 = {
+	sizeof(struct RICsubscriptionDeleteRequest_IEs),
+	offsetof(struct RICsubscriptionDeleteRequest_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteRequest_IEs_tag2el_37,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest_IEs = {
+	"RICsubscriptionDeleteRequest-IEs",
+	"RICsubscriptionDeleteRequest-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37,
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteRequest_IEs_37,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteRequest_IEs_specs_37	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_44[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_44[] = { 1, 0 };
+static const unsigned asn_MAP_value_from_canonical_44[] = { 1, 0 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_44[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_44 = {
+	sizeof(struct RICsubscriptionDeleteResponse_IEs__value),
+	offsetof(struct RICsubscriptionDeleteResponse_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionDeleteResponse_IEs__value, present),
+	sizeof(((struct RICsubscriptionDeleteResponse_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_44,
+	2,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_44,
+	asn_MAP_value_from_canonical_44,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_44 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_44,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_44	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteResponse_IEs_41[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_42, &asn_PER_memb_id_constr_42,  memb_id_constraint_41 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionDeleteResponse_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_43, &asn_PER_memb_criticality_constr_43,  memb_criticality_constraint_41 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_44,
+		select_RICsubscriptionDeleteResponse_IEs_value_type,
+		{ &asn_OER_memb_value_constr_44, &asn_PER_memb_value_constr_44,  memb_value_constraint_41 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteResponse_IEs_tag2el_41[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteResponse_IEs_specs_41 = {
+	sizeof(struct RICsubscriptionDeleteResponse_IEs),
+	offsetof(struct RICsubscriptionDeleteResponse_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteResponse_IEs_tag2el_41,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse_IEs = {
+	"RICsubscriptionDeleteResponse-IEs",
+	"RICsubscriptionDeleteResponse-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41,
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteResponse_IEs_41,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteResponse_IEs_specs_41	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_48[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_48[] = { 1, 0, 3, 2 };
+static const unsigned asn_MAP_value_from_canonical_48[] = { 1, 0, 3, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_48[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -1, 0 }, /* CriticalityDiagnostics */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 2, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_48 = {
+	sizeof(struct RICsubscriptionDeleteFailure_IEs__value),
+	offsetof(struct RICsubscriptionDeleteFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionDeleteFailure_IEs__value, present),
+	sizeof(((struct RICsubscriptionDeleteFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_48,
+	8,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_48,
+	asn_MAP_value_from_canonical_48,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_48 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_48,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_48	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteFailure_IEs_45[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_46, &asn_PER_memb_id_constr_46,  memb_id_constraint_45 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionDeleteFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_47, &asn_PER_memb_criticality_constr_47,  memb_criticality_constraint_45 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_48,
+		select_RICsubscriptionDeleteFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_48, &asn_PER_memb_value_constr_48,  memb_value_constraint_45 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteFailure_IEs_tag2el_45[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteFailure_IEs_specs_45 = {
+	sizeof(struct RICsubscriptionDeleteFailure_IEs),
+	offsetof(struct RICsubscriptionDeleteFailure_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteFailure_IEs_tag2el_45,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure_IEs = {
+	"RICsubscriptionDeleteFailure-IEs",
+	"RICsubscriptionDeleteFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45,
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteFailure_IEs_45,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteFailure_IEs_specs_45	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_52[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICactionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICactionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationSN),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RICindicationSN,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationSN"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationType),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_RICindicationType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationType"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationHeader),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICindicationHeader,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationHeader"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationMessage),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICindicationMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationMessage"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_52[] = { 1, 2, 3, 5, 6, 7, 4, 0 };
+static const unsigned asn_MAP_value_from_canonical_52[] = { 7, 0, 1, 2, 6, 3, 4, 5 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_52[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 2 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* RICactionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -2, 0 }, /* RICindicationSN */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 5, 0, 2 }, /* RICindicationHeader */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 6, -1, 1 }, /* RICindicationMessage */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 7, -2, 0 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* RICindicationType */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_52 = {
+	sizeof(struct RICindication_IEs__value),
+	offsetof(struct RICindication_IEs__value, _asn_ctx),
+	offsetof(struct RICindication_IEs__value, present),
+	sizeof(((struct RICindication_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_52,
+	8,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_52,
+	asn_MAP_value_from_canonical_52,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_52 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_52,
+	8,	/* Elements count */
+	&asn_SPC_value_specs_52	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICindication_IEs_49[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_50, &asn_PER_memb_id_constr_50,  memb_id_constraint_49 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICindication_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_51, &asn_PER_memb_criticality_constr_51,  memb_criticality_constraint_49 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_52,
+		select_RICindication_IEs_value_type,
+		{ &asn_OER_memb_value_constr_52, &asn_PER_memb_value_constr_52,  memb_value_constraint_49 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICindication_IEs_tags_49[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICindication_IEs_tag2el_49[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICindication_IEs_specs_49 = {
+	sizeof(struct RICindication_IEs),
+	offsetof(struct RICindication_IEs, _asn_ctx),
+	asn_MAP_RICindication_IEs_tag2el_49,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICindication_IEs = {
+	"RICindication-IEs",
+	"RICindication-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICindication_IEs_tags_49,
+	sizeof(asn_DEF_RICindication_IEs_tags_49)
+		/sizeof(asn_DEF_RICindication_IEs_tags_49[0]), /* 1 */
+	asn_DEF_RICindication_IEs_tags_49,	/* Same as above */
+	sizeof(asn_DEF_RICindication_IEs_tags_49)
+		/sizeof(asn_DEF_RICindication_IEs_tags_49[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICindication_IEs_49,
+	3,	/* Elements count */
+	&asn_SPC_RICindication_IEs_specs_49	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_56[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcontrolHeader),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolHeader,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolHeader"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcontrolMessage),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolMessage"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcontrolAckRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_RICcontrolAckRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolAckRequest"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_56[] = { 1, 2, 3, 4, 5, 0 };
+static const unsigned asn_MAP_value_from_canonical_56[] = { 5, 0, 1, 2, 3, 4 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_56[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 2 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 3, -1, 1 }, /* RICcontrolHeader */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 4, -2, 0 }, /* RICcontrolMessage */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 5, 0, 0 }, /* RICcontrolAckRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_56 = {
+	sizeof(struct RICcontrolRequest_IEs__value),
+	offsetof(struct RICcontrolRequest_IEs__value, _asn_ctx),
+	offsetof(struct RICcontrolRequest_IEs__value, present),
+	sizeof(((struct RICcontrolRequest_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_56,
+	6,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_56,
+	asn_MAP_value_from_canonical_56,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_56 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_56,
+	6,	/* Elements count */
+	&asn_SPC_value_specs_56	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICcontrolRequest_IEs_53[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_54, &asn_PER_memb_id_constr_54,  memb_id_constraint_53 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICcontrolRequest_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_55, &asn_PER_memb_criticality_constr_55,  memb_criticality_constraint_53 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_56,
+		select_RICcontrolRequest_IEs_value_type,
+		{ &asn_OER_memb_value_constr_56, &asn_PER_memb_value_constr_56,  memb_value_constraint_53 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolRequest_IEs_tags_53[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolRequest_IEs_tag2el_53[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICcontrolRequest_IEs_specs_53 = {
+	sizeof(struct RICcontrolRequest_IEs),
+	offsetof(struct RICcontrolRequest_IEs, _asn_ctx),
+	asn_MAP_RICcontrolRequest_IEs_tag2el_53,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest_IEs = {
+	"RICcontrolRequest-IEs",
+	"RICcontrolRequest-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolRequest_IEs_tags_53,
+	sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53)
+		/sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53[0]), /* 1 */
+	asn_DEF_RICcontrolRequest_IEs_tags_53,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53)
+		/sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolRequest_IEs_53,
+	3,	/* Elements count */
+	&asn_SPC_RICcontrolRequest_IEs_specs_53	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_60[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICcontrolStatus),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_RICcontrolStatus,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolStatus"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICcontrolOutcome),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolOutcome"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_60[] = { 1, 2, 4, 3, 0 };
+static const unsigned asn_MAP_value_from_canonical_60[] = { 4, 0, 1, 3, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_60[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 1 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 4, -1, 0 }, /* RICcontrolOutcome */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, 0, 0 }, /* RICcontrolStatus */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_60 = {
+	sizeof(struct RICcontrolAcknowledge_IEs__value),
+	offsetof(struct RICcontrolAcknowledge_IEs__value, _asn_ctx),
+	offsetof(struct RICcontrolAcknowledge_IEs__value, present),
+	sizeof(((struct RICcontrolAcknowledge_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_60,
+	5,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_60,
+	asn_MAP_value_from_canonical_60,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_60 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_60,
+	5,	/* Elements count */
+	&asn_SPC_value_specs_60	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICcontrolAcknowledge_IEs_57[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_58, &asn_PER_memb_id_constr_58,  memb_id_constraint_57 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICcontrolAcknowledge_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_59, &asn_PER_memb_criticality_constr_59,  memb_criticality_constraint_57 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_60,
+		select_RICcontrolAcknowledge_IEs_value_type,
+		{ &asn_OER_memb_value_constr_60, &asn_PER_memb_value_constr_60,  memb_value_constraint_57 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolAcknowledge_IEs_tags_57[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolAcknowledge_IEs_tag2el_57[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICcontrolAcknowledge_IEs_specs_57 = {
+	sizeof(struct RICcontrolAcknowledge_IEs),
+	offsetof(struct RICcontrolAcknowledge_IEs, _asn_ctx),
+	asn_MAP_RICcontrolAcknowledge_IEs_tag2el_57,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge_IEs = {
+	"RICcontrolAcknowledge-IEs",
+	"RICcontrolAcknowledge-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolAcknowledge_IEs_tags_57,
+	sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57[0]), /* 1 */
+	asn_DEF_RICcontrolAcknowledge_IEs_tags_57,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolAcknowledge_IEs_57,
+	3,	/* Elements count */
+	&asn_SPC_RICcontrolAcknowledge_IEs_specs_57	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_64[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RICcontrolOutcome),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolOutcome"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_64[] = { 1, 2, 4, 0, 3 };
+static const unsigned asn_MAP_value_from_canonical_64[] = { 3, 0, 1, 4, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_64[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 1 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 4, -1, 0 }, /* RICcontrolOutcome */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 3, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_64 = {
+	sizeof(struct RICcontrolFailure_IEs__value),
+	offsetof(struct RICcontrolFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICcontrolFailure_IEs__value, present),
+	sizeof(((struct RICcontrolFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_64,
+	9,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_64,
+	asn_MAP_value_from_canonical_64,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_64 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_64,
+	5,	/* Elements count */
+	&asn_SPC_value_specs_64	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICcontrolFailure_IEs_61[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_62, &asn_PER_memb_id_constr_62,  memb_id_constraint_61 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICcontrolFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_63, &asn_PER_memb_criticality_constr_63,  memb_criticality_constraint_61 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_64,
+		select_RICcontrolFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_64, &asn_PER_memb_value_constr_64,  memb_value_constraint_61 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolFailure_IEs_tags_61[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolFailure_IEs_tag2el_61[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICcontrolFailure_IEs_specs_61 = {
+	sizeof(struct RICcontrolFailure_IEs),
+	offsetof(struct RICcontrolFailure_IEs, _asn_ctx),
+	asn_MAP_RICcontrolFailure_IEs_tag2el_61,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure_IEs = {
+	"RICcontrolFailure-IEs",
+	"RICcontrolFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolFailure_IEs_tags_61,
+	sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61)
+		/sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61[0]), /* 1 */
+	asn_DEF_RICcontrolFailure_IEs_tags_61,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61)
+		/sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolFailure_IEs_61,
+	3,	/* Elements count */
+	&asn_SPC_RICcontrolFailure_IEs_specs_61	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_68[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_68[] = { 1, 0, 3, 2 };
+static const unsigned asn_MAP_value_from_canonical_68[] = { 1, 0, 3, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_68[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -1, 0 }, /* CriticalityDiagnostics */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 2, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_68 = {
+	sizeof(struct ErrorIndication_IEs__value),
+	offsetof(struct ErrorIndication_IEs__value, _asn_ctx),
+	offsetof(struct ErrorIndication_IEs__value, present),
+	sizeof(((struct ErrorIndication_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_68,
+	8,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_68,
+	asn_MAP_value_from_canonical_68,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_68 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_68,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_68	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ErrorIndication_IEs_65[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_66, &asn_PER_memb_id_constr_66,  memb_id_constraint_65 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_ErrorIndication_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_67, &asn_PER_memb_criticality_constr_67,  memb_criticality_constraint_65 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_68,
+		select_ErrorIndication_IEs_value_type,
+		{ &asn_OER_memb_value_constr_68, &asn_PER_memb_value_constr_68,  memb_value_constraint_65 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ErrorIndication_IEs_tags_65[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ErrorIndication_IEs_tag2el_65[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ErrorIndication_IEs_specs_65 = {
+	sizeof(struct ErrorIndication_IEs),
+	offsetof(struct ErrorIndication_IEs, _asn_ctx),
+	asn_MAP_ErrorIndication_IEs_tag2el_65,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ErrorIndication_IEs = {
+	"ErrorIndication-IEs",
+	"ErrorIndication-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ErrorIndication_IEs_tags_65,
+	sizeof(asn_DEF_ErrorIndication_IEs_tags_65)
+		/sizeof(asn_DEF_ErrorIndication_IEs_tags_65[0]), /* 1 */
+	asn_DEF_ErrorIndication_IEs_tags_65,	/* Same as above */
+	sizeof(asn_DEF_ErrorIndication_IEs_tags_65)
+		/sizeof(asn_DEF_ErrorIndication_IEs_tags_65[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ErrorIndication_IEs_65,
+	3,	/* Elements count */
+	&asn_SPC_ErrorIndication_IEs_specs_65	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_72[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs__value, choice.GlobalE2node_ID),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_GlobalE2node_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"GlobalE2node-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs__value, choice.RANfunctions_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctions_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctions-List"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_72[] = { 1, 0 };
+static const unsigned asn_MAP_value_from_canonical_72[] = { 1, 0 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_72[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* RANfunctions-List */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* en-gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* ng-eNB */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* eNB */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_72 = {
+	sizeof(struct E2setupRequestIEs__value),
+	offsetof(struct E2setupRequestIEs__value, _asn_ctx),
+	offsetof(struct E2setupRequestIEs__value, present),
+	sizeof(((struct E2setupRequestIEs__value *)0)->present),
+	asn_MAP_value_tag2el_72,
+	5,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_72,
+	asn_MAP_value_from_canonical_72,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_72 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_72,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_72	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2setupRequestIEs_69[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_70, &asn_PER_memb_id_constr_70,  memb_id_constraint_69 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_E2setupRequestIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_71, &asn_PER_memb_criticality_constr_71,  memb_criticality_constraint_69 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_72,
+		select_E2setupRequestIEs_value_type,
+		{ &asn_OER_memb_value_constr_72, &asn_PER_memb_value_constr_72,  memb_value_constraint_69 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupRequestIEs_tags_69[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupRequestIEs_tag2el_69[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2setupRequestIEs_specs_69 = {
+	sizeof(struct E2setupRequestIEs),
+	offsetof(struct E2setupRequestIEs, _asn_ctx),
+	asn_MAP_E2setupRequestIEs_tag2el_69,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupRequestIEs = {
+	"E2setupRequestIEs",
+	"E2setupRequestIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupRequestIEs_tags_69,
+	sizeof(asn_DEF_E2setupRequestIEs_tags_69)
+		/sizeof(asn_DEF_E2setupRequestIEs_tags_69[0]), /* 1 */
+	asn_DEF_E2setupRequestIEs_tags_69,	/* Same as above */
+	sizeof(asn_DEF_E2setupRequestIEs_tags_69)
+		/sizeof(asn_DEF_E2setupRequestIEs_tags_69[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupRequestIEs_69,
+	3,	/* Elements count */
+	&asn_SPC_E2setupRequestIEs_specs_69	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_76[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs__value, choice.GlobalRIC_ID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_GlobalRIC_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"GlobalRIC-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs__value, choice.RANfunctionsIDcause_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsIDcause_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsIDcause-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_76[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* GlobalRIC-ID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 1 }, /* RANfunctionsID-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 0 } /* RANfunctionsIDcause-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_76 = {
+	sizeof(struct E2setupResponseIEs__value),
+	offsetof(struct E2setupResponseIEs__value, _asn_ctx),
+	offsetof(struct E2setupResponseIEs__value, present),
+	sizeof(((struct E2setupResponseIEs__value *)0)->present),
+	asn_MAP_value_tag2el_76,
+	3,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_76 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_76,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_76	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2setupResponseIEs_73[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_74, &asn_PER_memb_id_constr_74,  memb_id_constraint_73 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_E2setupResponseIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_75, &asn_PER_memb_criticality_constr_75,  memb_criticality_constraint_73 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_76,
+		select_E2setupResponseIEs_value_type,
+		{ &asn_OER_memb_value_constr_76, &asn_PER_memb_value_constr_76,  memb_value_constraint_73 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupResponseIEs_tags_73[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupResponseIEs_tag2el_73[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2setupResponseIEs_specs_73 = {
+	sizeof(struct E2setupResponseIEs),
+	offsetof(struct E2setupResponseIEs, _asn_ctx),
+	asn_MAP_E2setupResponseIEs_tag2el_73,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupResponseIEs = {
+	"E2setupResponseIEs",
+	"E2setupResponseIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupResponseIEs_tags_73,
+	sizeof(asn_DEF_E2setupResponseIEs_tags_73)
+		/sizeof(asn_DEF_E2setupResponseIEs_tags_73[0]), /* 1 */
+	asn_DEF_E2setupResponseIEs_tags_73,	/* Same as above */
+	sizeof(asn_DEF_E2setupResponseIEs_tags_73)
+		/sizeof(asn_DEF_E2setupResponseIEs_tags_73[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupResponseIEs_73,
+	3,	/* Elements count */
+	&asn_SPC_E2setupResponseIEs_specs_73	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_80[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs__value, choice.TimeToWait),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_TimeToWait,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"TimeToWait"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_80[] = { 1, 2, 0 };
+static const unsigned asn_MAP_value_from_canonical_80[] = { 2, 0, 1 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_80[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 }, /* TimeToWait */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 }, /* CriticalityDiagnostics */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_80 = {
+	sizeof(struct E2setupFailureIEs__value),
+	offsetof(struct E2setupFailureIEs__value, _asn_ctx),
+	offsetof(struct E2setupFailureIEs__value, present),
+	sizeof(((struct E2setupFailureIEs__value *)0)->present),
+	asn_MAP_value_tag2el_80,
+	7,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_80,
+	asn_MAP_value_from_canonical_80,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_80 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_80,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_80	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2setupFailureIEs_77[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_78, &asn_PER_memb_id_constr_78,  memb_id_constraint_77 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_E2setupFailureIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_79, &asn_PER_memb_criticality_constr_79,  memb_criticality_constraint_77 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_80,
+		select_E2setupFailureIEs_value_type,
+		{ &asn_OER_memb_value_constr_80, &asn_PER_memb_value_constr_80,  memb_value_constraint_77 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupFailureIEs_tags_77[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupFailureIEs_tag2el_77[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2setupFailureIEs_specs_77 = {
+	sizeof(struct E2setupFailureIEs),
+	offsetof(struct E2setupFailureIEs, _asn_ctx),
+	asn_MAP_E2setupFailureIEs_tag2el_77,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupFailureIEs = {
+	"E2setupFailureIEs",
+	"E2setupFailureIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupFailureIEs_tags_77,
+	sizeof(asn_DEF_E2setupFailureIEs_tags_77)
+		/sizeof(asn_DEF_E2setupFailureIEs_tags_77[0]), /* 1 */
+	asn_DEF_E2setupFailureIEs_tags_77,	/* Same as above */
+	sizeof(asn_DEF_E2setupFailureIEs_tags_77)
+		/sizeof(asn_DEF_E2setupFailureIEs_tags_77[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupFailureIEs_77,
+	3,	/* Elements count */
+	&asn_SPC_E2setupFailureIEs_specs_77	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_84[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_84[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_84 = {
+	sizeof(struct ResetRequestIEs__value),
+	offsetof(struct ResetRequestIEs__value, _asn_ctx),
+	offsetof(struct ResetRequestIEs__value, present),
+	sizeof(((struct ResetRequestIEs__value *)0)->present),
+	asn_MAP_value_tag2el_84,
+	5,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_84 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_84,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_84	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ResetRequestIEs_81[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_82, &asn_PER_memb_id_constr_82,  memb_id_constraint_81 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_ResetRequestIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_83, &asn_PER_memb_criticality_constr_83,  memb_criticality_constraint_81 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_84,
+		select_ResetRequestIEs_value_type,
+		{ &asn_OER_memb_value_constr_84, &asn_PER_memb_value_constr_84,  memb_value_constraint_81 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetRequestIEs_tags_81[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetRequestIEs_tag2el_81[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ResetRequestIEs_specs_81 = {
+	sizeof(struct ResetRequestIEs),
+	offsetof(struct ResetRequestIEs, _asn_ctx),
+	asn_MAP_ResetRequestIEs_tag2el_81,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetRequestIEs = {
+	"ResetRequestIEs",
+	"ResetRequestIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetRequestIEs_tags_81,
+	sizeof(asn_DEF_ResetRequestIEs_tags_81)
+		/sizeof(asn_DEF_ResetRequestIEs_tags_81[0]), /* 1 */
+	asn_DEF_ResetRequestIEs_tags_81,	/* Same as above */
+	sizeof(asn_DEF_ResetRequestIEs_tags_81)
+		/sizeof(asn_DEF_ResetRequestIEs_tags_81[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetRequestIEs_81,
+	3,	/* Elements count */
+	&asn_SPC_ResetRequestIEs_specs_81	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_88[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_88[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* CriticalityDiagnostics */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_88 = {
+	sizeof(struct ResetResponseIEs__value),
+	offsetof(struct ResetResponseIEs__value, _asn_ctx),
+	offsetof(struct ResetResponseIEs__value, present),
+	sizeof(((struct ResetResponseIEs__value *)0)->present),
+	asn_MAP_value_tag2el_88,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_88 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_88,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_88	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ResetResponseIEs_85[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_86, &asn_PER_memb_id_constr_86,  memb_id_constraint_85 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_ResetResponseIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_87, &asn_PER_memb_criticality_constr_87,  memb_criticality_constraint_85 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_88,
+		select_ResetResponseIEs_value_type,
+		{ &asn_OER_memb_value_constr_88, &asn_PER_memb_value_constr_88,  memb_value_constraint_85 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetResponseIEs_tags_85[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetResponseIEs_tag2el_85[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ResetResponseIEs_specs_85 = {
+	sizeof(struct ResetResponseIEs),
+	offsetof(struct ResetResponseIEs, _asn_ctx),
+	asn_MAP_ResetResponseIEs_tag2el_85,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetResponseIEs = {
+	"ResetResponseIEs",
+	"ResetResponseIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetResponseIEs_tags_85,
+	sizeof(asn_DEF_ResetResponseIEs_tags_85)
+		/sizeof(asn_DEF_ResetResponseIEs_tags_85[0]), /* 1 */
+	asn_DEF_ResetResponseIEs_tags_85,	/* Same as above */
+	sizeof(asn_DEF_ResetResponseIEs_tags_85)
+		/sizeof(asn_DEF_ResetResponseIEs_tags_85[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetResponseIEs_85,
+	3,	/* Elements count */
+	&asn_SPC_ResetResponseIEs_specs_85	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_92[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs__value, choice.RANfunctions_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctions_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctions-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_92[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RANfunctions-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* RANfunctionsID-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_92 = {
+	sizeof(struct RICserviceUpdate_IEs__value),
+	offsetof(struct RICserviceUpdate_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceUpdate_IEs__value, present),
+	sizeof(((struct RICserviceUpdate_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_92,
+	2,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_92 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_92,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_92	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceUpdate_IEs_89[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_90, &asn_PER_memb_id_constr_90,  memb_id_constraint_89 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceUpdate_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_91, &asn_PER_memb_criticality_constr_91,  memb_criticality_constraint_89 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_92,
+		select_RICserviceUpdate_IEs_value_type,
+		{ &asn_OER_memb_value_constr_92, &asn_PER_memb_value_constr_92,  memb_value_constraint_89 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdate_IEs_tags_89[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdate_IEs_tag2el_89[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdate_IEs_specs_89 = {
+	sizeof(struct RICserviceUpdate_IEs),
+	offsetof(struct RICserviceUpdate_IEs, _asn_ctx),
+	asn_MAP_RICserviceUpdate_IEs_tag2el_89,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate_IEs = {
+	"RICserviceUpdate-IEs",
+	"RICserviceUpdate-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdate_IEs_tags_89,
+	sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89)
+		/sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89[0]), /* 1 */
+	asn_DEF_RICserviceUpdate_IEs_tags_89,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89)
+		/sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdate_IEs_89,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceUpdate_IEs_specs_89	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_96[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs__value, choice.RANfunctionsIDcause_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsIDcause_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsIDcause-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_96[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RANfunctionsID-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* RANfunctionsIDcause-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_96 = {
+	sizeof(struct RICserviceUpdateAcknowledge_IEs__value),
+	offsetof(struct RICserviceUpdateAcknowledge_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceUpdateAcknowledge_IEs__value, present),
+	sizeof(((struct RICserviceUpdateAcknowledge_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_96,
+	2,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_96 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_96,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_96	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceUpdateAcknowledge_IEs_93[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_94, &asn_PER_memb_id_constr_94,  memb_id_constraint_93 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceUpdateAcknowledge_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_95, &asn_PER_memb_criticality_constr_95,  memb_criticality_constraint_93 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_96,
+		select_RICserviceUpdateAcknowledge_IEs_value_type,
+		{ &asn_OER_memb_value_constr_96, &asn_PER_memb_value_constr_96,  memb_value_constraint_93 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateAcknowledge_IEs_tag2el_93[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateAcknowledge_IEs_specs_93 = {
+	sizeof(struct RICserviceUpdateAcknowledge_IEs),
+	offsetof(struct RICserviceUpdateAcknowledge_IEs, _asn_ctx),
+	asn_MAP_RICserviceUpdateAcknowledge_IEs_tag2el_93,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge_IEs = {
+	"RICserviceUpdateAcknowledge-IEs",
+	"RICserviceUpdateAcknowledge-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93,
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93[0]), /* 1 */
+	asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateAcknowledge_IEs_93,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceUpdateAcknowledge_IEs_specs_93	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_100[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs__value, choice.RANfunctionsIDcause_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsIDcause_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsIDcause-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs__value, choice.TimeToWait),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_TimeToWait,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"TimeToWait"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_100[] = { 1, 0, 2 };
+static const unsigned asn_MAP_value_from_canonical_100[] = { 1, 0, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_100[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 }, /* TimeToWait */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RANfunctionsIDcause-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 } /* CriticalityDiagnostics */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_100 = {
+	sizeof(struct RICserviceUpdateFailure_IEs__value),
+	offsetof(struct RICserviceUpdateFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceUpdateFailure_IEs__value, present),
+	sizeof(((struct RICserviceUpdateFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_100,
+	3,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_100,
+	asn_MAP_value_from_canonical_100,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_100 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_100,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_100	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceUpdateFailure_IEs_97[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_98, &asn_PER_memb_id_constr_98,  memb_id_constraint_97 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceUpdateFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_99, &asn_PER_memb_criticality_constr_99,  memb_criticality_constraint_97 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_100,
+		select_RICserviceUpdateFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_100, &asn_PER_memb_value_constr_100,  memb_value_constraint_97 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateFailure_IEs_tags_97[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateFailure_IEs_tag2el_97[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateFailure_IEs_specs_97 = {
+	sizeof(struct RICserviceUpdateFailure_IEs),
+	offsetof(struct RICserviceUpdateFailure_IEs, _asn_ctx),
+	asn_MAP_RICserviceUpdateFailure_IEs_tag2el_97,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure_IEs = {
+	"RICserviceUpdateFailure-IEs",
+	"RICserviceUpdateFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateFailure_IEs_tags_97,
+	sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97[0]), /* 1 */
+	asn_DEF_RICserviceUpdateFailure_IEs_tags_97,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateFailure_IEs_97,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceUpdateFailure_IEs_specs_97	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_104[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_104[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunctionsID-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_104 = {
+	sizeof(struct RICserviceQuery_IEs__value),
+	offsetof(struct RICserviceQuery_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceQuery_IEs__value, present),
+	sizeof(((struct RICserviceQuery_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_104,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_104 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_104,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_104	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceQuery_IEs_101[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_102, &asn_PER_memb_id_constr_102,  memb_id_constraint_101 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceQuery_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_103, &asn_PER_memb_criticality_constr_103,  memb_criticality_constraint_101 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_104,
+		select_RICserviceQuery_IEs_value_type,
+		{ &asn_OER_memb_value_constr_104, &asn_PER_memb_value_constr_104,  memb_value_constraint_101 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceQuery_IEs_tags_101[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceQuery_IEs_tag2el_101[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceQuery_IEs_specs_101 = {
+	sizeof(struct RICserviceQuery_IEs),
+	offsetof(struct RICserviceQuery_IEs, _asn_ctx),
+	asn_MAP_RICserviceQuery_IEs_tag2el_101,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceQuery_IEs = {
+	"RICserviceQuery-IEs",
+	"RICserviceQuery-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceQuery_IEs_tags_101,
+	sizeof(asn_DEF_RICserviceQuery_IEs_tags_101)
+		/sizeof(asn_DEF_RICserviceQuery_IEs_tags_101[0]), /* 1 */
+	asn_DEF_RICserviceQuery_IEs_tags_101,	/* Same as above */
+	sizeof(asn_DEF_RICserviceQuery_IEs_tags_101)
+		/sizeof(asn_DEF_RICserviceQuery_IEs_tags_101[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceQuery_IEs_101,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceQuery_IEs_specs_101	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ProtocolIE-FieldPair.c b/e2ap/lib/ProtocolIE-FieldPair.c
new file mode 100644
index 0000000..fa909ca
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-FieldPair.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-FieldPair.h"
+
diff --git a/e2ap/lib/ProtocolIE-ID.c b/e2ap/lib/ProtocolIE-ID.c
new file mode 100644
index 0000000..b0e56de
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ID.h"
+
+int
+ProtocolIE_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_ID_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+asn_per_constraints_t asn_PER_type_ProtocolIE_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_ID = {
+	"ProtocolIE-ID",
+	"ProtocolIE-ID",
+	&asn_OP_NativeInteger,
+	asn_DEF_ProtocolIE_ID_tags_1,
+	sizeof(asn_DEF_ProtocolIE_ID_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_ID_tags_1[0]), /* 1 */
+	asn_DEF_ProtocolIE_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_ID_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_ID_constr_1, &asn_PER_type_ProtocolIE_ID_constr_1, ProtocolIE_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/ProtocolIE-SingleContainer.c b/e2ap/lib/ProtocolIE-SingleContainer.c
new file mode 100644
index 0000000..5b06b80
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-SingleContainer.c
@@ -0,0 +1,147 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-SingleContainer.h"
+
+/*
+ * This type is implemented using RICaction_ToBeSetup_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RICaction_Admitted_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RICaction_NotAdmitted_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RANfunction_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RANfunctionID_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RANfunctionIDcause_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P0 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_ToBeSetup_ItemIEs_1,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P1 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_Admitted_ItemIEs_5,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_Admitted_ItemIEs_specs_5	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P2 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_NotAdmitted_ItemIEs_9,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P3 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunction_ItemIEs_13,
+	3,	/* Elements count */
+	&asn_SPC_RANfunction_ItemIEs_specs_13	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P4 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionID_ItemIEs_17,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionID_ItemIEs_specs_17	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P5 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionIDcause_ItemIEs_21,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionIDcause_ItemIEs_specs_21	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunction-Item.c b/e2ap/lib/RANfunction-Item.c
new file mode 100644
index 0000000..f80753b
--- /dev/null
+++ b/e2ap/lib/RANfunction-Item.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunction-Item.h"
+
+asn_TYPE_member_t asn_MBR_RANfunction_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Item, ranFunctionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Item, ranFunctionDefinition),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionDefinition,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionDefinition"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Item, ranFunctionRevision),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionRevision,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionRevision"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunction_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunction_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunctionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ranFunctionDefinition */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ranFunctionRevision */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunction_Item_specs_1 = {
+	sizeof(struct RANfunction_Item),
+	offsetof(struct RANfunction_Item, _asn_ctx),
+	asn_MAP_RANfunction_Item_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunction_Item = {
+	"RANfunction-Item",
+	"RANfunction-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunction_Item_tags_1,
+	sizeof(asn_DEF_RANfunction_Item_tags_1)
+		/sizeof(asn_DEF_RANfunction_Item_tags_1[0]), /* 1 */
+	asn_DEF_RANfunction_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunction_Item_tags_1)
+		/sizeof(asn_DEF_RANfunction_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunction_Item_1,
+	3,	/* Elements count */
+	&asn_SPC_RANfunction_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionDefinition.c b/e2ap/lib/RANfunctionDefinition.c
new file mode 100644
index 0000000..49c090f
--- /dev/null
+++ b/e2ap/lib/RANfunctionDefinition.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionDefinition.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RANfunctionDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionDefinition = {
+	"RANfunctionDefinition",
+	"RANfunctionDefinition",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RANfunctionDefinition_tags_1,
+	sizeof(asn_DEF_RANfunctionDefinition_tags_1)
+		/sizeof(asn_DEF_RANfunctionDefinition_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionDefinition_tags_1)
+		/sizeof(asn_DEF_RANfunctionDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionID-Item.c b/e2ap/lib/RANfunctionID-Item.c
new file mode 100644
index 0000000..fb2b6fc
--- /dev/null
+++ b/e2ap/lib/RANfunctionID-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionID-Item.h"
+
+asn_TYPE_member_t asn_MBR_RANfunctionID_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_Item, ranFunctionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_Item, ranFunctionRevision),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionRevision,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionRevision"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionID_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionID_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunctionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ranFunctionRevision */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_Item_specs_1 = {
+	sizeof(struct RANfunctionID_Item),
+	offsetof(struct RANfunctionID_Item, _asn_ctx),
+	asn_MAP_RANfunctionID_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionID_Item = {
+	"RANfunctionID-Item",
+	"RANfunctionID-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionID_Item_tags_1,
+	sizeof(asn_DEF_RANfunctionID_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_Item_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionID_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionID_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionID_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RANfunctionID_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionID.c b/e2ap/lib/RANfunctionID.c
new file mode 100644
index 0000000..d79a9d6
--- /dev/null
+++ b/e2ap/lib/RANfunctionID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionID.h"
+
+int
+RANfunctionID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 4095)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RANfunctionID_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..4095) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RANfunctionID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 12,  12,  0,  4095 }	/* (0..4095) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionID = {
+	"RANfunctionID",
+	"RANfunctionID",
+	&asn_OP_NativeInteger,
+	asn_DEF_RANfunctionID_tags_1,
+	sizeof(asn_DEF_RANfunctionID_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionID_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionID_constr_1, &asn_PER_type_RANfunctionID_constr_1, RANfunctionID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RANfunctionIDcause-Item.c b/e2ap/lib/RANfunctionIDcause-Item.c
new file mode 100644
index 0000000..b74eb64
--- /dev/null
+++ b/e2ap/lib/RANfunctionIDcause-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionIDcause-Item.h"
+
+asn_TYPE_member_t asn_MBR_RANfunctionIDcause_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_Item, ranFunctionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_Item, cause),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cause"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionIDcause_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionIDcause_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunctionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cause */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_Item_specs_1 = {
+	sizeof(struct RANfunctionIDcause_Item),
+	offsetof(struct RANfunctionIDcause_Item, _asn_ctx),
+	asn_MAP_RANfunctionIDcause_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionIDcause_Item = {
+	"RANfunctionIDcause-Item",
+	"RANfunctionIDcause-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionIDcause_Item_tags_1,
+	sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionIDcause_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionIDcause_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RANfunctionIDcause_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionRevision.c b/e2ap/lib/RANfunctionRevision.c
new file mode 100644
index 0000000..32cc4a5
--- /dev/null
+++ b/e2ap/lib/RANfunctionRevision.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionRevision.h"
+
+int
+RANfunctionRevision_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 4095)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RANfunctionRevision_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..4095) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RANfunctionRevision_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 12,  12,  0,  4095 }	/* (0..4095) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionRevision_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionRevision = {
+	"RANfunctionRevision",
+	"RANfunctionRevision",
+	&asn_OP_NativeInteger,
+	asn_DEF_RANfunctionRevision_tags_1,
+	sizeof(asn_DEF_RANfunctionRevision_tags_1)
+		/sizeof(asn_DEF_RANfunctionRevision_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionRevision_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionRevision_tags_1)
+		/sizeof(asn_DEF_RANfunctionRevision_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionRevision_constr_1, &asn_PER_type_RANfunctionRevision_constr_1, RANfunctionRevision_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RANfunctions-List.c b/e2ap/lib/RANfunctions-List.c
new file mode 100644
index 0000000..cf01054
--- /dev/null
+++ b/e2ap/lib/RANfunctions-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctions-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RANfunctions_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..256)) */};
+asn_per_constraints_t asn_PER_type_RANfunctions_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  0,  256 }	/* (SIZE(0..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANfunctions_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P3,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctions_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RANfunctions_List_specs_1 = {
+	sizeof(struct RANfunctions_List),
+	offsetof(struct RANfunctions_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctions_List = {
+	"RANfunctions-List",
+	"RANfunctions-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RANfunctions_List_tags_1,
+	sizeof(asn_DEF_RANfunctions_List_tags_1)
+		/sizeof(asn_DEF_RANfunctions_List_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctions_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctions_List_tags_1)
+		/sizeof(asn_DEF_RANfunctions_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctions_List_constr_1, &asn_PER_type_RANfunctions_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RANfunctions_List_1,
+	1,	/* Single element */
+	&asn_SPC_RANfunctions_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionsID-List.c b/e2ap/lib/RANfunctionsID-List.c
new file mode 100644
index 0000000..b888995
--- /dev/null
+++ b/e2ap/lib/RANfunctionsID-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionsID-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RANfunctionsID_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..256)) */};
+asn_per_constraints_t asn_PER_type_RANfunctionsID_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  0,  256 }	/* (SIZE(0..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANfunctionsID_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P4,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionsID_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RANfunctionsID_List_specs_1 = {
+	sizeof(struct RANfunctionsID_List),
+	offsetof(struct RANfunctionsID_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionsID_List = {
+	"RANfunctionsID-List",
+	"RANfunctionsID-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RANfunctionsID_List_tags_1,
+	sizeof(asn_DEF_RANfunctionsID_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsID_List_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionsID_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionsID_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsID_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionsID_List_constr_1, &asn_PER_type_RANfunctionsID_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RANfunctionsID_List_1,
+	1,	/* Single element */
+	&asn_SPC_RANfunctionsID_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionsIDcause-List.c b/e2ap/lib/RANfunctionsIDcause-List.c
new file mode 100644
index 0000000..e1ae0d2
--- /dev/null
+++ b/e2ap/lib/RANfunctionsIDcause-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionsIDcause-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RANfunctionsIDcause_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..256)) */};
+asn_per_constraints_t asn_PER_type_RANfunctionsIDcause_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  0,  256 }	/* (SIZE(0..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANfunctionsIDcause_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P5,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionsIDcause_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RANfunctionsIDcause_List_specs_1 = {
+	sizeof(struct RANfunctionsIDcause_List),
+	offsetof(struct RANfunctionsIDcause_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionsIDcause_List = {
+	"RANfunctionsIDcause-List",
+	"RANfunctionsIDcause-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RANfunctionsIDcause_List_tags_1,
+	sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionsIDcause_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionsIDcause_List_constr_1, &asn_PER_type_RANfunctionsIDcause_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RANfunctionsIDcause_List_1,
+	1,	/* Single element */
+	&asn_SPC_RANfunctionsIDcause_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-Admitted-Item.c b/e2ap/lib/RICaction-Admitted-Item.c
new file mode 100644
index 0000000..27e741d
--- /dev/null
+++ b/e2ap/lib/RICaction-Admitted-Item.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-Admitted-Item.h"
+
+asn_TYPE_member_t asn_MBR_RICaction_Admitted_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_Item, ricActionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_Admitted_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_Admitted_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* ricActionID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_Item_specs_1 = {
+	sizeof(struct RICaction_Admitted_Item),
+	offsetof(struct RICaction_Admitted_Item, _asn_ctx),
+	asn_MAP_RICaction_Admitted_Item_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_Item = {
+	"RICaction-Admitted-Item",
+	"RICaction-Admitted-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_Admitted_Item_tags_1,
+	sizeof(asn_DEF_RICaction_Admitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_Item_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_Admitted_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_Admitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_Admitted_Item_1,
+	1,	/* Elements count */
+	&asn_SPC_RICaction_Admitted_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-Admitted-List.c b/e2ap/lib/RICaction-Admitted-List.c
new file mode 100644
index 0000000..e9e8a5b
--- /dev/null
+++ b/e2ap/lib/RICaction-Admitted-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-Admitted-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RICaction_Admitted_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..16)) */};
+asn_per_constraints_t asn_PER_type_RICaction_Admitted_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  16 }	/* (SIZE(1..16)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICaction_Admitted_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_Admitted_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RICaction_Admitted_List_specs_1 = {
+	sizeof(struct RICaction_Admitted_List),
+	offsetof(struct RICaction_Admitted_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_List = {
+	"RICaction-Admitted-List",
+	"RICaction-Admitted-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RICaction_Admitted_List_tags_1,
+	sizeof(asn_DEF_RICaction_Admitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_List_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_Admitted_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_Admitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICaction_Admitted_List_constr_1, &asn_PER_type_RICaction_Admitted_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RICaction_Admitted_List_1,
+	1,	/* Single element */
+	&asn_SPC_RICaction_Admitted_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-NotAdmitted-Item.c b/e2ap/lib/RICaction-NotAdmitted-Item.c
new file mode 100644
index 0000000..86212ed
--- /dev/null
+++ b/e2ap/lib/RICaction-NotAdmitted-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-NotAdmitted-Item.h"
+
+asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_Item, ricActionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_Item, cause),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cause"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_NotAdmitted_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_NotAdmitted_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricActionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cause */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_Item_specs_1 = {
+	sizeof(struct RICaction_NotAdmitted_Item),
+	offsetof(struct RICaction_NotAdmitted_Item, _asn_ctx),
+	asn_MAP_RICaction_NotAdmitted_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_Item = {
+	"RICaction-NotAdmitted-Item",
+	"RICaction-NotAdmitted-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_NotAdmitted_Item_tags_1,
+	sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_NotAdmitted_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_NotAdmitted_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RICaction_NotAdmitted_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-NotAdmitted-List.c b/e2ap/lib/RICaction-NotAdmitted-List.c
new file mode 100644
index 0000000..7c7f6e2
--- /dev/null
+++ b/e2ap/lib/RICaction-NotAdmitted-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-NotAdmitted-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RICaction_NotAdmitted_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..16)) */};
+asn_per_constraints_t asn_PER_type_RICaction_NotAdmitted_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 5,  5,  0,  16 }	/* (SIZE(0..16)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P2,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_NotAdmitted_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RICaction_NotAdmitted_List_specs_1 = {
+	sizeof(struct RICaction_NotAdmitted_List),
+	offsetof(struct RICaction_NotAdmitted_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_List = {
+	"RICaction-NotAdmitted-List",
+	"RICaction-NotAdmitted-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RICaction_NotAdmitted_List_tags_1,
+	sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_NotAdmitted_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICaction_NotAdmitted_List_constr_1, &asn_PER_type_RICaction_NotAdmitted_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RICaction_NotAdmitted_List_1,
+	1,	/* Single element */
+	&asn_SPC_RICaction_NotAdmitted_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-ToBeSetup-Item.c b/e2ap/lib/RICaction-ToBeSetup-Item.c
new file mode 100644
index 0000000..1e78073
--- /dev/null
+++ b/e2ap/lib/RICaction-ToBeSetup-Item.c
@@ -0,0 +1,83 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-ToBeSetup-Item.h"
+
+#include "RICsubsequentAction.h"
+asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_Item, ricActionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_Item, ricActionType),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionType"
+		},
+	{ ATF_POINTER, 2, offsetof(struct RICaction_ToBeSetup_Item, ricActionDefinition),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionDefinition,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionDefinition"
+		},
+	{ ATF_POINTER, 1, offsetof(struct RICaction_ToBeSetup_Item, ricSubsequentAction),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICsubsequentAction,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricSubsequentAction"
+		},
+};
+static const int asn_MAP_RICaction_ToBeSetup_Item_oms_1[] = { 2, 3 };
+static const ber_tlv_tag_t asn_DEF_RICaction_ToBeSetup_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_ToBeSetup_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricActionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ricActionType */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ricActionDefinition */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* ricSubsequentAction */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_Item_specs_1 = {
+	sizeof(struct RICaction_ToBeSetup_Item),
+	offsetof(struct RICaction_ToBeSetup_Item, _asn_ctx),
+	asn_MAP_RICaction_ToBeSetup_Item_tag2el_1,
+	4,	/* Count of tags in the map */
+	asn_MAP_RICaction_ToBeSetup_Item_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	4,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_Item = {
+	"RICaction-ToBeSetup-Item",
+	"RICaction-ToBeSetup-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_ToBeSetup_Item_tags_1,
+	sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_ToBeSetup_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_ToBeSetup_Item_1,
+	4,	/* Elements count */
+	&asn_SPC_RICaction_ToBeSetup_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICactionDefinition.c b/e2ap/lib/RICactionDefinition.c
new file mode 100644
index 0000000..3f157ba
--- /dev/null
+++ b/e2ap/lib/RICactionDefinition.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactionDefinition.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICactionDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICactionDefinition = {
+	"RICactionDefinition",
+	"RICactionDefinition",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICactionDefinition_tags_1,
+	sizeof(asn_DEF_RICactionDefinition_tags_1)
+		/sizeof(asn_DEF_RICactionDefinition_tags_1[0]), /* 1 */
+	asn_DEF_RICactionDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactionDefinition_tags_1)
+		/sizeof(asn_DEF_RICactionDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICactionID.c b/e2ap/lib/RICactionID.c
new file mode 100644
index 0000000..73658f5
--- /dev/null
+++ b/e2ap/lib/RICactionID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactionID.h"
+
+int
+RICactionID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICactionID_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RICactionID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RICactionID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICactionID = {
+	"RICactionID",
+	"RICactionID",
+	&asn_OP_NativeInteger,
+	asn_DEF_RICactionID_tags_1,
+	sizeof(asn_DEF_RICactionID_tags_1)
+		/sizeof(asn_DEF_RICactionID_tags_1[0]), /* 1 */
+	asn_DEF_RICactionID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactionID_tags_1)
+		/sizeof(asn_DEF_RICactionID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICactionID_constr_1, &asn_PER_type_RICactionID_constr_1, RICactionID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RICactionType.c b/e2ap/lib/RICactionType.c
new file mode 100644
index 0000000..bfd33d5
--- /dev/null
+++ b/e2ap/lib/RICactionType.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactionType.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICactionType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICactionType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICactionType_value2enum_1[] = {
+	{ 0,	6,	"report" },
+	{ 1,	6,	"insert" },
+	{ 2,	6,	"policy" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICactionType_enum2value_1[] = {
+	1,	/* insert(1) */
+	2,	/* policy(2) */
+	0	/* report(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICactionType_specs_1 = {
+	asn_MAP_RICactionType_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICactionType_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICactionType_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICactionType = {
+	"RICactionType",
+	"RICactionType",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICactionType_tags_1,
+	sizeof(asn_DEF_RICactionType_tags_1)
+		/sizeof(asn_DEF_RICactionType_tags_1[0]), /* 1 */
+	asn_DEF_RICactionType_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactionType_tags_1)
+		/sizeof(asn_DEF_RICactionType_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICactionType_constr_1, &asn_PER_type_RICactionType_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICactionType_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICactions-ToBeSetup-List.c b/e2ap/lib/RICactions-ToBeSetup-List.c
new file mode 100644
index 0000000..93905c3
--- /dev/null
+++ b/e2ap/lib/RICactions-ToBeSetup-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactions-ToBeSetup-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RICactions_ToBeSetup_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..16)) */};
+asn_per_constraints_t asn_PER_type_RICactions_ToBeSetup_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  16 }	/* (SIZE(1..16)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICactions_ToBeSetup_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P0,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICactions_ToBeSetup_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RICactions_ToBeSetup_List_specs_1 = {
+	sizeof(struct RICactions_ToBeSetup_List),
+	offsetof(struct RICactions_ToBeSetup_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RICactions_ToBeSetup_List = {
+	"RICactions-ToBeSetup-List",
+	"RICactions-ToBeSetup-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RICactions_ToBeSetup_List_tags_1,
+	sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1)
+		/sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1[0]), /* 1 */
+	asn_DEF_RICactions_ToBeSetup_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1)
+		/sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICactions_ToBeSetup_List_constr_1, &asn_PER_type_RICactions_ToBeSetup_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RICactions_ToBeSetup_List_1,
+	1,	/* Single element */
+	&asn_SPC_RICactions_ToBeSetup_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcallProcessID.c b/e2ap/lib/RICcallProcessID.c
new file mode 100644
index 0000000..fd2d0eb
--- /dev/null
+++ b/e2ap/lib/RICcallProcessID.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcallProcessID.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcallProcessID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcallProcessID = {
+	"RICcallProcessID",
+	"RICcallProcessID",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcallProcessID_tags_1,
+	sizeof(asn_DEF_RICcallProcessID_tags_1)
+		/sizeof(asn_DEF_RICcallProcessID_tags_1[0]), /* 1 */
+	asn_DEF_RICcallProcessID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcallProcessID_tags_1)
+		/sizeof(asn_DEF_RICcallProcessID_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolAckRequest.c b/e2ap/lib/RICcontrolAckRequest.c
new file mode 100644
index 0000000..1db6bee
--- /dev/null
+++ b/e2ap/lib/RICcontrolAckRequest.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolAckRequest.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICcontrolAckRequest_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICcontrolAckRequest_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICcontrolAckRequest_value2enum_1[] = {
+	{ 0,	5,	"noAck" },
+	{ 1,	3,	"ack" },
+	{ 2,	4,	"nAck" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICcontrolAckRequest_enum2value_1[] = {
+	1,	/* ack(1) */
+	2,	/* nAck(2) */
+	0	/* noAck(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICcontrolAckRequest_specs_1 = {
+	asn_MAP_RICcontrolAckRequest_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICcontrolAckRequest_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolAckRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolAckRequest = {
+	"RICcontrolAckRequest",
+	"RICcontrolAckRequest",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICcontrolAckRequest_tags_1,
+	sizeof(asn_DEF_RICcontrolAckRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolAckRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolAckRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolAckRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolAckRequest_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICcontrolAckRequest_constr_1, &asn_PER_type_RICcontrolAckRequest_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICcontrolAckRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolAcknowledge.c b/e2ap/lib/RICcontrolAcknowledge.c
new file mode 100644
index 0000000..85011b6
--- /dev/null
+++ b/e2ap/lib/RICcontrolAcknowledge.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolAcknowledge.h"
+
+static asn_TYPE_member_t asn_MBR_RICcontrolAcknowledge_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P8,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolAcknowledge_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolAcknowledge_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICcontrolAcknowledge_specs_1 = {
+	sizeof(struct RICcontrolAcknowledge),
+	offsetof(struct RICcontrolAcknowledge, _asn_ctx),
+	asn_MAP_RICcontrolAcknowledge_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge = {
+	"RICcontrolAcknowledge",
+	"RICcontrolAcknowledge",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolAcknowledge_tags_1,
+	sizeof(asn_DEF_RICcontrolAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolAcknowledge_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolAcknowledge_1,
+	1,	/* Elements count */
+	&asn_SPC_RICcontrolAcknowledge_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolFailure.c b/e2ap/lib/RICcontrolFailure.c
new file mode 100644
index 0000000..a847f9f
--- /dev/null
+++ b/e2ap/lib/RICcontrolFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICcontrolFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P9,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICcontrolFailure_specs_1 = {
+	sizeof(struct RICcontrolFailure),
+	offsetof(struct RICcontrolFailure, _asn_ctx),
+	asn_MAP_RICcontrolFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure = {
+	"RICcontrolFailure",
+	"RICcontrolFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolFailure_tags_1,
+	sizeof(asn_DEF_RICcontrolFailure_tags_1)
+		/sizeof(asn_DEF_RICcontrolFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolFailure_tags_1)
+		/sizeof(asn_DEF_RICcontrolFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICcontrolFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolHeader.c b/e2ap/lib/RICcontrolHeader.c
new file mode 100644
index 0000000..3accabb
--- /dev/null
+++ b/e2ap/lib/RICcontrolHeader.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolHeader.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcontrolHeader_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolHeader = {
+	"RICcontrolHeader",
+	"RICcontrolHeader",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcontrolHeader_tags_1,
+	sizeof(asn_DEF_RICcontrolHeader_tags_1)
+		/sizeof(asn_DEF_RICcontrolHeader_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolHeader_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolHeader_tags_1)
+		/sizeof(asn_DEF_RICcontrolHeader_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolMessage.c b/e2ap/lib/RICcontrolMessage.c
new file mode 100644
index 0000000..d865706
--- /dev/null
+++ b/e2ap/lib/RICcontrolMessage.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolMessage.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcontrolMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolMessage = {
+	"RICcontrolMessage",
+	"RICcontrolMessage",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcontrolMessage_tags_1,
+	sizeof(asn_DEF_RICcontrolMessage_tags_1)
+		/sizeof(asn_DEF_RICcontrolMessage_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolMessage_tags_1)
+		/sizeof(asn_DEF_RICcontrolMessage_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolOutcome.c b/e2ap/lib/RICcontrolOutcome.c
new file mode 100644
index 0000000..806038d
--- /dev/null
+++ b/e2ap/lib/RICcontrolOutcome.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolOutcome.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcontrolOutcome_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolOutcome = {
+	"RICcontrolOutcome",
+	"RICcontrolOutcome",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcontrolOutcome_tags_1,
+	sizeof(asn_DEF_RICcontrolOutcome_tags_1)
+		/sizeof(asn_DEF_RICcontrolOutcome_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolOutcome_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolOutcome_tags_1)
+		/sizeof(asn_DEF_RICcontrolOutcome_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolRequest.c b/e2ap/lib/RICcontrolRequest.c
new file mode 100644
index 0000000..43a04e2
--- /dev/null
+++ b/e2ap/lib/RICcontrolRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolRequest.h"
+
+static asn_TYPE_member_t asn_MBR_RICcontrolRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P7,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICcontrolRequest_specs_1 = {
+	sizeof(struct RICcontrolRequest),
+	offsetof(struct RICcontrolRequest, _asn_ctx),
+	asn_MAP_RICcontrolRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest = {
+	"RICcontrolRequest",
+	"RICcontrolRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolRequest_tags_1,
+	sizeof(asn_DEF_RICcontrolRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_RICcontrolRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolStatus.c b/e2ap/lib/RICcontrolStatus.c
new file mode 100644
index 0000000..d2873fc
--- /dev/null
+++ b/e2ap/lib/RICcontrolStatus.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolStatus.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICcontrolStatus_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICcontrolStatus_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICcontrolStatus_value2enum_1[] = {
+	{ 0,	7,	"success" },
+	{ 1,	8,	"rejected" },
+	{ 2,	6,	"failed" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICcontrolStatus_enum2value_1[] = {
+	2,	/* failed(2) */
+	1,	/* rejected(1) */
+	0	/* success(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICcontrolStatus_specs_1 = {
+	asn_MAP_RICcontrolStatus_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICcontrolStatus_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolStatus_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolStatus = {
+	"RICcontrolStatus",
+	"RICcontrolStatus",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICcontrolStatus_tags_1,
+	sizeof(asn_DEF_RICcontrolStatus_tags_1)
+		/sizeof(asn_DEF_RICcontrolStatus_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolStatus_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolStatus_tags_1)
+		/sizeof(asn_DEF_RICcontrolStatus_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICcontrolStatus_constr_1, &asn_PER_type_RICcontrolStatus_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICcontrolStatus_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICeventTriggerDefinition.c b/e2ap/lib/RICeventTriggerDefinition.c
new file mode 100644
index 0000000..a13ddbd
--- /dev/null
+++ b/e2ap/lib/RICeventTriggerDefinition.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICeventTriggerDefinition.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICeventTriggerDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICeventTriggerDefinition = {
+	"RICeventTriggerDefinition",
+	"RICeventTriggerDefinition",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICeventTriggerDefinition_tags_1,
+	sizeof(asn_DEF_RICeventTriggerDefinition_tags_1)
+		/sizeof(asn_DEF_RICeventTriggerDefinition_tags_1[0]), /* 1 */
+	asn_DEF_RICeventTriggerDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICeventTriggerDefinition_tags_1)
+		/sizeof(asn_DEF_RICeventTriggerDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindication.c b/e2ap/lib/RICindication.c
new file mode 100644
index 0000000..5c40aa5
--- /dev/null
+++ b/e2ap/lib/RICindication.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindication.h"
+
+static asn_TYPE_member_t asn_MBR_RICindication_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P6,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICindication_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICindication_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICindication_specs_1 = {
+	sizeof(struct RICindication),
+	offsetof(struct RICindication, _asn_ctx),
+	asn_MAP_RICindication_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICindication = {
+	"RICindication",
+	"RICindication",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICindication_tags_1,
+	sizeof(asn_DEF_RICindication_tags_1)
+		/sizeof(asn_DEF_RICindication_tags_1[0]), /* 1 */
+	asn_DEF_RICindication_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindication_tags_1)
+		/sizeof(asn_DEF_RICindication_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICindication_1,
+	1,	/* Elements count */
+	&asn_SPC_RICindication_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindicationHeader.c b/e2ap/lib/RICindicationHeader.c
new file mode 100644
index 0000000..d252382
--- /dev/null
+++ b/e2ap/lib/RICindicationHeader.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationHeader.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICindicationHeader_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationHeader = {
+	"RICindicationHeader",
+	"RICindicationHeader",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICindicationHeader_tags_1,
+	sizeof(asn_DEF_RICindicationHeader_tags_1)
+		/sizeof(asn_DEF_RICindicationHeader_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationHeader_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationHeader_tags_1)
+		/sizeof(asn_DEF_RICindicationHeader_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindicationMessage.c b/e2ap/lib/RICindicationMessage.c
new file mode 100644
index 0000000..bd0ac0f
--- /dev/null
+++ b/e2ap/lib/RICindicationMessage.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationMessage.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICindicationMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationMessage = {
+	"RICindicationMessage",
+	"RICindicationMessage",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICindicationMessage_tags_1,
+	sizeof(asn_DEF_RICindicationMessage_tags_1)
+		/sizeof(asn_DEF_RICindicationMessage_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationMessage_tags_1)
+		/sizeof(asn_DEF_RICindicationMessage_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindicationSN.c b/e2ap/lib/RICindicationSN.c
new file mode 100644
index 0000000..efd2d48
--- /dev/null
+++ b/e2ap/lib/RICindicationSN.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationSN.h"
+
+int
+RICindicationSN_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICindicationSN_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RICindicationSN_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RICindicationSN_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationSN = {
+	"RICindicationSN",
+	"RICindicationSN",
+	&asn_OP_NativeInteger,
+	asn_DEF_RICindicationSN_tags_1,
+	sizeof(asn_DEF_RICindicationSN_tags_1)
+		/sizeof(asn_DEF_RICindicationSN_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationSN_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationSN_tags_1)
+		/sizeof(asn_DEF_RICindicationSN_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICindicationSN_constr_1, &asn_PER_type_RICindicationSN_constr_1, RICindicationSN_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RICindicationType.c b/e2ap/lib/RICindicationType.c
new file mode 100644
index 0000000..58935bb
--- /dev/null
+++ b/e2ap/lib/RICindicationType.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationType.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICindicationType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICindicationType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICindicationType_value2enum_1[] = {
+	{ 0,	6,	"report" },
+	{ 1,	6,	"insert" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICindicationType_enum2value_1[] = {
+	1,	/* insert(1) */
+	0	/* report(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICindicationType_specs_1 = {
+	asn_MAP_RICindicationType_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICindicationType_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICindicationType_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationType = {
+	"RICindicationType",
+	"RICindicationType",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICindicationType_tags_1,
+	sizeof(asn_DEF_RICindicationType_tags_1)
+		/sizeof(asn_DEF_RICindicationType_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationType_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationType_tags_1)
+		/sizeof(asn_DEF_RICindicationType_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICindicationType_constr_1, &asn_PER_type_RICindicationType_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICindicationType_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICrequestID.c b/e2ap/lib/RICrequestID.c
new file mode 100644
index 0000000..1422a31
--- /dev/null
+++ b/e2ap/lib/RICrequestID.c
@@ -0,0 +1,126 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICrequestID.h"
+
+static int
+memb_ricRequestorID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_ricInstanceID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_ricRequestorID_constr_2 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_ricRequestorID_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ricInstanceID_constr_3 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_ricInstanceID_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICrequestID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICrequestID, ricRequestorID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_ricRequestorID_constr_2, &asn_PER_memb_ricRequestorID_constr_2,  memb_ricRequestorID_constraint_1 },
+		0, 0, /* No default value */
+		"ricRequestorID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICrequestID, ricInstanceID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_ricInstanceID_constr_3, &asn_PER_memb_ricInstanceID_constr_3,  memb_ricInstanceID_constraint_1 },
+		0, 0, /* No default value */
+		"ricInstanceID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICrequestID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICrequestID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequestorID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ricInstanceID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICrequestID_specs_1 = {
+	sizeof(struct RICrequestID),
+	offsetof(struct RICrequestID, _asn_ctx),
+	asn_MAP_RICrequestID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICrequestID = {
+	"RICrequestID",
+	"RICrequestID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICrequestID_tags_1,
+	sizeof(asn_DEF_RICrequestID_tags_1)
+		/sizeof(asn_DEF_RICrequestID_tags_1[0]), /* 1 */
+	asn_DEF_RICrequestID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICrequestID_tags_1)
+		/sizeof(asn_DEF_RICrequestID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICrequestID_1,
+	2,	/* Elements count */
+	&asn_SPC_RICrequestID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceQuery.c b/e2ap/lib/RICserviceQuery.c
new file mode 100644
index 0000000..a7d452e
--- /dev/null
+++ b/e2ap/lib/RICserviceQuery.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceQuery.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceQuery_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P19,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceQuery_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceQuery_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceQuery_specs_1 = {
+	sizeof(struct RICserviceQuery),
+	offsetof(struct RICserviceQuery, _asn_ctx),
+	asn_MAP_RICserviceQuery_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceQuery = {
+	"RICserviceQuery",
+	"RICserviceQuery",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceQuery_tags_1,
+	sizeof(asn_DEF_RICserviceQuery_tags_1)
+		/sizeof(asn_DEF_RICserviceQuery_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceQuery_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceQuery_tags_1)
+		/sizeof(asn_DEF_RICserviceQuery_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceQuery_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceQuery_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceUpdate.c b/e2ap/lib/RICserviceUpdate.c
new file mode 100644
index 0000000..a562e2f
--- /dev/null
+++ b/e2ap/lib/RICserviceUpdate.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceUpdate.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceUpdate_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P16,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdate_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdate_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdate_specs_1 = {
+	sizeof(struct RICserviceUpdate),
+	offsetof(struct RICserviceUpdate, _asn_ctx),
+	asn_MAP_RICserviceUpdate_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate = {
+	"RICserviceUpdate",
+	"RICserviceUpdate",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdate_tags_1,
+	sizeof(asn_DEF_RICserviceUpdate_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdate_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceUpdate_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdate_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdate_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdate_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceUpdate_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceUpdateAcknowledge.c b/e2ap/lib/RICserviceUpdateAcknowledge.c
new file mode 100644
index 0000000..845acb2
--- /dev/null
+++ b/e2ap/lib/RICserviceUpdateAcknowledge.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceUpdateAcknowledge.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceUpdateAcknowledge_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P17,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateAcknowledge_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateAcknowledge_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateAcknowledge_specs_1 = {
+	sizeof(struct RICserviceUpdateAcknowledge),
+	offsetof(struct RICserviceUpdateAcknowledge, _asn_ctx),
+	asn_MAP_RICserviceUpdateAcknowledge_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge = {
+	"RICserviceUpdateAcknowledge",
+	"RICserviceUpdateAcknowledge",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateAcknowledge_tags_1,
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceUpdateAcknowledge_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateAcknowledge_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceUpdateAcknowledge_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceUpdateFailure.c b/e2ap/lib/RICserviceUpdateFailure.c
new file mode 100644
index 0000000..f54da69
--- /dev/null
+++ b/e2ap/lib/RICserviceUpdateFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceUpdateFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceUpdateFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P18,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateFailure_specs_1 = {
+	sizeof(struct RICserviceUpdateFailure),
+	offsetof(struct RICserviceUpdateFailure, _asn_ctx),
+	asn_MAP_RICserviceUpdateFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure = {
+	"RICserviceUpdateFailure",
+	"RICserviceUpdateFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateFailure_tags_1,
+	sizeof(asn_DEF_RICserviceUpdateFailure_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceUpdateFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateFailure_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceUpdateFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDeleteFailure.c b/e2ap/lib/RICsubscriptionDeleteFailure.c
new file mode 100644
index 0000000..88a9836
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDeleteFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDeleteFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P5,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteFailure_specs_1 = {
+	sizeof(struct RICsubscriptionDeleteFailure),
+	offsetof(struct RICsubscriptionDeleteFailure, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure = {
+	"RICsubscriptionDeleteFailure",
+	"RICsubscriptionDeleteFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteFailure_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDeleteRequest.c b/e2ap/lib/RICsubscriptionDeleteRequest.c
new file mode 100644
index 0000000..627f516
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDeleteRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDeleteRequest.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P3,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteRequest_specs_1 = {
+	sizeof(struct RICsubscriptionDeleteRequest),
+	offsetof(struct RICsubscriptionDeleteRequest, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest = {
+	"RICsubscriptionDeleteRequest",
+	"RICsubscriptionDeleteRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteRequest_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDeleteResponse.c b/e2ap/lib/RICsubscriptionDeleteResponse.c
new file mode 100644
index 0000000..fc0f72d
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDeleteResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDeleteResponse.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P4,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteResponse_specs_1 = {
+	sizeof(struct RICsubscriptionDeleteResponse),
+	offsetof(struct RICsubscriptionDeleteResponse, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse = {
+	"RICsubscriptionDeleteResponse",
+	"RICsubscriptionDeleteResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteResponse_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDetails.c b/e2ap/lib/RICsubscriptionDetails.c
new file mode 100644
index 0000000..9033dc2
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDetails.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDetails.h"
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDetails_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDetails, ricEventTriggerDefinition),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICeventTriggerDefinition,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricEventTriggerDefinition"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDetails, ricAction_ToBeSetup_List),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactions_ToBeSetup_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricAction-ToBeSetup-List"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDetails_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDetails_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricEventTriggerDefinition */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ricAction-ToBeSetup-List */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDetails_specs_1 = {
+	sizeof(struct RICsubscriptionDetails),
+	offsetof(struct RICsubscriptionDetails, _asn_ctx),
+	asn_MAP_RICsubscriptionDetails_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDetails = {
+	"RICsubscriptionDetails",
+	"RICsubscriptionDetails",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDetails_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDetails_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDetails_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDetails_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDetails_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDetails_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDetails_1,
+	2,	/* Elements count */
+	&asn_SPC_RICsubscriptionDetails_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionFailure.c b/e2ap/lib/RICsubscriptionFailure.c
new file mode 100644
index 0000000..f765319
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P2,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionFailure_specs_1 = {
+	sizeof(struct RICsubscriptionFailure),
+	offsetof(struct RICsubscriptionFailure, _asn_ctx),
+	asn_MAP_RICsubscriptionFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure = {
+	"RICsubscriptionFailure",
+	"RICsubscriptionFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionFailure_tags_1,
+	sizeof(asn_DEF_RICsubscriptionFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionRequest.c b/e2ap/lib/RICsubscriptionRequest.c
new file mode 100644
index 0000000..46c4fe8
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionRequest.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P0,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionRequest_specs_1 = {
+	sizeof(struct RICsubscriptionRequest),
+	offsetof(struct RICsubscriptionRequest, _asn_ctx),
+	asn_MAP_RICsubscriptionRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest = {
+	"RICsubscriptionRequest",
+	"RICsubscriptionRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionRequest_tags_1,
+	sizeof(asn_DEF_RICsubscriptionRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionResponse.c b/e2ap/lib/RICsubscriptionResponse.c
new file mode 100644
index 0000000..56c92ae
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionResponse.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionResponse_specs_1 = {
+	sizeof(struct RICsubscriptionResponse),
+	offsetof(struct RICsubscriptionResponse, _asn_ctx),
+	asn_MAP_RICsubscriptionResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse = {
+	"RICsubscriptionResponse",
+	"RICsubscriptionResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionResponse_tags_1,
+	sizeof(asn_DEF_RICsubscriptionResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionResponse_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubsequentAction.c b/e2ap/lib/RICsubsequentAction.c
new file mode 100644
index 0000000..8b3248c
--- /dev/null
+++ b/e2ap/lib/RICsubsequentAction.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubsequentAction.h"
+
+asn_TYPE_member_t asn_MBR_RICsubsequentAction_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubsequentAction, ricSubsequentActionType),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICsubsequentActionType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricSubsequentActionType"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubsequentAction, ricTimeToWait),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICtimeToWait,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricTimeToWait"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubsequentAction_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubsequentAction_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricSubsequentActionType */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ricTimeToWait */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubsequentAction_specs_1 = {
+	sizeof(struct RICsubsequentAction),
+	offsetof(struct RICsubsequentAction, _asn_ctx),
+	asn_MAP_RICsubsequentAction_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubsequentAction = {
+	"RICsubsequentAction",
+	"RICsubsequentAction",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubsequentAction_tags_1,
+	sizeof(asn_DEF_RICsubsequentAction_tags_1)
+		/sizeof(asn_DEF_RICsubsequentAction_tags_1[0]), /* 1 */
+	asn_DEF_RICsubsequentAction_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubsequentAction_tags_1)
+		/sizeof(asn_DEF_RICsubsequentAction_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubsequentAction_1,
+	2,	/* Elements count */
+	&asn_SPC_RICsubsequentAction_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubsequentActionType.c b/e2ap/lib/RICsubsequentActionType.c
new file mode 100644
index 0000000..f88a331
--- /dev/null
+++ b/e2ap/lib/RICsubsequentActionType.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubsequentActionType.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICsubsequentActionType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICsubsequentActionType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICsubsequentActionType_value2enum_1[] = {
+	{ 0,	8,	"continue" },
+	{ 1,	4,	"wait" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICsubsequentActionType_enum2value_1[] = {
+	0,	/* continue(0) */
+	1	/* wait(1) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICsubsequentActionType_specs_1 = {
+	asn_MAP_RICsubsequentActionType_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICsubsequentActionType_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICsubsequentActionType_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubsequentActionType = {
+	"RICsubsequentActionType",
+	"RICsubsequentActionType",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICsubsequentActionType_tags_1,
+	sizeof(asn_DEF_RICsubsequentActionType_tags_1)
+		/sizeof(asn_DEF_RICsubsequentActionType_tags_1[0]), /* 1 */
+	asn_DEF_RICsubsequentActionType_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubsequentActionType_tags_1)
+		/sizeof(asn_DEF_RICsubsequentActionType_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICsubsequentActionType_constr_1, &asn_PER_type_RICsubsequentActionType_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICsubsequentActionType_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICtimeToWait.c b/e2ap/lib/RICtimeToWait.c
new file mode 100644
index 0000000..94fc184
--- /dev/null
+++ b/e2ap/lib/RICtimeToWait.c
@@ -0,0 +1,90 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICtimeToWait.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICtimeToWait_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICtimeToWait_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  5,  5,  0,  17 }	/* (0..17,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICtimeToWait_value2enum_1[] = {
+	{ 0,	4,	"zero" },
+	{ 1,	4,	"w1ms" },
+	{ 2,	4,	"w2ms" },
+	{ 3,	4,	"w5ms" },
+	{ 4,	5,	"w10ms" },
+	{ 5,	5,	"w20ms" },
+	{ 6,	5,	"w30ms" },
+	{ 7,	5,	"w40ms" },
+	{ 8,	5,	"w50ms" },
+	{ 9,	6,	"w100ms" },
+	{ 10,	6,	"w200ms" },
+	{ 11,	6,	"w500ms" },
+	{ 12,	3,	"w1s" },
+	{ 13,	3,	"w2s" },
+	{ 14,	3,	"w5s" },
+	{ 15,	4,	"w10s" },
+	{ 16,	4,	"w20s" },
+	{ 17,	4,	"w60s" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICtimeToWait_enum2value_1[] = {
+	9,	/* w100ms(9) */
+	4,	/* w10ms(4) */
+	15,	/* w10s(15) */
+	1,	/* w1ms(1) */
+	12,	/* w1s(12) */
+	10,	/* w200ms(10) */
+	5,	/* w20ms(5) */
+	16,	/* w20s(16) */
+	2,	/* w2ms(2) */
+	13,	/* w2s(13) */
+	6,	/* w30ms(6) */
+	7,	/* w40ms(7) */
+	11,	/* w500ms(11) */
+	8,	/* w50ms(8) */
+	3,	/* w5ms(3) */
+	14,	/* w5s(14) */
+	17,	/* w60s(17) */
+	0	/* zero(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICtimeToWait_specs_1 = {
+	asn_MAP_RICtimeToWait_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICtimeToWait_enum2value_1,	/* N => "tag"; sorted by N */
+	18,	/* Number of elements in the maps */
+	19,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICtimeToWait_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICtimeToWait = {
+	"RICtimeToWait",
+	"RICtimeToWait",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICtimeToWait_tags_1,
+	sizeof(asn_DEF_RICtimeToWait_tags_1)
+		/sizeof(asn_DEF_RICtimeToWait_tags_1[0]), /* 1 */
+	asn_DEF_RICtimeToWait_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICtimeToWait_tags_1)
+		/sizeof(asn_DEF_RICtimeToWait_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICtimeToWait_constr_1, &asn_PER_type_RICtimeToWait_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICtimeToWait_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ResetRequest.c b/e2ap/lib/ResetRequest.c
new file mode 100644
index 0000000..f40779f
--- /dev/null
+++ b/e2ap/lib/ResetRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ResetRequest.h"
+
+static asn_TYPE_member_t asn_MBR_ResetRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P14,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ResetRequest_specs_1 = {
+	sizeof(struct ResetRequest),
+	offsetof(struct ResetRequest, _asn_ctx),
+	asn_MAP_ResetRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetRequest = {
+	"ResetRequest",
+	"ResetRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetRequest_tags_1,
+	sizeof(asn_DEF_ResetRequest_tags_1)
+		/sizeof(asn_DEF_ResetRequest_tags_1[0]), /* 1 */
+	asn_DEF_ResetRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResetRequest_tags_1)
+		/sizeof(asn_DEF_ResetRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_ResetRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ResetResponse.c b/e2ap/lib/ResetResponse.c
new file mode 100644
index 0000000..47c433a
--- /dev/null
+++ b/e2ap/lib/ResetResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ResetResponse.h"
+
+static asn_TYPE_member_t asn_MBR_ResetResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P15,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ResetResponse_specs_1 = {
+	sizeof(struct ResetResponse),
+	offsetof(struct ResetResponse, _asn_ctx),
+	asn_MAP_ResetResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetResponse = {
+	"ResetResponse",
+	"ResetResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetResponse_tags_1,
+	sizeof(asn_DEF_ResetResponse_tags_1)
+		/sizeof(asn_DEF_ResetResponse_tags_1[0]), /* 1 */
+	asn_DEF_ResetResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResetResponse_tags_1)
+		/sizeof(asn_DEF_ResetResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_ResetResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/SuccessfulOutcome.c b/e2ap/lib/SuccessfulOutcome.c
new file mode 100644
index 0000000..7328b32
--- /dev/null
+++ b/e2ap/lib/SuccessfulOutcome.c
@@ -0,0 +1,368 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "SuccessfulOutcome.h"
+
+static const long asn_VAL_1_id_RICsubscription = 8;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_3_id_RICserviceUpdate = 7;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_4_id_RICcontrol = 4;
+static const long asn_VAL_4_reject = 0;
+static const long asn_VAL_5_id_E2setup = 1;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_6_id_Reset = 3;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_7_id_RICindication = 5;
+static const long asn_VAL_7_ignore = 1;
+static const long asn_VAL_8_id_RICserviceQuery = 6;
+static const long asn_VAL_8_ignore = 1;
+static const long asn_VAL_9_id_ErrorIndication = 2;
+static const long asn_VAL_9_ignore = 1;
+static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_RICsubscription },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_2_id_RICsubscriptionDelete },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceUpdate },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_3_id_RICserviceUpdate },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICcontrolRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_4_id_RICcontrol },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_E2setupRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_E2setupResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2setupFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_5_id_E2setup },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ResetRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_ResetResponse },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_6_id_Reset },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICindication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_7_id_RICindication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceQuery },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_8_id_RICserviceQuery },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ErrorIndication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_9_id_ErrorIndication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore }
+};
+static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
+	{ 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
+};
+static int
+memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_SuccessfulOutcome_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 4; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_SuccessfulOutcome_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 1; /* &SuccessfulOutcome */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICsubscriptionResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionResponse"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICsubscriptionDeleteResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDeleteResponse"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICserviceUpdateAcknowledge),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateAcknowledge,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceUpdateAcknowledge"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICcontrolAcknowledge),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolAcknowledge,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolAcknowledge"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.E2setupResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"E2setupResponse"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.ResetResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ResetResponse"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 5 }, /* RICsubscriptionResponse */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 4 }, /* RICsubscriptionDeleteResponse */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 3 }, /* RICserviceUpdateAcknowledge */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 2 }, /* RICcontrolAcknowledge */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 1 }, /* E2setupResponse */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 5, -5, 0 } /* ResetResponse */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct SuccessfulOutcome__value),
+	offsetof(struct SuccessfulOutcome__value, _asn_ctx),
+	offsetof(struct SuccessfulOutcome__value, present),
+	sizeof(((struct SuccessfulOutcome__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	6,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	6,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SuccessfulOutcome_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ &asn_OER_memb_procedureCode_constr_2, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, criticality),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		select_SuccessfulOutcome_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, value),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_value_4,
+		select_SuccessfulOutcome_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_SuccessfulOutcome_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SuccessfulOutcome_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SuccessfulOutcome_specs_1 = {
+	sizeof(struct SuccessfulOutcome),
+	offsetof(struct SuccessfulOutcome, _asn_ctx),
+	asn_MAP_SuccessfulOutcome_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_SuccessfulOutcome = {
+	"SuccessfulOutcome",
+	"SuccessfulOutcome",
+	&asn_OP_SEQUENCE,
+	asn_DEF_SuccessfulOutcome_tags_1,
+	sizeof(asn_DEF_SuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_SuccessfulOutcome_tags_1[0]), /* 1 */
+	asn_DEF_SuccessfulOutcome_tags_1,	/* Same as above */
+	sizeof(asn_DEF_SuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_SuccessfulOutcome_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_SuccessfulOutcome_1,
+	3,	/* Elements count */
+	&asn_SPC_SuccessfulOutcome_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/TimeToWait.c b/e2ap/lib/TimeToWait.c
new file mode 100644
index 0000000..a969d55
--- /dev/null
+++ b/e2ap/lib/TimeToWait.c
@@ -0,0 +1,66 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "TimeToWait.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_TimeToWait_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_TimeToWait_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  5 }	/* (0..5,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_TimeToWait_value2enum_1[] = {
+	{ 0,	3,	"v1s" },
+	{ 1,	3,	"v2s" },
+	{ 2,	3,	"v5s" },
+	{ 3,	4,	"v10s" },
+	{ 4,	4,	"v20s" },
+	{ 5,	4,	"v60s" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_TimeToWait_enum2value_1[] = {
+	3,	/* v10s(3) */
+	0,	/* v1s(0) */
+	4,	/* v20s(4) */
+	1,	/* v2s(1) */
+	2,	/* v5s(2) */
+	5	/* v60s(5) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_TimeToWait_specs_1 = {
+	asn_MAP_TimeToWait_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_TimeToWait_enum2value_1,	/* N => "tag"; sorted by N */
+	6,	/* Number of elements in the maps */
+	7,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_TimeToWait_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TimeToWait = {
+	"TimeToWait",
+	"TimeToWait",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_TimeToWait_tags_1,
+	sizeof(asn_DEF_TimeToWait_tags_1)
+		/sizeof(asn_DEF_TimeToWait_tags_1[0]), /* 1 */
+	asn_DEF_TimeToWait_tags_1,	/* Same as above */
+	sizeof(asn_DEF_TimeToWait_tags_1)
+		/sizeof(asn_DEF_TimeToWait_tags_1[0]), /* 1 */
+	{ &asn_OER_type_TimeToWait_constr_1, &asn_PER_type_TimeToWait_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_TimeToWait_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/TriggeringMessage.c b/e2ap/lib/TriggeringMessage.c
new file mode 100644
index 0000000..7d1dbe8
--- /dev/null
+++ b/e2ap/lib/TriggeringMessage.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "TriggeringMessage.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_TriggeringMessage_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_TriggeringMessage_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_TriggeringMessage_value2enum_1[] = {
+	{ 0,	18,	"initiating-message" },
+	{ 1,	18,	"successful-outcome" },
+	{ 2,	21,	"unsuccessfull-outcome" }
+};
+static const unsigned int asn_MAP_TriggeringMessage_enum2value_1[] = {
+	0,	/* initiating-message(0) */
+	1,	/* successful-outcome(1) */
+	2	/* unsuccessfull-outcome(2) */
+};
+const asn_INTEGER_specifics_t asn_SPC_TriggeringMessage_specs_1 = {
+	asn_MAP_TriggeringMessage_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_TriggeringMessage_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	0,	/* Enumeration is not extensible */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_TriggeringMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TriggeringMessage = {
+	"TriggeringMessage",
+	"TriggeringMessage",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_TriggeringMessage_tags_1,
+	sizeof(asn_DEF_TriggeringMessage_tags_1)
+		/sizeof(asn_DEF_TriggeringMessage_tags_1[0]), /* 1 */
+	asn_DEF_TriggeringMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_TriggeringMessage_tags_1)
+		/sizeof(asn_DEF_TriggeringMessage_tags_1[0]), /* 1 */
+	{ &asn_OER_type_TriggeringMessage_constr_1, &asn_PER_type_TriggeringMessage_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_TriggeringMessage_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/TypeOfError.c b/e2ap/lib/TypeOfError.c
new file mode 100644
index 0000000..e37ab6b
--- /dev/null
+++ b/e2ap/lib/TypeOfError.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "TypeOfError.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_TypeOfError_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_TypeOfError_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_TypeOfError_value2enum_1[] = {
+	{ 0,	14,	"not-understood" },
+	{ 1,	7,	"missing" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_TypeOfError_enum2value_1[] = {
+	1,	/* missing(1) */
+	0	/* not-understood(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_TypeOfError_specs_1 = {
+	asn_MAP_TypeOfError_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_TypeOfError_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_TypeOfError_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TypeOfError = {
+	"TypeOfError",
+	"TypeOfError",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_TypeOfError_tags_1,
+	sizeof(asn_DEF_TypeOfError_tags_1)
+		/sizeof(asn_DEF_TypeOfError_tags_1[0]), /* 1 */
+	asn_DEF_TypeOfError_tags_1,	/* Same as above */
+	sizeof(asn_DEF_TypeOfError_tags_1)
+		/sizeof(asn_DEF_TypeOfError_tags_1[0]), /* 1 */
+	{ &asn_OER_type_TypeOfError_constr_1, &asn_PER_type_TypeOfError_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_TypeOfError_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/UnsuccessfulOutcome.c b/e2ap/lib/UnsuccessfulOutcome.c
new file mode 100644
index 0000000..5c85aa8
--- /dev/null
+++ b/e2ap/lib/UnsuccessfulOutcome.c
@@ -0,0 +1,358 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "UnsuccessfulOutcome.h"
+
+static const long asn_VAL_1_id_RICsubscription = 8;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_3_id_RICserviceUpdate = 7;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_4_id_RICcontrol = 4;
+static const long asn_VAL_4_reject = 0;
+static const long asn_VAL_5_id_E2setup = 1;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_6_id_Reset = 3;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_7_id_RICindication = 5;
+static const long asn_VAL_7_ignore = 1;
+static const long asn_VAL_8_id_RICserviceQuery = 6;
+static const long asn_VAL_8_ignore = 1;
+static const long asn_VAL_9_id_ErrorIndication = 2;
+static const long asn_VAL_9_ignore = 1;
+static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_RICsubscription },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_2_id_RICsubscriptionDelete },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceUpdate },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_3_id_RICserviceUpdate },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICcontrolRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_4_id_RICcontrol },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_E2setupRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_E2setupResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2setupFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_5_id_E2setup },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ResetRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_ResetResponse },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_6_id_Reset },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICindication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_7_id_RICindication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceQuery },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_8_id_RICserviceQuery },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ErrorIndication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_9_id_ErrorIndication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore }
+};
+static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
+	{ 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
+};
+static int
+memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_UnsuccessfulOutcome_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 4; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct UnsuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_UnsuccessfulOutcome_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 2; /* &UnsuccessfulOutcome */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct UnsuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICsubscriptionFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICsubscriptionDeleteFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDeleteFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICserviceUpdateFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceUpdateFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICcontrolFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.E2setupFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"E2setupFailure"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 4 }, /* RICsubscriptionFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 3 }, /* RICsubscriptionDeleteFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 2 }, /* RICserviceUpdateFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 1 }, /* RICcontrolFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 0 } /* E2setupFailure */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct UnsuccessfulOutcome__value),
+	offsetof(struct UnsuccessfulOutcome__value, _asn_ctx),
+	offsetof(struct UnsuccessfulOutcome__value, present),
+	sizeof(((struct UnsuccessfulOutcome__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	5,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	5,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_UnsuccessfulOutcome_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ &asn_OER_memb_procedureCode_constr_2, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome, criticality),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		select_UnsuccessfulOutcome_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome, value),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_value_4,
+		select_UnsuccessfulOutcome_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_UnsuccessfulOutcome_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_UnsuccessfulOutcome_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
+};
+asn_SEQUENCE_specifics_t asn_SPC_UnsuccessfulOutcome_specs_1 = {
+	sizeof(struct UnsuccessfulOutcome),
+	offsetof(struct UnsuccessfulOutcome, _asn_ctx),
+	asn_MAP_UnsuccessfulOutcome_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_UnsuccessfulOutcome = {
+	"UnsuccessfulOutcome",
+	"UnsuccessfulOutcome",
+	&asn_OP_SEQUENCE,
+	asn_DEF_UnsuccessfulOutcome_tags_1,
+	sizeof(asn_DEF_UnsuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_UnsuccessfulOutcome_tags_1[0]), /* 1 */
+	asn_DEF_UnsuccessfulOutcome_tags_1,	/* Same as above */
+	sizeof(asn_DEF_UnsuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_UnsuccessfulOutcome_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_UnsuccessfulOutcome_1,
+	3,	/* Elements count */
+	&asn_SPC_UnsuccessfulOutcome_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/asn_SEQUENCE_OF.c b/e2ap/lib/asn_SEQUENCE_OF.c
new file mode 100644
index 0000000..ec952fc
--- /dev/null
+++ b/e2ap/lib/asn_SEQUENCE_OF.c
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_SEQUENCE_OF.h>
+
+typedef A_SEQUENCE_OF(void) asn_sequence;
+
+void
+asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) {
+	asn_sequence *as = (asn_sequence *)asn_sequence_of_x;
+
+	if(as) {
+		void *ptr;
+		int n;
+
+		if(number < 0 || number >= as->count)
+			return;	/* Nothing to delete */
+
+		if(_do_free && as->free) {
+			ptr = as->array[number];
+		} else {
+			ptr = 0;
+		}
+
+		/*
+		 * Shift all elements to the left to hide the gap.
+		 */
+		--as->count;
+		for(n = number; n < as->count; n++)
+			as->array[n] = as->array[n+1];
+
+		/*
+		 * Invoke the third-party function only when the state
+		 * of the parent structure is consistent.
+		 */
+		if(ptr) as->free(ptr);
+	}
+}
+
diff --git a/e2ap/lib/asn_SET_OF.c b/e2ap/lib/asn_SET_OF.c
new file mode 100644
index 0000000..944f2cb
--- /dev/null
+++ b/e2ap/lib/asn_SET_OF.c
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_SET_OF.h>
+#include <errno.h>
+
+/*
+ * Add another element into the set.
+ */
+int
+asn_set_add(void *asn_set_of_x, void *ptr) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as == 0 || ptr == 0) {
+		errno = EINVAL;		/* Invalid arguments */
+		return -1;
+	}
+
+	/*
+	 * Make sure there's enough space to insert an element.
+	 */
+	if(as->count == as->size) {
+		int _newsize = as->size ? (as->size << 1) : 4;
+		void *_new_arr;
+		_new_arr = REALLOC(as->array, _newsize * sizeof(as->array[0]));
+		if(_new_arr) {
+			as->array = (void **)_new_arr;
+			as->size = _newsize;
+		} else {
+			/* ENOMEM */
+			return -1;
+		}
+	}
+
+	as->array[as->count++] = ptr;
+
+	return 0;
+}
+
+void
+asn_set_del(void *asn_set_of_x, int number, int _do_free) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as) {
+		void *ptr;
+		if(number < 0 || number >= as->count)
+			return;
+
+		if(_do_free && as->free) {
+			ptr = as->array[number];
+		} else {
+			ptr = 0;
+		}
+
+		as->array[number] = as->array[--as->count];
+
+		/*
+		 * Invoke the third-party function only when the state
+		 * of the parent structure is consistent.
+		 */
+		if(ptr) as->free(ptr);
+	}
+}
+
+/*
+ * Free the contents of the set, do not free the set itself.
+ */
+void
+asn_set_empty(void *asn_set_of_x) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as) {
+		if(as->array) {
+			if(as->free) {
+				while(as->count--)
+					as->free(as->array[as->count]);
+			}
+			FREEMEM(as->array);
+			as->array = 0;
+		}
+		as->count = 0;
+		as->size = 0;
+	}
+
+}
+
diff --git a/e2ap/lib/asn_application.c b/e2ap/lib/asn_application.c
new file mode 100644
index 0000000..2bff460
--- /dev/null
+++ b/e2ap/lib/asn_application.c
@@ -0,0 +1,481 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_application.h>
+#include <errno.h>
+
+static asn_enc_rval_t asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
+                                          enum asn_transfer_syntax syntax,
+                                          const asn_TYPE_descriptor_t *td,
+                                          const void *sptr,
+                                          asn_app_consume_bytes_f *callback,
+                                          void *callback_key);
+
+
+struct callback_count_bytes_key {
+    asn_app_consume_bytes_f *callback;
+    void *callback_key;
+    size_t computed_size;
+};
+
+/*
+ * Encoder which just counts bytes that come through it.
+ */
+static int
+callback_count_bytes_cb(const void *data, size_t size, void *keyp) {
+    struct callback_count_bytes_key *key = keyp;
+    int ret;
+
+    ret = key->callback(data, size, key->callback_key);
+    if(ret >= 0) {
+        key->computed_size += size;
+    }
+
+    return ret;
+}
+
+struct overrun_encoder_key {
+    void *buffer;
+    size_t buffer_size;
+    size_t computed_size;
+};
+
+struct dynamic_encoder_key {
+    void *buffer;
+    size_t buffer_size;
+    size_t computed_size;
+};
+
+struct callback_failure_catch_key {
+    asn_app_consume_bytes_f *callback;
+    void *callback_key;
+    int callback_failed;
+};
+
+/*
+ * Encoder which doesn't stop counting bytes
+ * even if it reaches the end of the buffer.
+ */
+static int
+overrun_encoder_cb(const void *data, size_t size, void *keyp) {
+    struct overrun_encoder_key *key = keyp;
+
+    if(key->computed_size + size > key->buffer_size) {
+        /*
+         * Avoid accident on the next call:
+         * stop adding bytes to the buffer.
+         */
+        key->buffer_size = 0;
+    } else {
+        memcpy((char *)key->buffer + key->computed_size, data, size);
+    }
+    key->computed_size += size;
+
+    return 0;
+}
+
+/*
+ * Encoder which dynamically allocates output, and continues
+ * to count even if allocation failed.
+ */
+static int
+dynamic_encoder_cb(const void *data, size_t size, void *keyp) {
+    struct dynamic_encoder_key *key = keyp;
+
+    if(key->buffer) {
+        if(key->computed_size + size >= key->buffer_size) {
+            void *p;
+            size_t new_size = key->buffer_size;
+
+            do {
+                new_size *= 2;
+            } while(new_size <= key->computed_size + size);
+
+            p = REALLOC(key->buffer, new_size);
+            if(p) {
+                key->buffer = p;
+                key->buffer_size = new_size;
+            } else {
+                FREEMEM(key->buffer);
+                key->buffer = 0;
+                key->buffer_size = 0;
+                key->computed_size += size;
+                return 0;
+            }
+        }
+        memcpy((char *)key->buffer + key->computed_size, data, size);
+    }
+
+    key->computed_size += size;
+
+    return 0;
+}
+
+/*
+ * Encoder which help convert the application level encoder failure into EIO.
+ */
+static int
+callback_failure_catch_cb(const void *data, size_t size, void *keyp) {
+    struct callback_failure_catch_key *key = keyp;
+    int ret;
+
+    ret = key->callback(data, size, key->callback_key);
+    if(ret < 0) {
+        key->callback_failed = 1;
+    }
+
+    return ret;
+}
+
+asn_enc_rval_t
+asn_encode(const asn_codec_ctx_t *opt_codec_ctx,
+           enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
+           const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) {
+    struct callback_failure_catch_key cb_key;
+    asn_enc_rval_t er = {0,0,0};
+
+    if(!callback) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    cb_key.callback = callback;
+    cb_key.callback_key = callback_key;
+    cb_key.callback_failed = 0;
+
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                             callback_failure_catch_cb, &cb_key);
+    if(cb_key.callback_failed) {
+        assert(er.encoded == -1);
+        assert(errno == EBADF);
+        errno = EIO;
+    }
+
+    return er;
+}
+
+asn_enc_rval_t
+asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx,
+                     enum asn_transfer_syntax syntax,
+                     const asn_TYPE_descriptor_t *td, const void *sptr,
+                     void *buffer, size_t buffer_size) {
+    struct overrun_encoder_key buf_key;
+    asn_enc_rval_t er = {0,0,0};
+
+    if(buffer_size > 0 && !buffer) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    buf_key.buffer = buffer;
+    buf_key.buffer_size = buffer_size;
+    buf_key.computed_size = 0;
+
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                             overrun_encoder_cb, &buf_key);
+
+    if(er.encoded >= 0 && (size_t)er.encoded != buf_key.computed_size) {
+        ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
+                  " yet produced %" ASN_PRI_SIZE " bytes",
+                  er.encoded, buf_key.computed_size);
+        assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size);
+    }
+
+    return er;
+}
+
+asn_encode_to_new_buffer_result_t
+asn_encode_to_new_buffer(const asn_codec_ctx_t *opt_codec_ctx,
+                         enum asn_transfer_syntax syntax,
+                         const asn_TYPE_descriptor_t *td, const void *sptr) {
+    struct dynamic_encoder_key buf_key;
+    asn_encode_to_new_buffer_result_t res;
+
+    buf_key.buffer_size = 16;
+    buf_key.buffer = MALLOC(buf_key.buffer_size);
+    buf_key.computed_size = 0;
+
+    res.result = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                                     dynamic_encoder_cb, &buf_key);
+
+    if(res.result.encoded >= 0
+       && (size_t)res.result.encoded != buf_key.computed_size) {
+        ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
+                  " yet produced %" ASN_PRI_SIZE " bytes",
+                  res.result.encoded, buf_key.computed_size);
+        assert(res.result.encoded < 0
+               || (size_t)res.result.encoded == buf_key.computed_size);
+    }
+
+    res.buffer = buf_key.buffer;
+
+    /* 0-terminate just in case. */
+    if(res.buffer) {
+        assert(buf_key.computed_size < buf_key.buffer_size);
+        ((char *)res.buffer)[buf_key.computed_size] = '\0';
+    }
+
+    return res;
+}
+
+static asn_enc_rval_t
+asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
+                    enum asn_transfer_syntax syntax,
+                    const asn_TYPE_descriptor_t *td, const void *sptr,
+                    asn_app_consume_bytes_f *callback, void *callback_key) {
+    asn_enc_rval_t er = {0,0,0};
+    enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL;
+
+    (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */
+
+    if(!td || !sptr) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    switch(syntax) {
+    case ATS_NONSTANDARD_PLAINTEXT:
+        if(td->op->print_struct) {
+            struct callback_count_bytes_key cb_key;
+            cb_key.callback = callback;
+            cb_key.callback_key = callback_key;
+            cb_key.computed_size = 0;
+            if(td->op->print_struct(td, sptr, 1, callback_count_bytes_cb,
+                                    &cb_key)
+                   < 0
+               || callback_count_bytes_cb("\n", 1, &cb_key) < 0) {
+                errno = EBADF; /* Structure has incorrect form. */
+                er.encoded = -1;
+                er.failed_type = td;
+                er.structure_ptr = sptr;
+            } else {
+                er.encoded = cb_key.computed_size;
+                er.failed_type = 0;
+                er.structure_ptr = 0;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+
+    case ATS_RANDOM:
+        errno = ENOENT; /* Randomization doesn't make sense on output. */
+        ASN__ENCODE_FAILED;
+
+    case ATS_BER:
+        /* BER is a superset of DER. */
+        /* Fall through. */
+    case ATS_DER:
+        if(td->op->der_encoder) {
+            er = der_encode(td, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->der_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* DER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+    case ATS_CER:
+        errno = ENOENT; /* Transfer syntax is not defined for any type. */
+        ASN__ENCODE_FAILED;
+
+#ifdef  ASN_DISABLE_OER_SUPPORT
+    case ATS_BASIC_OER:
+    case ATS_CANONICAL_OER:
+        errno = ENOENT; /* PER is not defined. */
+        ASN__ENCODE_FAILED;
+        break;
+#else /* ASN_DISABLE_OER_SUPPORT */
+    case ATS_BASIC_OER:
+        /* CANONICAL-OER is a superset of BASIC-OER. */
+        /* Fall through. */
+    case ATS_CANONICAL_OER:
+        if(td->op->oer_encoder) {
+            er = oer_encode(td, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->oer_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* OER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+#endif /* ASN_DISABLE_OER_SUPPORT */
+
+#ifdef  ASN_DISABLE_PER_SUPPORT
+    case ATS_UNALIGNED_BASIC_PER:
+    case ATS_UNALIGNED_CANONICAL_PER:
+    case ATS_ALIGNED_BASIC_PER:
+    case ATS_ALIGNED_CANONICAL_PER:
+        errno = ENOENT; /* PER is not defined. */
+        ASN__ENCODE_FAILED;
+        break;
+#else /* ASN_DISABLE_PER_SUPPORT */
+    case ATS_UNALIGNED_BASIC_PER:
+        /* CANONICAL-UPER is a superset of BASIC-UPER. */
+        /* Fall through. */
+    case ATS_UNALIGNED_CANONICAL_PER:
+        if(td->op->uper_encoder) {
+            er = uper_encode(td, 0, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->uper_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* UPER is not defined for this type. */
+                }
+            } else {
+                ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+                if(er.encoded == 0) {
+                    /* Enforce "Complete Encoding" of X.691 #11.1 */
+                    if(callback("\0", 1, callback_key) < 0) {
+                        errno = EBADF;
+                        ASN__ENCODE_FAILED;
+                    }
+                    er.encoded = 8; /* Exactly 8 zero bits is added. */
+                }
+                /* Convert bits into bytes */
+                er.encoded = (er.encoded + 7) >> 3;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+    case ATS_ALIGNED_BASIC_PER:
+        /* CANONICAL-APER is a superset of BASIC-APER. */
+        /* Fall through. */
+    case ATS_ALIGNED_CANONICAL_PER:
+        if(td->op->aper_encoder) {
+            er = aper_encode(td, 0, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->aper_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* APER is not defined for this type. */
+                }
+            } else {
+                ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+                if(er.encoded == 0) {
+                    /* Enforce "Complete Encoding" of X.691 #11.1 */
+                    if(callback("\0", 1, callback_key) < 0) {
+                        errno = EBADF;
+                        ASN__ENCODE_FAILED;
+                    }
+                    er.encoded = 8; /* Exactly 8 zero bits is added. */
+                }
+                /* Convert bits into bytes */
+                er.encoded = (er.encoded + 7) >> 3;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+    case ATS_BASIC_XER:
+        /* CANONICAL-XER is a superset of BASIC-XER. */
+        xer_flags &= ~XER_F_CANONICAL;
+        xer_flags |= XER_F_BASIC;
+        /* Fall through. */
+    case ATS_CANONICAL_XER:
+        if(td->op->xer_encoder) {
+            er = xer_encode(td, sptr, xer_flags, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->xer_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* XER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+
+    default:
+        errno = ENOENT;
+        ASN__ENCODE_FAILED;
+    }
+
+    return er;
+}
+
+asn_dec_rval_t
+asn_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
+           void **sptr, const void *buffer, size_t size) {
+    if(!td || !td->op || !sptr || (size && !buffer)) {
+        ASN__DECODE_FAILED;
+    }
+
+    switch(syntax) {
+    case ATS_CER:
+    case ATS_NONSTANDARD_PLAINTEXT:
+    default:
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+
+    case ATS_RANDOM:
+        if(!td->op->random_fill) {
+            ASN__DECODE_FAILED;
+        } else {
+            if(asn_random_fill(td, sptr, 16000) == 0) {
+                asn_dec_rval_t ret = {RC_OK, 0};
+                return ret;
+            } else {
+                ASN__DECODE_FAILED;
+            }
+        }
+        break;
+
+    case ATS_DER:
+    case ATS_BER:
+        return ber_decode(opt_codec_ctx, td, sptr, buffer, size);
+
+    case ATS_BASIC_OER:
+    case ATS_CANONICAL_OER:
+#ifdef  ASN_DISABLE_OER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return oer_decode(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_UNALIGNED_BASIC_PER:
+    case ATS_UNALIGNED_CANONICAL_PER:
+#ifdef  ASN_DISABLE_PER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_ALIGNED_BASIC_PER:
+    case ATS_ALIGNED_CANONICAL_PER:
+#ifdef  ASN_DISABLE_PER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return aper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_BASIC_XER:
+    case ATS_CANONICAL_XER:
+        return xer_decode(opt_codec_ctx, td, sptr, buffer, size);
+    }
+}
+
diff --git a/e2ap/lib/asn_bit_data.c b/e2ap/lib/asn_bit_data.c
new file mode 100644
index 0000000..fe4b89b
--- /dev/null
+++ b/e2ap/lib/asn_bit_data.c
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+#include <asn_bit_data.h>
+
+/*
+ * Create a contiguous non-refillable bit data structure.
+ * Can be freed by FREEMEM().
+ */
+asn_bit_data_t *
+asn_bit_data_new_contiguous(const void *data, size_t size_bits) {
+    size_t size_bytes = (size_bits + 7) / 8;
+    asn_bit_data_t *pd;
+    uint8_t *bytes;
+
+    /* Get the extensions map */
+    pd = CALLOC(1, sizeof(*pd) + size_bytes + 1);
+    if(!pd) {
+        return NULL;
+    }
+    bytes = (void *)(((char *)pd) + sizeof(*pd));
+    memcpy(bytes, data, size_bytes);
+    bytes[size_bytes] = 0;
+    pd->buffer = bytes;
+    pd->nboff = 0;
+    pd->nbits = size_bits;
+
+    return pd;
+}
+
+
+char *
+asn_bit_data_string(asn_bit_data_t *pd) {
+	static char buf[2][32];
+	static int n;
+	n = (n+1) % 2;
+    snprintf(buf[n], sizeof(buf[n]),
+             "{m=%" ASN_PRI_SIZE " span %" ASN_PRI_SIZE "[%" ASN_PRI_SIZE
+             "..%" ASN_PRI_SIZE "] (%" ASN_PRI_SIZE ")}",
+             pd->moved, ((uintptr_t)(pd->buffer) & 0xf), pd->nboff, pd->nbits,
+             pd->nbits - pd->nboff);
+    return buf[n];
+}
+
+void
+asn_get_undo(asn_bit_data_t *pd, int nbits) {
+	if((ssize_t)pd->nboff < nbits) {
+		assert((ssize_t)pd->nboff < nbits);
+	} else {
+		pd->nboff -= nbits;
+		pd->moved -= nbits;
+	}
+}
+
+/*
+ * Extract a small number of bits (<= 31) from the specified PER data pointer.
+ */
+int32_t
+asn_get_few_bits(asn_bit_data_t *pd, int nbits) {
+	size_t off;	/* Next after last bit offset */
+	ssize_t nleft;	/* Number of bits left in this stream */
+	uint32_t accum;
+	const uint8_t *buf;
+
+	if(nbits < 0)
+		return -1;
+
+	nleft = pd->nbits - pd->nboff;
+	if(nbits > nleft) {
+		int32_t tailv, vhead;
+		if(!pd->refill || nbits > 31) return -1;
+		/* Accumulate unused bytes before refill */
+		ASN_DEBUG("Obtain the rest %d bits (want %d)",
+			(int)nleft, (int)nbits);
+		tailv = asn_get_few_bits(pd, nleft);
+		if(tailv < 0) return -1;
+		/* Refill (replace pd contents with new data) */
+		if(pd->refill(pd))
+			return -1;
+		nbits -= nleft;
+		vhead = asn_get_few_bits(pd, nbits);
+		/* Combine the rest of previous pd with the head of new one */
+		tailv = (tailv << nbits) | vhead;  /* Could == -1 */
+		return tailv;
+	}
+
+	/*
+	 * Normalize position indicator.
+	 */
+	if(pd->nboff >= 8) {
+		pd->buffer += (pd->nboff >> 3);
+		pd->nbits  -= (pd->nboff & ~0x07);
+		pd->nboff  &= 0x07;
+	}
+	pd->moved += nbits;
+	pd->nboff += nbits;
+	off = pd->nboff;
+	buf = pd->buffer;
+
+	/*
+	 * Extract specified number of bits.
+	 */
+	if(off <= 8)
+		accum = nbits ? (buf[0]) >> (8 - off) : 0;
+	else if(off <= 16)
+		accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
+	else if(off <= 24)
+		accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
+	else if(off <= 31)
+		accum = (((uint32_t)buf[0] << 24) + (buf[1] << 16)
+			+ (buf[2] << 8) + (buf[3])) >> (32 - off);
+	else if(nbits <= 31) {
+		asn_bit_data_t tpd = *pd;
+		/* Here are we with our 31-bits limit plus 1..7 bits offset. */
+		asn_get_undo(&tpd, nbits);
+		/* The number of available bits in the stream allow
+		 * for the following operations to take place without
+		 * invoking the ->refill() function */
+		accum  = asn_get_few_bits(&tpd, nbits - 24) << 24;
+		accum |= asn_get_few_bits(&tpd, 24);
+	} else {
+		asn_get_undo(pd, nbits);
+		return -1;
+	}
+
+	accum &= (((uint32_t)1 << nbits) - 1);
+
+	ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
+		(int)nbits, (int)nleft,
+		(int)pd->moved,
+		(((long)pd->buffer) & 0xf),
+		(int)pd->nboff, (int)pd->nbits,
+		((pd->buffer != NULL)?pd->buffer[0]:0),
+		(int)(pd->nbits - pd->nboff),
+		(int)accum);
+
+	return accum;
+}
+
+/*
+ * Extract a large number of bits from the specified PER data pointer.
+ */
+int
+asn_get_many_bits(asn_bit_data_t *pd, uint8_t *dst, int alright, int nbits) {
+	int32_t value;
+
+	if(alright && (nbits & 7)) {
+		/* Perform right alignment of a first few bits */
+		value = asn_get_few_bits(pd, nbits & 0x07);
+		if(value < 0) return -1;
+		*dst++ = value;	/* value is already right-aligned */
+		nbits &= ~7;
+	}
+
+	while(nbits) {
+		if(nbits >= 24) {
+			value = asn_get_few_bits(pd, 24);
+			if(value < 0) return -1;
+			*(dst++) = value >> 16;
+			*(dst++) = value >> 8;
+			*(dst++) = value;
+			nbits -= 24;
+		} else {
+			value = asn_get_few_bits(pd, nbits);
+			if(value < 0) return -1;
+			if(nbits & 7) {	/* implies left alignment */
+				value <<= 8 - (nbits & 7),
+				nbits += 8 - (nbits & 7);
+				if(nbits > 24)
+					*dst++ = value >> 24;
+			}
+			if(nbits > 16)
+				*dst++ = value >> 16;
+			if(nbits > 8)
+				*dst++ = value >> 8;
+			*dst++ = value;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+/*
+ * Put a small number of bits (<= 31).
+ */
+int
+asn_put_few_bits(asn_bit_outp_t *po, uint32_t bits, int obits) {
+	size_t off;	/* Next after last bit offset */
+	size_t omsk;	/* Existing last byte meaningful bits mask */
+	uint8_t *buf;
+
+	if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
+
+	ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
+			obits, (int)bits, (void *)po->buffer, (int)po->nboff);
+
+	/*
+	 * Normalize position indicator.
+	 */
+	if(po->nboff >= 8) {
+		po->buffer += (po->nboff >> 3);
+		po->nbits  -= (po->nboff & ~0x07);
+		po->nboff  &= 0x07;
+	}
+
+	/*
+	 * Flush whole-bytes output, if necessary.
+	 */
+	if(po->nboff + obits > po->nbits) {
+		size_t complete_bytes;
+		if(!po->buffer) po->buffer = po->tmpspace;
+		complete_bytes = (po->buffer - po->tmpspace);
+		ASN_DEBUG("[PER output %ld complete + %ld]",
+			(long)complete_bytes, (long)po->flushed_bytes);
+		if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0)
+			return -1;
+		if(po->nboff)
+			po->tmpspace[0] = po->buffer[0];
+		po->buffer = po->tmpspace;
+		po->nbits = 8 * sizeof(po->tmpspace);
+		po->flushed_bytes += complete_bytes;
+	}
+
+	/*
+	 * Now, due to sizeof(tmpspace), we are guaranteed large enough space.
+	 */
+	buf = po->buffer;
+	omsk = ~((1 << (8 - po->nboff)) - 1);
+	off = (po->nboff + obits);
+
+	/* Clear data of debris before meaningful bits */
+	bits &= (((uint32_t)1 << obits) - 1);
+
+	ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
+		(int)bits, (int)bits,
+		(int)po->nboff, (int)off,
+		buf[0], (int)(omsk&0xff),
+		(int)(buf[0] & omsk));
+
+	if(off <= 8)	/* Completely within 1 byte */
+		po->nboff = off,
+		bits <<= (8 - off),
+		buf[0] = (buf[0] & omsk) | bits;
+	else if(off <= 16)
+		po->nboff = off,
+		bits <<= (16 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 8),
+		buf[1] = bits;
+	else if(off <= 24)
+		po->nboff = off,
+		bits <<= (24 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 16),
+		buf[1] = bits >> 8,
+		buf[2] = bits;
+	else if(off <= 31)
+		po->nboff = off,
+		bits <<= (32 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 24),
+		buf[1] = bits >> 16,
+		buf[2] = bits >> 8,
+		buf[3] = bits;
+	else {
+		if(asn_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
+		if(asn_put_few_bits(po, bits, obits - 24)) return -1;
+	}
+
+	ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
+		(int)bits, (int)bits, buf[0],
+		(long)(po->buffer - po->tmpspace));
+
+	return 0;
+}
+
+
+/*
+ * Output a large number of bits.
+ */
+int
+asn_put_many_bits(asn_bit_outp_t *po, const uint8_t *src, int nbits) {
+
+	while(nbits) {
+		uint32_t value;
+
+		if(nbits >= 24) {
+			value = (src[0] << 16) | (src[1] << 8) | src[2];
+			src += 3;
+			nbits -= 24;
+			if(asn_put_few_bits(po, value, 24))
+				return -1;
+		} else {
+			value = src[0];
+			if(nbits > 8)
+				value = (value << 8) | src[1];
+			if(nbits > 16)
+				value = (value << 8) | src[2];
+			if(nbits & 0x07)
+				value >>= (8 - (nbits & 0x07));
+			if(asn_put_few_bits(po, value, nbits))
+				return -1;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+
+int
+asn_put_aligned_flush(asn_bit_outp_t *po) {
+    uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07)));
+    size_t complete_bytes =
+        (po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3);
+
+    if(unused_bits) {
+        po->buffer[po->nboff >> 3] &= ~0u << unused_bits;
+    }
+
+    if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0) {
+        return -1;
+    } else {
+        po->buffer = po->tmpspace;
+        po->nboff = 0;
+        po->nbits = 8 * sizeof(po->tmpspace);
+        po->flushed_bytes += complete_bytes;
+        return 0;
+    }
+}
+
diff --git a/e2ap/lib/asn_codecs_prim.c b/e2ap/lib/asn_codecs_prim.c
new file mode 100644
index 0000000..fc24247
--- /dev/null
+++ b/e2ap/lib/asn_codecs_prim.c
@@ -0,0 +1,317 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+#include <errno.h>
+
+/*
+ * Decode an always-primitive type.
+ */
+asn_dec_rval_t
+ber_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buf_ptr, size_t size, int tag_mode) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
+	asn_dec_rval_t rval;
+	ber_tlv_len_t length = 0; /* =0 to avoid [incorrect] warning. */
+
+	/*
+	 * If the structure is not there, allocate it.
+	 */
+	if(st == NULL) {
+		st = (ASN__PRIMITIVE_TYPE_t *)CALLOC(1, sizeof(*st));
+		if(st == NULL) ASN__DECODE_FAILED;
+		*sptr = (void *)st;
+	}
+
+	ASN_DEBUG("Decoding %s as plain primitive (tm=%d)",
+		td->name, tag_mode);
+
+	/*
+	 * Check tags and extract value length.
+	 */
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
+	if(rval.code != RC_OK)
+		return rval;
+
+	ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
+
+	/*
+	 * Make sure we have this length.
+	 */
+	buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+	size -= rval.consumed;
+	if(length > (ber_tlv_len_t)size) {
+		rval.code = RC_WMORE;
+		rval.consumed = 0;
+		return rval;
+	}
+
+	st->size = (int)length;
+	/* The following better be optimized away. */
+	if(sizeof(st->size) != sizeof(length)
+			&& (ber_tlv_len_t)st->size != length) {
+		st->size = 0;
+		ASN__DECODE_FAILED;
+	}
+
+	st->buf = (uint8_t *)MALLOC(length + 1);
+	if(!st->buf) {
+		st->size = 0;
+		ASN__DECODE_FAILED;
+	}
+
+	memcpy(st->buf, buf_ptr, length);
+	st->buf[length] = '\0';		/* Just in case */
+
+	rval.code = RC_OK;
+	rval.consumed += length;
+
+	ASN_DEBUG("Took %ld/%ld bytes to encode %s",
+		(long)rval.consumed,
+		(long)length, td->name);
+
+	return rval;
+}
+
+/*
+ * Encode an always-primitive type using DER.
+ */
+asn_enc_rval_t
+der_encode_primitive(const asn_TYPE_descriptor_t *td, const void *sptr,
+                     int tag_mode, ber_tlv_tag_t tag,
+                     asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_enc_rval_t erval = {0,0,0};
+	const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr;
+
+	ASN_DEBUG("%s %s as a primitive type (tm=%d)",
+		cb?"Encoding":"Estimating", td->name, tag_mode);
+
+	erval.encoded = der_write_tags(td, st->size, tag_mode, 0, tag,
+		cb, app_key);
+	ASN_DEBUG("%s wrote tags %d", td->name, (int)erval.encoded);
+	if(erval.encoded == -1) {
+		erval.failed_type = td;
+		erval.structure_ptr = sptr;
+		return erval;
+	}
+
+	if(cb && st->buf) {
+		if(cb(st->buf, st->size, app_key) < 0) {
+			erval.encoded = -1;
+			erval.failed_type = td;
+			erval.structure_ptr = sptr;
+			return erval;
+		}
+	} else {
+		assert(st->buf || st->size == 0);
+	}
+
+	erval.encoded += st->size;
+	ASN__ENCODED_OK(erval);
+}
+
+void
+ASN__PRIMITIVE_TYPE_free(const asn_TYPE_descriptor_t *td, void *sptr,
+                         enum asn_struct_free_method method) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr;
+
+	if(!td || !sptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as a primitive type", td->name);
+
+	if(st->buf)
+		FREEMEM(st->buf);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(sptr, 0, sizeof(ASN__PRIMITIVE_TYPE_t));
+        break;
+    }
+}
+
+
+/*
+ * Local internal type passed around as an argument.
+ */
+struct xdp_arg_s {
+    const asn_TYPE_descriptor_t *type_descriptor;
+    void *struct_key;
+	xer_primitive_body_decoder_f *prim_body_decoder;
+	int decoded_something;
+	int want_more;
+};
+
+/*
+ * Since some kinds of primitive values can be encoded using value-specific
+ * tags (<MINUS-INFINITY>, <enum-element>, etc), the primitive decoder must
+ * be supplied with such tags to parse them as needed.
+ */
+static int
+xer_decode__unexpected_tag(void *key, const void *chunk_buf, size_t chunk_size) {
+	struct xdp_arg_s *arg = (struct xdp_arg_s *)key;
+	enum xer_pbd_rval bret;
+
+	/*
+	 * The chunk_buf is guaranteed to start at '<'.
+	 */
+	assert(chunk_size && ((const char *)chunk_buf)[0] == 0x3c);
+
+	/*
+	 * Decoding was performed once already. Prohibit doing it again.
+	 */
+	if(arg->decoded_something)
+		return -1;
+
+	bret = arg->prim_body_decoder(arg->type_descriptor,
+		arg->struct_key, chunk_buf, chunk_size);
+	switch(bret) {
+	case XPBD_SYSTEM_FAILURE:
+	case XPBD_DECODER_LIMIT:
+	case XPBD_BROKEN_ENCODING:
+		break;
+	case XPBD_BODY_CONSUMED:
+		/* Tag decoded successfully */
+		arg->decoded_something = 1;
+		/* Fall through */
+	case XPBD_NOT_BODY_IGNORE:	/* Safe to proceed further */
+		return 0;
+	}
+
+	return -1;
+}
+
+static ssize_t
+xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, int have_more) {
+	struct xdp_arg_s *arg = (struct xdp_arg_s *)key;
+	enum xer_pbd_rval bret;
+	size_t lead_wsp_size;
+
+	if(arg->decoded_something) {
+		if(xer_whitespace_span(chunk_buf, chunk_size) == chunk_size) {
+			/*
+			 * Example:
+			 * "<INTEGER>123<!--/--> </INTEGER>"
+			 *                      ^- chunk_buf position.
+			 */
+			return chunk_size;
+		}
+		/*
+		 * Decoding was done once already. Prohibit doing it again.
+		 */
+		return -1;
+	}
+
+	if(!have_more) {
+		/*
+		 * If we've received something like "1", we can't really
+		 * tell whether it is really `1` or `123`, until we know
+		 * that there is no more data coming.
+		 * The have_more argument will be set to 1 once something
+		 * like this is available to the caller of this callback:
+		 * "1<tag_start..."
+		 */
+		arg->want_more = 1;
+		return -1;
+	}
+
+	lead_wsp_size = xer_whitespace_span(chunk_buf, chunk_size);
+	chunk_buf = (const char *)chunk_buf + lead_wsp_size;
+	chunk_size -= lead_wsp_size;
+
+	bret = arg->prim_body_decoder(arg->type_descriptor,
+		arg->struct_key, chunk_buf, chunk_size);
+	switch(bret) {
+	case XPBD_SYSTEM_FAILURE:
+	case XPBD_DECODER_LIMIT:
+	case XPBD_BROKEN_ENCODING:
+		break;
+	case XPBD_BODY_CONSUMED:
+		/* Tag decoded successfully */
+		arg->decoded_something = 1;
+		/* Fall through */
+	case XPBD_NOT_BODY_IGNORE:	/* Safe to proceed further */
+		return lead_wsp_size + chunk_size;
+	}
+
+	return -1;
+}
+
+
+asn_dec_rval_t
+xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     size_t struct_size, const char *opt_mname,
+                     const void *buf_ptr, size_t size,
+                     xer_primitive_body_decoder_f *prim_body_decoder) {
+    const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+	asn_struct_ctx_t s_ctx;
+	struct xdp_arg_s s_arg;
+	asn_dec_rval_t rc;
+
+	/*
+	 * Create the structure if does not exist.
+	 */
+	if(!*sptr) {
+		*sptr = CALLOC(1, struct_size);
+		if(!*sptr) ASN__DECODE_FAILED;
+	}
+
+	memset(&s_ctx, 0, sizeof(s_ctx));
+	s_arg.type_descriptor = td;
+	s_arg.struct_key = *sptr;
+	s_arg.prim_body_decoder = prim_body_decoder;
+	s_arg.decoded_something = 0;
+	s_arg.want_more = 0;
+
+	rc = xer_decode_general(opt_codec_ctx, &s_ctx, &s_arg,
+		xml_tag, buf_ptr, size,
+		xer_decode__unexpected_tag, xer_decode__primitive_body);
+	switch(rc.code) {
+	case RC_OK:
+		if(!s_arg.decoded_something) {
+			char ch;
+			ASN_DEBUG("Primitive body is not recognized, "
+				"supplying empty one");
+			/*
+			 * Decoding opportunity has come and gone.
+			 * Where's the result?
+			 * Try to feed with empty body, see if it eats it.
+			 */
+			if(prim_body_decoder(s_arg.type_descriptor,
+				s_arg.struct_key, &ch, 0)
+					!= XPBD_BODY_CONSUMED) {
+				/*
+				 * This decoder does not like empty stuff.
+				 */
+				ASN__DECODE_FAILED;
+			}
+		}
+		break;
+	case RC_WMORE:
+		/*
+		 * Redo the whole thing later.
+		 * We don't have a context to save intermediate parsing state.
+		 */
+		rc.consumed = 0;
+		break;
+	case RC_FAIL:
+		rc.consumed = 0;
+		if(s_arg.want_more)
+			rc.code = RC_WMORE;
+		else
+			ASN__DECODE_FAILED;
+		break;
+	}
+	return rc;
+}
+
diff --git a/e2ap/lib/asn_internal.c b/e2ap/lib/asn_internal.c
new file mode 100644
index 0000000..1aff95f
--- /dev/null
+++ b/e2ap/lib/asn_internal.c
@@ -0,0 +1,48 @@
+#include <asn_internal.h>
+
+ssize_t
+asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key,
+                        const char *fmt, ...) {
+    char scratch[64];
+    char *buf = scratch;
+    size_t buf_size = sizeof(scratch);
+    int wrote;
+    int cb_ret;
+
+    do {
+        va_list args;
+        va_start(args, fmt);
+
+        wrote = vsnprintf(buf, buf_size, fmt, args);
+        if(wrote < (ssize_t)buf_size) {
+            if(wrote < 0) {
+                if(buf != scratch) FREEMEM(buf);
+		va_end(args);
+                return -1;
+            }
+            break;
+        }
+
+        buf_size <<= 1;
+        if(buf == scratch) {
+            buf = MALLOC(buf_size);
+            if(!buf) return -1;
+        } else {
+            void *p = REALLOC(buf, buf_size);
+            if(!p) {
+                FREEMEM(buf);
+                return -1;
+            }
+            buf = p;
+        }
+    } while(1);
+
+    cb_ret = cb(buf, wrote, key);
+    if(buf != scratch) FREEMEM(buf);
+    if(cb_ret < 0) {
+        return -1;
+    }
+
+    return wrote;
+}
+
diff --git a/e2ap/lib/asn_random_fill.c b/e2ap/lib/asn_random_fill.c
new file mode 100644
index 0000000..eb8ed8f
--- /dev/null
+++ b/e2ap/lib/asn_random_fill.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_random_fill.h>
+#include <constr_TYPE.h>
+
+int
+asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+                size_t length) {
+
+    if(td && td->op->random_fill) {
+        asn_random_fill_result_t res =
+            td->op->random_fill(td, struct_ptr, 0, length);
+        return (res.code == ARFILL_OK) ? 0 : -1;
+    } else {
+        return -1;
+    }
+}
+
+static uintmax_t
+asn__intmax_range(intmax_t lb, intmax_t ub) {
+    assert(lb <= ub);
+    if((ub < 0) == (lb < 0)) {
+        return ub - lb;
+    } else if(lb < 0) {
+        return 1 + ((uintmax_t)ub + (uintmax_t)-(lb + 1));
+    } else {
+        assert(!"Unreachable");
+        return 0;
+    }
+}
+
+intmax_t
+asn_random_between(intmax_t lb, intmax_t rb) {
+    if(lb == rb) {
+        return lb;
+    } else {
+        const uintmax_t intmax_max = ((~(uintmax_t)0) >> 1);
+        uintmax_t range = asn__intmax_range(lb, rb);
+        uintmax_t value = 0;
+        uintmax_t got_entropy = 0;
+
+        assert(RAND_MAX > 0xffffff);    /* Seen 7ffffffd! */
+        assert(range < intmax_max);
+
+        for(; got_entropy < range;) {
+            got_entropy = (got_entropy << 24) | 0xffffff;
+#ifdef WIN32    //MCHECK
+            value = (value << 24) | (rand() % 0xffffff); 
+#else
+            value = (value << 24) | (random() % 0xffffff);
+#endif
+        }
+
+        return lb + (intmax_t)(value % (range + 1));
+    }
+}
diff --git a/e2ap/lib/ber_decoder.c b/e2ap/lib/ber_decoder.c
new file mode 100644
index 0000000..75d6016
--- /dev/null
+++ b/e2ap/lib/ber_decoder.c
@@ -0,0 +1,283 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {					\
+		size_t num = num_bytes;					\
+		ptr = ((const char *)ptr) + num;			\
+		size -= num;						\
+		consumed_myself += num;					\
+	} while(0)
+#undef	RETURN
+#define	RETURN(_code)	do {						\
+		asn_dec_rval_t rval;					\
+		rval.code = _code;					\
+		if(opt_ctx) opt_ctx->step = step; /* Save context */	\
+		if(_code == RC_OK || opt_ctx)				\
+			rval.consumed = consumed_myself;		\
+		else							\
+			rval.consumed = 0;	/* Context-free */	\
+		return rval;						\
+	} while(0)
+
+/*
+ * The BER decoder of any type.
+ */
+asn_dec_rval_t
+ber_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+           const void *ptr, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return type_descriptor->op->ber_decoder(opt_codec_ctx, type_descriptor,
+		struct_ptr,	/* Pointer to the destination structure */
+		ptr, size,	/* Buffer and its size */
+		0		/* Default tag mode is 0 */
+		);
+}
+
+/*
+ * Check the set of <TL<TL<TL...>>> tags matches the definition.
+ */
+asn_dec_rval_t
+ber_check_tags(const asn_codec_ctx_t *opt_codec_ctx,
+               const asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx,
+               const void *ptr, size_t size, int tag_mode, int last_tag_form,
+               ber_tlv_len_t *last_length, int *opt_tlv_form) {
+    ssize_t consumed_myself = 0;
+	ssize_t tag_len;
+	ssize_t len_len;
+	ber_tlv_tag_t tlv_tag;
+	ber_tlv_len_t tlv_len;
+	ber_tlv_len_t limit_len = -1;
+	int expect_00_terminators = 0;
+	int tlv_constr = -1;	/* If CHOICE, opt_tlv_form is not given */
+	int step = opt_ctx ? opt_ctx->step : 0;	/* Where we left previously */
+	int tagno;
+
+	/*
+	 * Make sure we didn't exceed the maximum stack size.
+	 */
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		RETURN(RC_FAIL);
+
+	/*
+	 * So what does all this implicit skip stuff mean?
+	 * Imagine two types,
+	 * 	A ::= [5] IMPLICIT	T
+	 * 	B ::= [2] EXPLICIT	T
+	 * Where T is defined as
+	 *	T ::= [4] IMPLICIT SEQUENCE { ... }
+	 * 
+	 * Let's say, we are starting to decode type A, given the
+	 * following TLV stream: <5> <0>. What does this mean?
+	 * It means that the type A contains type T which is,
+	 * in turn, empty.
+	 * Remember though, that we are still in A. We cannot
+	 * just pass control to the type T decoder. Why? Because
+	 * the type T decoder expects <4> <0>, not <5> <0>.
+	 * So, we must make sure we are going to receive <5> while
+	 * still in A, then pass control to the T decoder, indicating
+	 * that the tag <4> was implicitly skipped. The decoder of T
+	 * hence will be prepared to treat <4> as valid tag, and decode
+	 * it appropriately.
+	 */
+
+	tagno = step	/* Continuing where left previously */
+		+ (tag_mode==1?-1:0)
+		;
+	ASN_DEBUG("ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)",
+		td->name, (long)size, tag_mode, step, tagno);
+	/* assert(td->tags_count >= 1) May not be the case for CHOICE or ANY */
+
+	if(tag_mode == 0 && tagno == (int)td->tags_count) {
+		/*
+		 * This must be the _untagged_ ANY type,
+		 * which outermost tag isn't known in advance.
+		 * Fetch the tag and length separately.
+		 */
+		tag_len = ber_fetch_tag(ptr, size, &tlv_tag);
+		switch(tag_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+		tlv_constr = BER_TLV_CONSTRUCTED(ptr);
+		len_len = ber_fetch_length(tlv_constr,
+			(const char *)ptr + tag_len, size - tag_len, &tlv_len);
+		switch(len_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+		ASN_DEBUG("Advancing %ld in ANY case",
+			(long)(tag_len + len_len));
+		ADVANCE(tag_len + len_len);
+	} else {
+		assert(tagno < (int)td->tags_count);	/* At least one loop */
+	}
+	for((void)tagno; tagno < (int)td->tags_count; tagno++, step++) {
+
+		/*
+		 * Fetch and process T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, size, &tlv_tag);
+			ASN_DEBUG("Fetching tag from {%p,%ld}: "
+				"len %ld, step %d, tagno %d got %s",
+				ptr, (long)size,
+				(long)tag_len, step, tagno,
+				ber_tlv_tag_string(tlv_tag));
+		switch(tag_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		tlv_constr = BER_TLV_CONSTRUCTED(ptr);
+
+		/*
+		 * If {I}, don't check anything.
+		 * If {I,B,C}, check B and C unless we're at I.
+		 */
+		if(tag_mode != 0 && step == 0) {
+			/*
+			 * We don't expect tag to match here.
+			 * It's just because we don't know how the tag
+			 * is supposed to look like.
+			 */
+		} else {
+		    assert(tagno >= 0);	/* Guaranteed by the code above */
+		    if(tlv_tag != td->tags[tagno]) {
+			/*
+			 * Unexpected tag. Too bad.
+			 */
+		    	ASN_DEBUG("Expected: %s, "
+				"expectation failed (tn=%d, tm=%d)",
+				ber_tlv_tag_string(td->tags[tagno]),
+				tagno, tag_mode
+			);
+			RETURN(RC_FAIL);
+		    }
+		}
+
+		/*
+		 * Attention: if there are more tags expected,
+		 * ensure that the current tag is presented
+		 * in constructed form (it contains other tags!).
+		 * If this one is the last one, check that the tag form
+		 * matches the one given in descriptor.
+		 */
+		if(tagno < ((int)td->tags_count - 1)) {
+			if(tlv_constr == 0) {
+				ASN_DEBUG("tlv_constr = %d, expfail",
+					tlv_constr);
+				RETURN(RC_FAIL);
+			}
+		} else {
+			if(last_tag_form != tlv_constr
+			&& last_tag_form != -1) {
+				ASN_DEBUG("last_tag_form %d != %d",
+					last_tag_form, tlv_constr);
+				RETURN(RC_FAIL);
+			}
+		}
+
+		/*
+		 * Fetch and process L from TLV.
+		 */
+		len_len = ber_fetch_length(tlv_constr,
+			(const char *)ptr + tag_len, size - tag_len, &tlv_len);
+		ASN_DEBUG("Fetching len = %ld", (long)len_len);
+		switch(len_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		/*
+		 * FIXME
+		 * As of today, the chain of tags
+		 * must either contain several indefinite length TLVs,
+		 * or several definite length ones.
+		 * No mixing is allowed.
+		 */
+		if(tlv_len == -1) {
+			/*
+			 * Indefinite length.
+			 */
+			if(limit_len == -1) {
+				expect_00_terminators++;
+			} else {
+				ASN_DEBUG("Unexpected indefinite length "
+					"in a chain of definite lengths");
+				RETURN(RC_FAIL);
+			}
+			ADVANCE(tag_len + len_len);
+			continue;
+		} else {
+			if(expect_00_terminators) {
+				ASN_DEBUG("Unexpected definite length "
+					"in a chain of indefinite lengths");
+				RETURN(RC_FAIL);
+			}
+		}
+
+		/*
+		 * Check that multiple TLVs specify ever decreasing length,
+		 * which is consistent.
+		 */
+		if(limit_len == -1) {
+			limit_len    = tlv_len + tag_len + len_len;
+			if(limit_len < 0) {
+				/* Too great tlv_len value? */
+				RETURN(RC_FAIL);
+			}
+		} else if(limit_len != tlv_len + tag_len + len_len) {
+			/*
+			 * Inner TLV specifies length which is inconsistent
+			 * with the outer TLV's length value.
+			 */
+			ASN_DEBUG("Outer TLV is %ld and inner is %ld",
+				(long)limit_len, (long)tlv_len);
+			RETURN(RC_FAIL);
+		}
+
+		ADVANCE(tag_len + len_len);
+
+		limit_len -= (tag_len + len_len);
+		if((ssize_t)size > limit_len) {
+			/*
+			 * Make sure that we won't consume more bytes
+			 * from the parent frame than the inferred limit.
+			 */
+			size = limit_len;
+		}
+	}
+
+	if(opt_tlv_form)
+		*opt_tlv_form = tlv_constr;
+	if(expect_00_terminators)
+		*last_length = -expect_00_terminators;
+	else
+		*last_length = tlv_len;
+
+	RETURN(RC_OK);
+}
diff --git a/e2ap/lib/ber_tlv_length.c b/e2ap/lib/ber_tlv_length.c
new file mode 100644
index 0000000..0a0deec
--- /dev/null
+++ b/e2ap/lib/ber_tlv_length.c
@@ -0,0 +1,168 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ber_tlv_length.h>
+#include <ber_tlv_tag.h>
+
+ssize_t
+ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
+		ber_tlv_len_t *len_r) {
+	const uint8_t *buf = (const uint8_t *)bufptr;
+	unsigned oct;
+
+	if(size == 0)
+		return 0;	/* Want more */
+
+	oct = *(const uint8_t *)buf;
+	if((oct & 0x80) == 0) {
+		/*
+		 * Short definite length.
+		 */
+		*len_r = oct;	/* & 0x7F */
+		return 1;
+	} else {
+		ber_tlv_len_t len;
+		size_t skipped;
+
+		if(_is_constructed && oct == 0x80) {
+			*len_r = -1;	/* Indefinite length */
+			return 1;
+		}
+
+		if(oct == 0xff) {
+			/* Reserved in standard for future use. */
+			return -1;
+		}
+
+		oct &= 0x7F;	/* Leave only the 7 LS bits */
+		for(len = 0, buf++, skipped = 1;
+			oct && (++skipped <= size); buf++, oct--) {
+
+			/* Verify that we won't overflow. */
+			if(!(len >> ((8 * sizeof(len)) - (8+1)))) {
+				len = (len << 8) | *buf;
+			} else {
+				/* Too large length value. */
+				return -1;
+			}
+		}
+
+		if(oct == 0) {
+			if(len < 0 || len > RSSIZE_MAX) {
+				/* Length value out of sane range. */
+				return -1;
+			}
+
+			*len_r = len;
+			return skipped;
+		}
+
+		return 0;	/* Want more */
+	}
+
+}
+
+ssize_t
+ber_skip_length(const asn_codec_ctx_t *opt_codec_ctx,
+		int _is_constructed, const void *ptr, size_t size) {
+	ber_tlv_len_t vlen;	/* Length of V in TLV */
+	ssize_t tl;		/* Length of L in TLV */
+	ssize_t ll;		/* Length of L in TLV */
+	size_t skip;
+
+	/*
+	 * Make sure we didn't exceed the maximum stack size.
+	 */
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		return -1;
+
+	/*
+	 * Determine the size of L in TLV.
+	 */
+	ll = ber_fetch_length(_is_constructed, ptr, size, &vlen);
+	if(ll <= 0) return ll;
+
+	/*
+	 * Definite length.
+	 */
+	if(vlen >= 0) {
+		skip = ll + vlen;
+		if(skip > size)
+			return 0;	/* Want more */
+		return skip;
+	}
+
+	/*
+	 * Indefinite length!
+	 */
+	ASN_DEBUG("Skipping indefinite length");
+	for(skip = ll, ptr = ((const char *)ptr) + ll, size -= ll;;) {
+		ber_tlv_tag_t tag;
+
+		/* Fetch the tag */
+		tl = ber_fetch_tag(ptr, size, &tag);
+		if(tl <= 0) return tl;
+
+		ll = ber_skip_length(opt_codec_ctx,
+			BER_TLV_CONSTRUCTED(ptr),
+			((const char *)ptr) + tl, size - tl);
+		if(ll <= 0) return ll;
+
+		skip += tl + ll;
+
+		/*
+		 * This may be the end of the indefinite length structure,
+		 * two consecutive 0 octets.
+		 * Check if it is true.
+		 */
+		if(((const uint8_t *)ptr)[0] == 0
+		&& ((const uint8_t *)ptr)[1] == 0)
+			return skip;
+
+		ptr = ((const char *)ptr) + tl + ll;
+		size -= tl + ll;
+	}
+
+	/* UNREACHABLE */
+}
+
+size_t
+der_tlv_length_serialize(ber_tlv_len_t len, void *bufp, size_t size) {
+	size_t required_size;	/* Size of len encoding */
+	uint8_t *buf = (uint8_t *)bufp;
+	uint8_t *end;
+	int i;
+
+	if(len <= 127) {
+		/* Encoded in 1 octet */
+		if(size) *buf = (uint8_t)len;
+		return 1;
+	}
+
+	/*
+	 * Compute the size of the subsequent bytes.
+	 */
+	for(required_size = 1, i = 8; i < 8 * (int)sizeof(len); i += 8) {
+		if(len >> i)
+			required_size++;
+		else
+			break;
+	}
+
+	if(size <= required_size)
+		return required_size + 1;
+
+	*buf++ = (uint8_t)(0x80 | required_size);  /* Length of the encoding */
+
+	/*
+	 * Produce the len encoding, space permitting.
+	 */
+	end = buf + required_size;
+	for(i -= 8; buf < end; i -= 8, buf++)
+		*buf = (uint8_t)(len >> i);
+
+	return required_size + 1;
+}
+
diff --git a/e2ap/lib/ber_tlv_tag.c b/e2ap/lib/ber_tlv_tag.c
new file mode 100644
index 0000000..4a7d732
--- /dev/null
+++ b/e2ap/lib/ber_tlv_tag.c
@@ -0,0 +1,144 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ber_tlv_tag.h>
+#include <errno.h>
+
+ssize_t
+ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
+	ber_tlv_tag_t val;
+	ber_tlv_tag_t tclass;
+	size_t skipped;
+
+	if(size == 0)
+		return 0;
+
+	val = *(const uint8_t *)ptr;
+	tclass = (val >> 6);
+	if((val &= 0x1F) != 0x1F) {
+		/*
+		 * Simple form: everything encoded in a single octet.
+		 * Tag Class is encoded using two least significant bits.
+		 */
+		*tag_r = (val << 2) | tclass;
+		return 1;
+	}
+
+	/*
+	 * Each octet contains 7 bits of useful information.
+	 * The MSB is 0 if it is the last octet of the tag.
+	 */
+	for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2;
+			skipped <= size;
+				ptr = ((const char *)ptr) + 1, skipped++) {
+		unsigned int oct = *(const uint8_t *)ptr;
+		if(oct & 0x80) {
+			val = (val << 7) | (oct & 0x7F);
+			/*
+			 * Make sure there are at least 9 bits spare
+			 * at the MS side of a value.
+			 */
+			if(val >> ((8 * sizeof(val)) - 9)) {
+				/*
+				 * We would not be able to accomodate
+				 * any more tag bits.
+				 */
+				return -1;
+			}
+		} else {
+			val = (val << 7) | oct;
+			*tag_r = (val << 2) | tclass;
+			return skipped;
+		}
+	}
+
+	return 0;	/* Want more */
+}
+
+
+ssize_t
+ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) {
+	char buf[sizeof("[APPLICATION ]") + 32];
+	ssize_t ret;
+
+	ret = ber_tlv_tag_snprint(tag, buf, sizeof(buf));
+	if(ret >= (ssize_t)sizeof(buf) || ret < 2) {
+		errno = EPERM;
+		return -1;
+	}
+
+	return fwrite(buf, 1, ret, f);
+}
+
+ssize_t
+ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) {
+	const char *type = 0;
+	int ret;
+
+	switch(tag & 0x3) {
+	case ASN_TAG_CLASS_UNIVERSAL:	type = "UNIVERSAL ";	break;
+	case ASN_TAG_CLASS_APPLICATION:	type = "APPLICATION ";	break;
+	case ASN_TAG_CLASS_CONTEXT:	type = "";		break;
+	case ASN_TAG_CLASS_PRIVATE:	type = "PRIVATE ";	break;
+	}
+
+	ret = snprintf(buf, size, "[%s%u]", type, ((unsigned)tag) >> 2);
+	if(ret <= 0 && size) buf[0] = '\0';	/* against broken libc's */
+
+	return ret;
+}
+
+char *
+ber_tlv_tag_string(ber_tlv_tag_t tag) {
+	static char buf[sizeof("[APPLICATION ]") + 32];
+
+	(void)ber_tlv_tag_snprint(tag, buf, sizeof(buf));
+
+	return buf;
+}
+
+
+size_t
+ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufp, size_t size) {
+	int tclass = BER_TAG_CLASS(tag);
+	ber_tlv_tag_t tval = BER_TAG_VALUE(tag);
+	uint8_t *buf = (uint8_t *)bufp;
+	uint8_t *end;
+	size_t required_size;
+	size_t i;
+
+	if(tval <= 30) {
+		/* Encoded in 1 octet */
+		if(size) buf[0] = (tclass << 6) | tval;
+		return 1;
+	} else if(size) {
+		*buf++ = (tclass << 6) | 0x1F;
+		size--;
+	}
+
+	/*
+	 * Compute the size of the subsequent bytes.
+	 */
+	for(required_size = 1, i = 7; i < 8 * sizeof(tval); i += 7) {
+		if(tval >> i)
+			required_size++;
+		else
+			break;
+	}
+
+	if(size < required_size)
+		return required_size + 1;
+
+	/*
+	 * Fill in the buffer, space permitting.
+	 */
+	end = buf + required_size - 1;
+	for(i -= 7; buf < end; i -= 7, buf++)
+		*buf = 0x80 | ((tval >> i) & 0x7F);
+	*buf = (tval & 0x7F);	/* Last octet without high bit */
+
+	return required_size + 1;
+}
+
diff --git a/e2ap/lib/constr_CHOICE.c b/e2ap/lib/constr_CHOICE.c
new file mode 100644
index 0000000..86dcbb0
--- /dev/null
+++ b/e2ap/lib/constr_CHOICE.c
@@ -0,0 +1,1533 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_CHOICE.h>
+#include <per_opentype.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num;\
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * See the definitions.
+ */
+static unsigned _fetch_present_idx(const void *struct_ptr, unsigned off,
+                                   unsigned size);
+static void _set_present_idx(void *sptr, unsigned offset, unsigned size,
+                             unsigned pres);
+static const void *_get_member_ptr(const asn_TYPE_descriptor_t *,
+                                   const void *sptr, asn_TYPE_member_t **elm,
+                                   unsigned *present);
+
+/*
+ * Tags are canonically sorted in the tag to member table.
+ */
+static int
+_search4tag(const void *ap, const void *bp) {
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+	int a_class = BER_TAG_CLASS(a->el_tag);
+	int b_class = BER_TAG_CLASS(b->el_tag);
+
+	if(a_class == b_class) {
+		ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+		ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+		if(a_value == b_value)
+			return 0;
+		else if(a_value < b_value)
+			return -1;
+		else
+			return 1;
+	} else if(a_class < b_class) {
+		return -1;
+	} else {
+		return 1;
+	}
+}
+
+/*
+ * The decoder of the CHOICE type.
+ */
+asn_dec_rval_t
+CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_CHOICE_specifics_t *specs =
+		(const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
+
+	/*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	ssize_t tag_len;	/* Length of TLV's T */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	ASN_DEBUG("Decoding %s as CHOICE", td->name);
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		if(tag_mode || td->tags_count) {
+			rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+				tag_mode, -1, &ctx->left, 0);
+			if(rval.code != RC_OK) {
+				ASN_DEBUG("%s tagging check failed: %d",
+					td->name, rval.code);
+				return rval;
+			}
+
+			if(ctx->left >= 0) {
+				/* ?Substracted below! */
+				ctx->left += rval.consumed;
+			}
+			ADVANCE(rval.consumed);
+		} else {
+			ctx->left = -1;
+		}
+
+		NEXT_PHASE(ctx);
+
+		ASN_DEBUG("Structure consumes %ld bytes, buffer %ld",
+			(long)ctx->left, (long)size);
+
+		/* Fall through */
+	case 1:
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		ASN_DEBUG("In %s CHOICE tag length %d", td->name, (int)tag_len);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+		do {
+			const asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key;
+
+			key.el_tag = tlv_tag;
+			t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+					specs->tag2el, specs->tag2el_count,
+					sizeof(specs->tag2el[0]), _search4tag);
+			if(t2m) {
+				/*
+				 * Found the element corresponding to the tag.
+				 */
+				NEXT_PHASE(ctx);
+				ctx->step = t2m->el_no;
+				break;
+			} else if(specs->ext_start == -1) {
+				ASN_DEBUG("Unexpected tag %s "
+					"in non-extensible CHOICE %s",
+					ber_tlv_tag_string(tlv_tag), td->name);
+				RETURN(RC_FAIL);
+			} else {
+				/* Skip this tag */
+				ssize_t skip;
+
+				ASN_DEBUG("Skipping unknown tag %s",
+					ber_tlv_tag_string(tlv_tag));
+
+				skip = ber_skip_length(opt_codec_ctx,
+					BER_TLV_CONSTRUCTED(ptr),
+					(const char *)ptr + tag_len,
+					LEFT - tag_len);
+
+				switch(skip) {
+				case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+					/* Fall through */
+				case -1: RETURN(RC_FAIL);
+				}
+
+				ADVANCE(skip + tag_len);
+				RETURN(RC_OK);
+			}
+		} while(0);
+
+	case 2:
+		/*
+		 * PHASE 2.
+		 * Read in the element.
+		 */
+	    do {
+		asn_TYPE_member_t *elm;/* CHOICE's element */
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+
+		elm = &elements[ctx->step];
+
+		/*
+		 * Compute the position of the member inside a structure,
+		 * and also a type of containment (it may be contained
+		 * as pointer or using inline inclusion).
+		 */
+		if(elm->flags & ATF_POINTER) {
+			/* Member is a pointer to another structure */
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			/*
+			 * A pointer to a pointer
+			 * holding the start of the structure
+			 */
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+		/* Set presence to be able to free it properly at any time */
+		_set_present_idx(st, specs->pres_offset,
+				specs->pres_size, ctx->step + 1);
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		rval = elm->type->op->ber_decoder(opt_codec_ctx, elm->type,
+				memb_ptr2, ptr, LEFT, elm->tag_mode);
+		switch(rval.code) {
+		case RC_OK:
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			RETURN(RC_FAIL);
+		case RC_FAIL: /* Fatal error */
+			RETURN(rval.code);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  } while(0);
+
+		NEXT_PHASE(ctx);
+
+		/* Fall through */
+	case 3:
+		ASN_DEBUG("CHOICE %s Leftover: %ld, size = %ld, tm=%d, tc=%d",
+			td->name, (long)ctx->left, (long)size,
+			tag_mode, td->tags_count);
+
+		if(ctx->left > 0) {
+			/*
+			 * The type must be fully decoded
+			 * by the CHOICE member-specific decoder.
+			 */
+			RETURN(RC_FAIL);
+		}
+
+		if(ctx->left == -1
+		&& !(tag_mode || td->tags_count)) {
+			/*
+			 * This is an untagged CHOICE.
+			 * It doesn't contain nothing
+			 * except for the member itself, including all its tags.
+			 * The decoding is completed.
+			 */
+			NEXT_PHASE(ctx);
+			break;
+		}
+
+		/*
+		 * Read in the "end of data chunks"'s.
+		 */
+		while(ctx->left < 0) {
+			ssize_t tl;
+
+			tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+			switch(tl) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			/*
+			 * Expected <0><0>...
+			 */
+			if(((const uint8_t *)ptr)[0] == 0) {
+				if(LEFT < 2) {
+					if(SIZE_VIOLATION)
+						RETURN(RC_FAIL);
+					else
+						RETURN(RC_WMORE);
+				} else if(((const uint8_t *)ptr)[1] == 0) {
+					/*
+					 * Correctly finished with <0><0>.
+					 */
+					ADVANCE(2);
+					ctx->left++;
+					continue;
+				}
+			} else {
+				ASN_DEBUG("Unexpected continuation in %s",
+					td->name);
+				RETURN(RC_FAIL);
+			}
+
+			/* UNREACHABLE */
+		}
+
+		NEXT_PHASE(ctx);
+	case 4:
+		/* No meaningful work here */
+		break;
+	}
+	
+	RETURN(RC_OK);
+}
+
+asn_enc_rval_t
+CHOICE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elm;	/* CHOICE element */
+	asn_enc_rval_t erval = {0,0,0};
+	const void *memb_ptr;
+	size_t computed_size = 0;
+	unsigned present;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("%s %s as CHOICE",
+		cb?"Encoding":"Estimating", td->name);
+
+	present = _fetch_present_idx(sptr,
+		specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present == 0 || present > td->elements_count) {
+		if(present == 0 && td->elements_count == 0) {
+			/* The CHOICE is empty?! */
+			erval.encoded = 0;
+			ASN__ENCODED_OK(erval);
+		}
+		ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Seek over the present member of the structure.
+	 */
+	elm = &td->elements[present-1];
+	if(elm->flags & ATF_POINTER) {
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(memb_ptr == 0) {
+			if(elm->optional) {
+				erval.encoded = 0;
+				ASN__ENCODED_OK(erval);
+			}
+			/* Mandatory element absent */
+			ASN__ENCODE_FAILED;
+		}
+	} else {
+        memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+    }
+
+	/*
+	 * If the CHOICE itself is tagged EXPLICIT:
+	 * T ::= [2] EXPLICIT CHOICE { ... }
+	 * Then emit the appropriate tags.
+	 */
+	if(tag_mode == 1 || td->tags_count) {
+		/*
+		 * For this, we need to pre-compute the member.
+		 */
+		ssize_t ret;
+
+		/* Encode member with its tag */
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			elm->tag_mode, elm->tag, 0, 0);
+		if(erval.encoded == -1)
+			return erval;
+
+		/* Encode CHOICE with parent or my own tag */
+		ret = der_write_tags(td, erval.encoded, tag_mode, 1, tag,
+			cb, app_key);
+		if(ret == -1)
+			ASN__ENCODE_FAILED;
+		computed_size += ret;
+	}
+
+	/*
+	 * Encode the single underlying member.
+	 */
+	erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+		elm->tag_mode, elm->tag, cb, app_key);
+	if(erval.encoded == -1)
+		return erval;
+
+	ASN_DEBUG("Encoded CHOICE member in %ld bytes (+%ld)",
+		(long)erval.encoded, (long)computed_size);
+
+	erval.encoded += computed_size;
+
+	return erval;
+}
+
+ber_tlv_tag_t
+CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	unsigned present;
+
+	assert(tag_mode == 0); (void)tag_mode;
+	assert(tag == 0); (void)tag;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size);
+
+	if(present > 0 && present <= td->elements_count) {
+		const asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)
+					((const char *)ptr + elm->memb_offset);
+		} else {
+			memb_ptr = (const void *)
+					((const char *)ptr + elm->memb_offset);
+		}
+
+		return asn_TYPE_outmost_tag(elm->type, memb_ptr,
+			elm->tag_mode, elm->tag);
+	} else {
+		return (ber_tlv_tag_t)-1;
+	}
+}
+
+int
+CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional)
+					return 0;
+				ASN__CTFAIL(app_key, td, sptr,
+					"%s: mandatory CHOICE element %s absent (%s:%d)",
+					td->name, elm->name, __FILE__, __LINE__);
+				return -1;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		if(elm->encoding_constraints.general_constraints) {
+			return elm->encoding_constraints.general_constraints(elm->type, memb_ptr,
+				ctfailcb, app_key);
+		} else {
+			return elm->type->encoding_constraints.general_constraints(elm->type,
+					memb_ptr, ctfailcb, app_key);
+		}
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: no CHOICE element given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+#undef	XER_ADVANCE
+#define	XER_ADVANCE(num_bytes)	do {			\
+		size_t num = num_bytes;			\
+		buf_ptr = (const void *)(((const char *)buf_ptr) + num); \
+		size -= num;				\
+		consumed_myself += num;			\
+	} while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const char *opt_mname, const void *buf_ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval;		/* Return value of a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* Element index */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	if(ctx->phase == 0 && !*xml_tag)
+		ctx->phase = 1;	/* Skip the outer tag checking phase */
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 * Phase 3: Only waiting for closing tag.
+	 * Phase 4: Skipping unknown extensions.
+	 * Phase 5: PHASED OUT
+	 */
+	for(edx = ctx->step; ctx->phase <= 4;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+		asn_TYPE_member_t *elm;
+
+		/*
+		 * Go inside the member.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval;
+			void *memb_ptr;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+			unsigned old_present;
+
+			elm = &td->elements[edx];
+
+			if(elm->flags & ATF_POINTER) {
+				/* Member is a pointer to another structure */
+				memb_ptr2 = (void **)((char *)st
+					+ elm->memb_offset);
+			} else {
+				memb_ptr = (char *)st + elm->memb_offset;
+				memb_ptr2 = &memb_ptr;
+			}
+
+			/* Start/Continue decoding the inner member */
+			tmprval = elm->type->op->xer_decoder(opt_codec_ctx,
+					elm->type, memb_ptr2, elm->name,
+					buf_ptr, size);
+			XER_ADVANCE(tmprval.consumed);
+			ASN_DEBUG("XER/CHOICE: itdf: [%s] code=%d",
+				elm->type->name, tmprval.code);
+			old_present = _fetch_present_idx(st,
+				specs->pres_offset, specs->pres_size);
+			assert(old_present == 0 || old_present == edx + 1);
+			/* Record what we've got */
+			_set_present_idx(st,
+				specs->pres_offset, specs->pres_size, edx + 1);
+			if(tmprval.code != RC_OK)
+				RETURN(tmprval.code);
+			ctx->phase = 3;
+			/* Fall through */
+		}
+
+		/* No need to wait for closing tag; special mode. */
+		if(ctx->phase == 3 && !*xml_tag) {
+			ctx->phase = 5;	/* Phase out */
+			RETURN(RC_OK);
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+			case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d",
+			ch_size>0?((const uint8_t *)buf_ptr)[0]:'?',
+			ch_size>1?((const uint8_t *)buf_ptr)[1]:'?',
+			ch_size>2?((const uint8_t *)buf_ptr)[2]:'?',
+			ch_size>3?((const uint8_t *)buf_ptr)[3]:'?',
+		xml_tag, tcv);
+
+		/* Skip the extensions section */
+		if(ctx->phase == 4) {
+			ASN_DEBUG("skip_unknown(%d, %ld)",
+				tcv, (long)ctx->left);
+			switch(xer_skip_unknown(tcv, &ctx->left)) {
+			case -1:
+				ctx->phase = 5;
+				RETURN(RC_FAIL);
+			case 1:
+				ctx->phase = 3;
+				/* Fall through */
+			case 0:
+				XER_ADVANCE(ch_size);
+				continue;
+			case 2:
+				ctx->phase = 3;
+				break;
+			}
+		}
+
+		switch(tcv) {
+		case XCT_BOTH:
+			break;	/* No CHOICE? */
+		case XCT_CLOSING:
+			if(ctx->phase != 3)
+				break;
+			XER_ADVANCE(ch_size);
+			ctx->phase = 5;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			if(ctx->phase != 1)
+				break;	/* Really unexpected */
+
+			/*
+			 * Search which inner member corresponds to this tag.
+			 */
+			for(edx = 0; edx < td->elements_count; edx++) {
+				elm = &td->elements[edx];
+				tcv = xer_check_tag(buf_ptr,ch_size,elm->name);
+				switch(tcv) {
+				case XCT_BOTH:
+				case XCT_OPENING:
+					/*
+					 * Process this member.
+					 */
+					ctx->step = edx;
+					ctx->phase = 2;
+					break;
+				case XCT_UNKNOWN_OP:
+				case XCT_UNKNOWN_BO:
+					continue;
+				default:
+					edx = td->elements_count;
+					break;	/* Phase out */
+				}
+				break;
+			}
+			if(edx != td->elements_count)
+				continue;
+
+			/* It is expected extension */
+			if(specs->ext_start != -1) {
+				ASN_DEBUG("Got anticipated extension");
+				/*
+				 * Check for (XCT_BOTH or XCT_UNKNOWN_BO)
+				 * By using a mask. Only record a pure
+				 * <opening> tags.
+				 */
+				if(tcv & XCT_CLOSING) {
+					/* Found </extension> without body */
+					ctx->phase = 3; /* Terminating */
+				} else {
+					ctx->left = 1;
+					ctx->phase = 4; /* Skip ...'s */
+				}
+				XER_ADVANCE(ch_size);
+				continue;
+			}
+
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag [%c%c%c%c] in CHOICE [%s]"
+			" (ph=%d, tag=%s)",
+			ch_size>0?((const uint8_t *)buf_ptr)[0]:'?',
+			ch_size>1?((const uint8_t *)buf_ptr)[1]:'?',
+			ch_size>2?((const uint8_t *)buf_ptr)[2]:'?',
+			ch_size>3?((const uint8_t *)buf_ptr)[3]:'?',
+			td->name, ctx->phase, xml_tag);
+		break;
+	}
+
+	ctx->phase = 5;	/* Phase out, just in case */
+	RETURN(RC_FAIL);
+}
+
+
+asn_enc_rval_t
+CHOICE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                  enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+	const asn_CHOICE_specifics_t *specs =
+        	(const asn_CHOICE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	unsigned present = 0;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+
+	if(present == 0 || present > td->elements_count) {
+		ASN__ENCODE_FAILED;
+	}  else {
+		asn_enc_rval_t tmper = {0,0,0};
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr = NULL;
+		const char *mname = elm->name;
+		unsigned int mlen = strlen(mname);
+
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!memb_ptr) ASN__ENCODE_FAILED;
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+
+        er.encoded = 0;
+
+		if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel);
+		ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+		tmper = elm->type->op->xer_encoder(elm->type, memb_ptr,
+				ilevel + 1, flags, cb, app_key);
+		if(tmper.encoded == -1) return tmper;
+		er.encoded += tmper.encoded;
+
+		ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+	}
+
+	if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+asn_dec_rval_t
+CHOICE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_dec_rval_t rv;
+	const asn_per_constraint_t *ct;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	void *memb_ptr;
+	void **memb_ptr2;
+	void *st = *sptr;
+	int value;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints) ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted */
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		ASN_DEBUG("CHOICE %s got index %d in range %d",
+			td->name, value, ct->range_bits);
+		if(value > ct->upper_bound)
+			ASN__DECODE_FAILED;
+	} else {
+		if(specs->ext_start == -1)
+			ASN__DECODE_FAILED;
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->ext_start;
+		if((unsigned)value >= td->elements_count)
+			ASN__DECODE_FAILED;
+	}
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->from_canonical_order) {
+        ASN_DEBUG("CHOICE presence from wire %d", value);
+		value = specs->from_canonical_order[value];
+        ASN_DEBUG("CHOICE presence index effective %d", value);
+    }
+
+	/* Set presence to be able to free it later */
+	_set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
+
+	elm = &td->elements[value];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+	ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
+
+	if(ct && ct->range_bits >= 0) {
+		rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+			elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	} else {
+		rv = uper_open_type_get(opt_codec_ctx, elm->type,
+			elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	}
+
+	if(rv.code != RC_OK)
+		ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
+			elm->name, td->name, rv.code);
+	return rv;
+}
+
+asn_enc_rval_t
+CHOICE_encode_uper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	const asn_per_constraint_t *ct;
+	const void *memb_ptr;
+	unsigned present;
+	int present_enc;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Encoding %s as CHOICE", td->name);
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized properly, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present == 0 || present > td->elements_count)
+		ASN__ENCODE_FAILED;
+	else
+		present--;
+
+	ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
+
+    /* Adjust if canonical order is different from natural order */
+    if(specs->to_canonical_order)
+        present_enc = specs->to_canonical_order[present];
+    else
+        present_enc = present;
+
+    if(ct && ct->range_bits >= 0) {
+		if(present_enc < ct->lower_bound
+		|| present_enc > ct->upper_bound) {
+			if(ct->flags & APC_EXTENSIBLE) {
+                ASN_DEBUG(
+                    "CHOICE member %d (enc %d) is an extension (%ld..%ld)",
+                    present, present_enc, ct->lower_bound, ct->upper_bound);
+                if(per_put_few_bits(po, 1, 1))
+					ASN__ENCODE_FAILED;
+			} else {
+				ASN__ENCODE_FAILED;
+			}
+			ct = 0;
+		}
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+        ASN_DEBUG("CHOICE member %d (enc %d) is not an extension (%ld..%ld)",
+                  present, present_enc, ct->lower_bound, ct->upper_bound);
+        if(per_put_few_bits(po, 0, 1))
+			ASN__ENCODE_FAILED;
+    }
+
+
+	elm = &td->elements[present];
+    ASN_DEBUG("CHOICE member \"%s\" %d (as %d)", elm->name, present,
+              present_enc);
+    if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+	} else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(ct && ct->range_bits >= 0) {
+        if(per_put_few_bits(po, present_enc, ct->range_bits))
+            ASN__ENCODE_FAILED;
+
+        return elm->type->op->uper_encoder(
+            elm->type, elm->encoding_constraints.per_constraints, memb_ptr, po);
+    } else {
+        asn_enc_rval_t rval = {0,0,0};
+        if(specs->ext_start == -1) ASN__ENCODE_FAILED;
+        if(uper_put_nsnnwn(po, present_enc - specs->ext_start))
+            ASN__ENCODE_FAILED;
+        if(uper_open_type_put(elm->type,
+                              elm->encoding_constraints.per_constraints,
+                              memb_ptr, po))
+            ASN__ENCODE_FAILED;
+        rval.encoded = 0;
+        ASN__ENCODED_OK(rval);
+    }
+}
+
+asn_dec_rval_t
+CHOICE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_dec_rval_t rv;
+	const asn_per_constraint_t *ct;
+	const asn_per_constraint_t *ext_ct = NULL;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	void *memb_ptr;
+	void **memb_ptr2;
+	void *st = *sptr;
+	int value;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) {
+		  ext_ct = ct;
+		  ct = 0;	/* Not restricted */
+		}
+	}
+
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		ASN_DEBUG("CHOICE %s got index %d in range %d",
+		          td->name, value, ct->range_bits);
+		if(value > ct->upper_bound)
+			ASN__DECODE_FAILED;
+	} else {
+		if(specs->ext_start == -1)
+			ASN__DECODE_FAILED;
+		value = aper_get_nsnnwn(pd, ext_ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->ext_start;
+		if((unsigned)value >= td->elements_count)
+			ASN__DECODE_FAILED;
+	}
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->from_canonical_order)
+		value = specs->from_canonical_order[value];
+
+	/* Set presence to be able to free it later */
+	_set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
+
+	elm = &td->elements[value];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+	ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
+
+	if(ct && ct->range_bits >= 0) {
+		rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+		                                 elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	} else {
+		rv = aper_open_type_get(opt_codec_ctx, elm->type,
+		                        elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	}
+
+	if(rv.code != RC_OK)
+		ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
+		          elm->name, td->name, rv.code);
+	return rv;
+}
+
+asn_enc_rval_t
+CHOICE_encode_aper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   const void *sptr, asn_per_outp_t *po) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm; /* CHOICE's element */
+	const asn_per_constraint_t *ct = NULL;
+	const asn_per_constraint_t *ext_ct = NULL;
+	const void *memb_ptr;
+	unsigned present;
+	int present_enc;
+	
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Encoding %s as CHOICE using ALIGNED PER", td->name);
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = NULL;
+
+	present = _fetch_present_idx(sptr,
+	                             specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized properly, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present <= 0 || (unsigned)present > td->elements_count)
+		ASN__ENCODE_FAILED;
+	else
+		present--;
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->to_canonical_order)
+		present_enc = specs->to_canonical_order[present];
+	else
+	        present_enc = present;
+	
+	ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
+
+	if(ct && (ct->range_bits >= 0)) {
+	  // Value is not within the range of the primary values ?
+	  if(present < ct->lower_bound || present > ct->upper_bound) {
+	    if(ct->flags & APC_EXTENSIBLE) {
+	      ASN_DEBUG("CHOICE member %d (enc %d) is an extension (%ld..%ld)",
+			present, present_enc, ct->lower_bound, ct->upper_bound);
+	      // X691/23.5 Extension marker = 1 
+	      if(per_put_few_bits(po, 1, 1)) {
+		ASN__ENCODE_FAILED;
+	      }
+	    } else {
+	      ASN__ENCODE_FAILED;
+	    }
+	    // no more need of constraint.
+	    ext_ct = ct;
+	    ct = NULL;
+	  }
+	}
+	
+	if(ct && (ct->flags & APC_EXTENSIBLE)) {
+	  ASN_DEBUG("CHOICE member %d (enc %d) is not an extension (%ld..%ld)",
+		    present, present, ct->lower_bound, ct->upper_bound);
+	  // X691.23.5 Extension marker = 0
+	  if(per_put_few_bits(po, 0, 1)) {
+	    ASN__ENCODE_FAILED;
+	  }
+	}
+
+	elm = &td->elements[present];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr = *(const void *const *)((const char *)sptr + elm->memb_offset);
+		if(!memb_ptr) ASN__ENCODE_FAILED;
+	} else {
+		memb_ptr = (const char *)sptr + elm->memb_offset;
+	}
+
+	if(ct && (ct->range_bits >= 0)) {
+	        // By construction (ct != 0), the alternative value is a non extended one.
+	        // X691/23.7 X691/23.6 alternative value encoded as a range_bits bits value.
+		if(per_put_few_bits(po, present_enc, ct->range_bits))
+			ASN__ENCODE_FAILED;
+
+		return elm->type->op->aper_encoder(elm->type, elm->encoding_constraints.per_constraints,
+		                                   memb_ptr, po);
+	} else {
+		asn_enc_rval_t rval = {0,0,0};
+		if(specs->ext_start == -1)
+			ASN__ENCODE_FAILED;
+		// X691/23.8 normally encoded as a small non negative whole number
+		
+		if(ext_ct && aper_put_nsnnwn(po, ext_ct->range_bits, present_enc - specs->ext_start))
+			ASN__ENCODE_FAILED;
+		if(aper_open_type_put(elm->type, elm->encoding_constraints.per_constraints,
+		                      memb_ptr, po))
+			ASN__ENCODE_FAILED;
+		rval.encoded = 0;
+		ASN__ENCODED_OK(rval);
+	}
+}
+
+int
+CHOICE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+             asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	unsigned present;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+
+	/*
+	 * Print that element.
+	 */
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		/* Print member's name and stuff */
+		if(0) {
+			if(cb(elm->name, strlen(elm->name), app_key) < 0
+			|| cb(": ", 2, app_key) < 0)
+				return -1;
+		}
+
+		return elm->type->op->print_struct(elm->type, memb_ptr, ilevel,
+			cb, app_key);
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr,
+            enum asn_struct_free_method method) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+	if(!td || !ptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as CHOICE", td->name);
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size);
+
+	/*
+	 * Free that element.
+	 */
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
+			if(memb_ptr)
+				ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		} else {
+			memb_ptr = (void *)((char *)ptr + elm->memb_offset);
+			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
+		}
+	}
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(ptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(ptr, 0, specs->struct_size);
+        break;
+    }
+}
+
+
+/*
+ * The following functions functions offer protection against -fshort-enums,
+ * compatible with little- and big-endian machines.
+ * If assertion is triggered, either disable -fshort-enums, or add an entry
+ * here with the ->pres_size of your target stracture.
+ * Unless the target structure is packed, the ".present" member
+ * is guaranteed to be aligned properly. ASN.1 compiler itself does not
+ * produce packed code.
+ */
+static unsigned
+_fetch_present_idx(const void *struct_ptr, unsigned pres_offset,
+                   unsigned pres_size) {
+    const void *present_ptr;
+	unsigned present;
+
+	present_ptr = ((const char *)struct_ptr) + pres_offset;
+
+	switch(pres_size) {
+	case sizeof(int):	present = *(const unsigned int *)present_ptr; break;
+	case sizeof(short):	present = *(const unsigned short *)present_ptr; break;
+	case sizeof(char):	present = *(const unsigned char *)present_ptr; break;
+	default:
+		/* ANSI C mandates enum to be equivalent to integer */
+		assert(pres_size != sizeof(int));
+		return 0;	/* If not aborted, pass back safe value */
+	}
+
+	return present;
+}
+
+static void
+_set_present_idx(void *struct_ptr, unsigned pres_offset, unsigned pres_size,
+                 unsigned present) {
+    void *present_ptr;
+	present_ptr = ((char *)struct_ptr) + pres_offset;
+
+	switch(pres_size) {
+	case sizeof(int):	*(unsigned int *)present_ptr   = present; break;
+	case sizeof(short):	*(unsigned short *)present_ptr = present; break;
+	case sizeof(char):	*(unsigned char *)present_ptr  = present; break;
+	default:
+		/* ANSI C mandates enum to be equivalent to integer */
+		assert(pres_size != sizeof(int));
+	}
+}
+
+static const void *
+_get_member_ptr(const asn_TYPE_descriptor_t *td, const void *sptr,
+                asn_TYPE_member_t **elm_ptr, unsigned *present_out) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+    if(!sptr) {
+        *elm_ptr = NULL;
+        *present_out = 0;
+        return NULL;
+    }
+
+    /*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+    *present_out = present;
+
+    /*
+     * The presence index is intentionally 1-based to avoid
+     * treating zeroed structure as a valid one.
+     */
+	if(present > 0 && present <= td->elements_count) {
+        asn_TYPE_member_t *const elm = &td->elements[present - 1];
+        const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+        *elm_ptr = elm;
+        return memb_ptr;
+    } else {
+        *elm_ptr = NULL;
+        return NULL;
+    }
+
+}
+
+int
+CHOICE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) {
+    asn_TYPE_member_t *aelm;
+    asn_TYPE_member_t *belm;
+    unsigned apresent = 0;
+    unsigned bpresent = 0;
+    const void *amember = _get_member_ptr(td, aptr, &aelm, &apresent);
+    const void *bmember = _get_member_ptr(td, bptr, &belm, &bpresent);
+
+    if(amember && bmember) {
+        if(apresent == bpresent) {
+            assert(aelm == belm);
+            return aelm->type->op->compare_struct(aelm->type, amember, bmember);
+        } else if(apresent < bpresent) {
+            return -1;
+        } else {
+            return 1;
+        }
+    } else if(!amember) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+/*
+ * Return the 1-based choice variant presence index.
+ * Returns 0 in case of error.
+ */
+unsigned
+CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    return _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+}
+
+/*
+ * Sets or resets the 1-based choice variant presence index.
+ * In case a previous index is not zero, the currently selected structure
+ * member is freed and zeroed-out first.
+ * Returns 0 on success and -1 on error.
+ */
+int
+CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *sptr,
+                            unsigned present) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned old_present;
+
+    if(!sptr) {
+        return -1;
+    }
+
+    if(present > td->elements_count)
+        return -1;
+
+    old_present =
+        _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+    if(present == old_present)
+        return 0;
+
+    if(old_present != 0) {
+        assert(old_present <= td->elements_count);
+        ASN_STRUCT_RESET(*td, sptr);
+    }
+
+    _set_present_idx(sptr, specs->pres_offset, specs->pres_size, present);
+
+    return 0;
+}
+
+
+asn_random_fill_result_t
+CHOICE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constr,
+                   size_t max_length) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_random_fill_result_t res;
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    const asn_TYPE_member_t *elm;
+    unsigned present;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *st = *sptr;
+
+    if(max_length == 0) return result_skipped;
+
+    (void)constr;
+
+    if(st == NULL) {
+        st = CALLOC(1, specs->struct_size);
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    present = asn_random_between(1, td->elements_count);
+    elm = &td->elements[present - 1];
+
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+
+    res = elm->type->op->random_fill(elm->type, memb_ptr2,
+                                    &elm->encoding_constraints, max_length);
+    _set_present_idx(st, specs->pres_offset, specs->pres_size, present);
+    if(res.code == ARFILL_OK) {
+        *sptr = st;
+    } else {
+        if(st == *sptr) {
+            ASN_STRUCT_RESET(*td, st);
+        } else {
+            ASN_STRUCT_FREE(*td, st);
+        }
+    }
+
+    return res;
+}
+
+
+asn_TYPE_operation_t asn_OP_CHOICE = {
+	CHOICE_free,
+	CHOICE_print,
+	CHOICE_compare,
+	CHOICE_decode_ber,
+	CHOICE_encode_der,
+	CHOICE_decode_xer,
+	CHOICE_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	CHOICE_decode_oer,
+	CHOICE_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	CHOICE_decode_uper,
+	CHOICE_encode_uper,
+	CHOICE_decode_aper,
+	CHOICE_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	CHOICE_random_fill,
+	CHOICE_outmost_tag
+};
diff --git a/e2ap/lib/constr_CHOICE_oer.c b/e2ap/lib/constr_CHOICE_oer.c
new file mode 100644
index 0000000..a4c591c
--- /dev/null
+++ b/e2ap/lib/constr_CHOICE_oer.c
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_CHOICE.h>
+#include <errno.h>
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)                    \
+    do {                                 \
+        asn_dec_rval_t rval;             \
+        rval.code = _code;               \
+        rval.consumed = consumed_myself; \
+        return rval;                     \
+    } while(0)
+
+#undef  ADVANCE
+#define ADVANCE(num_bytes)               \
+    do {                                 \
+        size_t num = num_bytes;          \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+#undef  SET_PHASE
+#define SET_PHASE(ctx, value) \
+    do {                      \
+        ctx->phase = value;   \
+        ctx->step = 0;        \
+    } while(0)
+
+/*
+ * Tags are canonically sorted in the tag to member table.
+ */
+static int
+_search4tag(const void *ap, const void *bp) {
+    const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+    const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+    int a_class = BER_TAG_CLASS(a->el_tag);
+    int b_class = BER_TAG_CLASS(b->el_tag);
+
+    if(a_class == b_class) {
+        ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+        ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+        if(a_value == b_value)
+            return 0;
+        else if(a_value < b_value)
+            return -1;
+        else
+            return 1;
+    } else if(a_class < b_class) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+/*
+ * X.696 (08/2015) #8.7 Encoding of tags
+ */
+static ssize_t
+oer_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
+    ber_tlv_tag_t val;
+    ber_tlv_tag_t tclass;
+    size_t skipped;
+
+    if(size == 0)
+        return 0;
+
+    val = *(const uint8_t *)ptr;
+    tclass = (val >> 6);
+    if((val & 0x3F) != 0x3F) {
+        /* #8.7.1 */
+        *tag_r = ((val & 0x3F) << 2) | tclass;
+        return 1;
+    }
+
+    /*
+     * Each octet contains 7 bits of useful information.
+     * The MSB is 0 if it is the last octet of the tag.
+     */
+    for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; skipped <= size;
+        ptr = ((const char *)ptr) + 1, skipped++) {
+        unsigned int oct = *(const uint8_t *)ptr;
+        if(oct & 0x80) {
+            val = (val << 7) | (oct & 0x7F);
+            /*
+             * Make sure there are at least 9 bits spare
+             * at the MS side of a value.
+             */
+            if(val >> ((8 * sizeof(val)) - 9)) {
+                /*
+                 * We would not be able to accomodate
+                 * any more tag bits.
+                 */
+                return -1;
+            }
+        } else {
+            val = (val << 7) | oct;
+            *tag_r = (val << 2) | tclass;
+            return skipped;
+        }
+    }
+
+    return 0; /* Want more */
+}
+
+asn_dec_rval_t
+CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *ptr, size_t size) {
+    /*
+     * Bring closer parts of structure description.
+     */
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_TYPE_member_t *elements = td->elements;
+
+    /*
+     * Parts of the structure being constructed.
+     */
+    void *st = *struct_ptr; /* Target structure. */
+    asn_struct_ctx_t *ctx;  /* Decoder context */
+
+    ssize_t consumed_myself = 0; /* Consumed bytes from ptr */
+
+    (void)constraints;
+
+    ASN_DEBUG("Decoding %s as CHOICE", td->name);
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Discover the tag.
+         */
+        ber_tlv_tag_t tlv_tag; /* T from TLV */
+        ssize_t tag_len;       /* Length of TLV's T */
+
+        tag_len = oer_fetch_tag(ptr, size, &tlv_tag);
+        switch(tag_len) {
+        case 0:
+            ASN__DECODE_STARVED;
+        case -1:
+            ASN__DECODE_FAILED;
+        }
+
+        do {
+            const asn_TYPE_tag2member_t *t2m;
+            asn_TYPE_tag2member_t key = {0, 0, 0, 0};
+            key.el_tag = tlv_tag;
+
+            t2m = (const asn_TYPE_tag2member_t *)bsearch(
+                &key, specs->tag2el, specs->tag2el_count,
+                sizeof(specs->tag2el[0]), _search4tag);
+            if(t2m) {
+                /*
+                 * Found the element corresponding to the tag.
+                 */
+                NEXT_PHASE(ctx);
+                ctx->step = t2m->el_no;
+                break;
+            } else if(specs->ext_start == -1) {
+                ASN_DEBUG(
+                    "Unexpected tag %s "
+                    "in non-extensible CHOICE %s",
+                    ber_tlv_tag_string(tlv_tag), td->name);
+                RETURN(RC_FAIL);
+            } else {
+                /* Skip open type extension */
+                ASN_DEBUG(
+                    "Not implemented skipping open type extension for tag %s",
+                    ber_tlv_tag_string(tlv_tag));
+                RETURN(RC_FAIL);
+            }
+        } while(0);
+
+
+        ADVANCE(tag_len);
+    }
+        /* Fall through */
+    case 1: {
+        asn_TYPE_member_t *elm = &elements[ctx->step]; /* CHOICE's element */
+        void *memb_ptr;         /* Pointer to the member */
+        void **memb_ptr2;       /* Pointer to that pointer */
+        asn_dec_rval_t rval = {0,0};
+
+        /*
+         * Compute the position of the member inside a structure,
+         * and also a type of containment (it may be contained
+         * as pointer or using inline inclusion).
+         */
+        if(elm->flags & ATF_POINTER) {
+            /* Member is a pointer to another structure */
+            memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+        } else {
+            /*
+             * A pointer to a pointer
+             * holding the start of the structure
+             */
+            memb_ptr = (char *)st + elm->memb_offset;
+            memb_ptr2 = &memb_ptr;
+        }
+
+        /* Set presence to be able to free it properly at any time */
+        (void)CHOICE_variant_set_presence(td, st, ctx->step + 1);
+
+        if(specs->ext_start >= 0 && specs->ext_start <= ctx->step) {
+            ssize_t got =
+                oer_open_type_get(opt_codec_ctx, elm->type,
+                                  elm->encoding_constraints.oer_constraints,
+                                  memb_ptr2, ptr, size);
+            if(got < 0) ASN__DECODE_FAILED;
+            if(got == 0) ASN__DECODE_STARVED;
+            rval.code = RC_OK;
+            rval.consumed = got;
+        } else {
+            rval = elm->type->op->oer_decoder(
+                opt_codec_ctx, elm->type,
+                elm->encoding_constraints.oer_constraints, memb_ptr2, ptr,
+                size);
+        }
+        rval.consumed += consumed_myself;
+        switch(rval.code) {
+        case RC_OK:
+            NEXT_PHASE(ctx);
+        case RC_WMORE:
+            break;
+        case RC_FAIL:
+            SET_PHASE(ctx, 3);  /* => 3 */
+        }
+        return rval;
+    }
+    case 2:
+        /* Already decoded everything */
+        RETURN(RC_OK);
+    case 3:
+        /* Failed to decode, after all */
+        RETURN(RC_FAIL);
+    }
+
+    RETURN(RC_FAIL);
+}
+
+/*
+ * X.696 (08/2015) #8.7 Encoding of tags
+ */
+static ssize_t
+oer_put_tag(ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
+    uint8_t tclass = BER_TAG_CLASS(tag);
+    ber_tlv_tag_t tval = BER_TAG_VALUE(tag);
+
+    if(tval < 0x3F) {
+        uint8_t b = (uint8_t)((tclass << 6) | tval);
+        if(cb(&b, 1, app_key) < 0) {
+            return -1;
+        }
+        return 1;
+    } else {
+        uint8_t buf[1 + 2 * sizeof(tval)];
+        uint8_t *b = &buf[sizeof(buf)-1]; /* Last addressable */
+        size_t encoded;
+        for(; ; tval >>= 7) {
+            if(tval >> 7) {
+                *b-- = 0x80 | (tval & 0x7f);
+            } else {
+                *b-- = tval & 0x7f;
+                break;
+            }
+        }
+        *b = (uint8_t)((tclass << 6) | 0x3F);
+        encoded = sizeof(buf) - (b - buf);
+        if(cb(b, encoded, app_key) < 0) {
+            return -1;
+        }
+        return encoded;
+    }
+
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+CHOICE_encode_oer(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_TYPE_member_t *elm; /* CHOICE element */
+    unsigned present;
+    const void *memb_ptr;
+    ber_tlv_tag_t tag;
+    ssize_t tag_len;
+    asn_enc_rval_t er = {0, 0, 0};
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("OER %s encoding as CHOICE", td->name);
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN_DEBUG("CHOICE %s member is not selected", td->name);
+        ASN__ENCODE_FAILED;
+    }
+
+    elm = &td->elements[present-1];
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(memb_ptr == 0) {
+            /* Mandatory element absent */
+            ASN__ENCODE_FAILED;
+        }
+    } else {
+        memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+    }
+
+    tag = asn_TYPE_outmost_tag(elm->type, memb_ptr, elm->tag_mode, elm->tag);
+    if(tag == 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    tag_len = oer_put_tag(tag, cb, app_key);
+    if(tag_len < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    if(specs->ext_start >= 0 && (unsigned)specs->ext_start <= (present-1)) {
+        ssize_t encoded = oer_open_type_put(elm->type,
+                               elm->encoding_constraints.oer_constraints,
+                               memb_ptr, cb, app_key);
+        if(encoded < 0) ASN__ENCODE_FAILED;
+        er.encoded = tag_len + encoded;
+    } else {
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded >= 0) er.encoded += tag_len;
+    }
+
+    return er;
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/constr_SEQUENCE.c b/e2ap/lib/constr_SEQUENCE.c
new file mode 100644
index 0000000..43dcac7
--- /dev/null
+++ b/e2ap/lib/constr_SEQUENCE.c
@@ -0,0 +1,2059 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SEQUENCE.h>
+#include <OPEN_TYPE.h>
+#include <per_opentype.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num; \
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#undef	PHASE_OUT
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+#define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * Check whether we are inside the extensions group.
+ */
+#define IN_EXTENSION_GROUP(specs, memb_idx) \
+    ((specs)->first_extension >= 0          \
+     && (unsigned)(specs)->first_extension <= (memb_idx))
+
+/*
+ * Tags are canonically sorted in the tag2element map.
+ */
+static int
+_t2e_cmp(const void *ap, const void *bp) {
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+	int a_class = BER_TAG_CLASS(a->el_tag);
+	int b_class = BER_TAG_CLASS(b->el_tag);
+
+	if(a_class == b_class) {
+		ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+		ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+		if(a_value == b_value) {
+			if(a->el_no > b->el_no)
+				return 1;
+			/*
+			 * Important: we do not check
+			 * for a->el_no <= b->el_no!
+			 */
+			return 0;
+		} else if(a_value < b_value)
+			return -1;
+		else
+			return 1;
+	} else if(a_class < b_class) {
+		return -1;
+	} else {
+		return 1;
+	}
+}
+
+
+/*
+ * The decoder of the SEQUENCE type.
+ */
+asn_dec_rval_t
+SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                    const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elements = td->elements;
+
+    /*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* SEQUENCE element's index */
+
+	ASN_DEBUG("Decoding %s as SEQUENCE", td->name);
+	
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+			tag_mode, 1, &ctx->left, 0);
+		if(rval.code != RC_OK) {
+			ASN_DEBUG("%s tagging check failed: %d",
+				td->name, rval.code);
+			return rval;
+		}
+
+		if(ctx->left >= 0)
+			ctx->left += rval.consumed; /* ?Substracted below! */
+		ADVANCE(rval.consumed);
+
+		NEXT_PHASE(ctx);
+
+		ASN_DEBUG("Structure consumes %ld bytes, buffer %ld",
+			(long)ctx->left, (long)size);
+
+		/* Fall through */
+	case 1:
+		/*
+		 * PHASE 1.
+		 * From the place where we've left it previously,
+		 * try to decode the next member from the list of
+		 * this structure's elements.
+		 * (ctx->step) stores the member being processed
+		 * between invocations and the microphase {0,1} of parsing
+		 * that member:
+		 * 	step = (<member_number> * 2 + <microphase>).
+		 */
+	  for(edx = ((size_t)ctx->step >> 1); edx < td->elements_count;
+			edx++, ctx->step = (ctx->step & ~1) + 2) {
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+		ssize_t tag_len;	/* Length of TLV's T */
+		size_t opt_edx_end;	/* Next non-optional element */
+		size_t n;
+		int use_bsearch;
+
+		if(ctx->step & 1)
+			goto microphase2;
+
+		/*
+		 * MICROPHASE 1: Synchronize decoding.
+		 */
+		ASN_DEBUG("In %s SEQUENCE left %d, edx=%" ASN_PRI_SIZE " flags=%d"
+				" opt=%d ec=%d",
+			td->name, (int)ctx->left, edx,
+			elements[edx].flags, elements[edx].optional,
+			td->elements_count);
+
+        if(ctx->left == 0 /* No more stuff is expected */
+           && (
+                  /* Explicit OPTIONAL specification reaches the end */
+                  (edx + elements[edx].optional == td->elements_count) ||
+                  /* All extensions are optional */
+                  IN_EXTENSION_GROUP(specs, edx))) {
+            ASN_DEBUG("End of SEQUENCE %s", td->name);
+            /*
+             * Found the legitimate end of the structure.
+             */
+            PHASE_OUT(ctx);
+            RETURN(RC_OK);
+        }
+
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		ASN_DEBUG("Current tag in %s SEQUENCE for element %" ASN_PRI_SIZE " "
+			"(%s) is %s encoded in %d bytes, of frame %ld",
+			td->name, edx, elements[edx].name,
+			ber_tlv_tag_string(tlv_tag), (int)tag_len, (long)LEFT);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+        if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) {
+            if(LEFT < 2) {
+                if(SIZE_VIOLATION) {
+                    RETURN(RC_FAIL);
+                } else {
+                    RETURN(RC_WMORE);
+                }
+            } else if(((const uint8_t *)ptr)[1] == 0) {
+                ASN_DEBUG("edx = %" ASN_PRI_SIZE ", opt = %d, ec=%d", edx,
+                          elements[edx].optional, td->elements_count);
+                if((edx + elements[edx].optional == td->elements_count)
+                   || IN_EXTENSION_GROUP(specs, edx)) {
+                    /*
+                     * Yeah, baby! Found the terminator
+                     * of the indefinite length structure.
+                     */
+                    /*
+                     * Proceed to the canonical
+                     * finalization function.
+                     * No advancing is necessary.
+                     */
+                    goto phase3;
+                }
+            }
+        }
+
+		/*
+		 * Find the next available type with this tag.
+		 */
+		use_bsearch = 0;
+		opt_edx_end = edx + elements[edx].optional + 1;
+		if(opt_edx_end > td->elements_count)
+			opt_edx_end = td->elements_count;	/* Cap */
+		else if(opt_edx_end - edx > 8) {
+			/* Limit the scope of linear search... */
+			opt_edx_end = edx + 8;
+			use_bsearch = 1;
+			/* ... and resort to bsearch() */
+		}
+		for(n = edx; n < opt_edx_end; n++) {
+			if(BER_TAGS_EQUAL(tlv_tag, elements[n].tag)) {
+				/*
+				 * Found element corresponding to the tag
+				 * being looked at.
+				 * Reposition over the right element.
+				 */
+				edx = n;
+				ctx->step = 1 + 2 * edx;	/* Remember! */
+				goto microphase2;
+			} else if(elements[n].flags & ATF_ANY_TYPE) {
+				/*
+				 * This is the ANY type, which may bear
+				 * any flag whatsoever.
+				 */
+				edx = n;
+				ctx->step = 1 + 2 * edx;	/* Remember! */
+				goto microphase2;
+			} else if(elements[n].tag == (ber_tlv_tag_t)-1) {
+				use_bsearch = 1;
+				break;
+			}
+		}
+		if(use_bsearch) {
+			/*
+			 * Resort to a binary search over
+			 * sorted array of tags.
+			 */
+			const asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key = {0, 0, 0, 0};
+			key.el_tag = tlv_tag;
+			key.el_no = edx;
+			t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+				specs->tag2el, specs->tag2el_count,
+				sizeof(specs->tag2el[0]), _t2e_cmp);
+			if(t2m) {
+				const asn_TYPE_tag2member_t *best = 0;
+				const asn_TYPE_tag2member_t *t2m_f, *t2m_l;
+				size_t edx_max = edx + elements[edx].optional;
+				/*
+				 * Rewind to the first element with that tag,
+				 * `cause bsearch() does not guarantee order.
+				 */
+				t2m_f = t2m + t2m->toff_first;
+				t2m_l = t2m + t2m->toff_last;
+				for(t2m = t2m_f; t2m <= t2m_l; t2m++) {
+					if(t2m->el_no > edx_max) break;
+					if(t2m->el_no < edx) continue;
+					best = t2m;
+				}
+				if(best) {
+					edx = best->el_no;
+					ctx->step = 1 + 2 * edx;
+					goto microphase2;
+				}
+			}
+			n = opt_edx_end;
+		}
+		if(n == opt_edx_end) {
+			/*
+			 * If tag is unknown, it may be either
+			 * an unknown (thus, incorrect) tag,
+			 * or an extension (...),
+			 * or an end of the indefinite-length structure.
+			 */
+			if(!IN_EXTENSION_GROUP(specs,
+				edx + elements[edx].optional)) {
+				ASN_DEBUG("Unexpected tag %s (at %" ASN_PRI_SIZE ")",
+					ber_tlv_tag_string(tlv_tag), edx);
+				ASN_DEBUG("Expected tag %s (%s)%s",
+					ber_tlv_tag_string(elements[edx].tag),
+					elements[edx].name,
+					elements[edx].optional
+						?" or alternatives":"");
+				RETURN(RC_FAIL);
+			} else {
+				/* Skip this tag */
+				ssize_t skip;
+				edx += elements[edx].optional;
+
+				ASN_DEBUG("Skipping unexpected %s (at %" ASN_PRI_SIZE ")",
+					ber_tlv_tag_string(tlv_tag), edx);
+				skip = ber_skip_length(opt_codec_ctx,
+					BER_TLV_CONSTRUCTED(ptr),
+					(const char *)ptr + tag_len,
+					LEFT - tag_len);
+				ASN_DEBUG("Skip length %d in %s",
+					(int)skip, td->name);
+				switch(skip) {
+				case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+					/* Fall through */
+				case -1: RETURN(RC_FAIL);
+				}
+
+				ADVANCE(skip + tag_len);
+				ctx->step -= 2;
+				edx--;
+				continue;  /* Try again with the next tag */
+			}
+		}
+
+		/*
+		 * MICROPHASE 2: Invoke the member-specific decoder.
+		 */
+		ctx->step |= 1;		/* Confirm entering next microphase */
+	microphase2:
+		ASN_DEBUG("Inside SEQUENCE %s MF2", td->name);
+		
+		/*
+		 * Compute the position of the member inside a structure,
+		 * and also a type of containment (it may be contained
+		 * as pointer or using inline inclusion).
+		 */
+		if(elements[edx].flags & ATF_POINTER) {
+			/* Member is a pointer to another structure */
+			memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset);
+		} else {
+			/*
+			 * A pointer to a pointer
+			 * holding the start of the structure
+			 */
+			memb_ptr = (char *)st + elements[edx].memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		if(elements[edx].flags & ATF_OPEN_TYPE) {
+			rval = OPEN_TYPE_ber_get(opt_codec_ctx, td, st, &elements[edx], ptr, LEFT);
+        } else {
+			rval = elements[edx].type->op->ber_decoder(opt_codec_ctx,
+					elements[edx].type,
+					memb_ptr2, ptr, LEFT,
+					elements[edx].tag_mode);
+		}
+		ASN_DEBUG("In %s SEQUENCE decoded %" ASN_PRI_SIZE " %s of %d "
+			"in %d bytes rval.code %d, size=%d",
+			td->name, edx, elements[edx].type->name,
+			(int)LEFT, (int)rval.consumed, rval.code, (int)size);
+		switch(rval.code) {
+		case RC_OK:
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			ASN_DEBUG("Size violation (c->l=%ld <= s=%ld)",
+				(long)ctx->left, (long)size);
+			/* Fall through */
+		case RC_FAIL: /* Fatal error */
+			RETURN(RC_FAIL);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  }	/* for(all structure members) */
+
+	phase3:
+		ctx->phase = 3;
+        /* Fall through */
+	case 3:	/* 00 and other tags expected */
+	case 4:	/* only 00's expected */
+
+		ASN_DEBUG("SEQUENCE %s Leftover: %ld, size = %ld",
+			td->name, (long)ctx->left, (long)size);
+
+		/*
+		 * Skip everything until the end of the SEQUENCE.
+		 */
+		while(ctx->left) {
+			ssize_t tl, ll;
+
+			tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+			switch(tl) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			/*
+			 * If expected <0><0>...
+			 */
+			if(ctx->left < 0
+				&& ((const uint8_t *)ptr)[0] == 0) {
+				if(LEFT < 2) {
+					if(SIZE_VIOLATION)
+						RETURN(RC_FAIL);
+					else
+						RETURN(RC_WMORE);
+				} else if(((const uint8_t *)ptr)[1] == 0) {
+					/*
+					 * Correctly finished with <0><0>.
+					 */
+					ADVANCE(2);
+					ctx->left++;
+					ctx->phase = 4;
+					continue;
+				}
+			}
+
+			if(!IN_EXTENSION_GROUP(specs, td->elements_count)
+			|| ctx->phase == 4) {
+				ASN_DEBUG("Unexpected continuation "
+					"of a non-extensible type "
+					"%s (SEQUENCE): %s",
+					td->name,
+					ber_tlv_tag_string(tlv_tag));
+				RETURN(RC_FAIL);
+			}
+
+			ll = ber_skip_length(opt_codec_ctx,
+				BER_TLV_CONSTRUCTED(ptr),
+				(const char *)ptr + tl, LEFT - tl);
+			switch(ll) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			ADVANCE(tl + ll);
+		}
+
+		PHASE_OUT(ctx);
+	}
+	
+	RETURN(RC_OK);
+}
+
+
+/*
+ * The DER encoder of the SEQUENCE type.
+ */
+asn_enc_rval_t
+SEQUENCE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int tag_mode, ber_tlv_tag_t tag,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t computed_size = 0;
+	asn_enc_rval_t erval = {0,0,0};
+	ssize_t ret;
+	size_t edx;
+
+	ASN_DEBUG("%s %s as SEQUENCE",
+		cb?"Encoding":"Estimating", td->name);
+
+	/*
+	 * Gather the length of the underlying members sequence.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+
+		const void *memb_ptr;		/* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present",
+					elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+			continue;
+
+		erval = elm->type->op->der_encoder(elm->type, *memb_ptr2,
+			elm->tag_mode, elm->tag,
+			0, 0);
+		if(erval.encoded == -1)
+			return erval;
+		computed_size += erval.encoded;
+		ASN_DEBUG("Member %" ASN_PRI_SIZE " %s estimated %ld bytes",
+			edx, elm->name, (long)erval.encoded);
+	}
+
+	/*
+	 * Encode the TLV for the sequence itself.
+	 */
+	ret = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key);
+	ASN_DEBUG("Wrote tags: %ld (+%ld)", (long)ret, (long)computed_size);
+	if(ret == -1)
+		ASN__ENCODE_FAILED;
+	erval.encoded = computed_size + ret;
+
+	if(!cb) ASN__ENCODED_OK(erval);
+
+	/*
+	 * Encode all members.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		asn_enc_rval_t tmperval = {0,0,0};
+        const void *memb_ptr;           /* Pointer to the member */
+        const void *const *memb_ptr2;   /* Pointer to that pointer */
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) continue;
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+        if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+            continue;
+
+		tmperval = elm->type->op->der_encoder(elm->type, *memb_ptr2,
+			elm->tag_mode, elm->tag, cb, app_key);
+		if(tmperval.encoded == -1)
+			return tmperval;
+		computed_size -= tmperval.encoded;
+		ASN_DEBUG("Member %" ASN_PRI_SIZE " %s of SEQUENCE %s encoded in %ld bytes",
+			edx, elm->name, td->name, (long)tmperval.encoded);
+	}
+
+	if(computed_size != 0)
+		/*
+		 * Encoded size is not equal to the computed size.
+		 */
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(erval);
+}
+
+
+#undef	XER_ADVANCE
+#define XER_ADVANCE(num_bytes)           \
+    do {                                 \
+        size_t num = (num_bytes);        \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                    const char *opt_mname, const void *ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SEQUENCE_specifics_t *specs
+		= (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * ... and parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval;		/* Return value from a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* Element index */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 * Phase 3: Skipping unknown extensions.
+	 * Phase 4: PHASED OUT
+	 */
+	for(edx = ctx->step; ctx->phase <= 3;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+		asn_TYPE_member_t *elm;
+
+		/*
+		 * Go inside the inner member of a sequence.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval;
+			void *memb_ptr_dontuse;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+
+			elm = &td->elements[edx];
+
+			if(elm->flags & ATF_POINTER) {
+				/* Member is a pointer to another structure */
+				memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+			} else {
+				memb_ptr_dontuse = (char *)st + elm->memb_offset;
+				memb_ptr2 = &memb_ptr_dontuse;  /* Only use of memb_ptr_dontuse */
+			}
+
+			if(elm->flags & ATF_OPEN_TYPE) {
+				tmprval = OPEN_TYPE_xer_get(opt_codec_ctx, td, st, elm, ptr, size);
+			} else {
+				/* Invoke the inner type decoder, m.b. multiple times */
+				tmprval = elm->type->op->xer_decoder(opt_codec_ctx,
+						elm->type, memb_ptr2, elm->name,
+						ptr, size);
+			}
+			XER_ADVANCE(tmprval.consumed);
+			if(tmprval.code != RC_OK)
+				RETURN(tmprval.code);
+			ctx->phase = 1;	/* Back to body processing */
+			ctx->step = ++edx;
+			ASN_DEBUG("XER/SEQUENCE phase => %d, step => %d",
+				ctx->phase, ctx->step);
+			/* Fall through */
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, ptr, size,
+			&ch_type);
+		if(ch_size == -1) {
+		    RETURN(RC_FAIL);
+		} else {
+			switch(ch_type) {
+			case PXER_WMORE:
+				RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/SEQUENCE: tcv = %d, ph=%d [%s]",
+			tcv, ctx->phase, xml_tag);
+
+		/* Skip the extensions section */
+		if(ctx->phase == 3) {
+			switch(xer_skip_unknown(tcv, &ctx->left)) {
+			case -1:
+				ctx->phase = 4;
+				RETURN(RC_FAIL);
+			case 0:
+				XER_ADVANCE(ch_size);
+				continue;
+			case 1:
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;
+				continue;
+			case 2:
+				ctx->phase = 1;
+				break;
+			}
+		}
+
+		switch(tcv) {
+		case XCT_CLOSING:
+			if(ctx->phase == 0) break;
+			ctx->phase = 0;
+			/* Fall through */
+		case XCT_BOTH:
+            if(ctx->phase == 0) {
+                if(edx >= td->elements_count ||
+                   /* Explicit OPTIONAL specs reaches the end */
+                   (edx + elements[edx].optional == td->elements_count) ||
+                   /* All extensions are optional */
+                   IN_EXTENSION_GROUP(specs, edx)) {
+                    XER_ADVANCE(ch_size);
+					ctx->phase = 4;	/* Phase out */
+					RETURN(RC_OK);
+				} else {
+					ASN_DEBUG("Premature end of XER SEQUENCE");
+					RETURN(RC_FAIL);
+				}
+			}
+			/* Fall through */
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%" ASN_PRI_SIZE "",
+				tcv, ctx->phase, edx);
+			if(ctx->phase != 1) {
+				break;	/* Really unexpected */
+			}
+
+			if(edx < td->elements_count) {
+				/*
+				 * Search which member corresponds to this tag.
+				 */
+				size_t n;
+				size_t edx_end = edx + elements[edx].optional + 1;
+				if(edx_end > td->elements_count)
+					edx_end = td->elements_count;
+				for(n = edx; n < edx_end; n++) {
+					elm = &td->elements[n];
+					tcv = xer_check_tag(ptr, ch_size, elm->name);
+					switch(tcv) {
+					case XCT_BOTH:
+					case XCT_OPENING:
+						/*
+						 * Process this member.
+						 */
+						ctx->step = edx = n;
+						ctx->phase = 2;
+						break;
+					case XCT_UNKNOWN_OP:
+					case XCT_UNKNOWN_BO:
+						continue;
+					default:
+						n = edx_end;
+						break;	/* Phase out */
+					}
+					break;
+				}
+				if(n != edx_end)
+					continue;
+			} else {
+				ASN_DEBUG("Out of defined members: %" ASN_PRI_SIZE "/%u",
+					edx, td->elements_count);
+			}
+
+			/* It is expected extension */
+			if(IN_EXTENSION_GROUP(specs,
+				edx + (edx < td->elements_count
+					? elements[edx].optional : 0))) {
+				ASN_DEBUG("Got anticipated extension at %" ASN_PRI_SIZE "",
+					edx);
+				/*
+				 * Check for (XCT_BOTH or XCT_UNKNOWN_BO)
+				 * By using a mask. Only record a pure
+				 * <opening> tags.
+				 */
+				if(tcv & XCT_CLOSING) {
+					/* Found </extension> without body */
+				} else {
+					ctx->left = 1;
+					ctx->phase = 3;	/* Skip ...'s */
+				}
+				XER_ADVANCE(ch_size);
+				continue;
+			}
+
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag in SEQUENCE [%c%c%c%c%c%c]",
+			size>0?((const char *)ptr)[0]:'.',
+			size>1?((const char *)ptr)[1]:'.',
+			size>2?((const char *)ptr)[2]:'.',
+			size>3?((const char *)ptr)[3]:'.',
+			size>4?((const char *)ptr)[4]:'.',
+			size>5?((const char *)ptr)[5]:'.');
+		break;
+	}
+
+	ctx->phase = 4;	/* "Phase out" on hard failure */
+	RETURN(RC_FAIL);
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int ilevel, enum xer_encoder_flags_e flags,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    int xcan = (flags & XER_F_CANONICAL);
+    asn_TYPE_descriptor_t *tmp_def_val_td = 0;
+    void *tmp_def_val = 0;
+    size_t edx;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    er.encoded = 0;
+
+    for(edx = 0; edx < td->elements_count; edx++) {
+        asn_enc_rval_t tmper = {0,0,0};
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        const void *memb_ptr;
+        const char *mname = elm->name;
+        unsigned int mlen = strlen(mname);
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!memb_ptr) {
+                assert(tmp_def_val == 0);
+                if(elm->default_value_set) {
+                    if(elm->default_value_set(&tmp_def_val)) {
+                        ASN__ENCODE_FAILED;
+                    } else {
+                        memb_ptr = tmp_def_val;
+                        tmp_def_val_td = elm->type;
+                    }
+                } else if(elm->optional) {
+                    continue;
+                } else {
+                    /* Mandatory element is missing */
+                    ASN__ENCODE_FAILED;
+                }
+            }
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+
+        if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+        ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+        /* Print the member itself */
+        tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1,
+                                           flags, cb, app_key);
+        if(tmp_def_val) {
+            ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val);
+            tmp_def_val = 0;
+        }
+        if(tmper.encoded == -1) return tmper;
+        er.encoded += tmper.encoded;
+
+        ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+    }
+
+    if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+    ASN__ENCODED_OK(er);
+cb_failed:
+    if(tmp_def_val) ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val);
+    ASN__ENCODE_FAILED;
+}
+
+int
+SEQUENCE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+               asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t edx;
+	int ret;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/* Dump preamble */
+	if(cb(td->name, strlen(td->name), app_key) < 0
+	|| cb(" ::= {", 6, app_key) < 0)
+		return -1;
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional) continue;
+				/* Print <absent> line */
+				/* Fall through */
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		/* Indentation */
+		_i_INDENT(1);
+
+		/* Print the member's name and stuff */
+		if(cb(elm->name, strlen(elm->name), app_key) < 0
+		|| cb(": ", 2, app_key) < 0)
+			return -1;
+
+		/* Print the member itself */
+		ret = elm->type->op->print_struct(elm->type, memb_ptr, ilevel + 1,
+			cb, app_key);
+		if(ret) return ret;
+	}
+
+	ilevel--;
+	_i_INDENT(1);
+
+	return (cb("}", 1, app_key) < 0) ? -1 : 0;
+}
+
+void
+SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
+              enum asn_struct_free_method method) {
+    size_t edx;
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_struct_ctx_t *ctx; /* Decoder context */
+
+	if(!td || !sptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as SEQUENCE", td->name);
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
+			if(memb_ptr)
+				ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		} else {
+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
+			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
+		}
+	}
+
+	/* Clean parsing context */
+	ctx = (asn_struct_ctx_t *)((char *)sptr + specs->ctx_offset);
+	FREEMEM(ctx->ptr);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(
+            sptr, 0,
+            ((const asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size);
+        break;
+    }
+}
+
+int
+SEQUENCE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    size_t edx;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	/*
+	 * Iterate over structure members and check their validity.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional)
+					continue;
+				ASN__CTFAIL(app_key, td, sptr,
+				"%s: mandatory element %s absent (%s:%d)",
+				td->name, elm->name, __FILE__, __LINE__);
+				return -1;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		if(elm->encoding_constraints.general_constraints) {
+			int ret = elm->encoding_constraints.general_constraints(elm->type, memb_ptr,
+				ctfailcb, app_key);
+			if(ret) return ret;
+		} else {
+			return elm->type->encoding_constraints.general_constraints(elm->type,
+				memb_ptr, ctfailcb, app_key);
+		}
+	}
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, void **sptr,
+                     asn_per_data_t *pd) {
+    const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	void *st = *sptr;	/* Target structure. */
+	int extpresent;		/* Extension additions are present */
+	uint8_t *opres;		/* Presence of optional root members */
+	asn_per_data_t opmd;
+	asn_dec_rval_t rv;
+	size_t edx;
+
+	(void)constraints;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as SEQUENCE (UPER)", td->name);
+
+	/* Handle extensions */
+	if(specs->first_extension < 0) {
+		extpresent = 0;
+	} else {
+		extpresent = per_get_few_bits(pd, 1);
+		if(extpresent < 0) ASN__DECODE_STARVED;
+	}
+
+	/* Prepare a place and read-in the presence bitmap */
+	memset(&opmd, 0, sizeof(opmd));
+	if(specs->roms_count) {
+		opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
+		if(!opres) ASN__DECODE_FAILED;
+		/* Get the presence map */
+		if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
+			FREEMEM(opres);
+			ASN__DECODE_STARVED;
+		}
+		opmd.buffer = opres;
+		opmd.nbits = specs->roms_count;
+		ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
+			td->name, specs->roms_count, *opres);
+	} else {
+		opres = 0;
+	}
+
+	/*
+	 * Get the sequence ROOT elements.
+	 */
+    for(edx = 0;
+        edx < (specs->first_extension < 0 ? td->elements_count
+                                          : (size_t)specs->first_extension);
+        edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+
+		assert(!IN_EXTENSION_GROUP(specs, edx));
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+
+		/* Deal with optionality */
+		if(elm->optional) {
+			int present = per_get_few_bits(&opmd, 1);
+			ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
+				td->name, elm->name, present,
+				(int)opmd.nboff, (int)opmd.nbits);
+			if(present == 0) {
+				/* This element is not present */
+				if(elm->default_value_set) {
+					/* Fill-in DEFAULT */
+					if(elm->default_value_set(memb_ptr2)) {
+						FREEMEM(opres);
+						ASN__DECODE_FAILED;
+					}
+					ASN_DEBUG("Filled-in default");
+				}
+				/* The member is just not present */
+				continue;
+			}
+			/* Fall through */
+		}
+
+		/* Fetch the member from the stream */
+		ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
+
+		if(elm->flags & ATF_OPEN_TYPE) {
+			rv = OPEN_TYPE_uper_get(opt_codec_ctx, td, st, elm, pd);
+		} else {
+			rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+					elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+		}
+		if(rv.code != RC_OK) {
+			ASN_DEBUG("Failed decode %s in %s",
+				elm->name, td->name);
+			FREEMEM(opres);
+			return rv;
+		}
+	}
+
+	/* Optionality map is not needed anymore */
+	FREEMEM(opres);
+
+	/*
+	 * Deal with extensions.
+	 */
+	if(extpresent) {
+		ssize_t bmlength;
+		uint8_t *epres;		/* Presence of extension members */
+		asn_per_data_t epmd;
+
+		bmlength = uper_get_nslength(pd);
+		if(bmlength < 0) ASN__DECODE_STARVED;
+
+		ASN_DEBUG("Extensions %" ASN_PRI_SSIZE " present in %s", bmlength, td->name);
+
+		epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
+		if(!epres) ASN__DECODE_STARVED;
+
+		/* Get the extensions map */
+		if(per_get_many_bits(pd, epres, 0, bmlength)) {
+			FREEMEM(epres);
+			ASN__DECODE_STARVED;
+		}
+
+		memset(&epmd, 0, sizeof(epmd));
+		epmd.buffer = epres;
+		epmd.nbits = bmlength;
+		ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
+			td->name, (long)bmlength, *epres);
+
+	    /* Go over extensions and read them in */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            void *memb_ptr;   /* Pointer to the member */
+            void **memb_ptr2; /* Pointer to that pointer */
+            int present;
+
+            /* Fetch the pointer to this member */
+            if(elm->flags & ATF_POINTER) {
+                memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+            } else {
+                memb_ptr = (void *)((char *)st + elm->memb_offset);
+                memb_ptr2 = &memb_ptr;
+            }
+
+            present = per_get_few_bits(&epmd, 1);
+            if(present <= 0) {
+                if(present < 0) break; /* No more extensions */
+                continue;
+            }
+
+            ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name,
+                      *memb_ptr2);
+            rv = uper_open_type_get(opt_codec_ctx, elm->type,
+                                    elm->encoding_constraints.per_constraints,
+                                    memb_ptr2, pd);
+            if(rv.code != RC_OK) {
+                FREEMEM(epres);
+                return rv;
+            }
+	    }
+
+		/* Skip over overflow extensions which aren't present
+		 * in this system's version of the protocol */
+		for(;;) {
+			ASN_DEBUG("Getting overflow extensions");
+			switch(per_get_few_bits(&epmd, 1)) {
+			case -1: break;
+			case 0: continue;
+			default:
+				if(uper_open_type_skip(opt_codec_ctx, pd)) {
+					FREEMEM(epres);
+					ASN__DECODE_STARVED;
+				}
+                ASN_DEBUG("Skipped overflow extension");
+                continue;
+			}
+			break;
+		}
+
+		FREEMEM(epres);
+	}
+
+    if(specs->first_extension >= 0) {
+        unsigned i;
+        /* Fill DEFAULT members in extensions */
+        for(i = specs->roms_count; i < specs->roms_count + specs->aoms_count;
+            i++) {
+            asn_TYPE_member_t *elm;
+            void **memb_ptr2; /* Pointer to member pointer */
+
+            edx = specs->oms[i];
+            elm = &td->elements[edx];
+
+            if(!elm->default_value_set) continue;
+
+            /* Fetch the pointer to this member */
+            if(elm->flags & ATF_POINTER) {
+                memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+                if(*memb_ptr2) continue;
+            } else {
+                continue; /* Extensions are all optionals */
+            }
+
+            /* Set default value */
+            if(elm->default_value_set(memb_ptr2)) {
+                ASN__DECODE_FAILED;
+            }
+        }
+    }
+
+	rv.consumed = 0;
+	rv.code = RC_OK;
+	return rv;
+}
+
+static int
+SEQUENCE__handle_extensions(const asn_TYPE_descriptor_t *td, const void *sptr,
+                            asn_per_outp_t *po1, asn_per_outp_t *po2) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    int exts_present = 0;
+    int exts_count = 0;
+    size_t edx;
+
+    if(specs->first_extension < 0) {
+        return 0;
+    }
+
+    /* Find out which extensions are present */
+    for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        const void *memb_ptr;         /* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+        int present;
+
+        /* Fetch the pointer to this member */
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            present = (*memb_ptr2 != 0);
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+        ASN_DEBUG("checking %s:%s (@%" ASN_PRI_SIZE ") present => %d", elm->name,
+                  elm->type->name, edx, present);
+        exts_count++;
+        exts_present += present;
+
+        /* Encode as presence marker */
+        if(po1 && per_put_few_bits(po1, present, 1)) {
+            return -1;
+        }
+        /* Encode as open type field */
+        if(po2 && present
+           && uper_open_type_put(elm->type,
+                                 elm->encoding_constraints.per_constraints,
+                                 *memb_ptr2, po2))
+            return -1;
+    }
+
+    return exts_present ? exts_count : 0;
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_uper(const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, const void *sptr,
+                     asn_per_outp_t *po) {
+    const asn_SEQUENCE_specifics_t *specs
+		= (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	int n_extensions;
+	size_t edx;
+	size_t i;
+
+	(void)constraints;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE (UPER)", td->name);
+
+	/*
+	 * X.691#18.1 Whether structure is extensible
+	 * and whether to encode extensions
+	 */
+    if(specs->first_extension < 0) {
+        n_extensions = 0; /* There are no extensions to encode */
+    } else {
+        n_extensions = SEQUENCE__handle_extensions(td, sptr, 0, 0);
+        if(n_extensions < 0) ASN__ENCODE_FAILED;
+        if(per_put_few_bits(po, n_extensions ? 1 : 0, 1)) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+	/* Encode a presence bitmap */
+	for(i = 0; i < specs->roms_count; i++) {
+		asn_TYPE_member_t *elm;
+		const void *memb_ptr;		/* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+        int present;
+
+		edx = specs->oms[i];
+		elm = &td->elements[edx];
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            present = (*memb_ptr2 != 0);
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		/* Eliminate default values */
+        if(present && elm->default_value_cmp
+           && elm->default_value_cmp(*memb_ptr2) == 0)
+            present = 0;
+
+		ASN_DEBUG("Element %s %s %s->%s is %s",
+			elm->flags & ATF_POINTER ? "ptr" : "inline",
+			elm->default_value_cmp ? "def" : "wtv",
+			td->name, elm->name, present ? "present" : "absent");
+		if(per_put_few_bits(po, present, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Encode the sequence ROOT elements.
+	 */
+    ASN_DEBUG("first_extension = %d, elements = %d", specs->first_extension,
+              td->elements_count);
+	for(edx = 0;
+		edx < ((specs->first_extension < 0) ? td->elements_count
+                                            : (size_t)specs->first_extension);
+		edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;         /* Pointer to the member */
+		const void *const *memb_ptr2; /* Pointer to that pointer */
+
+		ASN_DEBUG("About to encode %s", elm->type->name);
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present",
+					elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+			continue;
+
+        ASN_DEBUG("Encoding %s->%s:%s", td->name, elm->name, elm->type->name);
+        er = elm->type->op->uper_encoder(
+            elm->type, elm->encoding_constraints.per_constraints, *memb_ptr2,
+            po);
+        if(er.encoded == -1) return er;
+    }
+
+	/* No extensions to encode */
+	if(!n_extensions) ASN__ENCODED_OK(er);
+
+	ASN_DEBUG("Length of extensions %d bit-map", n_extensions);
+	/* #18.8. Write down the presence bit-map length. */
+	if(uper_put_nslength(po, n_extensions))
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Bit-map of %d elements", n_extensions);
+	/* #18.7. Encoding the extensions presence bit-map. */
+	/* TODO: act upon NOTE in #18.7 for canonical PER */
+	if(SEQUENCE__handle_extensions(td, sptr, po, 0) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Writing %d extensions", n_extensions);
+	/* #18.9. Encode extensions as open type fields. */
+	if(SEQUENCE__handle_extensions(td, sptr, 0, po) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+SEQUENCE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	void *st = *sptr;	/* Target structure. */
+	int extpresent;		/* Extension additions are present */
+	uint8_t *opres;		/* Presence of optional root members */
+	asn_per_data_t opmd;
+	asn_dec_rval_t rv;
+	size_t edx;
+
+	(void)constraints;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as SEQUENCE (APER)", td->name);
+
+	/* Handle extensions */
+	if(specs->first_extension < 0) {
+		extpresent = 0;
+	} else {
+		extpresent = per_get_few_bits(pd, 1);
+		if(extpresent < 0) ASN__DECODE_STARVED;
+	}
+
+	/* Prepare a place and read-in the presence bitmap */
+	memset(&opmd, 0, sizeof(opmd));
+	if(specs->roms_count) {
+		opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
+		if(!opres) ASN__DECODE_FAILED;
+		/* Get the presence map */
+		if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
+			FREEMEM(opres);
+			ASN__DECODE_STARVED;
+		}
+		opmd.buffer = opres;
+		opmd.nbits = specs->roms_count;
+		ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
+		          td->name, specs->roms_count, *opres);
+	} else {
+		opres = 0;
+	}
+
+	/*
+	 * Get the sequence ROOT elements.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+#if 0
+		int padding;
+#endif
+
+		if(IN_EXTENSION_GROUP(specs, edx))
+			continue;
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+#if 0
+		/* Get Padding */
+		padding = (8 - (pd->moved % 8)) % 8;
+		if(padding > 0)
+			ASN_DEBUG("For element %s,offset= %ld Padding bits = %d", td->name, pd->moved, padding);
+#if 0 /* old way of removing padding */
+		per_get_few_bits(pd, padding);
+#else /* Experimental fix proposed by @mhanna123 */
+		if(edx != (td->elements_count-1))
+			per_get_few_bits(pd, padding);
+		else {
+			if(specs->roms_count && (padding > 0))
+				ASN_DEBUG(">>>>> not skipping padding of %d bits for element:%ld out of %d", padding, edx, td->elements_count);
+			else
+				per_get_few_bits(pd, padding);
+		}
+#endif /* dealing with padding */
+#endif
+		/* Deal with optionality */
+		if(elm->optional) {
+			int present = per_get_few_bits(&opmd, 1);
+			ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
+			          td->name, elm->name, present,
+			          (int)opmd.nboff, (int)opmd.nbits);
+			if(present == 0) {
+				/* This element is not present */
+				if(elm->default_value_set) {
+					/* Fill-in DEFAULT */
+					if(elm->default_value_set(memb_ptr2)) {
+						FREEMEM(opres);
+						ASN__DECODE_FAILED;
+					}
+					ASN_DEBUG("Filled-in default");
+				}
+				/* The member is just not present */
+				continue;
+			}
+			/* Fall through */
+		}
+
+		/* Fetch the member from the stream */
+		ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
+
+		if(elm->flags & ATF_OPEN_TYPE) {
+			rv = OPEN_TYPE_aper_get(opt_codec_ctx, td, st, elm, pd);
+		} else {
+			rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+					elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+		}
+		if(rv.code != RC_OK) {
+			ASN_DEBUG("Failed decode %s in %s",
+			          elm->name, td->name);
+			FREEMEM(opres);
+			return rv;
+		}
+	}
+
+	/* Optionality map is not needed anymore */
+	FREEMEM(opres);
+
+	/*
+	 * Deal with extensions.
+	 */
+	if(extpresent) {
+		ssize_t bmlength;
+		uint8_t *epres;		/* Presence of extension members */
+		asn_per_data_t epmd;
+
+		bmlength = aper_get_nslength(pd);
+		if(bmlength < 0) ASN__DECODE_STARVED;
+
+		ASN_DEBUG("Extensions %" ASN_PRI_SSIZE " present in %s", bmlength, td->name);
+
+		epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
+		if(!epres) ASN__DECODE_STARVED;
+
+		/* Get the extensions map */
+		if(per_get_many_bits(pd, epres, 0, bmlength))
+			ASN__DECODE_STARVED;
+
+		memset(&epmd, 0, sizeof(epmd));
+		epmd.buffer = epres;
+		epmd.nbits = bmlength;
+		ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
+		          td->name, bmlength, *epres);
+
+		/* Go over extensions and read them in */
+		for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+			asn_TYPE_member_t *elm = &td->elements[edx];
+			void *memb_ptr;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+			int present;
+
+			if(!IN_EXTENSION_GROUP(specs, edx)) {
+				ASN_DEBUG("%ld is not extension", edx);
+				continue;
+			}
+
+			/* Fetch the pointer to this member */
+			if(elm->flags & ATF_POINTER) {
+				memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+			} else {
+				memb_ptr = (void *)((char *)st + elm->memb_offset);
+				memb_ptr2 = &memb_ptr;
+			}
+
+			present = per_get_few_bits(&epmd, 1);
+			if(present <= 0) {
+				if(present < 0) break;	/* No more extensions */
+				continue;
+			}
+
+			ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2);
+			rv = aper_open_type_get(opt_codec_ctx, elm->type,
+			                        elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+			if(rv.code != RC_OK) {
+				FREEMEM(epres);
+				return rv;
+			}
+		}
+
+		/* Skip over overflow extensions which aren't present
+		 * in this system's version of the protocol */
+		for(;;) {
+			ASN_DEBUG("Getting overflow extensions");
+			switch(per_get_few_bits(&epmd, 1)) {
+			case -1:
+				break;
+			case 0:
+				continue;
+			default:
+				if(aper_open_type_skip(opt_codec_ctx, pd)) {
+					FREEMEM(epres);
+					ASN__DECODE_STARVED;
+				}
+			}
+			break;
+		}
+
+		FREEMEM(epres);
+	}
+
+	/* Fill DEFAULT members in extensions */
+	for(edx = specs->roms_count; edx < specs->roms_count
+	        + specs->aoms_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void **memb_ptr2;	/* Pointer to member pointer */
+
+		if(!elm->default_value_set) continue;
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st
+			                      + elm->memb_offset);
+			if(*memb_ptr2) continue;
+		} else {
+			continue;	/* Extensions are all optionals */
+		}
+
+		/* Set default value */
+		if(elm->default_value_set(memb_ptr2)) {
+			ASN__DECODE_FAILED;
+		}
+	}
+
+	rv.consumed = 0;
+	rv.code = RC_OK;
+	return rv;
+}
+
+static int
+SEQUENCE_handle_extensions_aper(const asn_TYPE_descriptor_t *td,
+                                const void *sptr,
+                                asn_per_outp_t *po1, asn_per_outp_t *po2) {
+	const asn_SEQUENCE_specifics_t *specs
+	    = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	int exts_present = 0;
+	int exts_count = 0;
+	size_t edx;
+
+	if(specs->first_extension < 0) {
+		return 0;
+	}
+
+	/* Find out which extensions are present */
+	for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;           /* Pointer to the member */
+		const void * const *memb_ptr2;  /* Pointer to that pointer */
+		int present;
+
+		if(!IN_EXTENSION_GROUP(specs, edx)) {
+			ASN_DEBUG("%s (@%ld) is not extension", elm->type->name, edx);
+			continue;
+		}
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			present = (*memb_ptr2 != 0);
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		ASN_DEBUG("checking %s (@%ld) present => %d",
+		          elm->type->name, edx, present);
+		exts_count++;
+		exts_present += present;
+
+		/* Encode as presence marker */
+		if(po1 && per_put_few_bits(po1, present, 1))
+			return -1;
+		/* Encode as open type field */
+		if(po2 && present && aper_open_type_put(elm->type,
+		                                        elm->encoding_constraints.per_constraints, *memb_ptr2, po2))
+			return -1;
+
+	}
+
+	return exts_present ? exts_count : 0;
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_aper(const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints,
+                     const void *sptr, asn_per_outp_t *po) {
+	const asn_SEQUENCE_specifics_t *specs
+	    = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	int n_extensions;
+	size_t edx;
+	size_t i;
+
+	(void)constraints;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE (APER)", td->name);
+
+	/*
+	 * X.691#18.1 Whether structure is extensible
+	 * and whether to encode extensions
+	 */
+	if(specs->first_extension < 0) {
+		n_extensions = 0; /* There are no extensions to encode */
+	} else {
+		n_extensions = SEQUENCE_handle_extensions_aper(td, sptr, 0, 0);
+		if(n_extensions < 0) ASN__ENCODE_FAILED;
+		if(per_put_few_bits(po, n_extensions ? 1 : 0, 1)) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+	/* Encode a presence bitmap */
+	for(i = 0; i < specs->roms_count; i++) {
+		asn_TYPE_member_t *elm;
+		const void *memb_ptr;	 /* Pointer to the member */
+		const void * const *memb_ptr2;       /* Pointer to that pointer */
+		int present;
+
+		edx = specs->oms[i];
+		elm = &td->elements[edx];
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			present = (*memb_ptr2 != 0);
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		/* Eliminate default values */
+		if(present && elm->default_value_cmp
+		        && elm->default_value_cmp(memb_ptr2) == 1)
+			present = 0;
+
+		ASN_DEBUG("Element %s %s %s->%s is %s",
+		          elm->flags & ATF_POINTER ? "ptr" : "inline",
+		          elm->default_value_cmp ? "def" : "wtv",
+		          td->name, elm->name, present ? "present" : "absent");
+		if(per_put_few_bits(po, present, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Encode the sequence ROOT elements.
+	 */
+	ASN_DEBUG("first_extension = %d, elements = %d", specs->first_extension,
+              td->elements_count);
+	for(edx = 0;
+		edx < ((specs->first_extension < 0) ? td->elements_count
+                                            : (size_t)specs->first_extension);
+		edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;          /* Pointer to the member */
+		const void * const *memb_ptr2; /* Pointer to that pointer */
+
+		if(IN_EXTENSION_GROUP(specs, edx))
+			continue;
+
+		ASN_DEBUG("About to encode %s", elm->type->name);
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %ld not present",
+				          elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(memb_ptr2) == 1)
+			continue;
+
+		ASN_DEBUG("Encoding %s->%s", td->name, elm->name);
+		er = elm->type->op->aper_encoder(elm->type, elm->encoding_constraints.per_constraints,
+		                                 *memb_ptr2, po);
+		if(er.encoded == -1)
+			return er;
+	}
+
+	/* No extensions to encode */
+	if(!n_extensions) ASN__ENCODED_OK(er);
+
+	ASN_DEBUG("Length of %d bit-map", n_extensions);
+	/* #18.8. Write down the presence bit-map length. */
+	if(aper_put_nslength(po, n_extensions))
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Bit-map of %d elements", n_extensions);
+	/* #18.7. Encoding the extensions presence bit-map. */
+	/* TODO: act upon NOTE in #18.7 for canonical PER */
+	if(SEQUENCE_handle_extensions_aper(td, sptr, po, 0) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Writing %d extensions", n_extensions);
+	/* #18.9. Encode extensions as open type fields. */
+	if(SEQUENCE_handle_extensions_aper(td, sptr, 0, po) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+SEQUENCE_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                 const void *bptr) {
+    size_t edx;
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *amemb;
+		const void *bmemb;
+        int ret;
+
+		if(elm->flags & ATF_POINTER) {
+            amemb =
+                *(const void *const *)((const char *)aptr + elm->memb_offset);
+            bmemb =
+                *(const void *const *)((const char *)bptr + elm->memb_offset);
+            if(!amemb) {
+                if(!bmemb) continue;
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(bmemb) == 0) {
+                    /* A is absent, but B is present and equal to DEFAULT */
+                    continue;
+                }
+                return -1;
+            } else if(!bmemb) {
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(amemb) == 0) {
+                    /* B is absent, but A is present and equal to DEFAULT */
+                    continue;
+                }
+                return 1;
+            }
+		} else {
+            amemb = (const void *)((const char *)aptr + elm->memb_offset);
+            bmemb = (const void *)((const char *)bptr + elm->memb_offset);
+		}
+
+        ret = elm->type->op->compare_struct(elm->type, amemb, bmemb);
+        if(ret != 0) return ret;
+    }
+
+    return 0;
+}
+
+asn_TYPE_operation_t asn_OP_SEQUENCE = {
+	SEQUENCE_free,
+	SEQUENCE_print,
+	SEQUENCE_compare,
+	SEQUENCE_decode_ber,
+	SEQUENCE_encode_der,
+	SEQUENCE_decode_xer,
+	SEQUENCE_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SEQUENCE_decode_oer,
+	SEQUENCE_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SEQUENCE_decode_uper,
+	SEQUENCE_encode_uper,
+	SEQUENCE_decode_aper,
+	SEQUENCE_encode_aper,
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SEQUENCE_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
+
+asn_random_fill_result_t
+SEQUENCE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constr,
+                   size_t max_length) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 0};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    void *st = *sptr;
+    size_t edx;
+
+    if(max_length == 0) return result_skipped;
+
+    (void)constr;
+
+    if(st == NULL) {
+        st = CALLOC(1, specs->struct_size);
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    for(edx = 0; edx < td->elements_count; edx++) {
+        const asn_TYPE_member_t *elm = &td->elements[edx];
+        void *memb_ptr;   /* Pointer to the member */
+        void **memb_ptr2; /* Pointer to that pointer */
+        asn_random_fill_result_t tmpres;
+
+        if(elm->optional && asn_random_between(0, 4) == 2) {
+            /* Sometimes decide not to fill the optional value */
+            continue;
+        }
+
+        if(elm->flags & ATF_POINTER) {
+            /* Member is a pointer to another structure */
+            memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+        } else {
+            memb_ptr = (char *)st + elm->memb_offset;
+            memb_ptr2 = &memb_ptr;
+        }
+
+        tmpres = elm->type->op->random_fill(
+            elm->type, memb_ptr2, &elm->encoding_constraints,
+            max_length > result_ok.length ? max_length - result_ok.length : 0);
+        switch(tmpres.code) {
+        case ARFILL_OK:
+            result_ok.length += tmpres.length;
+            continue;
+        case ARFILL_SKIPPED:
+            assert(!(elm->flags & ATF_POINTER) || *memb_ptr2 == NULL);
+            continue;
+        case ARFILL_FAILED:
+            if(st == *sptr) {
+                ASN_STRUCT_RESET(*td, st);
+            } else {
+                ASN_STRUCT_FREE(*td, st);
+            }
+            return tmpres;
+        }
+    }
+
+    *sptr = st;
+
+    return result_ok;
+}
+
diff --git a/e2ap/lib/constr_SEQUENCE_OF.c b/e2ap/lib/constr_SEQUENCE_OF.c
new file mode 100644
index 0000000..10f18cf
--- /dev/null
+++ b/e2ap/lib/constr_SEQUENCE_OF.c
@@ -0,0 +1,358 @@
+/*-
+ * Copyright (c) 2003, 2004, 2006 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SEQUENCE_OF.h>
+#include <asn_SEQUENCE_OF.h>
+
+/*
+ * The DER encoder of the SEQUENCE OF type.
+ */
+asn_enc_rval_t
+SEQUENCE_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *ptr,
+                       int tag_mode, ber_tlv_tag_t tag,
+                       asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_TYPE_member_t *elm = td->elements;
+	const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(ptr);
+	size_t computed_size = 0;
+	ssize_t encoding_size = 0;
+	asn_enc_rval_t erval = {0,0,0};
+	int edx;
+
+	ASN_DEBUG("Estimating size of SEQUENCE OF %s", td->name);
+
+	/*
+	 * Gather the length of the underlying members sequence.
+	 */
+	for(edx = 0; edx < list->count; edx++) {
+		void *memb_ptr = list->array[edx];
+		if(!memb_ptr) continue;
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			0, elm->tag,
+			0, 0);
+		if(erval.encoded == -1)
+			return erval;
+		computed_size += erval.encoded;
+	}
+
+	/*
+	 * Encode the TLV for the sequence itself.
+	 */
+	encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag,
+		cb, app_key);
+	if(encoding_size == -1) {
+		erval.encoded = -1;
+		erval.failed_type = td;
+		erval.structure_ptr = ptr;
+		return erval;
+	}
+
+	computed_size += encoding_size;
+	if(!cb) {
+		erval.encoded = computed_size;
+		ASN__ENCODED_OK(erval);
+	}
+
+	ASN_DEBUG("Encoding members of SEQUENCE OF %s", td->name);
+
+	/*
+	 * Encode all members.
+	 */
+	for(edx = 0; edx < list->count; edx++) {
+		void *memb_ptr = list->array[edx];
+		if(!memb_ptr) continue;
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			0, elm->tag,
+			cb, app_key);
+		if(erval.encoded == -1)
+			return erval;
+		encoding_size += erval.encoded;
+	}
+
+	if(computed_size != (size_t)encoding_size) {
+		/*
+		 * Encoded size is not equal to the computed size.
+		 */
+		erval.encoded = -1;
+		erval.failed_type = td;
+		erval.structure_ptr = ptr;
+	} else {
+		erval.encoded = computed_size;
+		erval.structure_ptr = 0;
+		erval.failed_type = 0;
+	}
+
+	return erval;
+}
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                       int ilevel, enum xer_encoder_flags_e flags,
+                       asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(sptr);
+    const char *mname = specs->as_XMLValueList
+                            ? 0
+                            : ((*elm->name) ? elm->name : elm->type->xml_tag);
+    size_t mlen = mname ? strlen(mname) : 0;
+    int xcan = (flags & XER_F_CANONICAL);
+    int i;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    er.encoded = 0;
+
+    for(i = 0; i < list->count; i++) {
+        asn_enc_rval_t tmper = {0,0,0};
+        void *memb_ptr = list->array[i];
+        if(!memb_ptr) continue;
+
+        if(mname) {
+            if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+            ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+        }
+
+        tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1,
+                                           flags, cb, app_key);
+        if(tmper.encoded == -1) return tmper;
+        er.encoded += tmper.encoded;
+        if(tmper.encoded == 0 && specs->as_XMLValueList) {
+            const char *name = elm->type->xml_tag;
+            size_t len = strlen(name);
+            if(!xcan) ASN__TEXT_INDENT(1, ilevel + 1);
+            ASN__CALLBACK3("<", 1, name, len, "/>", 2);
+        }
+
+        if(mname) {
+            ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+        }
+    }
+
+    if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+    ASN__ENCODED_OK(er);
+cb_failed:
+    ASN__ENCODE_FAILED;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_uper(const asn_TYPE_descriptor_t *td,
+                        const asn_per_constraints_t *constraints,
+                        const void *sptr, asn_per_outp_t *po) {
+    const asn_anonymous_sequence_ *list;
+	const asn_per_constraint_t *ct;
+	asn_enc_rval_t er = {0,0,0};
+	const asn_TYPE_member_t *elm = td->elements;
+	size_t encoded_edx;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+    list = _A_CSEQUENCE_FROM_VOID(sptr);
+
+    er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
+
+    if(constraints) ct = &constraints->size;
+    else if(td->encoding_constraints.per_constraints)
+        ct = &td->encoding_constraints.per_constraints->size;
+    else ct = 0;
+
+    /* If extensible constraint, check if size is in root */
+    if(ct) {
+        int not_in_root =
+            (list->count < ct->lower_bound || list->count > ct->upper_bound);
+        ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
+                  ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+        if(ct->flags & APC_EXTENSIBLE) {
+            /* Declare whether size is in extension root */
+            if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED;
+            if(not_in_root) ct = 0;
+        } else if(not_in_root && ct->effective_bits >= 0) {
+            ASN__ENCODE_FAILED;
+        }
+
+    }
+
+    if(ct && ct->effective_bits >= 0) {
+        /* X.691, #19.5: No length determinant */
+        if(per_put_few_bits(po, list->count - ct->lower_bound,
+                            ct->effective_bits))
+            ASN__ENCODE_FAILED;
+    } else if(list->count == 0) {
+        /* When the list is empty add only the length determinant
+         * X.691, #20.6 and #11.9.4.1
+         */
+        if (uper_put_length(po, 0, 0)) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+    for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) {
+        ssize_t may_encode;
+        size_t edx;
+        int need_eom = 0;
+
+        if(ct && ct->effective_bits >= 0) {
+            may_encode = list->count;
+        } else {
+            may_encode =
+                uper_put_length(po, list->count - encoded_edx, &need_eom);
+            if(may_encode < 0) ASN__ENCODE_FAILED;
+        }
+
+        for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) {
+            void *memb_ptr = list->array[edx];
+            if(!memb_ptr) ASN__ENCODE_FAILED;
+            er = elm->type->op->uper_encoder(
+                elm->type, elm->encoding_constraints.per_constraints, memb_ptr,
+                po);
+            if(er.encoded == -1) ASN__ENCODE_FAILED;
+        }
+
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+
+        encoded_edx += may_encode;
+    }
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_aper(const asn_TYPE_descriptor_t *td,
+                        const asn_per_constraints_t *constraints,
+                        const void *sptr, asn_per_outp_t *po) {
+	const asn_anonymous_sequence_ *list;
+	const asn_per_constraint_t *ct;
+	asn_enc_rval_t er = {0,0,0};
+	asn_TYPE_member_t *elm = td->elements;
+	int seq;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	list = _A_CSEQUENCE_FROM_VOID(sptr);
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE OF size (%d) using ALIGNED PER", td->name, list->count);
+
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	/* If extensible constraint, check if size is in root */
+	if(ct) {
+		int not_in_root = (list->count < ct->lower_bound
+				|| list->count > ct->upper_bound);
+		ASN_DEBUG("lb %ld ub %ld %s",
+			ct->lower_bound, ct->upper_bound,
+			ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+		if(ct->flags & APC_EXTENSIBLE) {
+			/* Declare whether size is in extension root */
+			if(per_put_few_bits(po, not_in_root, 1))
+				ASN__ENCODE_FAILED;
+			if(not_in_root) ct = 0;
+		} else if(not_in_root && ct->effective_bits >= 0)
+			ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+/*		 if(per_put_few_bits(po, list->count - ct->lower_bound,
+				 ct->effective_bits))
+			 ASN__ENCODE_FAILED;
+*/
+		if (aper_put_length(po, ct->upper_bound - ct->lower_bound + 1, list->count - ct->lower_bound) < 0)
+			ASN__ENCODE_FAILED;
+	}
+
+	for(seq = -1; seq < list->count;) {
+		ssize_t mayEncode;
+		if(seq < 0) seq = 0;
+		if(ct && ct->effective_bits >= 0) {
+			mayEncode = list->count;
+		} else {
+			mayEncode = aper_put_length(po, -1, list->count - seq);
+			if(mayEncode < 0) ASN__ENCODE_FAILED;
+		}
+
+		while(mayEncode--) {
+			void *memb_ptr = list->array[seq++];
+			if(!memb_ptr) ASN__ENCODE_FAILED;
+			er = elm->type->op->aper_encoder(elm->type,
+				elm->encoding_constraints.per_constraints, memb_ptr, po);
+			if(er.encoded == -1)
+				ASN__ENCODE_FAILED;
+		}
+	}
+
+	ASN__ENCODED_OK(er);
+}
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+SEQUENCE_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+               const void *bptr) {
+    const asn_anonymous_sequence_ *a = _A_CSEQUENCE_FROM_VOID(aptr);
+    const asn_anonymous_sequence_ *b = _A_CSEQUENCE_FROM_VOID(bptr);
+    ssize_t idx;
+
+    if(a && b) {
+        ssize_t common_length = (a->count < b->count ? a->count : b->count);
+        for(idx = 0; idx < common_length; idx++) {
+            int ret = td->elements->type->op->compare_struct(
+                td->elements->type, a->array[idx], b->array[idx]);
+            if(ret) return ret;
+        }
+
+        if(idx < b->count) /* more elements in b */
+            return -1;    /* a is shorter, so put it first */
+        if(idx < a->count) return 1;
+
+    } else if(!a) {
+        return -1;
+    } else if(!b) {
+        return 1;
+    }
+
+    return 0;
+}
+
+
+asn_TYPE_operation_t asn_OP_SEQUENCE_OF = {
+	SEQUENCE_OF_free,
+	SEQUENCE_OF_print,
+	SEQUENCE_OF_compare,
+	SEQUENCE_OF_decode_ber,
+	SEQUENCE_OF_encode_der,
+	SEQUENCE_OF_decode_xer,
+	SEQUENCE_OF_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SEQUENCE_OF_decode_oer, /* Same as SET OF decoder. */
+	SEQUENCE_OF_encode_oer, /* Same as SET OF encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SEQUENCE_OF_decode_uper, /* Same as SET OF decoder */
+	SEQUENCE_OF_encode_uper,
+	SEQUENCE_OF_decode_aper,
+	SEQUENCE_OF_encode_aper,
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SEQUENCE_OF_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
diff --git a/e2ap/lib/constr_SEQUENCE_oer.c b/e2ap/lib/constr_SEQUENCE_oer.c
new file mode 100644
index 0000000..ecb589c
--- /dev/null
+++ b/e2ap/lib/constr_SEQUENCE_oer.c
@@ -0,0 +1,561 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_SEQUENCE.h>
+#include <OPEN_TYPE.h>
+#include <errno.h>
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef  ADVANCE
+#define ADVANCE(num_bytes)                   \
+    do {                                     \
+        size_t num = num_bytes;              \
+        ptr = ((const char *)ptr) + num;     \
+        size -= num;                         \
+        consumed_myself += num;              \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#undef PHASE_OUT
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+
+/*
+ * Check whether we are inside the extensions group.
+ */
+#define IN_EXTENSION_GROUP(specs, memb_idx) \
+    ((specs)->first_extension >= 0          \
+     && (unsigned)(specs)->first_extension <= (memb_idx))
+
+#define IN_ROOT_GROUP_PRED(edx)                            \
+    edx < (specs->first_extension < 0 ? td->elements_count \
+                                      : (size_t)specs->first_extension)
+
+#define FOR_IN_ROOT_GROUP(edx) for(edx = 0; IN_ROOT_GROUP_PRED(edx); edx++)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)   do {                    \
+                rval.code = _code;              \
+                rval.consumed = consumed_myself;\
+                return rval;                    \
+        } while(0)
+
+/*
+ * Return pointer to a member.
+ */
+static void **
+element_ptrptr(void *struct_ptr, asn_TYPE_member_t *elm, void **tmp_save_ptr) {
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        return (void **)((char *)struct_ptr + elm->memb_offset);
+    } else {
+        assert(tmp_save_ptr);
+        *tmp_save_ptr = (void *)((char *)struct_ptr + elm->memb_offset);
+        return tmp_save_ptr;
+    }
+}
+
+static const void *
+element_ptr(const void *struct_ptr, const asn_TYPE_member_t *elm) {
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        return *(const void *const *)((const char *)struct_ptr
+                                      + elm->memb_offset);
+    } else {
+        return (const void *)((const char *)struct_ptr + elm->memb_offset);
+    }
+}
+
+asn_dec_rval_t
+SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_oer_constraints_t *constraints, void **struct_ptr,
+                    const void *ptr, size_t size) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    void *st = *struct_ptr; /* Target structure */
+    asn_struct_ctx_t *ctx; /* Decoder context */
+    size_t consumed_myself = 0; /* Consumed bytes from ptr. */
+
+    (void)constraints;
+
+    if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+        ASN__DECODE_FAILED;
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+    /*
+     * Start to parse where left previously.
+     */
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Fetch preamble.
+         */
+        asn_bit_data_t *preamble;
+        int has_extensions_bit = (specs->first_extension >= 0);
+        size_t preamble_bits = (has_extensions_bit + specs->roms_count);
+        size_t preamble_bytes = ((7 + preamble_bits) >> 3);
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 0", td->name);
+
+        ASN_DEBUG(
+            "Expecting preamble bits %" ASN_PRI_SIZE " for %s (including %d extension bits)",
+            preamble_bits, td->name, has_extensions_bit);
+
+        if(preamble_bytes > size) {
+            ASN__DECODE_STARVED;
+        }
+
+        preamble = asn_bit_data_new_contiguous(ptr, preamble_bits);
+        if(!preamble) {
+            RETURN(RC_FAIL);
+        }
+        preamble->nboff = has_extensions_bit;
+        ctx->ptr = preamble;
+        ADVANCE(preamble_bytes);
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 1: {
+        /* Decode components of the extension root */
+        asn_bit_data_t *preamble = ctx->ptr;
+        size_t edx;
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 1 (Root)", td->name);
+
+        assert(preamble);
+
+        for(edx = (ctx->step >> 1); IN_ROOT_GROUP_PRED(edx);
+            edx++, ctx->step = (ctx->step & ~1) + 2) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+
+            ASN_DEBUG("Decoding %s->%s", td->name, elm->name);
+
+            assert(!IN_EXTENSION_GROUP(specs, edx));
+
+            if(ctx->step & 1) {
+                goto microphase2_decode_continues;
+            }
+
+
+            if(elm->optional) {
+                int32_t present = asn_get_few_bits(preamble, 1);
+                if(present < 0) {
+                    ASN_DEBUG("Presence map ended prematurely: %d", present);
+                    RETURN(RC_FAIL);
+                } else if(present == 0) {
+                    if(elm->default_value_set) {
+                        /* Fill-in DEFAULT */
+                        void *tmp;
+                        if(elm->default_value_set(
+                               element_ptrptr(st, elm, &tmp))) {
+                            RETURN(RC_FAIL);
+                        }
+                    }
+                    /* The member is not present. */
+                    continue;
+                }
+                /* Present OPTIONAL or DEFAULT component. */
+            }
+
+            /*
+             * MICROPHASE 2: Invoke the member-specific decoder.
+             */
+            ctx->step |= 1; /* Confirm entering next microphase */
+        microphase2_decode_continues:
+            if(elm->flags & ATF_OPEN_TYPE) {
+                rval = OPEN_TYPE_oer_get(opt_codec_ctx, td, st, elm, ptr, size);
+            } else {
+                void *save_memb_ptr; /* Temporary reference. */
+                void **memb_ptr2;  /* Pointer to a pointer to a memmber */
+
+                memb_ptr2 = element_ptrptr(st, elm, &save_memb_ptr);
+
+                rval = elm->type->op->oer_decoder(
+                    opt_codec_ctx, elm->type,
+                    elm->encoding_constraints.oer_constraints, memb_ptr2, ptr,
+                    size);
+            }
+            switch(rval.code) {
+            case RC_OK:
+                ADVANCE(rval.consumed);
+                break;
+            case RC_WMORE:
+                ASN_DEBUG("More bytes needed at element %s \"%s\"", td->name,
+                          elm->name);
+                ADVANCE(rval.consumed);
+                RETURN(RC_WMORE);
+            case RC_FAIL:
+                ASN_DEBUG("Decoding failed at element %s \"%s\"", td->name,
+                          elm->name);
+                RETURN(RC_FAIL);
+            }
+        } /* for(all root members) */
+
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 2:
+        assert(ctx->ptr);
+        {
+        /* Cleanup preamble. */
+        asn_bit_data_t *preamble = ctx->ptr;
+        asn_bit_data_t *extadds;
+        int has_extensions_bit = (specs->first_extension >= 0);
+        int extensions_present =
+            has_extensions_bit
+            && (preamble->buffer == NULL
+                || (((const uint8_t *)preamble->buffer)[0] & 0x80));
+        uint8_t unused_bits;
+        size_t len = 0;
+        ssize_t len_len;
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 2", td->name);
+
+        preamble->buffer = 0; /* Will do extensions_present==1 next time. */
+
+        if(!extensions_present) {
+            ctx->phase = 10;
+            RETURN(RC_OK);
+        }
+
+        /*
+         * X.696 (08/2015) #16.1 (c), #16.4
+         * Read in the extension addition presence bitmap.
+         */
+
+        len_len = oer_fetch_length(ptr, size, &len);
+        if(len_len > 0) {
+            ADVANCE(len_len);
+        } else if(len_len < 0) {
+            RETURN(RC_FAIL);
+        } else {
+            RETURN(RC_WMORE);
+        }
+
+        if(len == 0) {
+            /* 16.4.1-2 */
+            RETURN(RC_FAIL);
+        } else if(len > size) {
+            RETURN(RC_WMORE);
+        }
+
+        /* Account for unused bits */
+        unused_bits = 0x7 & *(const uint8_t *)ptr;
+        ADVANCE(1);
+        len--;
+        if(unused_bits && len == 0) {
+            RETURN(RC_FAIL);
+        }
+
+        /* Get the extensions map */
+        extadds = asn_bit_data_new_contiguous(ptr, len * 8 - unused_bits);
+        if(!extadds) {
+            RETURN(RC_FAIL);
+        }
+        FREEMEM(preamble);
+        ctx->ptr = extadds;
+        ADVANCE(len);
+    }
+        NEXT_PHASE(ctx);
+        ctx->step =
+            (specs->first_extension < 0 ? td->elements_count
+                                        : (size_t)specs->first_extension);
+        /* Fall through */
+    case 3:
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 3 (Extensions)", td->name);
+        for(; ctx->step < (signed)td->elements_count; ctx->step++) {
+            asn_bit_data_t *extadds = ctx->ptr;
+            size_t edx = ctx->step;
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            void *tmp_memb_ptr;
+            void **memb_ptr2 = element_ptrptr(st, elm, &tmp_memb_ptr);
+
+            switch(asn_get_few_bits(extadds, 1)) {
+            case -1:
+                /*
+                 * Not every one of our extensions is known to the remote side.
+                 * Continue filling in their defaults though.
+                 */
+                /* Fall through */
+            case 0:
+                /* Fill-in DEFAULT */
+                if(elm->default_value_set
+                   && elm->default_value_set(memb_ptr2)) {
+                    RETURN(RC_FAIL);
+                }
+                continue;
+            case 1: {
+                /* Read OER open type */
+                ssize_t ot_size =
+                    oer_open_type_get(opt_codec_ctx, elm->type,
+                                      elm->encoding_constraints.oer_constraints,
+                                      memb_ptr2, ptr, size);
+                assert(ot_size <= (ssize_t)size);
+                if(ot_size > 0) {
+                    ADVANCE(ot_size);
+                } else if(ot_size < 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    /* Roll back open type parsing */
+                    asn_get_undo(extadds, 1);
+                    RETURN(RC_WMORE);
+                }
+                break;
+            }
+            default:
+                RETURN(RC_FAIL);
+            }
+        }
+
+        NEXT_PHASE(ctx);
+        /* Fall through */
+    case 4:
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 4", td->name);
+        /* Read in the rest of Open Types while ignoring them */
+        for(;;) {
+            asn_bit_data_t *extadds = ctx->ptr;
+            switch(asn_get_few_bits(extadds, 1)) {
+            case 0:
+                continue;
+            case 1: {
+                ssize_t skipped = oer_open_type_skip(ptr, size);
+                if(skipped > 0) {
+                    ADVANCE(skipped);
+                } else if(skipped < 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    asn_get_undo(extadds, 1);
+                    RETURN(RC_WMORE);
+                }
+                continue;
+            }
+            case -1:
+                /* No more Open Type encoded components */
+                break;
+            default:
+                RETURN(RC_FAIL);
+            }
+            break;
+        }
+    }
+
+    RETURN(RC_OK);
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+SEQUENCE_encode_oer(const asn_TYPE_descriptor_t *td,
+                    const asn_oer_constraints_t *constraints, const void *sptr,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+    size_t computed_size = 0;
+    int has_extensions_bit = (specs->first_extension >= 0);
+    size_t preamble_bits = (has_extensions_bit + specs->roms_count);
+    uint32_t has_extensions = 0;
+    size_t edx;
+    int ret;
+
+    (void)constraints;
+
+    if(preamble_bits) {
+        asn_bit_outp_t preamble;
+
+        memset(&preamble, 0, sizeof(preamble));
+        preamble.output = cb;
+        preamble.op_key = app_key;
+
+        if(has_extensions_bit) {
+            for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+                asn_TYPE_member_t *elm = &td->elements[edx];
+                const void *memb_ptr = element_ptr(sptr, elm);
+                if(memb_ptr) {
+                    if(elm->default_value_cmp
+                       && elm->default_value_cmp(memb_ptr) == 0) {
+                        /* Do not encode default values in extensions */
+                    } else {
+                        has_extensions = 1;
+                        break;
+                    }
+                }
+            }
+            ret = asn_put_few_bits(&preamble, has_extensions, 1);
+            assert(ret == 0);
+            if(ret < 0) {
+                ASN__ENCODE_FAILED;
+            }
+        }
+
+        /*
+         * Encode optional components bitmap.
+         */
+        if(specs->roms_count) {
+            FOR_IN_ROOT_GROUP(edx) {
+                asn_TYPE_member_t *elm = &td->elements[edx];
+
+                if(IN_EXTENSION_GROUP(specs, edx)) break;
+
+                if(elm->optional) {
+                    const void *memb_ptr = element_ptr(sptr, elm);
+                    uint32_t has_component = memb_ptr != NULL;
+                    if(has_component && elm->default_value_cmp
+                       && elm->default_value_cmp(memb_ptr) == 0) {
+                        has_component = 0;
+                    }
+                    ret = asn_put_few_bits(&preamble, has_component, 1);
+                    if(ret < 0) {
+                        ASN__ENCODE_FAILED;
+                    }
+                }
+            }
+        }
+
+        asn_put_aligned_flush(&preamble);
+        computed_size += preamble.flushed_bytes;
+    }   /* if(preamble_bits) */
+
+    /*
+     * Put root components and extensions root.
+     */
+    for(edx = 0; edx < td->elements_count; edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        asn_enc_rval_t er = {0,0,0};
+        const void *memb_ptr;
+
+        if(IN_EXTENSION_GROUP(specs, edx)) break;
+
+        memb_ptr = element_ptr(sptr, elm);
+        if(memb_ptr) {
+            if(elm->default_value_cmp
+               && elm->default_value_cmp(memb_ptr) == 0) {
+                /* Skip default values in encoding */
+                continue;
+            }
+        } else {
+            if(elm->optional) continue;
+            /* Mandatory element is missing */
+            ASN__ENCODE_FAILED;
+        }
+        if(!elm->type->op->oer_encoder) {
+            ASN_DEBUG("OER encoder is not defined for type %s", elm->type->name);
+            ASN__ENCODE_FAILED;
+        }
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded == -1) {
+            ASN_DEBUG("... while encoding %s member \"%s\"\n", td->name,
+                      elm->name);
+            return er;
+        }
+        computed_size += er.encoded;
+    }
+
+    /*
+     * Before encode extensions, encode extensions additions presense bitmap
+     # X.696 (08/2015) #16.4.
+     */
+    if(has_extensions) {
+        asn_bit_outp_t extadds;
+
+        /* Special case allowing us to use exactly one byte for #8.6 */
+        size_t aoms_length_bits = specs->aoms_count;
+        size_t aoms_length_bytes = (7 + aoms_length_bits) >> 3;
+        uint8_t unused_bits = 0x07 & (8 - (aoms_length_bits & 0x07));
+
+        assert(1 + aoms_length_bytes <= 127);
+
+        memset(&extadds, 0, sizeof(extadds));
+        extadds.output = cb;
+        extadds.op_key = app_key;
+
+        /* #8.6 length determinant */
+        ret = asn_put_few_bits(&extadds, (1 + aoms_length_bytes), 8);
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        /* Number of unused bytes, #16.4.2 */
+        ret = asn_put_few_bits(&extadds, unused_bits, 8);
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        /* Encode presence bitmap #16.4.3 */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            const void *memb_ptr = element_ptr(sptr, elm);
+            if(memb_ptr && elm->default_value_cmp
+               && elm->default_value_cmp(memb_ptr) == 0) {
+                memb_ptr = 0;   /* Do not encode default value. */
+            }
+            ret |= asn_put_few_bits(&extadds, memb_ptr ? 1 : 0, 1);
+        }
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        asn_put_aligned_flush(&extadds);
+        computed_size += extadds.flushed_bytes;
+
+        /* Now, encode extensions */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            const void *memb_ptr = element_ptr(sptr, elm);
+
+            if(memb_ptr) {
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(memb_ptr) == 0) {
+                    /* Do not encode default value. */
+                } else {
+                    ssize_t wrote = oer_open_type_put(
+                        elm->type, elm->encoding_constraints.oer_constraints,
+                        memb_ptr, cb, app_key);
+                    if(wrote == -1) {
+                        ASN__ENCODE_FAILED;
+                    }
+                    computed_size += wrote;
+                }
+            } else if(!elm->optional) {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    }   /* if(has_extensions) */
+
+
+    {
+        asn_enc_rval_t er = {0, 0, 0};
+        er.encoded = computed_size;
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/constr_SET_OF.c b/e2ap/lib/constr_SET_OF.c
new file mode 100644
index 0000000..bf1dc27
--- /dev/null
+++ b/e2ap/lib/constr_SET_OF.c
@@ -0,0 +1,1441 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SET_OF.h>
+#include <asn_SET_OF.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num;\
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#undef	PHASE_OUT
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+#define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * The decoder of the SET OF type.
+ */
+asn_dec_rval_t
+SET_OF_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements; /* Single one */
+
+    /*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	ASN_DEBUG("Decoding %s as SET OF", td->name);
+	
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+			tag_mode, 1, &ctx->left, 0);
+		if(rval.code != RC_OK) {
+			ASN_DEBUG("%s tagging check failed: %d",
+				td->name, rval.code);
+			return rval;
+		}
+
+		if(ctx->left >= 0)
+			ctx->left += rval.consumed; /* ?Substracted below! */
+		ADVANCE(rval.consumed);
+
+		ASN_DEBUG("Structure consumes %ld bytes, "
+			"buffer %ld", (long)ctx->left, (long)size);
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 1:
+		/*
+		 * PHASE 1.
+		 * From the place where we've left it previously,
+		 * try to decode the next item.
+		 */
+	  for(;; ctx->step = 0) {
+		ssize_t tag_len;	/* Length of TLV's T */
+
+		if(ctx->step & 1)
+			goto microphase2;
+
+		/*
+		 * MICROPHASE 1: Synchronize decoding.
+		 */
+
+		if(ctx->left == 0) {
+			ASN_DEBUG("End of SET OF %s", td->name);
+			/*
+			 * No more things to decode.
+			 * Exit out of here.
+			 */
+			PHASE_OUT(ctx);
+			RETURN(RC_OK);
+		}
+
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+		if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) {
+			if(LEFT < 2) {
+				if(SIZE_VIOLATION)
+					RETURN(RC_FAIL);
+				else
+					RETURN(RC_WMORE);
+			} else if(((const uint8_t *)ptr)[1] == 0) {
+				/*
+				 * Found the terminator of the
+				 * indefinite length structure.
+				 */
+				break;
+			}
+		}
+
+		/* Outmost tag may be unknown and cannot be fetched/compared */
+		if(elm->tag != (ber_tlv_tag_t)-1) {
+		    if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) {
+			/*
+			 * The new list member of expected type has arrived.
+			 */
+		    } else {
+			ASN_DEBUG("Unexpected tag %s fixed SET OF %s",
+				ber_tlv_tag_string(tlv_tag), td->name);
+			ASN_DEBUG("%s SET OF has tag %s",
+				td->name, ber_tlv_tag_string(elm->tag));
+			RETURN(RC_FAIL);
+		    }
+		}
+
+		/*
+		 * MICROPHASE 2: Invoke the member-specific decoder.
+		 */
+		ctx->step |= 1;		/* Confirm entering next microphase */
+	microphase2:
+		
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		rval = elm->type->op->ber_decoder(opt_codec_ctx,
+				elm->type, &ctx->ptr, ptr, LEFT, 0);
+		ASN_DEBUG("In %s SET OF %s code %d consumed %d",
+			td->name, elm->type->name,
+			rval.code, (int)rval.consumed);
+		switch(rval.code) {
+		case RC_OK:
+			{
+				asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+				if(ASN_SET_ADD(list, ctx->ptr) != 0)
+					RETURN(RC_FAIL);
+				else
+					ctx->ptr = 0;
+			}
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			/* Fall through */
+		case RC_FAIL: /* Fatal error */
+			ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+			ctx->ptr = 0;
+			RETURN(RC_FAIL);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  }	/* for(all list members) */
+
+		NEXT_PHASE(ctx);
+	case 2:
+		/*
+		 * Read in all "end of content" TLVs.
+		 */
+		while(ctx->left < 0) {
+			if(LEFT < 2) {
+				if(LEFT > 0 && ((const char *)ptr)[0] != 0) {
+					/* Unexpected tag */
+					RETURN(RC_FAIL);
+				} else {
+					RETURN(RC_WMORE);
+				}
+			}
+			if(((const char *)ptr)[0] == 0
+			&& ((const char *)ptr)[1] == 0) {
+				ADVANCE(2);
+				ctx->left++;
+			} else {
+				RETURN(RC_FAIL);
+			}
+		}
+
+		PHASE_OUT(ctx);
+	}
+	
+	RETURN(RC_OK);
+}
+
+/*
+ * Internally visible buffer holding a single encoded element.
+ */
+struct _el_buffer {
+	uint8_t *buf;
+	size_t length;
+	size_t allocated_size;
+    unsigned bits_unused;
+};
+/* Append bytes to the above structure */
+static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) {
+    struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr;
+
+    if(el_buf->length + size > el_buf->allocated_size) {
+        size_t new_size = el_buf->allocated_size ? el_buf->allocated_size : 8;
+        void *p;
+
+        do {
+            new_size <<= 2;
+        } while(el_buf->length + size > new_size);
+
+        p = REALLOC(el_buf->buf, new_size);
+        if(p) {
+            el_buf->buf = p;
+            el_buf->allocated_size = new_size;
+        } else {
+            return -1;
+        }
+    }
+
+    memcpy(el_buf->buf + el_buf->length, buffer, size);
+
+    el_buf->length += size;
+    return 0;
+}
+
+static void assert_unused_bits(const struct _el_buffer* p) {
+    if(p->length) {
+        assert((p->buf[p->length-1] & ~(0xff << p->bits_unused)) == 0);
+    } else {
+        assert(p->bits_unused == 0);
+    }
+}
+
+static int _el_buf_cmp(const void *ap, const void *bp) {
+    const struct _el_buffer *a = (const struct _el_buffer *)ap;
+    const struct _el_buffer *b = (const struct _el_buffer *)bp;
+    size_t common_len;
+    int ret = 0;
+
+    if(a->length < b->length)
+        common_len = a->length;
+    else
+        common_len = b->length;
+
+    if (a->buf && b->buf) {
+        ret = memcmp(a->buf, b->buf, common_len);
+    }
+    if(ret == 0) {
+        if(a->length < b->length)
+            ret = -1;
+        else if(a->length > b->length)
+            ret = 1;
+        /* Ignore unused bits. */
+        assert_unused_bits(a);
+        assert_unused_bits(b);
+    }
+
+    return ret;
+}
+
+static void
+SET_OF__encode_sorted_free(struct _el_buffer *el_buf, size_t count) {
+    size_t i;
+
+    for(i = 0; i < count; i++) {
+        FREEMEM(el_buf[i].buf);
+    }
+
+    FREEMEM(el_buf);
+}
+
+enum SET_OF__encode_method {
+    SOES_DER,   /* Distinguished Encoding Rules */
+    SOES_CUPER  /* Canonical Unaligned Packed Encoding Rules */
+};
+
+static struct _el_buffer *
+SET_OF__encode_sorted(const asn_TYPE_member_t *elm,
+                      const asn_anonymous_set_ *list,
+                      enum SET_OF__encode_method method) {
+    struct _el_buffer *encoded_els;
+    int edx;
+
+    encoded_els =
+        (struct _el_buffer *)CALLOC(list->count, sizeof(encoded_els[0]));
+    if(encoded_els == NULL) {
+        return NULL;
+    }
+
+	/*
+	 * Encode all members.
+	 */
+    for(edx = 0; edx < list->count; edx++) {
+        const void *memb_ptr = list->array[edx];
+        struct _el_buffer *encoding_el = &encoded_els[edx];
+        asn_enc_rval_t erval = {0,0,0};
+
+        if(!memb_ptr) break;
+
+        /*
+		 * Encode the member into the prepared space.
+		 */
+        switch(method) {
+        case SOES_DER:
+            erval = elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag,
+                                               _el_addbytes, encoding_el);
+            break;
+        case SOES_CUPER:
+            erval = uper_encode(elm->type,
+                                elm->encoding_constraints.per_constraints,
+                                memb_ptr, _el_addbytes, encoding_el);
+            if(erval.encoded != -1) {
+                size_t extra_bits = erval.encoded % 8;
+                assert(encoding_el->length == (size_t)(erval.encoded + 7) / 8);
+                encoding_el->bits_unused = (8 - extra_bits) & 0x7;
+            }
+            break;
+        default:
+            assert(!"Unreachable");
+            break;
+        }
+        if(erval.encoded < 0) break;
+	}
+
+    if(edx == list->count) {
+        /*
+         * Sort the encoded elements according to their encoding.
+         */
+        qsort(encoded_els, list->count, sizeof(encoded_els[0]), _el_buf_cmp);
+
+        return encoded_els;
+    } else {
+        SET_OF__encode_sorted_free(encoded_els, edx);
+        return NULL;
+    }
+}
+
+
+/*
+ * The DER encoder of the SET OF type.
+ */
+asn_enc_rval_t
+SET_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+    size_t computed_size = 0;
+    ssize_t encoding_size = 0;
+    struct _el_buffer *encoded_els;
+    int edx;
+
+	ASN_DEBUG("Estimating size for SET OF %s", td->name);
+
+    /*
+     * Gather the length of the underlying members sequence.
+     */
+    for(edx = 0; edx < list->count; edx++) {
+        void *memb_ptr = list->array[edx];
+        asn_enc_rval_t erval = {0,0,0};
+
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+
+        erval =
+            elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag, 0, 0);
+        if(erval.encoded == -1) return erval;
+        computed_size += erval.encoded;
+	}
+
+
+    /*
+     * Encode the TLV for the sequence itself.
+     */
+    encoding_size =
+        der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key);
+    if(encoding_size < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    computed_size += encoding_size;
+
+    if(!cb || list->count == 0) {
+        asn_enc_rval_t erval = {0,0,0};
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    }
+
+    ASN_DEBUG("Encoding members of %s SET OF", td->name);
+
+    /*
+     * DER mandates dynamic sorting of the SET OF elements
+     * according to their encodings. Build an array of the
+     * encoded elements.
+     */
+    encoded_els = SET_OF__encode_sorted(elm, list, SOES_DER);
+
+    /*
+     * Report encoded elements to the application.
+     * Dispose of temporary sorted members table.
+     */
+    for(edx = 0; edx < list->count; edx++) {
+        struct _el_buffer *encoded_el = &encoded_els[edx];
+        /* Report encoded chunks to the application */
+        if(cb(encoded_el->buf, encoded_el->length, app_key) < 0) {
+            break;
+        } else {
+            encoding_size += encoded_el->length;
+        }
+    }
+
+    SET_OF__encode_sorted_free(encoded_els, list->count);
+
+    if(edx == list->count) {
+        asn_enc_rval_t erval = {0,0,0};
+        assert(computed_size == (size_t)encoding_size);
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    } else {
+        ASN__ENCODE_FAILED;
+    }
+}
+
+#undef	XER_ADVANCE
+#define	XER_ADVANCE(num_bytes)	do {			\
+		size_t num = num_bytes;			\
+		buf_ptr = ((const char *)buf_ptr) + num;\
+		size -= num;				\
+		consumed_myself += num;			\
+	} while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const char *opt_mname, const void *buf_ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *element = td->elements;
+	const char *elm_tag;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * ... and parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval = {RC_OK, 0};/* Return value from a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/* Which tag is expected for the downstream */
+	if(specs->as_XMLValueList) {
+		elm_tag = (specs->as_XMLValueList == 1) ? 0 : "";
+	} else {
+		elm_tag = (*element->name)
+				? element->name : element->type->xml_tag;
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 */
+	for(; ctx->phase <= 2;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+
+		/*
+		 * Go inside the inner member of a set.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval = {RC_OK, 0};
+
+			/* Invoke the inner type decoder, m.b. multiple times */
+			ASN_DEBUG("XER/SET OF element [%s]", elm_tag);
+			tmprval = element->type->op->xer_decoder(opt_codec_ctx,
+					element->type, &ctx->ptr, elm_tag,
+					buf_ptr, size);
+			if(tmprval.code == RC_OK) {
+				asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+				if(ASN_SET_ADD(list, ctx->ptr) != 0)
+					RETURN(RC_FAIL);
+				ctx->ptr = 0;
+				XER_ADVANCE(tmprval.consumed);
+			} else {
+				XER_ADVANCE(tmprval.consumed);
+				RETURN(tmprval.code);
+			}
+			ctx->phase = 1;	/* Back to body processing */
+			ASN_DEBUG("XER/SET OF phase => %d", ctx->phase);
+			/* Fall through */
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context,
+			buf_ptr, size, &ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+            case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s",
+			tcv, ctx->phase, xml_tag);
+		switch(tcv) {
+		case XCT_CLOSING:
+			if(ctx->phase == 0) break;
+			ctx->phase = 0;
+			/* Fall through */
+		case XCT_BOTH:
+			if(ctx->phase == 0) {
+				/* No more things to decode */
+				XER_ADVANCE(ch_size);
+				ctx->phase = 3;	/* Phase out */
+				RETURN(RC_OK);
+			}
+			/* Fall through */
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase);
+			if(ctx->phase == 1) {
+				/*
+				 * Process a single possible member.
+				 */
+				ctx->phase = 2;
+				continue;
+			}
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag in SET OF");
+		break;
+	}
+
+	ctx->phase = 3;	/* "Phase out" on hard failure */
+	RETURN(RC_FAIL);
+}
+
+
+
+typedef struct xer_tmp_enc_s {
+	void *buffer;
+	size_t offset;
+	size_t size;
+} xer_tmp_enc_t;
+static int
+SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) {
+	xer_tmp_enc_t *t = (xer_tmp_enc_t *)key;
+	if(t->offset + size >= t->size) {
+		size_t newsize = (t->size << 2) + size;
+		void *p = REALLOC(t->buffer, newsize);
+		if(!p) return -1;
+		t->buffer = p;
+		t->size = newsize;
+	}
+	memcpy((char *)t->buffer + t->offset, buffer, size);
+	t->offset += size;
+	return 0;
+}
+static int
+SET_OF_xer_order(const void *aptr, const void *bptr) {
+	const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr;
+	const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr;
+	size_t minlen = a->offset;
+	int ret;
+	if(b->offset < minlen) minlen = b->offset;
+	/* Well-formed UTF-8 has this nice lexicographical property... */
+	ret = memcmp(a->buffer, b->buffer, minlen);
+	if(ret != 0) return ret;
+	if(a->offset == b->offset)
+		return 0;
+	if(a->offset == minlen)
+		return -1;
+	return 1;
+}
+
+
+asn_enc_rval_t
+SET_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                  enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+    const char *mname = specs->as_XMLValueList
+		? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag);
+	size_t mlen = mname ? strlen(mname) : 0;
+	int xcan = (flags & XER_F_CANONICAL);
+	xer_tmp_enc_t *encs = 0;
+	size_t encs_count = 0;
+	void *original_app_key = app_key;
+	asn_app_consume_bytes_f *original_cb = cb;
+	int i;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	if(xcan) {
+		encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0]));
+		if(!encs) ASN__ENCODE_FAILED;
+		cb = SET_OF_encode_xer_callback;
+	}
+
+	er.encoded = 0;
+
+	for(i = 0; i < list->count; i++) {
+		asn_enc_rval_t tmper = {0,0,0};
+
+		void *memb_ptr = list->array[i];
+		if(!memb_ptr) continue;
+
+		if(encs) {
+			memset(&encs[encs_count], 0, sizeof(encs[0]));
+			app_key = &encs[encs_count];
+			encs_count++;
+		}
+
+		if(mname) {
+			if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+			ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+		}
+
+		if(!xcan && specs->as_XMLValueList == 1)
+			ASN__TEXT_INDENT(1, ilevel + 1);
+		tmper = elm->type->op->xer_encoder(elm->type, memb_ptr,
+				ilevel + (specs->as_XMLValueList != 2),
+				flags, cb, app_key);
+		if(tmper.encoded == -1) return tmper;
+		er.encoded += tmper.encoded;
+		if(tmper.encoded == 0 && specs->as_XMLValueList) {
+			const char *name = elm->type->xml_tag;
+			size_t len = strlen(name);
+			ASN__CALLBACK3("<", 1, name, len, "/>", 2);
+		}
+
+		if(mname) {
+			ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+		}
+
+	}
+
+	if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	if(encs) {
+		xer_tmp_enc_t *enc = encs;
+		xer_tmp_enc_t *end = encs + encs_count;
+		ssize_t control_size = 0;
+
+		er.encoded = 0;
+		cb = original_cb;
+		app_key = original_app_key;
+		qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order);
+
+		for(; enc < end; enc++) {
+			ASN__CALLBACK(enc->buffer, enc->offset);
+			FREEMEM(enc->buffer);
+			enc->buffer = 0;
+			control_size += enc->offset;
+		}
+		assert(control_size == er.encoded);
+	}
+
+	goto cleanup;
+cb_failed:
+	ASN__ENCODE_FAILED;
+cleanup:
+	if(encs) {
+		size_t n;
+		for(n = 0; n < encs_count; n++) {
+			FREEMEM(encs[n].buffer);
+		}
+		FREEMEM(encs);
+	}
+	ASN__ENCODED_OK(er);
+}
+
+int
+SET_OF_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+             asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_TYPE_member_t *elm = td->elements;
+	const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+	int ret;
+	int i;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/* Dump preamble */
+	if(cb(td->name, strlen(td->name), app_key) < 0
+	|| cb(" ::= {", 6, app_key) < 0)
+		return -1;
+
+	for(i = 0; i < list->count; i++) {
+		const void *memb_ptr = list->array[i];
+		if(!memb_ptr) continue;
+
+		_i_INDENT(1);
+
+		ret = elm->type->op->print_struct(elm->type, memb_ptr,
+			ilevel + 1, cb, app_key);
+		if(ret) return ret;
+	}
+
+	ilevel--;
+	_i_INDENT(1);
+
+	return (cb("}", 1, app_key) < 0) ? -1 : 0;
+}
+
+void
+SET_OF_free(const asn_TYPE_descriptor_t *td, void *ptr,
+            enum asn_struct_free_method method) {
+    if(td && ptr) {
+		const asn_SET_OF_specifics_t *specs;
+		asn_TYPE_member_t *elm = td->elements;
+		asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr);
+		asn_struct_ctx_t *ctx;	/* Decoder context */
+		int i;
+
+		/*
+		 * Could not use set_of_empty() because of (*free)
+		 * incompatibility.
+		 */
+		for(i = 0; i < list->count; i++) {
+			void *memb_ptr = list->array[i];
+			if(memb_ptr)
+			ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		}
+		list->count = 0;	/* No meaningful elements left */
+
+		asn_set_empty(list);	/* Remove (list->array) */
+
+		specs = (const asn_SET_OF_specifics_t *)td->specifics;
+		ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
+		if(ctx->ptr) {
+			ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+			ctx->ptr = 0;
+		}
+
+        switch(method) {
+        case ASFM_FREE_EVERYTHING:
+            FREEMEM(ptr);
+            break;
+        case ASFM_FREE_UNDERLYING:
+            break;
+        case ASFM_FREE_UNDERLYING_AND_RESET:
+            memset(ptr, 0, specs->struct_size);
+            break;
+        }
+    }
+}
+
+int
+SET_OF_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const asn_TYPE_member_t *elm = td->elements;
+	asn_constr_check_f *constr;
+	const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+	int i;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	constr = elm->encoding_constraints.general_constraints;
+	if(!constr) constr = elm->type->encoding_constraints.general_constraints;
+
+	/*
+	 * Iterate over the members of an array.
+	 * Validate each in turn, until one fails.
+	 */
+	for(i = 0; i < list->count; i++) {
+		const void *memb_ptr = list->array[i];
+		int ret;
+
+		if(!memb_ptr) continue;
+
+		ret = constr(elm->type, memb_ptr, ctfailcb, app_key);
+		if(ret) return ret;
+	}
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    asn_dec_rval_t rv = {RC_OK, 0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements; /* Single one */
+    void *st = *sptr;
+	asn_anonymous_set_ *list;
+	const asn_per_constraint_t *ct;
+	int repeat = 0;
+	ssize_t nelems;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}                                                                       
+	list = _A_SET_FROM_VOID(st);
+
+	/* Figure out which constraints to use */
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted! */
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+		nelems = per_get_few_bits(pd, ct->effective_bits);
+		ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
+			(long)nelems, ct->lower_bound, td->name);
+		if(nelems < 0)  ASN__DECODE_STARVED;
+		nelems += ct->lower_bound;
+	} else {
+		nelems = -1;
+	}
+
+	do {
+		int i;
+		if(nelems < 0) {
+			nelems = uper_get_length(pd, -1, 0, &repeat);
+            ASN_DEBUG("Got to decode %" ASN_PRI_SSIZE " elements (eff %d)",
+                      nelems, (int)(ct ? ct->effective_bits : -1));
+            if(nelems < 0) ASN__DECODE_STARVED;
+		}
+
+		for(i = 0; i < nelems; i++) {
+			void *ptr = 0;
+			ASN_DEBUG("SET OF %s decoding", elm->type->name);
+			rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+				elm->encoding_constraints.per_constraints, &ptr, pd);
+			ASN_DEBUG("%s SET OF %s decoded %d, %p",
+				td->name, elm->type->name, rv.code, ptr);
+			if(rv.code == RC_OK) {
+				if(ASN_SET_ADD(list, ptr) == 0) {
+                    if(rv.consumed == 0 && nelems > 200) {
+                        /* Protect from SET OF NULL compression bombs. */
+                        ASN__DECODE_FAILED;
+                    }
+					continue;
+                }
+				ASN_DEBUG("Failed to add element into %s",
+					td->name);
+				/* Fall through */
+				rv.code = RC_FAIL;
+			} else {
+				ASN_DEBUG("Failed decoding %s of %s (SET OF)",
+					elm->type->name, td->name);
+			}
+			if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
+			return rv;
+		}
+
+		nelems = -1;	/* Allow uper_get_length() */
+	} while(repeat);
+
+	ASN_DEBUG("Decoded %s as SET OF", td->name);
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+asn_enc_rval_t
+SET_OF_encode_uper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+    const asn_anonymous_set_ *list;
+    const asn_per_constraint_t *ct;
+    const asn_TYPE_member_t *elm = td->elements;
+    struct _el_buffer *encoded_els;
+    asn_enc_rval_t er = {0,0,0};
+    size_t encoded_edx;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    list = _A_CSET_FROM_VOID(sptr);
+
+    er.encoded = 0;
+
+    ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
+
+    if(constraints) ct = &constraints->size;
+    else if(td->encoding_constraints.per_constraints)
+        ct = &td->encoding_constraints.per_constraints->size;
+    else ct = 0;
+
+    /* If extensible constraint, check if size is in root */
+    if(ct) {
+        int not_in_root =
+            (list->count < ct->lower_bound || list->count > ct->upper_bound);
+        ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
+                  ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+        if(ct->flags & APC_EXTENSIBLE) {
+            /* Declare whether size is in extension root */
+            if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED;
+            if(not_in_root) ct = 0;
+        } else if(not_in_root && ct->effective_bits >= 0) {
+            ASN__ENCODE_FAILED;
+        }
+
+    }
+
+    if(ct && ct->effective_bits >= 0) {
+        /* X.691, #19.5: No length determinant */
+        if(per_put_few_bits(po, list->count - ct->lower_bound,
+                            ct->effective_bits))
+            ASN__ENCODE_FAILED;
+    } else if(list->count == 0) {
+        /* When the list is empty add only the length determinant
+         * X.691, #20.6 and #11.9.4.1
+         */
+        if (uper_put_length(po, 0, 0)) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+
+    /*
+     * Canonical UPER #22.1 mandates dynamic sorting of the SET OF elements
+     * according to their encodings. Build an array of the encoded elements.
+     */
+    encoded_els = SET_OF__encode_sorted(elm, list, SOES_CUPER);
+
+    for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) {
+        ssize_t may_encode;
+        size_t edx;
+        int need_eom = 0;
+
+        if(ct && ct->effective_bits >= 0) {
+            may_encode = list->count;
+        } else {
+            may_encode =
+                uper_put_length(po, list->count - encoded_edx, &need_eom);
+            if(may_encode < 0) ASN__ENCODE_FAILED;
+        }
+
+        for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) {
+            const struct _el_buffer *el = &encoded_els[edx];
+            if(asn_put_many_bits(po, el->buf,
+                                 (8 * el->length) - el->bits_unused) < 0) {
+                break;
+            }
+        }
+
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+
+        encoded_edx += may_encode;
+    }
+
+    SET_OF__encode_sorted_free(encoded_els, list->count);
+
+    if((ssize_t)encoded_edx == list->count) {
+        ASN__ENCODED_OK(er);
+    } else {
+        ASN__ENCODE_FAILED;
+    }
+}
+
+asn_dec_rval_t
+SET_OF_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv = {RC_OK, 0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm = td->elements; /* Single one */
+	void *st = *sptr;
+	asn_anonymous_set_ *list;
+	const asn_per_constraint_t *ct;
+	int repeat = 0;
+	ssize_t nelems;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+	list = _A_SET_FROM_VOID(st);
+
+	/* Figure out which constraints to use */
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted! */
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+		nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
+		ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
+		          (long)nelems, ct->lower_bound, td->name);
+		if(nelems < 0)  ASN__DECODE_STARVED;
+		nelems += ct->lower_bound;
+	} else {
+		nelems = -1;
+	}
+
+	do {
+		int i;
+		if(nelems < 0) {
+			nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1,
+			                         ct ? ct->effective_bits : -1, &repeat);
+			ASN_DEBUG("Got to decode %d elements (eff %d)",
+			          (int)nelems, (int)(ct ? ct->effective_bits : -1));
+			if(nelems < 0) ASN__DECODE_STARVED;
+		}
+
+		for(i = 0; i < nelems; i++) {
+			void *ptr = 0;
+			ASN_DEBUG("SET OF %s decoding", elm->type->name);
+			rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+			                                 elm->encoding_constraints.per_constraints, &ptr, pd);
+			ASN_DEBUG("%s SET OF %s decoded %d, %p",
+			          td->name, elm->type->name, rv.code, ptr);
+			if(rv.code == RC_OK) {
+				if(ASN_SET_ADD(list, ptr) == 0)
+					continue;
+				ASN_DEBUG("Failed to add element into %s",
+				          td->name);
+				/* Fall through */
+				rv.code = RC_FAIL;
+			} else {
+				ASN_DEBUG("Failed decoding %s of %s (SET OF)",
+				          elm->type->name, td->name);
+			}
+			if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
+			return rv;
+		}
+
+		nelems = -1;	/* Allow uper_get_length() */
+	} while(repeat);
+
+	ASN_DEBUG("Decoded %s as SET OF", td->name);
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+struct comparable_ptr {
+    const asn_TYPE_descriptor_t *td;
+    const void *sptr;
+};
+
+static int
+SET_OF__compare_cb(const void *aptr, const void *bptr) {
+    const struct comparable_ptr *a = aptr;
+    const struct comparable_ptr *b = bptr;
+    assert(a->td == b->td);
+    return a->td->op->compare_struct(a->td, a->sptr, b->sptr);
+}
+
+int
+SET_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+               const void *bptr) {
+    const asn_anonymous_set_ *a = _A_CSET_FROM_VOID(aptr);
+    const asn_anonymous_set_ *b = _A_CSET_FROM_VOID(bptr);
+
+    if(a && b) {
+        struct comparable_ptr *asorted;
+        struct comparable_ptr *bsorted;
+        ssize_t common_length;
+        ssize_t idx;
+
+        if(a->count == 0) {
+            if(b->count) return -1;
+            return 0;
+        } else if(b->count == 0) {
+            return 1;
+        }
+
+        asorted = MALLOC(a->count * sizeof(asorted[0]));
+        bsorted = MALLOC(b->count * sizeof(bsorted[0]));
+        if(!asorted || !bsorted) {
+            FREEMEM(asorted);
+            FREEMEM(bsorted);
+            return -1;
+        }
+
+        for(idx = 0; idx < a->count; idx++) {
+            asorted[idx].td = td->elements->type;
+            asorted[idx].sptr = a->array[idx];
+        }
+
+        for(idx = 0; idx < b->count; idx++) {
+            bsorted[idx].td = td->elements->type;
+            bsorted[idx].sptr = b->array[idx];
+        }
+
+        qsort(asorted, a->count, sizeof(asorted[0]), SET_OF__compare_cb);
+        qsort(bsorted, b->count, sizeof(bsorted[0]), SET_OF__compare_cb);
+
+        common_length = (a->count < b->count ? a->count : b->count);
+        for(idx = 0; idx < common_length; idx++) {
+            int ret = td->elements->type->op->compare_struct(
+                td->elements->type, asorted[idx].sptr, bsorted[idx].sptr);
+            if(ret) {
+                FREEMEM(asorted);
+                FREEMEM(bsorted);
+                return ret;
+            }
+        }
+
+        FREEMEM(asorted);
+        FREEMEM(bsorted);
+
+        if(idx < b->count) /* more elements in b */
+            return -1;     /* a is shorter, so put it first */
+        if(idx < a->count) return 1;
+    } else if(!a) {
+        return -1;
+    } else if(!b) {
+        return 1;
+    }
+
+	return 0;
+}
+
+
+asn_TYPE_operation_t asn_OP_SET_OF = {
+	SET_OF_free,
+	SET_OF_print,
+	SET_OF_compare,
+	SET_OF_decode_ber,
+	SET_OF_encode_der,
+	SET_OF_decode_xer,
+	SET_OF_encode_xer,
+#ifdef ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SET_OF_decode_oer,
+	SET_OF_encode_oer,
+#endif
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SET_OF_decode_uper,
+	SET_OF_encode_uper,
+	SET_OF_decode_aper,
+	0,	/* SET_OF_encode_aper */
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SET_OF_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
+
+asn_random_fill_result_t
+SET_OF_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constraints,
+                   size_t max_length) {
+    const asn_SET_OF_specifics_t *specs =
+        (const asn_SET_OF_specifics_t *)td->specifics;
+    asn_random_fill_result_t res_ok = {ARFILL_OK, 0};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    const asn_TYPE_member_t *elm = td->elements;
+    void *st = *sptr;
+    long max_elements = 5;
+    long slb = 0;   /* Lower size bound */
+    long sub = 0;   /* Upper size bound */
+    size_t rnd_len;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (*sptr = CALLOC(1, specs->struct_size));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    switch(asn_random_between(0, 6)) {
+    case 0: max_elements = 0; break;
+    case 1: max_elements = 1; break;
+    case 2: max_elements = 5; break;
+    case 3: max_elements = max_length; break;
+    case 4: max_elements = max_length / 2; break;
+    case 5: max_elements = max_length / 4; break;
+    default: break;
+    }
+    sub = slb + max_elements;
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_SEMI_CONSTRAINED) {
+            slb = pc->lower_bound;
+            sub = pc->lower_bound + max_elements;
+        } else if(pc->flags & APC_CONSTRAINED) {
+            slb = pc->lower_bound;
+            sub = pc->upper_bound;
+            if(sub - slb > max_elements) sub = slb + max_elements;
+        }
+    }
+
+    /* Bias towards edges of allowed space */
+    switch(asn_random_between(-1, 4)) {
+    default:
+    case -1:
+        /* Prepare lengths somewhat outside of constrained range. */
+        if(constraints->per_constraints
+           && (constraints->per_constraints->size.flags & APC_EXTENSIBLE)) {
+            switch(asn_random_between(0, 5)) {
+            default:
+            case 0:
+                rnd_len = 0;
+                break;
+            case 1:
+                if(slb > 0) {
+                    rnd_len = slb - 1;
+                } else {
+                    rnd_len = 0;
+                }
+                break;
+            case 2:
+                rnd_len = asn_random_between(0, slb);
+                break;
+            case 3:
+                if(sub < (ssize_t)max_length) {
+                    rnd_len = sub + 1;
+                } else {
+                    rnd_len = max_length;
+                }
+                break;
+            case 4:
+                if(sub < (ssize_t)max_length) {
+                    rnd_len = asn_random_between(sub + 1, max_length);
+                } else {
+                    rnd_len = max_length;
+                }
+                break;
+            case 5:
+                rnd_len = max_length;
+                break;
+            }
+            break;
+        }
+        /* Fall through */
+    case 0:
+        rnd_len = asn_random_between(slb, sub);
+        break;
+    case 1:
+        if(slb < sub) {
+            rnd_len = asn_random_between(slb + 1, sub);
+            break;
+        }
+        /* Fall through */
+    case 2:
+        rnd_len = asn_random_between(slb, slb);
+        break;
+    case 3:
+        if(slb < sub) {
+            rnd_len = asn_random_between(slb, sub - 1);
+            break;
+        }
+        /* Fall through */
+    case 4:
+        rnd_len = asn_random_between(sub, sub);
+        break;
+    }
+
+    for(; rnd_len > 0; rnd_len--) {
+        asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+        void *ptr = 0;
+        asn_random_fill_result_t tmpres = elm->type->op->random_fill(
+            elm->type, &ptr, &elm->encoding_constraints,
+            (max_length > res_ok.length ? max_length - res_ok.length : 0)
+                / rnd_len);
+        switch(tmpres.code) {
+        case ARFILL_OK:
+            ASN_SET_ADD(list, ptr);
+            res_ok.length += tmpres.length;
+            break;
+        case ARFILL_SKIPPED:
+            break;
+        case ARFILL_FAILED:
+            assert(ptr == 0);
+            return tmpres;
+        }
+    }
+
+    return res_ok;
+}
+
diff --git a/e2ap/lib/constr_SET_OF_oer.c b/e2ap/lib/constr_SET_OF_oer.c
new file mode 100644
index 0000000..5200518
--- /dev/null
+++ b/e2ap/lib/constr_SET_OF_oer.c
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_SET_OF.h>
+#include <asn_SET_OF.h>
+#include <errno.h>
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef  ADVANCE
+#define ADVANCE(num_bytes)                   \
+    do {                                     \
+        size_t num = num_bytes;              \
+        ptr = ((const char *)ptr) + num;     \
+        size -= num;                         \
+        consumed_myself += num;              \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+#undef  SET_PHASE
+#define SET_PHASE(ctx, value) \
+    do {                      \
+        ctx->phase = value;   \
+        ctx->step = 0;        \
+    } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)                    \
+    do {                                 \
+        asn_dec_rval_t rval;             \
+        rval.code = _code;               \
+        rval.consumed = consumed_myself; \
+        return rval;                     \
+    } while(0)
+
+/*
+ * The SEQUENCE OF and SET OF values utilize a "quantity field".
+ * It is is a pointless combination of #8.6 (length determinant, capable
+ * of encoding tiny and huge numbers in the shortest possible number of octets)
+ * and the variable sized integer. What could have been encoded by #8.6 alone
+ * is required to be encoded by #8.6 followed by that number of unsigned octets.
+ * This doesn't make too much sense. It seems that the original version of OER
+ * standard have been using the unconstrained unsigned integer as a quantity
+ * field, and this legacy have gone through ISO/ITU-T standardization process.
+ */
+static ssize_t
+oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) {
+    const uint8_t *b;
+    const uint8_t *bend;
+    size_t len = 0;
+    size_t qty;
+
+    ssize_t len_len = oer_fetch_length(ptr, size, &len);
+    if(len_len <= 0) {
+        *qty_r = 0;
+        return len_len;
+    }
+
+    if((len_len + len) > size) {
+        *qty_r = 0;
+        return 0;
+    }
+
+    b = (const uint8_t *)ptr + len_len;
+    bend = b + len;
+
+    /* Skip the leading 0-bytes */
+    for(; b < bend && *b == 0; b++) {
+    }
+
+    if((bend - b) > (ssize_t)sizeof(size_t)) {
+        /* Length is not representable by the native size_t type */
+        *qty_r = 0;
+        return -1;
+    }
+
+    for(qty = 0; b < bend; b++) {
+        qty = (qty << 8) + *b;
+    }
+
+    if(qty > RSIZE_MAX) { /* A bit of C11 validation */
+        *qty_r = 0;
+        return -1;
+    }
+
+    *qty_r = qty;
+    assert((size_t)len_len + len == (size_t)(bend - (const uint8_t *)ptr));
+    return len_len + len;
+}
+
+asn_dec_rval_t
+SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *ptr, size_t size) {
+    const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    void *st = *struct_ptr; /* Target structure */
+    asn_struct_ctx_t *ctx; /* Decoder context */
+    size_t consumed_myself = 0; /* Consumed bytes from ptr. */
+
+    (void)constraints;
+
+    if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+        ASN__DECODE_FAILED;
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+    /*
+     * Start to parse where left previously.
+     */
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Fetch number of elements to decode.
+         */
+        size_t length = 0;
+        size_t len_size = oer_fetch_quantity(ptr, size, &length);
+        switch(len_size) {
+        case 0:
+            RETURN(RC_WMORE);
+        case -1:
+            RETURN(RC_FAIL);
+        default:
+            ADVANCE(len_size);
+            ctx->left = length;
+        }
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 1: {
+        /* Decode components of the extension root */
+        asn_TYPE_member_t *elm = td->elements;
+        asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+        const void *base_ptr = ptr;
+        ber_tlv_len_t base_ctx_left = ctx->left;
+
+        assert(td->elements_count == 1);
+
+        ASN_DEBUG("OER SET OF %s Decoding PHASE 1", td->name);
+
+        for(; ctx->left > 0; ctx->left--) {
+            asn_dec_rval_t rv = elm->type->op->oer_decoder(
+                opt_codec_ctx, elm->type,
+                elm->encoding_constraints.oer_constraints, &ctx->ptr, ptr,
+                size);
+            ADVANCE(rv.consumed);
+            switch(rv.code) {
+            case RC_OK:
+                if(ASN_SET_ADD(list, ctx->ptr) != 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    ctx->ptr = 0;
+                    /*
+                     * This check is to avoid compression bomb with
+                     * specs like SEQUENCE/SET OF NULL which don't
+                     * consume data at all.
+                     */
+                    if(rv.consumed == 0 && base_ptr == ptr
+                       && (base_ctx_left - ctx->left) > 200) {
+                        ASN__DECODE_FAILED;
+                    }
+                    break;
+                }
+            case RC_WMORE:
+                RETURN(RC_WMORE);
+            case RC_FAIL:
+                ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+                ctx->ptr = 0;
+                SET_PHASE(ctx, 3);
+                RETURN(RC_FAIL);
+            }
+        }
+        /* Decoded decently. */
+        NEXT_PHASE(ctx);
+    }
+        /* Fall through */
+    case 2:
+        /* Ignore fully decoded */
+        assert(ctx->left == 0);
+        RETURN(RC_OK);
+    case 3:
+        /* Failed to decode. */
+        RETURN(RC_FAIL);
+    }
+
+    return rval;
+}
+
+static ssize_t
+oer_put_quantity(size_t qty, asn_app_consume_bytes_f *cb, void *app_key) {
+    uint8_t buf[1 + sizeof(size_t)];
+    uint8_t *b = &buf[sizeof(size_t)]; /* Last addressable */
+    size_t encoded;
+
+    do {
+        *b-- = qty;
+        qty >>= 8;
+    } while(qty);
+
+    *b = sizeof(buf) - (b-buf) - 1;
+    encoded = sizeof(buf) - (b-buf);
+    if(cb(b, encoded, app_key) < 0)
+        return -1;
+    return encoded;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+SET_OF_encode_oer(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_TYPE_member_t *elm;
+    const asn_anonymous_set_ *list;
+    size_t computed_size = 0;
+    ssize_t qty_len;
+    int n;
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    elm = td->elements;
+    list = _A_CSET_FROM_VOID(sptr);
+
+    qty_len = oer_put_quantity(list->count, cb, app_key);
+    if(qty_len < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    computed_size += qty_len;
+
+    for(n = 0; n < list->count; n++) {
+        void *memb_ptr = list->array[n];
+        asn_enc_rval_t er = {0,0,0};
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded < 0) {
+            return er;
+        } else {
+            computed_size += er.encoded;
+        }
+    }
+
+    {
+        asn_enc_rval_t erval = {0,0,0};
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/constr_TYPE.c b/e2ap/lib/constr_TYPE.c
new file mode 100644
index 0000000..aefaefd
--- /dev/null
+++ b/e2ap/lib/constr_TYPE.c
@@ -0,0 +1,80 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_TYPE.h>
+#include <errno.h>
+
+/*
+ * Version of the ASN.1 infrastructure shipped with compiler.
+ */
+int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; }
+
+static asn_app_consume_bytes_f _print2fp;
+
+/*
+ * Return the outmost tag of the type.
+ */
+ber_tlv_tag_t
+asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor,
+		const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) {
+
+	if(tag_mode)
+		return tag;
+
+	if(type_descriptor->tags_count)
+		return type_descriptor->tags[0];
+
+	return type_descriptor->op->outmost_tag(type_descriptor, struct_ptr, 0, 0);
+}
+
+/*
+ * Print the target language's structure in human readable form.
+ */
+int
+asn_fprint(FILE *stream, const asn_TYPE_descriptor_t *td,
+           const void *struct_ptr) {
+    if(!stream) stream = stdout;
+    if(!td || !struct_ptr) {
+        errno = EINVAL;
+        return -1;
+	}
+
+	/* Invoke type-specific printer */
+    if(td->op->print_struct(td, struct_ptr, 1, _print2fp, stream)) {
+        return -1;
+    }
+
+    /* Terminate the output */
+    if(_print2fp("\n", 1, stream)) {
+        return -1;
+    }
+
+    return fflush(stream);
+}
+
+/* Dump the data into the specified stdio stream */
+static int
+_print2fp(const void *buffer, size_t size, void *app_key) {
+	FILE *stream = (FILE *)app_key;
+
+	if(fwrite(buffer, 1, size, stream) != size)
+		return -1;
+
+	return 0;
+}
+
+
+/*
+ * Some compilers do not support variable args macros.
+ * This function is a replacement of ASN_DEBUG() macro.
+ */
+void ASN_DEBUG_f(const char *fmt, ...);
+void ASN_DEBUG_f(const char *fmt, ...) {
+	va_list ap;
+	va_start(ap, fmt);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, "\n");
+	va_end(ap);
+}
diff --git a/e2ap/lib/constraints.c b/e2ap/lib/constraints.c
new file mode 100644
index 0000000..df3c6c1
--- /dev/null
+++ b/e2ap/lib/constraints.c
@@ -0,0 +1,93 @@
+#include <asn_internal.h>
+#include <constraints.h>
+
+int
+asn_generic_no_constraint(const asn_TYPE_descriptor_t *type_descriptor,
+                          const void *struct_ptr,
+                          asn_app_constraint_failed_f *cb, void *key) {
+    (void)type_descriptor;	/* Unused argument */
+	(void)struct_ptr;	/* Unused argument */
+	(void)cb;	/* Unused argument */
+	(void)key;	/* Unused argument */
+
+	/* Nothing to check */
+	return 0;
+}
+
+int
+asn_generic_unknown_constraint(const asn_TYPE_descriptor_t *type_descriptor,
+                               const void *struct_ptr,
+                               asn_app_constraint_failed_f *cb, void *key) {
+    (void)type_descriptor;	/* Unused argument */
+	(void)struct_ptr;	/* Unused argument */
+	(void)cb;	/* Unused argument */
+	(void)key;	/* Unused argument */
+
+	/* Unknown how to check */
+	return 0;
+}
+
+struct errbufDesc {
+    const asn_TYPE_descriptor_t *failed_type;
+    const void *failed_struct_ptr;
+	char *errbuf;
+	size_t errlen;
+};
+
+static void
+_asn_i_ctfailcb(void *key, const asn_TYPE_descriptor_t *td, const void *sptr,
+                const char *fmt, ...) {
+    struct errbufDesc *arg = key;
+	va_list ap;
+	ssize_t vlen;
+	ssize_t maxlen;
+
+	arg->failed_type = td;
+	arg->failed_struct_ptr = sptr;
+
+	maxlen = arg->errlen;
+	if(maxlen <= 0)
+		return;
+
+	va_start(ap, fmt);
+	vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap);
+	va_end(ap);
+	if(vlen >= maxlen) {
+		arg->errbuf[maxlen-1] = '\0';	/* Ensuring libc correctness */
+		arg->errlen = maxlen - 1;	/* Not counting termination */
+		return;
+	} else if(vlen >= 0) {
+		arg->errbuf[vlen] = '\0';	/* Ensuring libc correctness */
+		arg->errlen = vlen;		/* Not counting termination */
+	} else {
+		/*
+		 * The libc on this system is broken.
+		 */
+		vlen = sizeof("<broken vsnprintf>") - 1;
+		maxlen--;
+		arg->errlen = vlen < maxlen ? vlen : maxlen;
+		memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
+		arg->errbuf[arg->errlen] = 0;
+	}
+
+	return;
+}
+
+int
+asn_check_constraints(const asn_TYPE_descriptor_t *type_descriptor,
+                      const void *struct_ptr, char *errbuf, size_t *errlen) {
+    struct errbufDesc arg;
+    int ret;
+
+    arg.failed_type = 0;
+    arg.failed_struct_ptr = 0;
+    arg.errbuf = errbuf;
+    arg.errlen = errlen ? *errlen : 0;
+
+    ret = type_descriptor->encoding_constraints.general_constraints(
+        type_descriptor, struct_ptr, _asn_i_ctfailcb, &arg);
+    if(ret == -1 && errlen) *errlen = arg.errlen;
+
+    return ret;
+}
+
diff --git a/e2ap/lib/der_encoder.c b/e2ap/lib/der_encoder.c
new file mode 100644
index 0000000..2c6a6f7
--- /dev/null
+++ b/e2ap/lib/der_encoder.c
@@ -0,0 +1,194 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <errno.h>
+
+static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
+	asn_app_consume_bytes_f *cb, void *app_key, int constructed);
+
+/*
+ * The DER encoder of any type.
+ */
+asn_enc_rval_t
+der_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr,
+           asn_app_consume_bytes_f *consume_bytes, void *app_key) {
+    ASN_DEBUG("DER encoder invoked for %s",
+		type_descriptor->name);
+
+	/*
+	 * Invoke type-specific encoder.
+	 */
+    return type_descriptor->op->der_encoder(
+        type_descriptor, struct_ptr, /* Pointer to the destination structure */
+        0, 0, consume_bytes, app_key);
+}
+
+/*
+ * Argument type and callback necessary for der_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+	void *buffer;
+	size_t left;
+} enc_to_buf_arg;
+static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+	enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+	if(arg->left < size)
+		return -1;	/* Data exceeds the available buffer size */
+
+	memcpy(arg->buffer, buffer, size);
+	arg->buffer = ((char *)arg->buffer) + size;
+	arg->left -= size;
+
+	return 0;
+}
+
+/*
+ * A variant of the der_encode() which encodes the data into the provided buffer
+ */
+asn_enc_rval_t
+der_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor,
+                     const void *struct_ptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg arg;
+	asn_enc_rval_t ec;
+
+	arg.buffer = buffer;
+	arg.left = buffer_size;
+
+	ec = type_descriptor->op->der_encoder(type_descriptor,
+		struct_ptr,	/* Pointer to the destination structure */
+		0, 0, encode_to_buffer_cb, &arg);
+	if(ec.encoded != -1) {
+		assert(ec.encoded == (ssize_t)(buffer_size - arg.left));
+		/* Return the encoded contents size */
+	}
+	return ec;
+}
+
+
+/*
+ * Write out leading TL[v] sequence according to the type definition.
+ */
+ssize_t
+der_write_tags(const asn_TYPE_descriptor_t *sd, size_t struct_length,
+               int tag_mode, int last_tag_form,
+               ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */
+               asn_app_consume_bytes_f *cb, void *app_key) {
+#define ASN1_DER_MAX_TAGS_COUNT 4
+    ber_tlv_tag_t
+        tags_buf_scratch[ASN1_DER_MAX_TAGS_COUNT * sizeof(ber_tlv_tag_t)];
+    ssize_t lens[ASN1_DER_MAX_TAGS_COUNT * sizeof(ssize_t)];
+    const ber_tlv_tag_t *tags; /* Copy of tags stream */
+    int tags_count;            /* Number of tags */
+    size_t overall_length;
+    int i;
+
+    ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)",
+		sd->name, tag_mode, sd->tags_count,
+		ber_tlv_tag_string(tag),
+		tag_mode
+			?(sd->tags_count+1
+				-((tag_mode == -1) && sd->tags_count))
+			:sd->tags_count
+	);
+
+    if(sd->tags_count + 1 > ASN1_DER_MAX_TAGS_COUNT) {
+        ASN_DEBUG("System limit %d on tags count", ASN1_DER_MAX_TAGS_COUNT);
+        return -1;
+    }
+
+	if(tag_mode) {
+		/*
+		 * Instead of doing shaman dance like we do in ber_check_tags(),
+		 * allocate a small array on the stack
+		 * and initialize it appropriately.
+		 */
+		int stag_offset;
+		ber_tlv_tag_t *tags_buf = tags_buf_scratch;
+		tags_count = sd->tags_count
+			+ 1	/* EXPLICIT or IMPLICIT tag is given */
+			- ((tag_mode == -1) && sd->tags_count);
+		/* Copy tags over */
+		tags_buf[0] = tag;
+		stag_offset = -1 + ((tag_mode == -1) && sd->tags_count);
+		for(i = 1; i < tags_count; i++)
+			tags_buf[i] = sd->tags[i + stag_offset];
+		tags = tags_buf;
+	} else {
+		tags = sd->tags;
+		tags_count = sd->tags_count;
+	}
+
+	/* No tags to write */
+	if(tags_count == 0)
+		return 0;
+
+	/*
+	 * Array of tags is initialized.
+	 * Now, compute the size of the TLV pairs, from right to left.
+	 */
+	overall_length = struct_length;
+	for(i = tags_count - 1; i >= 0; --i) {
+		lens[i] = der_write_TL(tags[i], overall_length, 0, 0, 0);
+		if(lens[i] == -1) return -1;
+		overall_length += lens[i];
+		lens[i] = overall_length - lens[i];
+	}
+
+	if(!cb) return overall_length - struct_length;
+
+	ASN_DEBUG("Encoding %s TL sequence (%d elements)", sd->name,
+                  tags_count);
+
+	/*
+	 * Encode the TL sequence for real.
+	 */
+	for(i = 0; i < tags_count; i++) {
+		ssize_t len;
+		int _constr;
+
+		/* Check if this tag happens to be constructed */
+		_constr = (last_tag_form || i < (tags_count - 1));
+
+		len = der_write_TL(tags[i], lens[i], cb, app_key, _constr);
+		if(len == -1) return -1;
+	}
+
+	return overall_length - struct_length;
+}
+
+static ssize_t
+der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
+		asn_app_consume_bytes_f *cb, void *app_key,
+		int constructed) {
+	uint8_t buf[32];
+	size_t size = 0;
+	int buf_size = cb?sizeof(buf):0;
+	ssize_t tmp;
+
+	/* Serialize tag (T from TLV) into possibly zero-length buffer */
+	tmp = ber_tlv_tag_serialize(tag, buf, buf_size);
+	if(tmp == -1 || tmp > (ssize_t)sizeof(buf)) return -1;
+	size += tmp;
+
+	/* Serialize length (L from TLV) into possibly zero-length buffer */
+	tmp = der_tlv_length_serialize(len, buf+size, buf_size?buf_size-size:0);
+	if(tmp == -1) return -1;
+	size += tmp;
+
+	if(size > sizeof(buf))
+		return -1;
+
+	/*
+	 * If callback is specified, invoke it, and check its return value.
+	 */
+	if(cb) {
+		if(constructed) *buf |= 0x20;
+		if(cb(buf, size, app_key) < 0)
+			return -1;
+	}
+
+	return size;
+}
diff --git a/e2ap/lib/oer_decoder.c b/e2ap/lib/oer_decoder.c
new file mode 100644
index 0000000..0701738
--- /dev/null
+++ b/e2ap/lib/oer_decoder.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+
+/*
+ * The OER decoder of any type.
+ */
+asn_dec_rval_t
+oer_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+           const void *ptr, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return type_descriptor->op->oer_decoder(opt_codec_ctx, type_descriptor, 0,
+		struct_ptr,	/* Pointer to the destination structure */
+		ptr, size	/* Buffer and its size */
+		);
+}
+
+/*
+ * Open Type is encoded as a length (#8.6) followed by that number of bytes.
+ * Since we're just skipping, reading the length would be enough.
+ */
+ssize_t
+oer_open_type_skip(const void *bufptr, size_t size) {
+    size_t len = 0;
+    return oer_fetch_length(bufptr, size, &len);
+}
+
+/*
+ * Read the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t
+oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const struct asn_TYPE_descriptor_s *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *bufptr, size_t size) {
+    asn_dec_rval_t dr;
+    size_t container_len = 0;
+    ssize_t len_len;
+    enum asn_struct_free_method dispose_method =
+        (*struct_ptr) ? ASFM_FREE_UNDERLYING_AND_RESET : ASFM_FREE_EVERYTHING;
+
+    /* Get the size of a length determinant */
+    len_len = oer_fetch_length(bufptr, size, &container_len);
+    if(len_len <= 0) {
+        return len_len; /* Error or more data expected */
+    }
+
+    /*
+     * len_len can't be bigger than size, but size without len_len
+     * should be bigger or equal to container length
+     */
+    if(size - len_len < container_len) {
+        /* More data is expected */
+        return 0;
+    }
+
+    dr = td->op->oer_decoder(opt_codec_ctx, td, constraints, struct_ptr,
+                         (const uint8_t *)bufptr + len_len, container_len);
+    if(dr.code == RC_OK) {
+        return len_len + container_len;
+    } else {
+        /* Even if RC_WMORE, we can't get more data into a closed container. */
+        td->op->free_struct(td, *struct_ptr, dispose_method);
+        *struct_ptr = NULL;
+        return -1;
+    }
+}
+
+
+asn_dec_rval_t
+oer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_oer_constraints_t *constraints, void **sptr,
+                     const void *ptr, size_t size) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+    ssize_t len_len;
+
+    (void)td;
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    if(!st) {
+        st = (ASN__PRIMITIVE_TYPE_t *)(*sptr = CALLOC(
+                                           1, sizeof(ASN__PRIMITIVE_TYPE_t)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+
+    /*
+     * X.696 (08/2015) #27.2
+     * Encode length determinant as _number of octets_, but only
+     * if upper bound is not equal to lower bound.
+     */
+    len_len = oer_fetch_length(ptr, size, &expected_length);
+    if(len_len > 0) {
+        rval.consumed = len_len;
+        ptr = (const char *)ptr + len_len;
+        size -= len_len;
+    } else if(len_len == 0) {
+        ASN__DECODE_STARVED;
+    } else if(len_len < 0) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
diff --git a/e2ap/lib/oer_encoder.c b/e2ap/lib/oer_encoder.c
new file mode 100644
index 0000000..a284cc2
--- /dev/null
+++ b/e2ap/lib/oer_encoder.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+
+/*
+ * The OER encoder of any type.
+ */
+asn_enc_rval_t
+oer_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr,
+           asn_app_consume_bytes_f *consume_bytes, void *app_key) {
+    ASN_DEBUG("OER encoder invoked for %s", type_descriptor->name);
+
+    /*
+     * Invoke type-specific encoder.
+     */
+    return type_descriptor->op->oer_encoder(
+        type_descriptor, 0,
+        struct_ptr, /* Pointer to the destination structure */
+        consume_bytes, app_key);
+}
+
+/*
+ * Argument type and callback necessary for oer_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+        void *buffer;
+        size_t left;
+} enc_to_buf_arg;
+static int
+encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+    enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+    if(arg->left < size) return -1; /* Data exceeds the available buffer size */
+
+    memcpy(arg->buffer, buffer, size);
+    arg->buffer = ((char *)arg->buffer) + size;
+    arg->left -= size;
+
+    return 0;
+}
+
+/*
+ * A variant of the oer_encode() which encodes the data into the provided buffer
+ */
+asn_enc_rval_t
+oer_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor,
+                     const asn_oer_constraints_t *constraints,
+                     const void *struct_ptr, /* Structure to be encoded */
+                     void *buffer,           /* Pre-allocated buffer */
+                     size_t buffer_size      /* Initial buffer size (maximum) */
+) {
+    enc_to_buf_arg arg;
+    asn_enc_rval_t ec;
+
+    arg.buffer = buffer;
+    arg.left = buffer_size;
+
+    if(type_descriptor->op->oer_encoder == NULL) {
+        ec.encoded = -1;
+        ec.failed_type = type_descriptor;
+        ec.structure_ptr = struct_ptr;
+        ASN_DEBUG("OER encoder is not defined for %s",
+                type_descriptor->name);
+    } else {
+        ec = type_descriptor->op->oer_encoder(
+            type_descriptor, constraints,
+            struct_ptr, /* Pointer to the destination structure */
+            encode_to_buffer_cb, &arg);
+        if(ec.encoded != -1) {
+            assert(ec.encoded == (ssize_t)(buffer_size - arg.left));
+            /* Return the encoded contents size */
+        }
+    }
+    return ec;
+}
+
+asn_enc_rval_t
+oer_encode_primitive(const asn_TYPE_descriptor_t *td,
+                     const asn_oer_constraints_t *constraints, const void *sptr,
+                     asn_app_consume_bytes_f *cb, void *app_key) {
+    const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr;
+    asn_enc_rval_t er = {0, 0, 0};
+    ssize_t ret;
+
+    (void)constraints;
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("Encoding %s (%" ASN_PRI_SIZE " bytes)", td ? td->name : "", st->size);
+
+    /*
+     * X.696 (08/2015) #27.2
+     */
+    ret = oer_serialize_length(st->size, cb, app_key);
+    if(ret < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    er.encoded += ret;
+
+    er.encoded += st->size;
+    if(cb(st->buf, st->size, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        ASN__ENCODED_OK(er);
+    }
+}
+
+static int
+oer__count_bytes(const void *buffer, size_t size, void *bytes_ptr) {
+    size_t *bytes = bytes_ptr;
+    (void)buffer;
+    *bytes += size;
+    return 0;
+}
+
+ssize_t
+oer_open_type_put(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t serialized_byte_count = 0;
+    asn_enc_rval_t er = {0,0,0};
+    ssize_t len_len;
+
+    er = td->op->oer_encoder(td, constraints, sptr, oer__count_bytes,
+                             &serialized_byte_count);
+    if(er.encoded < 0) return -1;
+    assert(serialized_byte_count == (size_t)er.encoded);
+
+    len_len = oer_serialize_length(serialized_byte_count, cb, app_key);
+    if(len_len == -1) return -1;
+
+    er = td->op->oer_encoder(td, constraints, sptr, cb, app_key);
+    if(er.encoded < 0) return -1;
+    assert(serialized_byte_count == (size_t)er.encoded);
+
+    return len_len + er.encoded;
+}
+
diff --git a/e2ap/lib/oer_support.c b/e2ap/lib/oer_support.c
new file mode 100644
index 0000000..b15a3bc
--- /dev/null
+++ b/e2ap/lib/oer_support.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+
+#include <oer_support.h>
+
+/*
+ * Fetch the length determinant (X.696 08/2015, #8.6) into *len_r.
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t
+oer_fetch_length(const void *bufptr, size_t size, size_t *len_r) {
+    uint8_t first_byte;
+    size_t len_len;    /* Length of the length determinant */
+    const uint8_t *b;
+    const uint8_t *bend;
+    size_t len;
+
+    if(size == 0) {
+        *len_r = 0;
+        return 0;
+    }
+
+    first_byte = *(const uint8_t *)bufptr;
+    if((first_byte & 0x80) == 0) {   /* Short form */
+        *len_r = first_byte; /* 0..127 */
+        return 1;
+    }
+
+    len_len = (first_byte & 0x7f);
+    if((1 + len_len) > size) {
+        *len_r = 0;
+        return 0;
+    }
+
+    b = (const uint8_t *)bufptr + 1;
+    bend = b + len_len;
+
+    for(; b < bend && *b == 0; b++) {
+        /* Skip the leading 0-bytes */
+    }
+
+    if((bend - b) > (ssize_t)sizeof(size_t)) {
+        /* Length is not representable by the native size_t type */
+        *len_r = 0;
+        return -1;
+    }
+
+    for(len = 0; b < bend; b++) {
+        len = (len << 8) + *b;
+    }
+
+    if(len > RSIZE_MAX) { /* A bit of C11 validation */
+        *len_r = 0;
+        return -1;
+    }
+
+    *len_r = len;
+    assert(len_len + 1 == (size_t)(bend - (const uint8_t *)bufptr));
+    return len_len + 1;
+}
+
+
+/*
+ * Serialize OER length. Returns the number of bytes serialized
+ * or -1 if a given callback returned with negative result.
+ */
+ssize_t
+oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb,
+                     void *app_key) {
+    uint8_t scratch[1 + sizeof(length)];
+    uint8_t *sp = scratch;
+    int littleEndian = 1;   /* Run-time detection */
+    const uint8_t *pstart;
+    const uint8_t *pend;
+    const uint8_t *p;
+    int add;
+
+    if(length <= 127) {
+        uint8_t b = length;
+        if(cb(&b, 1, app_key) < 0) {
+            return -1;
+        }
+        return 1;
+    }
+
+    if(*(char *)&littleEndian) {
+        pstart = (const uint8_t *)&length + sizeof(length) - 1;
+        pend = (const uint8_t *)&length;
+        add = -1;
+    } else {
+        pstart = (const uint8_t *)&length;
+        pend = pstart + sizeof(length);
+        add = 1;
+    }
+
+    for(p = pstart; p != pend; p += add) {
+        /* Skip leading zeros. */
+        if(*p) break;
+    }
+
+    for(sp = scratch + 1; ; p += add) {
+        *sp++ = *p;
+        if(p == pend) break;
+    }
+    assert((sp - scratch) - 1 <= 0x7f);
+    scratch[0] = 0x80 + ((sp - scratch) - 1);
+
+    if(cb(scratch, sp - scratch, app_key) < 0) {
+        return -1;
+    }
+
+    return sp - scratch;
+}
+
diff --git a/e2ap/lib/per_decoder.c b/e2ap/lib/per_decoder.c
new file mode 100644
index 0000000..8a3e39d
--- /dev/null
+++ b/e2ap/lib/per_decoder.c
@@ -0,0 +1,185 @@
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <per_decoder.h>
+
+/*
+ * Decode a "Production of a complete encoding", X.691#10.1.
+ * The complete encoding contains at least one byte, and is an integral
+ * multiple of 8 bytes.
+ */
+asn_dec_rval_t
+uper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buffer, size_t size) {
+    asn_dec_rval_t rval;
+
+	rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
+	if(rval.consumed) {
+		/*
+		 * We've always given 8-aligned data,
+		 * so convert bits to integral bytes.
+		 */
+		rval.consumed += 7;
+		rval.consumed >>= 3;
+	} else if(rval.code == RC_OK) {
+		if(size) {
+			if(((const uint8_t *)buffer)[0] == 0) {
+				rval.consumed = 1;	/* 1 byte */
+			} else {
+				ASN_DEBUG("Expecting single zeroed byte");
+				rval.code = RC_FAIL;
+			}
+		} else {
+			/* Must contain at least 8 bits. */
+			rval.code = RC_WMORE;
+		}
+	}
+
+	return rval;
+}
+
+asn_dec_rval_t
+uper_decode(const asn_codec_ctx_t *opt_codec_ctx,
+            const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer,
+            size_t size, int skip_bits, int unused_bits) {
+    asn_codec_ctx_t s_codec_ctx;
+	asn_dec_rval_t rval;
+	asn_per_data_t pd;
+
+	if(skip_bits < 0 || skip_bits > 7
+	|| unused_bits < 0 || unused_bits > 7
+	|| (unused_bits > 0 && !size))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/* Fill in the position indicator */
+	memset(&pd, 0, sizeof(pd));
+	pd.buffer = (const uint8_t *)buffer;
+	pd.nboff = skip_bits;
+	pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from <limits.h> */
+	if(pd.nboff > pd.nbits)
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	if(!td->op->uper_decoder)
+		ASN__DECODE_FAILED;	/* PER is not compiled in */
+	rval = td->op->uper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+	if(rval.code == RC_OK) {
+		/* Return the number of consumed bits */
+		rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
+					+ pd.nboff - skip_bits;
+		ASN_DEBUG("PER decoding consumed %ld, counted %ld",
+			(long)rval.consumed, (long)pd.moved);
+		assert(rval.consumed == pd.moved);
+	} else {
+		/* PER codec is not a restartable */
+		rval.consumed = 0;
+	}
+	return rval;
+}
+
+asn_dec_rval_t
+aper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buffer, size_t size) {
+	asn_dec_rval_t rval;
+
+	rval = aper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
+	if(rval.consumed) {
+		/*
+		 * We've always given 8-aligned data,
+		 * so convert bits to integral bytes.
+		 */
+		rval.consumed += 7;
+		rval.consumed >>= 3;
+	} else if(rval.code == RC_OK) {
+		if(size) {
+			if(((const uint8_t *)buffer)[0] == 0) {
+				rval.consumed = 1;	/* 1 byte */
+			} else {
+				ASN_DEBUG("Expecting single zeroed byte");
+				rval.code = RC_FAIL;
+			}
+		} else {
+			/* Must contain at least 8 bits. */
+			rval.code = RC_WMORE;
+		}
+	}
+
+	return rval;
+}
+
+asn_dec_rval_t
+aper_decode(const asn_codec_ctx_t *opt_codec_ctx,
+            const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer,
+            size_t size, int skip_bits, int unused_bits) {
+	asn_codec_ctx_t s_codec_ctx;
+	asn_dec_rval_t rval;
+	asn_per_data_t pd;
+
+	if(skip_bits < 0 || skip_bits > 7
+		|| unused_bits < 0 || unused_bits > 7
+		|| (unused_bits > 0 && !size))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/* Fill in the position indicator */
+	memset(&pd, 0, sizeof(pd));
+	pd.buffer = (const uint8_t *)buffer;
+	pd.nboff = skip_bits;
+	pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from <limits.h> */
+	if(pd.nboff > pd.nbits)
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	if(!td->op->aper_decoder)
+		ASN__DECODE_FAILED;	/* PER is not compiled in */
+		rval = td->op->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+	if(rval.code == RC_OK) {
+		/* Return the number of consumed bits */
+		rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
+		+ pd.nboff - skip_bits;
+		ASN_DEBUG("PER decoding consumed %zu, counted %zu",
+				  rval.consumed, pd.moved);
+		assert(rval.consumed == pd.moved);
+	} else {
+		/* PER codec is not a restartable */
+		rval.consumed = 0;
+	}
+	return rval;
+}
+
diff --git a/e2ap/lib/per_encoder.c b/e2ap/lib/per_encoder.c
new file mode 100644
index 0000000..a35e1f0
--- /dev/null
+++ b/e2ap/lib/per_encoder.c
@@ -0,0 +1,265 @@
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <per_encoder.h>
+
+static int _uper_encode_flush_outp(asn_per_outp_t *po);
+
+static int
+ignore_output(const void *data, size_t size, void *app_key) {
+    (void)data;
+    (void)size;
+    (void)app_key;
+    return 0;
+}
+
+asn_enc_rval_t
+uper_encode(const asn_TYPE_descriptor_t *td,
+            const asn_per_constraints_t *constraints, const void *sptr,
+            asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_per_outp_t po;
+    asn_enc_rval_t er = {0,0,0};
+
+    /*
+     * Invoke type-specific encoder.
+     */
+    if(!td || !td->op->uper_encoder)
+        ASN__ENCODE_FAILED;	/* PER is not compiled in */
+
+    po.buffer = po.tmpspace;
+    po.nboff = 0;
+    po.nbits = 8 * sizeof(po.tmpspace);
+    po.output = cb ? cb : ignore_output;
+    po.op_key = app_key;
+    po.flushed_bytes = 0;
+
+    er = td->op->uper_encoder(td, constraints, sptr, &po);
+    if(er.encoded != -1) {
+        size_t bits_to_flush;
+
+        bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
+
+        /* Set number of bits encoded to a firm value */
+        er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
+
+        if(_uper_encode_flush_outp(&po)) ASN__ENCODE_FAILED;
+    }
+
+    return er;
+}
+
+/*
+ * Argument type and callback necessary for uper_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+	void *buffer;
+	size_t left;
+} enc_to_buf_arg;
+static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+	enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+	if(arg->left < size)
+		return -1;	/* Data exceeds the available buffer size */
+
+	memcpy(arg->buffer, buffer, size);
+	arg->buffer = ((char *)arg->buffer) + size;
+	arg->left -= size;
+
+	return 0;
+}
+
+asn_enc_rval_t
+uper_encode_to_buffer(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg key;
+
+    key.buffer = buffer;
+    key.left = buffer_size;
+
+    if(td) ASN_DEBUG("Encoding \"%s\" using UNALIGNED PER", td->name);
+
+    return uper_encode(td, constraints, sptr, encode_to_buffer_cb, &key);
+}
+
+typedef struct enc_dyn_arg {
+	void *buffer;
+	size_t length;
+	size_t allocated;
+} enc_dyn_arg;
+static int
+encode_dyn_cb(const void *buffer, size_t size, void *key) {
+    enc_dyn_arg *arg = key;
+    if(arg->length + size >= arg->allocated) {
+        size_t new_size = arg->allocated ? arg->allocated : 8;
+        void *p;
+
+        do {
+            new_size <<= 2;
+        } while(arg->length + size >= new_size);
+
+        p = REALLOC(arg->buffer, new_size);
+        if(!p) {
+            FREEMEM(arg->buffer);
+            memset(arg, 0, sizeof(*arg));
+            return -1;
+        }
+        arg->buffer = p;
+        arg->allocated = new_size;
+    }
+    memcpy(((char *)arg->buffer) + arg->length, buffer, size);
+    arg->length += size;
+    return 0;
+}
+ssize_t
+uper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, void **buffer_r) {
+    asn_enc_rval_t er = {0,0,0};
+	enc_dyn_arg key;
+
+	memset(&key, 0, sizeof(key));
+
+	er = uper_encode(td, constraints, sptr, encode_dyn_cb, &key);
+	switch(er.encoded) {
+	case -1:
+		FREEMEM(key.buffer);
+		return -1;
+	case 0:
+		FREEMEM(key.buffer);
+		key.buffer = MALLOC(1);
+		if(key.buffer) {
+			*(char *)key.buffer = '\0';
+			*buffer_r = key.buffer;
+			return 1;
+		} else {
+			return -1;
+		}
+	default:
+		*buffer_r = key.buffer;
+		ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+		return ((er.encoded + 7) >> 3);
+	}
+}
+
+/*
+ * Internally useful functions.
+ */
+
+/* Flush partially filled buffer */
+static int
+_uper_encode_flush_outp(asn_per_outp_t *po) {
+	uint8_t *buf;
+
+	if(po->nboff == 0 && po->buffer == po->tmpspace)
+		return 0;
+
+	buf = po->buffer + (po->nboff >> 3);
+	/* Make sure we account for the last, partially filled */
+	if(po->nboff & 0x07) {
+		buf[0] &= 0xff << (8 - (po->nboff & 0x07));
+		buf++;
+	}
+
+	return po->output(po->tmpspace, buf - po->tmpspace, po->op_key);
+}
+
+asn_enc_rval_t
+aper_encode_to_buffer(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg key;
+
+    key.buffer = buffer;
+    key.left = buffer_size;
+
+    if(td) ASN_DEBUG("Encoding \"%s\" using ALIGNED PER", td->name);
+
+    return aper_encode(td, constraints, sptr, encode_to_buffer_cb, &key);
+}
+
+ssize_t
+aper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, void **buffer_r) {
+    asn_enc_rval_t er = {0,0,0};
+	enc_dyn_arg key;
+
+	memset(&key, 0, sizeof(key));
+
+	er = aper_encode(td, constraints, sptr, encode_dyn_cb, &key);
+	switch(er.encoded) {
+	case -1:
+		FREEMEM(key.buffer);
+		return -1;
+	case 0:
+		FREEMEM(key.buffer);
+		key.buffer = MALLOC(1);
+		if(key.buffer) {
+			*(char *)key.buffer = '\0';
+			*buffer_r = key.buffer;
+			return 1;
+		} else {
+			return -1;
+		}
+	default:
+		*buffer_r = key.buffer;
+		ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+		return ((er.encoded + 7) >> 3);
+	}
+}
+
+static int
+_aper_encode_flush_outp(asn_per_outp_t *po) {
+	uint8_t *buf;
+
+	if(po->nboff == 0 && po->buffer == po->tmpspace)
+		return 0;
+
+	buf = po->buffer + (po->nboff >> 3);
+	/* Make sure we account for the last, partially filled */
+	if(po->nboff & 0x07) {
+		buf[0] &= 0xff << (8 - (po->nboff & 0x07));
+		buf++;
+	}
+
+	if (po->output) {
+		return po->output(po->tmpspace, buf - po->tmpspace, po->op_key);
+	}
+	return 0;
+}
+
+asn_enc_rval_t
+aper_encode(const asn_TYPE_descriptor_t *td,
+        const asn_per_constraints_t *constraints,
+        const void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_per_outp_t po;
+	asn_enc_rval_t er = {0,0,0};
+
+	/*
+	 * Invoke type-specific encoder.
+	 */
+	if(!td || !td->op->aper_encoder)
+		ASN__ENCODE_FAILED;	 /* PER is not compiled in */
+
+	po.buffer = po.tmpspace;
+	po.nboff = 0;
+	po.nbits = 8 * sizeof(po.tmpspace);
+	po.output = cb;
+	po.op_key = app_key;
+	po.flushed_bytes = 0;
+
+	er = td->op->aper_encoder(td, constraints, sptr, &po);
+	if(er.encoded != -1) {
+		size_t bits_to_flush;
+
+		bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
+
+		/* Set number of bits encoded to a firm value */
+		er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
+
+		if(_aper_encode_flush_outp(&po))
+			ASN__ENCODE_FAILED;
+	}
+
+	return er;
+}
diff --git a/e2ap/lib/per_opentype.c b/e2ap/lib/per_opentype.c
new file mode 100644
index 0000000..28f3cb6
--- /dev/null
+++ b/e2ap/lib/per_opentype.c
@@ -0,0 +1,533 @@
+/*
+ * Copyright (c) 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <per_support.h>
+#include <constr_TYPE.h>
+#include <per_opentype.h>
+
+typedef struct uper_ugot_key {
+	asn_per_data_t oldpd;	/* Old per data source */
+	size_t unclaimed;
+	size_t ot_moved;	/* Number of bits moved by OT processing */
+	int repeat;
+} uper_ugot_key;
+
+static int uper_ugot_refill(asn_per_data_t *pd);
+static int per_skip_bits(asn_per_data_t *pd, int skip_nbits);
+static asn_dec_rval_t uper_sot_suck(const asn_codec_ctx_t *,
+                                    const asn_TYPE_descriptor_t *td,
+                                    const asn_per_constraints_t *constraints,
+                                    void **sptr, asn_per_data_t *pd);
+
+/*
+ * Encode an "open type field".
+ * #10.1, #10.2
+ */
+int
+uper_open_type_put(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+    void *buf;
+    void *bptr;
+    ssize_t size;
+
+    ASN_DEBUG("Open type put %s ...", td->name);
+
+    size = uper_encode_to_new_buffer(td, constraints, sptr, &buf);
+    if(size <= 0) return -1;
+
+    ASN_DEBUG("Open type put %s of length %" ASN_PRI_SSIZE " + overhead (1byte?)", td->name,
+              size);
+
+    bptr = buf;
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size, &need_eom);
+        ASN_DEBUG("Prepending length %" ASN_PRI_SSIZE
+                  " to %s and allowing to save %" ASN_PRI_SSIZE,
+                  size, td->name, may_save);
+        if(may_save < 0) break;
+        if(per_put_many_bits(po, bptr, may_save * 8)) break;
+        bptr = (char *)bptr + may_save;
+        size -= may_save;
+        if(need_eom && uper_put_length(po, 0, 0)) {
+            FREEMEM(buf);
+            return -1;
+        }
+    } while(size);
+
+    FREEMEM(buf);
+    if(size) return -1;
+
+    return 0;
+}
+
+static asn_dec_rval_t
+uper_open_type_get_simple(const asn_codec_ctx_t *ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr,
+                          asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+	ssize_t chunk_bytes;
+	int repeat;
+	uint8_t *buf = 0;
+	size_t bufLen = 0;
+	size_t bufSize = 0;
+	asn_per_data_t spd;
+	size_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s...", td->name);
+
+	do {
+		chunk_bytes = uper_get_length(pd, -1, 0, &repeat);
+		if(chunk_bytes < 0) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		if(bufLen + chunk_bytes > bufSize) {
+			void *ptr;
+			bufSize = chunk_bytes + (bufSize << 2);
+			ptr = REALLOC(buf, bufSize);
+			if(!ptr) {
+				FREEMEM(buf);
+				ASN__DECODE_FAILED;
+			}
+			buf = ptr;
+		}
+		if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		bufLen += chunk_bytes;
+	} while(repeat);
+
+	ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name,
+		(long)bufLen);
+
+	memset(&spd, 0, sizeof(spd));
+	spd.buffer = buf;
+	spd.nbits = bufLen << 3;
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->uper_decoder(ctx, td, constraints, sptr, &spd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+	if(rv.code == RC_OK) {
+		/* Check padding validity */
+		padding = spd.nbits - spd.nboff;
+                if (((padding > 0 && padding < 8) ||
+		/* X.691#10.1.3 */
+		(spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) &&
+                    per_get_few_bits(&spd, padding) == 0) {
+			/* Everything is cool */
+			FREEMEM(buf);
+			return rv;
+		}
+		FREEMEM(buf);
+		if(padding >= 8) {
+			ASN_DEBUG("Too large padding %d in open type", (int)padding);
+			ASN__DECODE_FAILED;
+		} else {
+			ASN_DEBUG("No padding");
+		}
+	} else {
+		FREEMEM(buf);
+		/* rv.code could be RC_WMORE, nonsense in this context */
+		rv.code = RC_FAIL; /* Noone would give us more */
+	}
+
+	return rv;
+}
+
+static asn_dec_rval_t CC_NOTUSED
+uper_open_type_get_complex(const asn_codec_ctx_t *ctx,
+                           const asn_TYPE_descriptor_t *td,
+                           asn_per_constraints_t *constraints, void **sptr,
+                           asn_per_data_t *pd) {
+    uper_ugot_key arg;
+	asn_dec_rval_t rv;
+	ssize_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s from %s", td->name,
+		asn_bit_data_string(pd));
+	arg.oldpd = *pd;
+	arg.unclaimed = 0;
+	arg.ot_moved = 0;
+	arg.repeat = 1;
+	pd->refill = uper_ugot_refill;
+	pd->refill_key = &arg;
+	pd->nbits = pd->nboff;	/* 0 good bits at this point, will refill */
+	pd->moved = 0;	/* This now counts the open type size in bits */
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->uper_decoder(ctx, td, constraints, sptr, pd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+#define	UPDRESTOREPD	do {						\
+	/* buffer and nboff are valid, preserve them. */		\
+	pd->nbits = arg.oldpd.nbits - (pd->moved - arg.ot_moved);	\
+	pd->moved = arg.oldpd.moved + (pd->moved - arg.ot_moved);	\
+	pd->refill = arg.oldpd.refill;					\
+	pd->refill_key = arg.oldpd.refill_key;				\
+  } while(0)
+
+	if(rv.code != RC_OK) {
+		UPDRESTOREPD;
+		return rv;
+	}
+
+	ASN_DEBUG("OpenType %s pd%s old%s unclaimed=%d, repeat=%d", td->name,
+		asn_bit_data_string(pd),
+		asn_bit_data_string(&arg.oldpd),
+		(int)arg.unclaimed, (int)arg.repeat);
+
+	padding = pd->moved % 8;
+	if(padding) {
+		int32_t pvalue;
+		if(padding > 7) {
+			ASN_DEBUG("Too large padding %d in open type",
+				(int)padding);
+			rv.code = RC_FAIL;
+			UPDRESTOREPD;
+			return rv;
+		}
+		padding = 8 - padding;
+		ASN_DEBUG("Getting padding of %d bits", (int)padding);
+		pvalue = per_get_few_bits(pd, padding);
+		switch(pvalue) {
+		case -1:
+			ASN_DEBUG("Padding skip failed");
+			UPDRESTOREPD;
+			ASN__DECODE_STARVED;
+		case 0: break;
+		default:
+			ASN_DEBUG("Non-blank padding (%d bits 0x%02x)",
+				(int)padding, (int)pvalue);
+			UPDRESTOREPD;
+			ASN__DECODE_FAILED;
+		}
+	}
+	if(pd->nboff != pd->nbits) {
+		ASN_DEBUG("Open type %s overhead pd%s old%s", td->name,
+			asn_bit_data_string(pd), asn_bit_data_string(&arg.oldpd));
+		if(1) {
+			UPDRESTOREPD;
+			ASN__DECODE_FAILED;
+		} else {
+			arg.unclaimed += pd->nbits - pd->nboff;
+		}
+	}
+
+	/* Adjust pd back so it points to original data */
+	UPDRESTOREPD;
+
+	/* Skip data not consumed by the decoder */
+	if(arg.unclaimed) {
+		ASN_DEBUG("Getting unclaimed %d", (int)arg.unclaimed);
+		switch(per_skip_bits(pd, arg.unclaimed)) {
+		case -1:
+			ASN_DEBUG("Claim of %d failed", (int)arg.unclaimed);
+			ASN__DECODE_STARVED;
+		case 0:
+			ASN_DEBUG("Got claim of %d", (int)arg.unclaimed);
+			break;
+		default:
+			/* Padding must be blank */
+			ASN_DEBUG("Non-blank unconsumed padding");
+			ASN__DECODE_FAILED;
+		}
+		arg.unclaimed = 0;
+	}
+
+	if(arg.repeat) {
+		ASN_DEBUG("Not consumed the whole thing");
+		rv.code = RC_FAIL;
+		return rv;
+	}
+
+	return rv;
+}
+
+
+asn_dec_rval_t
+uper_open_type_get(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    return uper_open_type_get_simple(ctx, td, constraints, sptr, pd);
+}
+
+int
+uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
+	asn_TYPE_descriptor_t s_td;
+    asn_TYPE_operation_t s_op;
+	asn_dec_rval_t rv;
+
+	s_td.name = "<unknown extension>";
+	s_td.op = &s_op;
+    s_op.uper_decoder = uper_sot_suck;
+
+	rv = uper_open_type_get(ctx, &s_td, 0, 0, pd);
+	if(rv.code != RC_OK)
+		return -1;
+	else
+		return 0;
+}
+
+/*
+ * Internal functions.
+ */
+
+static asn_dec_rval_t
+uper_sot_suck(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
+              const asn_per_constraints_t *constraints, void **sptr,
+              asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+
+	(void)ctx;
+	(void)td;
+	(void)constraints;
+	(void)sptr;
+
+	while(per_get_few_bits(pd, 1) >= 0);
+
+	rv.code = RC_OK;
+	rv.consumed = pd->moved;
+
+	return rv;
+}
+
+static int
+uper_ugot_refill(asn_per_data_t *pd) {
+	uper_ugot_key *arg = pd->refill_key;
+	ssize_t next_chunk_bytes, next_chunk_bits;
+	ssize_t avail;
+
+	asn_per_data_t *oldpd = &arg->oldpd;
+
+	ASN_DEBUG("REFILLING pd->moved=%ld, oldpd->moved=%ld",
+		(long)pd->moved, (long)oldpd->moved);
+
+	/* Advance our position to where pd is */
+	oldpd->buffer = pd->buffer;
+	oldpd->nboff  = pd->nboff;
+	oldpd->nbits -= pd->moved - arg->ot_moved;
+	oldpd->moved += pd->moved - arg->ot_moved;
+	arg->ot_moved = pd->moved;
+
+	if(arg->unclaimed) {
+		/* Refill the container */
+		if(per_get_few_bits(oldpd, 1))
+			return -1;
+		if(oldpd->nboff == 0) {
+			assert(0);
+			return -1;
+		}
+		pd->buffer = oldpd->buffer;
+		pd->nboff = oldpd->nboff - 1;
+		pd->nbits = oldpd->nbits;
+		ASN_DEBUG("UNCLAIMED <- return from (pd->moved=%ld)",
+			(long)pd->moved);
+		return 0;
+	}
+
+	if(!arg->repeat) {
+		ASN_DEBUG("Want more but refill doesn't have it");
+		return -1;
+	}
+
+	next_chunk_bytes = uper_get_length(oldpd, -1, 0, &arg->repeat);
+	ASN_DEBUG("Open type LENGTH %ld bytes at off %ld, repeat %ld",
+		(long)next_chunk_bytes, (long)oldpd->moved, (long)arg->repeat);
+	if(next_chunk_bytes < 0) return -1;
+	if(next_chunk_bytes == 0) {
+		pd->refill = 0;	/* No more refills, naturally */
+		assert(!arg->repeat);	/* Implementation guarantee */
+	}
+	next_chunk_bits = next_chunk_bytes << 3;
+	avail = oldpd->nbits - oldpd->nboff;
+	if(avail >= next_chunk_bits) {
+		pd->nbits = oldpd->nboff + next_chunk_bits;
+		arg->unclaimed = 0;
+		ASN_DEBUG("!+Parent frame %ld bits, alloting %ld [%ld..%ld] (%ld)",
+			(long)next_chunk_bits, (long)oldpd->moved,
+			(long)oldpd->nboff, (long)oldpd->nbits,
+			(long)(oldpd->nbits - oldpd->nboff));
+	} else {
+		pd->nbits = oldpd->nbits;
+		arg->unclaimed = next_chunk_bits - avail;
+		ASN_DEBUG("!-Parent frame %ld, require %ld, will claim %ld",
+			(long)avail, (long)next_chunk_bits,
+			(long)arg->unclaimed);
+	}
+	pd->buffer = oldpd->buffer;
+	pd->nboff = oldpd->nboff;
+	ASN_DEBUG("Refilled pd%s old%s",
+		asn_bit_data_string(pd), asn_bit_data_string(oldpd));
+	return 0;
+}
+
+static int
+per_skip_bits(asn_per_data_t *pd, int skip_nbits) {
+	int hasNonZeroBits = 0;
+	while(skip_nbits > 0) {
+		int skip;
+
+		/* per_get_few_bits() is more efficient when nbits <= 24 */
+		if(skip_nbits < 24)
+			skip = skip_nbits;
+		else
+			skip = 24;
+		skip_nbits -= skip;
+
+		switch(per_get_few_bits(pd, skip)) {
+		case -1: return -1;	/* Starving */
+		case 0: continue;	/* Skipped empty space */
+		default: hasNonZeroBits = 1; continue;
+		}
+	}
+	return hasNonZeroBits;
+}
+
+static asn_dec_rval_t
+aper_open_type_get_simple(const asn_codec_ctx_t *ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv;
+	ssize_t chunk_bytes;
+	int repeat;
+	uint8_t *buf = 0;
+	size_t bufLen = 0;
+	size_t bufSize = 0;
+	asn_per_data_t spd;
+	size_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s...", td->name);
+
+	do {
+	        chunk_bytes = aper_get_length(pd, -1, -1, &repeat);
+		if(chunk_bytes < 0) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		if(bufLen + chunk_bytes > bufSize) {
+			void *ptr;
+			bufSize = chunk_bytes + (bufSize << 2);
+			ptr = REALLOC(buf, bufSize);
+			if(!ptr) {
+				FREEMEM(buf);
+				ASN__DECODE_FAILED;
+			}
+			buf = ptr;
+		}
+		if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		bufLen += chunk_bytes;
+	} while(repeat);
+
+	ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name,
+		(long)bufLen);
+
+	memset(&spd, 0, sizeof(spd));
+	spd.buffer = buf;
+	spd.nbits = bufLen << 3;
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->aper_decoder(ctx, td, constraints, sptr, &spd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+	if(rv.code == RC_OK) {
+		/* Check padding validity */
+		padding = spd.nbits - spd.nboff;
+                if (((padding > 0 && padding < 8) ||
+		/* X.691#10.1.3 */
+		(spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) &&
+                    per_get_few_bits(&spd, padding) == 0) {
+			/* Everything is cool */
+			FREEMEM(buf);
+			return rv;
+		}
+		FREEMEM(buf);
+		if(padding >= 8) {
+			ASN_DEBUG("Too large padding %d in open type", (int)padding);
+			ASN__DECODE_FAILED;
+		} else {
+			ASN_DEBUG("No padding");
+		}
+	} else {
+		FREEMEM(buf);
+		/* rv.code could be RC_WMORE, nonsense in this context */
+		rv.code = RC_FAIL; /* Noone would give us more */
+	}
+
+	return rv;
+}
+
+int
+aper_open_type_put(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   const void *sptr, asn_per_outp_t *po) {
+	void *buf;
+	void *bptr;
+	ssize_t size;
+	size_t toGo;
+
+	ASN_DEBUG("Open type put %s ...", td->name);
+
+	size = aper_encode_to_new_buffer(td, constraints, sptr, &buf);
+	if(size <= 0) return -1;
+
+	for(bptr = buf, toGo = size; toGo;) {
+		ssize_t maySave = aper_put_length(po, -1, toGo);
+		if(maySave < 0) break;
+		if(per_put_many_bits(po, bptr, maySave * 8)) break;
+		bptr = (char *)bptr + maySave;
+		toGo -= maySave;
+	}
+
+	FREEMEM(buf);
+	if(toGo) return -1;
+
+	ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)",
+			  td->name, size);
+
+	return 0;
+}
+
+asn_dec_rval_t
+aper_open_type_get(const asn_codec_ctx_t *ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   void **sptr, asn_per_data_t *pd) {
+
+	return aper_open_type_get_simple(ctx, td, constraints, sptr, pd);
+}
+
+int
+aper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
+	asn_TYPE_descriptor_t s_td;
+	asn_dec_rval_t rv;
+	asn_TYPE_operation_t op_t;
+
+	memset(&op_t, 0, sizeof(op_t));
+	s_td.name = "<unknown extension>";
+	s_td.op = &op_t;
+	s_td.op->aper_decoder = uper_sot_suck;
+
+	rv = aper_open_type_get(ctx, &s_td, 0, 0, pd);
+	if(rv.code != RC_OK)
+		return -1;
+	else
+		return 0;
+}
+
+
diff --git a/e2ap/lib/per_support.c b/e2ap/lib/per_support.c
new file mode 100644
index 0000000..2285677
--- /dev/null
+++ b/e2ap/lib/per_support.c
@@ -0,0 +1,489 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+#include <per_support.h>
+
+/*
+ * X.691-201508 #10.9 General rules for encoding a length determinant.
+ * Get the optionally constrained length "n" from the stream.
+ */
+ssize_t
+uper_get_length(asn_per_data_t *pd, int ebits, size_t lower_bound,
+                int *repeat) {
+    ssize_t value;
+
+    *repeat = 0;
+
+    /* #11.9.4.1 Encoding if constrained (according to effective bits) */
+    if(ebits >= 0 && ebits <= 16) {
+        value = per_get_few_bits(pd, ebits);
+        if(value >= 0) value += lower_bound;
+        return value;
+    }
+
+	value = per_get_few_bits(pd, 8);
+    if((value & 0x80) == 0) { /* #11.9.3.6 */
+        return (value & 0x7F);
+    } else if((value & 0x40) == 0) { /* #11.9.3.7 */
+        /* bit 8 ... set to 1 and bit 7 ... set to zero */
+        value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8);
+        return value; /* potential -1 from per_get_few_bits passes through. */
+    } else if(value < 0) {
+        ASN_DEBUG("END of stream reached for PER");
+        return -1;
+    }
+    value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */
+    if(value < 1 || value > 4) {
+        return -1; /* Prohibited by #11.9.3.8 */
+    }
+    *repeat = 1;
+    return (16384 * value);
+}
+
+/*
+ * Get the normally small length "n".
+ * This procedure used to decode length of extensions bit-maps
+ * for SET and SEQUENCE types.
+ */
+ssize_t
+uper_get_nslength(asn_per_data_t *pd) {
+	ssize_t length;
+
+	ASN_DEBUG("Getting normally small length");
+
+	if(per_get_few_bits(pd, 1) == 0) {
+		length = per_get_few_bits(pd, 6) + 1;
+		if(length <= 0) return -1;
+		ASN_DEBUG("l=%d", (int)length);
+		return length;
+	} else {
+		int repeat;
+		length = uper_get_length(pd, -1, 0, &repeat);
+		if(length >= 0 && !repeat) return length;
+		return -1; /* Error, or do not support >16K extensions */
+	}
+}
+
+/*
+ * Get the normally small non-negative whole number.
+ * X.691, #10.6
+ */
+ssize_t
+uper_get_nsnnwn(asn_per_data_t *pd) {
+	ssize_t value;
+
+	value = per_get_few_bits(pd, 7);
+	if(value & 64) {	/* implicit (value < 0) */
+		value &= 63;
+		value <<= 2;
+		value |= per_get_few_bits(pd, 2);
+		if(value & 128)	/* implicit (value < 0) */
+			return -1;
+		if(value == 0)
+			return 0;
+		if(value >= 3)
+			return -1;
+		value = per_get_few_bits(pd, 8 * value);
+		return value;
+	}
+
+	return value;
+}
+
+/*
+ * X.691-11/2008, #11.6
+ * Encoding of a normally small non-negative whole number
+ */
+int
+uper_put_nsnnwn(asn_per_outp_t *po, int n) {
+	int bytes;
+
+	if(n <= 63) {
+		if(n < 0) return -1;
+		return per_put_few_bits(po, n, 7);
+	}
+	if(n < 256)
+		bytes = 1;
+	else if(n < 65536)
+		bytes = 2;
+	else if(n < 256 * 65536)
+		bytes = 3;
+	else
+		return -1;	/* This is not a "normally small" value */
+	if(per_put_few_bits(po, bytes, 8))
+		return -1;
+
+	return per_put_few_bits(po, n, 8 * bytes);
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) {
+	unsigned long lhalf;    /* Lower half of the number*/
+	long half;
+
+	if(nbits <= 31) {
+		half = per_get_few_bits(pd, nbits);
+		if(half < 0) return -1;
+		*out_value = half;
+		return 0;
+	}
+
+	if((size_t)nbits > 8 * sizeof(*out_value))
+		return -1;  /* RANGE */
+
+	half = per_get_few_bits(pd, 31);
+	if(half < 0) return -1;
+
+	if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31))
+		return -1;
+
+	*out_value = ((unsigned long)half << (nbits - 31)) | lhalf;
+	return 0;
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int
+uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v,
+                                    int nbits) {
+    if(nbits <= 31) {
+        return per_put_few_bits(po, v, nbits);
+    } else {
+        /* Put higher portion first, followed by lower 31-bit */
+        if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31))
+            return -1;
+        return per_put_few_bits(po, v, 31);
+    }
+}
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Put the length "n" (or part of it) into the stream.
+ */
+ssize_t
+uper_put_length(asn_per_outp_t *po, size_t length, int *need_eom) {
+    int dummy = 0;
+    if(!need_eom) need_eom = &dummy;
+
+    if(length <= 127) {	/* #11.9.3.6 */
+        *need_eom = 0;
+        return per_put_few_bits(po, length, 8)
+            ? -1 : (ssize_t)length;
+    } else if(length < 16384) { /* #10.9.3.7 */
+        *need_eom = 0;
+        return per_put_few_bits(po, length|0x8000, 16)
+            ? -1 : (ssize_t)length;
+    }
+
+    *need_eom = 0 == (length & 16383);
+    length >>= 14;
+    if(length > 4) {
+        *need_eom = 0;
+        length = 4;
+    }
+
+    return per_put_few_bits(po, 0xC0 | length, 8)
+            ? -1 : (ssize_t)(length << 14);
+
+}
+
+
+/*
+ * Put the normally small length "n" into the stream.
+ * This procedure used to encode length of extensions bit-maps
+ * for SET and SEQUENCE types.
+ */
+int
+uper_put_nslength(asn_per_outp_t *po, size_t length) {
+    if(length <= 64) {
+        /* #11.9.3.4 */
+        if(length == 0) return -1;
+        return per_put_few_bits(po, length - 1, 7) ? -1 : 0;
+    } else {
+        int need_eom = 0;
+        if(uper_put_length(po, length, &need_eom) != (ssize_t)length
+           || need_eom) {
+            /* This might happen in case of >16K extensions */
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+static int
+per__long_range(long lb, long ub, unsigned long *range_r) {
+    unsigned long bounds_range;
+    if((ub < 0) == (lb < 0)) {
+        bounds_range = ub - lb;
+    } else if(lb < 0) {
+        assert(ub >= 0);
+        bounds_range = 1 + ((unsigned long)ub + (unsigned long)-(lb + 1));
+    } else {
+        assert(!"Unreachable");
+        return -1;
+    }
+    *range_r = bounds_range;
+    return 0;
+}
+
+int
+per_long_range_rebase(long v, long lb, long ub, unsigned long *output) {
+    unsigned long range;
+
+    assert(lb <= ub);
+
+    if(v < lb || v > ub || per__long_range(lb, ub, &range) < 0) {
+        /* Range error. */
+        return -1;
+    }
+
+    /*
+     * Fundamentally what we're doing is returning (v-lb).
+     * However, this triggers undefined behavior when the word width
+     * of signed (v) is the same as the size of unsigned (*output).
+     * In practice, it triggers the UndefinedSanitizer. Therefore we shall
+     * compute the ranges accurately to avoid C's undefined behavior.
+     */
+    if((v < 0) == (lb < 0)) {
+        *output = v-lb;
+        return 0;
+    } else if(v < 0) {
+        unsigned long rebased = 1 + (unsigned long)-(v+1) + (unsigned long)lb;
+        assert(rebased <= range);   /* By construction */
+        *output = rebased;
+        return 0;
+    } else if(lb < 0) {
+        unsigned long rebased = 1 + (unsigned long)-(lb+1) + (unsigned long)v;
+        assert(rebased <= range);   /* By construction */
+        *output = rebased;
+        return 0;
+    } else {
+        assert(!"Unreachable");
+        return -1;
+    }
+}
+
+int
+per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp) {
+    unsigned long range;
+
+    if(per__long_range(lb, ub, &range) != 0) {
+        return -1;
+    }
+
+    if(inp > range) {
+        /*
+         * We can encode something in the given number of bits that technically
+         * exceeds the range. This is an avenue for security errors,
+         * so we don't allow that.
+         */
+        return -1;
+    }
+
+    if(inp <= LONG_MAX) {
+        *outp = (long)inp + lb;
+    } else {
+        *outp = (lb + LONG_MAX + 1) + (long)((inp - LONG_MAX) - 1);
+    }
+
+    return 0;
+}
+
+int32_t
+aper_get_align(asn_per_data_t *pd) {
+
+	if(pd->nboff & 0x7) {
+		ASN_DEBUG("Aligning %ld bits", 8 - ((unsigned long)pd->nboff & 0x7));
+		return per_get_few_bits(pd, 8 - (pd->nboff & 0x7));
+	}
+	return 0;
+}
+
+ssize_t
+aper_get_length(asn_per_data_t *pd, int range, int ebits, int *repeat) {
+	ssize_t value;
+
+	*repeat = 0;
+
+	if (range <= 65536 && range >= 0)
+		return aper_get_nsnnwn(pd, range);
+
+	if (aper_get_align(pd) < 0)
+		return -1;
+
+	if(ebits >= 0) return per_get_few_bits(pd, ebits);
+
+	value = per_get_few_bits(pd, 8);
+	if(value < 0) return -1;
+	if((value & 128) == 0)  /* #10.9.3.6 */
+		return (value & 0x7F);
+	if((value & 64) == 0) { /* #10.9.3.7 */
+		value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
+		if(value < 0) return -1;
+		return value;
+	}
+	value &= 63;	/* this is "m" from X.691, #10.9.3.8 */
+	if(value < 1 || value > 4)
+		return -1;
+	*repeat = 1;
+	return (16384 * value);
+}
+
+ssize_t
+aper_get_nslength(asn_per_data_t *pd) {
+	ssize_t length;
+
+	ASN_DEBUG("Getting normally small length");
+
+	if(per_get_few_bits(pd, 1) == 0) {
+		length = per_get_few_bits(pd, 6) + 1;
+		if(length <= 0) return -1;
+		ASN_DEBUG("l=%ld", length);
+		return length;
+	} else {
+		int repeat;
+		length = aper_get_length(pd, -1, -1, &repeat);
+		if(length >= 0 && !repeat) return length;
+		return -1; /* Error, or do not support >16K extensions */
+	}
+}
+
+ssize_t
+aper_get_nsnnwn(asn_per_data_t *pd, int range) {
+	ssize_t value;
+	int bytes = 0;
+
+	ASN_DEBUG("getting nsnnwn with range %d", range);
+
+	if(range <= 255) {
+		int i;
+
+		if (range < 0) return -1;
+		/* 1 -> 8 bits */
+		for (i = 1; i <= 8; i++) {
+			int upper = 1 << i;
+			if (upper >= range)
+				break;
+		}
+		value = per_get_few_bits(pd, i);
+		return value;
+	} else if (range == 256){
+		/* 1 byte */
+		bytes = 1;
+	} else if (range <= 65536) {
+		/* 2 bytes */
+		bytes = 2;
+	} else {
+		return -1;
+	}
+	if (aper_get_align(pd) < 0)
+		return -1;
+	value = per_get_few_bits(pd, 8 * bytes);
+	return value;
+}
+
+int aper_put_align(asn_per_outp_t *po) {
+
+	if(po->nboff & 0x7) {
+		ASN_DEBUG("Aligning %ld bits", 8 - ((unsigned long)po->nboff & 0x7));
+		if(per_put_few_bits(po, 0x00, (8 - (po->nboff & 0x7))))
+			return -1;
+	}
+	return 0;
+}
+
+ssize_t
+aper_put_length(asn_per_outp_t *po, int range, size_t length) {
+
+	ASN_DEBUG("APER put length %zu with range %d", length, range);
+
+	/* 10.9 X.691 Note 2 */
+	if (range <= 65536 && range >= 0)
+		return aper_put_nsnnwn(po, range, length);
+
+	if (aper_put_align(po) < 0)
+		return -1;
+
+	if(length <= 127)	   /* #10.9.3.6 */{
+		return per_put_few_bits(po, length, 8)
+		? -1 : (ssize_t)length;
+	}
+	else if(length < 16384) /* #10.9.3.7 */
+		return per_put_few_bits(po, length|0x8000, 16)
+		? -1 : (ssize_t)length;
+
+	length >>= 14;
+	if(length > 4) length = 4;
+
+	return per_put_few_bits(po, 0xC0 | length, 8)
+	? -1 : (ssize_t)(length << 14);
+}
+
+
+int
+aper_put_nslength(asn_per_outp_t *po, size_t length) {
+
+	if(length <= 64) {
+		/* #10.9.3.4 */
+		if(length == 0) return -1;
+		return per_put_few_bits(po, length-1, 7) ? -1 : 0;
+	} else {
+		if(aper_put_length(po, -1, length) != (ssize_t)length) {
+			/* This might happen in case of >16K extensions */
+			return -1;
+		}
+	}
+
+	return 0;
+}
+
+int
+aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
+	int bytes;
+
+    ASN_DEBUG("aper put nsnnwn %d with range %d", number, range);
+	/* 10.5.7.1 X.691 */
+	if(range < 0) {
+		int i;
+		for (i = 1; ; i++) {
+			int bits = 1 << (8 * i);
+			if (number <= bits)
+				break;
+		}
+		bytes = i;
+		assert(i <= 4);
+	}
+	if(range <= 255) {
+		int i;
+		for (i = 1; i <= 8; i++) {
+			int bits = 1 << i;
+			if (range <= bits)
+				break;
+		}
+		return per_put_few_bits(po, number, i);
+	} else if(range == 256) {
+		bytes = 1;
+	} else if(range <= 65536) {
+		bytes = 2;
+	} else { /* Ranges > 64K */
+		int i;
+		for (i = 1; ; i++) {
+			int bits = 1 << (8 * i);
+			if (range <= bits)
+				break;
+		}
+		assert(i <= 4);
+		bytes = i;
+	}
+	if(aper_put_align(po) < 0) /* Aligning on octet */
+		return -1;
+/* 	if(per_put_few_bits(po, bytes, 8))
+		return -1;
+*/
+    return per_put_few_bits(po, number, 8 * bytes);
+}
diff --git a/e2ap/lib/xer_decoder.c b/e2ap/lib/xer_decoder.c
new file mode 100644
index 0000000..5b87703
--- /dev/null
+++ b/e2ap/lib/xer_decoder.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <xer_support.h>		/* XER/XML parsing support */
+
+
+/*
+ * Decode the XER encoding of a given type.
+ */
+asn_dec_rval_t
+xer_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *td, void **struct_ptr,
+           const void *buffer, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return td->op->xer_decoder(opt_codec_ctx, td, struct_ptr, 0, buffer, size);
+}
+
+
+
+struct xer__cb_arg {
+	pxml_chunk_type_e	chunk_type;
+	size_t			chunk_size;
+	const void		*chunk_buf;
+	int callback_not_invoked;
+};
+
+static int
+xer__token_cb(pxml_chunk_type_e type, const void *_chunk_data, size_t _chunk_size, void *key) {
+	struct xer__cb_arg *arg = (struct xer__cb_arg *)key;
+	arg->chunk_type = type;
+	arg->chunk_size = _chunk_size;
+	arg->chunk_buf = _chunk_data;
+	arg->callback_not_invoked = 0;
+	return -1;	/* Terminate the XML parsing */
+}
+
+/*
+ * Fetch the next token from the XER/XML stream.
+ */
+ssize_t
+xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_type_e *ch_type) {
+	struct xer__cb_arg arg;
+	int new_stateContext = *stateContext;
+	ssize_t ret;
+
+	arg.callback_not_invoked = 1;
+	ret = pxml_parse(&new_stateContext, buffer, size, xer__token_cb, &arg);
+	if(ret < 0) return -1;
+	if(arg.callback_not_invoked) {
+		assert(ret == 0);	/* No data was consumed */
+        *ch_type = PXER_WMORE;
+		return 0;		/* Try again with more data */
+	} else {
+		assert(arg.chunk_size);
+		assert(arg.chunk_buf == buffer);
+	}
+
+	/*
+	 * Translate the XML chunk types into more convenient ones.
+	 */
+	switch(arg.chunk_type) {
+	case PXML_TEXT:
+		*ch_type = PXER_TEXT;
+		break;
+	case PXML_TAG:
+		*ch_type = PXER_WMORE;
+		return 0;	/* Want more */
+	case PXML_TAG_END:
+		*ch_type = PXER_TAG;
+		break;
+	case PXML_COMMENT:
+	case PXML_COMMENT_END:
+		*ch_type = PXER_COMMENT;
+		break;
+	}
+
+	*stateContext = new_stateContext;
+	return arg.chunk_size;
+}
+
+#define	CSLASH	0x2f	/* '/' */
+#define	LANGLE	0x3c	/* '<' */
+#define	RANGLE	0x3e	/* '>' */
+
+xer_check_tag_e
+xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
+	const char *buf = (const char *)buf_ptr;
+	const char *end;
+	xer_check_tag_e ct = XCT_OPENING;
+
+	if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) {
+		if(size >= 2)
+			ASN_DEBUG("Broken XML tag: \"%c...%c\"",
+			buf[0], buf[size - 1]);
+		return XCT_BROKEN;
+	}
+
+	/*
+	 * Determine the tag class.
+	 */
+	if(buf[1] == CSLASH) {
+		buf += 2;	/* advance past "</" */
+		size -= 3;	/* strip "</" and ">" */
+		ct = XCT_CLOSING;
+		if(size > 0 && buf[size-1] == CSLASH)
+			return XCT_BROKEN;	/* </abc/> */
+	} else {
+		buf++;		/* advance past "<" */
+		size -= 2;	/* strip "<" and ">" */
+		if(size > 0 && buf[size-1] == CSLASH) {
+			ct = XCT_BOTH;
+			size--;	/* One more, for "/" */
+		}
+	}
+
+	/* Sometimes we don't care about the tag */
+	if(!need_tag || !*need_tag)
+		return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+
+	/*
+	 * Determine the tag name.
+	 */
+	for(end = buf + size; buf < end; buf++, need_tag++) {
+		int b = *buf, n = *need_tag;
+		if(b != n) {
+			if(n == 0) {
+				switch(b) {
+				case 0x09: case 0x0a: case 0x0c: case 0x0d:
+				case 0x20:
+					/* "<abc def/>": whitespace is normal */
+					return ct;
+				}
+			}
+			return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+		}
+		if(b == 0)
+			return XCT_BROKEN;	/* Embedded 0 in buf?! */
+	}
+	if(*need_tag)
+		return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+
+	return ct;
+}
+
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {				\
+		size_t num = (num_bytes);			\
+		buf_ptr = ((const char *)buf_ptr) + num;	\
+		size -= num;					\
+		consumed_myself += num;				\
+	} while(0)
+
+#undef	RETURN
+#define	RETURN(_code)	do {					\
+		rval.code = _code;				\
+		rval.consumed = consumed_myself;		\
+		if(rval.code != RC_OK)				\
+			ASN_DEBUG("Failed with %d", rval.code);	\
+		return rval;					\
+	} while(0)
+
+#define	XER_GOT_BODY(chunk_buf, chunk_size, size)	do {	\
+		ssize_t converted_size = body_receiver		\
+			(struct_key, chunk_buf, chunk_size,	\
+				(size_t)chunk_size < size);	\
+		if(converted_size == -1) RETURN(RC_FAIL);	\
+		if(converted_size == 0				\
+			&& size == (size_t)chunk_size)		\
+			RETURN(RC_WMORE);			\
+		chunk_size = converted_size;			\
+	} while(0)
+#define	XER_GOT_EMPTY()	do {					\
+	if(body_receiver(struct_key, 0, 0, size > 0) == -1)	\
+			RETURN(RC_FAIL);			\
+	} while(0)
+
+/*
+ * Generalized function for decoding the primitive values.
+ */
+asn_dec_rval_t
+xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx,
+	asn_struct_ctx_t *ctx,	/* Type decoder context */
+	void *struct_key,
+	const char *xml_tag,	/* Expected XML tag */
+	const void *buf_ptr, size_t size,
+	int (*opt_unexpected_tag_decoder)
+		(void *struct_key, const void *chunk_buf, size_t chunk_size),
+	ssize_t (*body_receiver)
+		(void *struct_key, const void *chunk_buf, size_t chunk_size,
+			int have_more)
+	) {
+
+	asn_dec_rval_t rval;
+	ssize_t consumed_myself = 0;
+
+	(void)opt_codec_ctx;
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 */
+	if(ctx->phase > 1) RETURN(RC_FAIL);
+	for(;;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, buf_ptr, size,
+			&ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+			case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:		/* Got XML comment */
+				ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TEXT:
+				if(ctx->phase == 0) {
+					/*
+					 * We have to ignore whitespace here,
+					 * but in order to be forward compatible
+					 * with EXTENDED-XER (EMBED-VALUES, #25)
+					 * any text is just ignored here.
+					 */
+				} else {
+					XER_GOT_BODY(buf_ptr, ch_size, size);
+				}
+				ADVANCE(ch_size);
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		assert(ch_type == PXER_TAG && size);
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		/*
+		 * Phase 0:
+		 * 	Expecting the opening tag
+		 * 	for the type being processed.
+		 * Phase 1:
+		 * 	Waiting for the closing XML tag.
+		 */
+		switch(tcv) {
+		case XCT_BOTH:
+			if(ctx->phase) break;
+			/* Finished decoding of an empty element */
+			XER_GOT_EMPTY();
+			ADVANCE(ch_size);
+			ctx->phase = 2;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_OPENING:
+			if(ctx->phase) break;
+			ADVANCE(ch_size);
+			ctx->phase = 1;	/* Processing body phase */
+			continue;
+		case XCT_CLOSING:
+			if(!ctx->phase) break;
+			ADVANCE(ch_size);
+			ctx->phase = 2;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_UNKNOWN_BO:
+			/*
+			 * Certain tags in the body may be expected.
+			 */
+			if(opt_unexpected_tag_decoder
+			&& opt_unexpected_tag_decoder(struct_key,
+					buf_ptr, ch_size) >= 0) {
+				/* Tag's processed fine */
+				ADVANCE(ch_size);
+				if(!ctx->phase) {
+					/* We are not expecting
+					 * the closing tag anymore. */
+					ctx->phase = 2;	/* Phase out */
+					RETURN(RC_OK);
+				}
+				continue;
+			}
+			/* Fall through */
+		default:
+			break;		/* Unexpected tag */
+		}
+
+		ASN_DEBUG("Unexpected XML tag (expected \"%s\")", xml_tag);
+		break;	/* Dark and mysterious things have just happened */
+	}
+
+	RETURN(RC_FAIL);
+}
+
+
+size_t
+xer_whitespace_span(const void *chunk_buf, size_t chunk_size) {
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+
+	for(; p < pend; p++) {
+		switch(*p) {
+		/* X.693, #8.1.4
+		 * HORISONTAL TAB (9)
+		 * LINE FEED (10) 
+		 * CARRIAGE RETURN (13) 
+		 * SPACE (32)
+		 */
+		case 0x09: case 0x0a: case 0x0d: case 0x20:
+			continue;
+		default:
+			break;
+		}
+		break;
+	}
+	return (p - (const char *)chunk_buf);
+}
+
+/*
+ * This is a vastly simplified, non-validating XML tree skipper.
+ */
+int
+xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth) {
+	assert(*depth > 0);
+	switch(tcv) {
+	case XCT_BOTH:
+	case XCT_UNKNOWN_BO:
+		/* These negate each other. */
+		return 0;
+	case XCT_OPENING:
+	case XCT_UNKNOWN_OP:
+		++(*depth);
+		return 0;
+	case XCT_CLOSING:
+	case XCT_UNKNOWN_CL:
+		if(--(*depth) == 0)
+			return (tcv == XCT_CLOSING) ? 2 : 1;
+		return 0;
+	default:
+		return -1;
+	}
+}
diff --git a/e2ap/lib/xer_encoder.c b/e2ap/lib/xer_encoder.c
new file mode 100644
index 0000000..4177ede
--- /dev/null
+++ b/e2ap/lib/xer_encoder.c
@@ -0,0 +1,237 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <stdio.h>
+#include <errno.h>
+
+/*
+ * The XER encoder of any type. May be invoked by the application.
+ */
+asn_enc_rval_t
+xer_encode(const asn_TYPE_descriptor_t *td, const void *sptr,
+           enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *cb,
+           void *app_key) {
+    asn_enc_rval_t er = {0, 0, 0};
+	asn_enc_rval_t tmper;
+	const char *mname;
+	size_t mlen;
+	int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2;
+
+	if(!td || !sptr) goto cb_failed;
+
+	mname = td->xml_tag;
+	mlen = strlen(mname);
+
+	ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+	tmper = td->op->xer_encoder(td, sptr, 1, xer_flags, cb, app_key);
+	if(tmper.encoded == -1) return tmper;
+	er.encoded += tmper.encoded;
+
+	ASN__CALLBACK3("</", 2, mname, mlen, ">\n", xcan);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+/*
+ * This is a helper function for xer_fprint, which directs all incoming data
+ * into the provided file descriptor.
+ */
+static int
+xer__print2fp(const void *buffer, size_t size, void *app_key) {
+	FILE *stream = (FILE *)app_key;
+
+	if(fwrite(buffer, 1, size, stream) != size)
+		return -1;
+
+	return 0;
+}
+
+int
+xer_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, const void *sptr) {
+	asn_enc_rval_t er = {0,0,0};
+
+	if(!stream) stream = stdout;
+	if(!td || !sptr)
+		return -1;
+
+	er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream);
+	if(er.encoded == -1)
+		return -1;
+
+	return fflush(stream);
+}
+
+struct xer_buffer {
+    char *buffer;
+    size_t buffer_size;
+    size_t allocated_size;
+};
+
+static int
+xer__buffer_append(const void *buffer, size_t size, void *app_key) {
+    struct xer_buffer *xb = app_key;
+
+    while(xb->buffer_size + size + 1 > xb->allocated_size) {
+        size_t new_size = 2 * (xb->allocated_size ? xb->allocated_size : 64);
+        char *new_buf = MALLOC(new_size);
+        if(!new_buf) return -1;
+        if (xb->buffer) {
+            memcpy(new_buf, xb->buffer, xb->buffer_size);
+        }
+        FREEMEM(xb->buffer);
+        xb->buffer = new_buf;
+        xb->allocated_size = new_size;
+    }
+
+    memcpy(xb->buffer + xb->buffer_size, buffer, size);
+    xb->buffer_size += size;
+    xb->buffer[xb->buffer_size] = '\0';
+    return 0;
+}
+
+enum xer_equivalence_e
+xer_equivalent(const struct asn_TYPE_descriptor_s *td, const void *struct1,
+               const void *struct2, FILE *opt_debug_stream) {
+    struct xer_buffer xb1 = {0, 0, 0};
+    struct xer_buffer xb2 = {0, 0, 0};
+    asn_enc_rval_t e1, e2;
+    asn_dec_rval_t rval;
+    void *sptr = NULL;
+
+    if(!td || !struct1 || !struct2) {
+        if(opt_debug_stream) {
+            if(!td) fprintf(opt_debug_stream, "Type descriptor missing\n");
+            if(!struct1) fprintf(opt_debug_stream, "Structure 1 missing\n");
+            if(!struct2) fprintf(opt_debug_stream, "Structure 2 missing\n");
+        }
+        return XEQ_FAILURE;
+    }
+
+    e1 = xer_encode(td, struct1, XER_F_BASIC, xer__buffer_append, &xb1);
+    if(e1.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of %s failed\n", td->name);
+        }
+        FREEMEM(xb1.buffer);
+        return XEQ_ENCODE1_FAILED;
+    }
+
+    e2 = xer_encode(td, struct2, XER_F_BASIC, xer__buffer_append, &xb2);
+    if(e2.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of %s failed\n", td->name);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ENCODE1_FAILED;
+    }
+
+    if(xb1.buffer_size != xb2.buffer_size
+       || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structures XER-encoded into different byte streams:\n=== "
+                    "Structure 1 ===\n%s\n=== Structure 2 ===\n%s\n",
+                    xb1.buffer, xb2.buffer);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_DIFFERENT;
+    } else {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Both structures encoded into the same XER byte stream "
+                    "of size %" ASN_PRI_SIZE ":\n%s",
+                    xb1.buffer_size, xb1.buffer);
+        }
+    }
+
+    rval = xer_decode(NULL, td, (void **)&sptr, xb1.buffer,
+               xb1.buffer_size);
+    switch(rval.code) {
+    case RC_OK:
+        break;
+    case RC_WMORE:
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structure %s XER decode unexpectedly requires "
+                    "more data:\n%s\n",
+                    td->name, xb1.buffer);
+        }
+        /* Fall through */
+    case RC_FAIL:
+    default:
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structure %s XER decoding resulted in failure.\n",
+                    td->name);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_DECODE_FAILED;
+    }
+
+    if(rval.consumed != xb1.buffer_size
+       && ((rval.consumed > xb1.buffer_size)
+           || xer_whitespace_span(xb1.buffer + rval.consumed,
+                                  xb1.buffer_size - rval.consumed)
+                  != (xb1.buffer_size - rval.consumed))) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Round-trip decode of %s required less bytes (%" ASN_PRI_SIZE ") than "
+                    "encoded (%" ASN_PRI_SIZE ")\n",
+                    td->name, rval.consumed, xb1.buffer_size);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+    /*
+     * Reuse xb2 to encode newly decoded structure.
+     */
+    FREEMEM(xb2.buffer);
+    memset(&xb2, 0, sizeof(xb2));
+
+    e2 = xer_encode(td, sptr, XER_F_BASIC, xer__buffer_append, &xb2);
+    if(e2.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of round-trip decode of %s failed\n",
+                    td->name);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+    ASN_STRUCT_FREE(*td, sptr);
+    sptr = 0;
+
+    if(xb1.buffer_size != xb2.buffer_size
+       || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "XER Encoding of round-trip decode of %s resulted in "
+                    "different byte stream:\n"
+                    "=== Original ===\n%s\n"
+                    "=== Round-tripped ===\n%s\n",
+                    xb1.buffer, xb2.buffer, td->name);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+	FREEMEM(xb1.buffer);
+	FREEMEM(xb2.buffer);
+	return XEQ_SUCCESS;
+}
+
diff --git a/e2ap/lib/xer_support.c b/e2ap/lib/xer_support.c
new file mode 100644
index 0000000..36b4bfb
--- /dev/null
+++ b/e2ap/lib/xer_support.c
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com.
+ * Copyright (c) 2003, 2004, 2005 Lev Walkin <vlm@lionet.info>.
+ * 	All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <xer_support.h>
+
+/* Parser states */
+typedef enum {
+	ST_TEXT,
+	ST_TAG_START,
+	ST_TAG_BODY,
+	ST_TAG_QUOTE_WAIT,
+	ST_TAG_QUOTED_STRING,
+	ST_TAG_UNQUOTED_STRING,
+	ST_COMMENT_WAIT_DASH1,	/* "<!--"[1] */
+	ST_COMMENT_WAIT_DASH2,	/* "<!--"[2] */
+	ST_COMMENT,
+	ST_COMMENT_CLO_DASH2,	/* "-->"[0] */
+	ST_COMMENT_CLO_RT	/* "-->"[1] */
+} pstate_e;
+
+static const int
+_charclass[256] = {
+	0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0,
+	0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+	1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+	2,2,2,2,2,2,2,2, 2,2,0,0,0,0,0,0,	/* 01234567 89       */
+	0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,	/*  ABCDEFG HIJKLMNO */
+	3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0,	/* PQRSTUVW XYZ      */
+	0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,	/*  abcdefg hijklmno */
+	3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0	/* pqrstuvw xyz      */
+};
+#define WHITESPACE(c)	(_charclass[(unsigned char)(c)] == 1)
+#define ALNUM(c)	(_charclass[(unsigned char)(c)] >= 2)
+#define ALPHA(c)	(_charclass[(unsigned char)(c)] == 3)
+
+/* Aliases for characters, ASCII/UTF-8 */
+#define	EXCLAM	0x21	/* '!' */
+#define	CQUOTE	0x22	/* '"' */
+#define	CDASH	0x2d	/* '-' */
+#define	CSLASH	0x2f	/* '/' */
+#define	LANGLE	0x3c	/* '<' */
+#define	CEQUAL	0x3d	/* '=' */
+#define	RANGLE	0x3e	/* '>' */
+#define	CQUEST	0x3f	/* '?' */
+
+/* Invoke token callback */
+#define	TOKEN_CB_CALL(type, _ns, _current_too, _final) do {	\
+		int _ret;					\
+		pstate_e ns  = _ns;				\
+		ssize_t _sz = (p - chunk_start) + _current_too;	\
+		if (!_sz) {					\
+			/* Shortcut */				\
+			state = _ns;				\
+			break;					\
+		}						\
+		_ret = cb(type, chunk_start, _sz, key);		\
+		if(_ret < _sz) {				\
+			if(_current_too && _ret == -1)		\
+				state = ns;			\
+			goto finish;				\
+		}						\
+		chunk_start = p + _current_too;			\
+		state = ns;					\
+	} while(0)
+
+#define TOKEN_CB(_type, _ns, _current_too)			\
+	TOKEN_CB_CALL(_type, _ns, _current_too, 0)
+
+#define PXML_TAG_FINAL_CHUNK_TYPE      PXML_TAG_END
+#define PXML_COMMENT_FINAL_CHUNK_TYPE  PXML_COMMENT_END
+
+#define TOKEN_CB_FINAL(_type, _ns, _current_too)		\
+	TOKEN_CB_CALL( _type ## _FINAL_CHUNK_TYPE , _ns, _current_too, 1)
+
+/*
+ * Parser itself
+ */
+ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_callback_f *cb, void *key) {
+	pstate_e state = (pstate_e)*stateContext;
+	const char *chunk_start = (const char *)xmlbuf;
+	const char *p = chunk_start;
+	const char *end = p + size;
+
+	for(; p < end; p++) {
+	  int C = *(const unsigned char *)p;
+	  switch(state) {
+	  case ST_TEXT:
+		/*
+		 * Initial state: we're in the middle of some text,
+		 * or just have started.
+		 */
+		if (C == LANGLE) 
+			/* We're now in the tag, probably */
+			TOKEN_CB(PXML_TEXT, ST_TAG_START, 0);
+		break;
+	  case ST_TAG_START:
+		if (ALPHA(C) || (C == CSLASH))
+			state = ST_TAG_BODY;
+		else if (C == EXCLAM)
+			state = ST_COMMENT_WAIT_DASH1;
+		else 
+			/*
+			 * Not characters and not whitespace.
+			 * Must be something like "3 < 4".
+			 */
+			TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */
+		break;
+	  case ST_TAG_BODY:
+		switch(C) {
+		case RANGLE:
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+			break;
+		case LANGLE:
+			/*
+			 * The previous tag wasn't completed, but still
+			 * recognized as valid. (Mozilla-compatible)
+			 */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0);	
+			break;
+		case CEQUAL:
+			state = ST_TAG_QUOTE_WAIT;
+			break;
+		}
+		break;
+	  case ST_TAG_QUOTE_WAIT:
+		/*
+		 * State after the equal sign ("=") in the tag.
+		 */
+		switch(C) {
+		case CQUOTE:
+			state = ST_TAG_QUOTED_STRING;
+			break;
+		case RANGLE:
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+			break;
+		default:
+			if(!WHITESPACE(C))
+				/* Unquoted string value */
+				state = ST_TAG_UNQUOTED_STRING;
+		}
+		break;
+	  case ST_TAG_QUOTED_STRING:
+		/*
+		 * Tag attribute's string value in quotes.
+		 */
+		if(C == CQUOTE) {
+			/* Return back to the tag state */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_TAG_UNQUOTED_STRING:
+		if(C == RANGLE) {
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+		} else if(WHITESPACE(C)) {
+			/* Return back to the tag state */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT_WAIT_DASH1:
+		if(C == CDASH) {
+			state = ST_COMMENT_WAIT_DASH2;
+		} else {
+			/* Some ordinary tag. */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT_WAIT_DASH2:
+		if(C == CDASH) {
+			/* Seen "<--" */
+			state = ST_COMMENT;
+		} else {
+			/* Some ordinary tag */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT:
+		if(C == CDASH) {
+			state = ST_COMMENT_CLO_DASH2;
+		}
+		break;
+	  case ST_COMMENT_CLO_DASH2:
+		if(C == CDASH) {
+			state = ST_COMMENT_CLO_RT;
+		} else {
+			/* This is not an end of a comment */
+			state = ST_COMMENT;
+		}
+		break;
+	  case ST_COMMENT_CLO_RT:
+		if(C == RANGLE) {
+			TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1);
+		} else if(C == CDASH) {
+			/* Maintain current state, still waiting for '>' */
+		} else {
+			state = ST_COMMENT;
+		}
+		break;
+	  } /* switch(*ptr) */
+	} /* for() */
+
+	/*
+	 * Flush the partially processed chunk, state permitting.
+	 */
+	if(p - chunk_start) {
+		switch (state) {
+		case ST_COMMENT:
+			TOKEN_CB(PXML_COMMENT, state, 0);
+			break;
+		case ST_TEXT:
+			TOKEN_CB(PXML_TEXT, state, 0);
+			break;
+		default: break;	/* a no-op */
+		}
+	}
+
+finish:
+	*stateContext = (int)state;
+	return chunk_start - (const char *)xmlbuf;
+}
+
diff --git a/e2ap/wrapper.c b/e2ap/wrapper.c
new file mode 100644
index 0000000..1e38f0f
--- /dev/null
+++ b/e2ap/wrapper.c
@@ -0,0 +1,142 @@
+#include <errno.h>
+#include "wrapper.h"
+
+size_t encode_E2AP_PDU(E2AP_PDU_t* pdu, void* buffer, size_t buf_size)
+{
+    asn_enc_rval_t encode_result;
+    encode_result = aper_encode_to_buffer(&asn_DEF_E2AP_PDU, NULL, pdu, buffer, buf_size);
+    ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pdu);
+    if(encode_result.encoded == -1) {
+        fprintf(stderr, "Cannot encode %s: %s\n", encode_result.failed_type->name, strerror(errno));
+        return -1;
+    } else {
+          return encode_result.encoded;
+    }
+}
+
+E2AP_PDU_t* decode_E2AP_PDU(const void* buffer, size_t buf_size)
+{
+    asn_dec_rval_t decode_result;
+    E2AP_PDU_t *pdu = 0;
+    decode_result = aper_decode_complete(NULL, &asn_DEF_E2AP_PDU, (void **)&pdu, buffer, buf_size);
+    if(decode_result.code == RC_OK) {
+        return pdu;
+    } else {
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pdu);
+        return 0;
+    }
+}
+
+ssize_t e2ap_encode_ric_control_request_message(void *buffer, size_t buf_size, long ricRequestorID, long ricRequestSequenceNumber, 
+                  long ranFunctionID, void *ricControlHdr, size_t ricControlHdrSize, void *ricControlMsg, size_t ricControlMsgSize)
+{
+  
+    E2AP_PDU_t *init = (E2AP_PDU_t *)calloc(1, sizeof(E2AP_PDU_t));
+    if(!init) {
+        fprintf(stderr, "alloc E2AP_PDU failed\n");
+        return -1;
+    }
+
+    
+    InitiatingMessage_t *initiatingMsg = (InitiatingMessage_t *)calloc(1, sizeof(InitiatingMessage_t));
+    if(!initiatingMsg) {
+        fprintf(stderr, "alloc InitiatingMessage failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+        init->choice.initiatingMessage = initiatingMsg;
+    init->present = E2AP_PDU_PR_initiatingMessage;
+
+    initiatingMsg->procedureCode = ProcedureCode_id_RICcontrol;
+    initiatingMsg->criticality = Criticality_reject;
+    initiatingMsg->value.present = InitiatingMessage__value_PR_RICcontrolRequest;
+
+    RICcontrolRequest_t *control_request = &initiatingMsg->value.choice.RICcontrolRequest;
+
+
+    //RICrequestID
+    RICcontrolRequest_IEs_t *controlReqID = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqID) {
+        fprintf(stderr, "alloc RICrequestID failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    controlReqID->criticality = Criticality_reject;
+    controlReqID->id = ProtocolIE_ID_id_RICrequestID;
+
+    controlReqID->value.present = RICcontrolRequest_IEs__value_PR_RICrequestID;
+    RICrequestID_t *ricrequest_ie = &controlReqID->value.choice.RICrequestID;
+    ricrequest_ie->ricRequestorID = ricRequestorID;
+    ricrequest_ie->ricInstanceID = ricRequestSequenceNumber;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqID);
+
+    //RICfunctionID
+    RICcontrolRequest_IEs_t *controlReqFunID = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqFunID) {
+        fprintf(stderr, "alloc RICrequestID failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    controlReqFunID->criticality = Criticality_reject;
+    controlReqFunID->id = ProtocolIE_ID_id_RANfunctionID;
+    controlReqFunID->value.present = RICcontrolRequest_IEs__value_PR_RANfunctionID;
+    RANfunctionID_t *ranfunction_ie = &controlReqFunID->value.choice.RANfunctionID;
+    *ranfunction_ie = ranFunctionID;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqFunID);
+
+    // RICControlHdr
+    RICcontrolRequest_IEs_t *controlReqHdr = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqHdr) {
+        fprintf(stderr, "alloc RICcontrolRequest_IEs_t failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+    controlReqHdr->criticality = Criticality_reject;
+    controlReqHdr->id = ProtocolIE_ID_id_RICcontrolHeader;
+    controlReqHdr->value.present = RICcontrolRequest_IEs__value_PR_RICcontrolHeader;
+    RICcontrolHeader_t *controlHdr = &controlReqHdr->value.choice.RICcontrolHeader;
+    controlHdr->buf = (uint8_t *)calloc(1, ricControlHdrSize);
+    if(!controlHdr->buf) {
+        fprintf(stderr, "alloc RICcontrolHeader_t buf failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    memcpy(controlHdr->buf, ricControlHdr, ricControlHdrSize);
+    controlHdr->size = ricControlHdrSize;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqHdr);
+
+    //Ric Control Message
+    RICcontrolRequest_IEs_t *controlReqMsg = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqMsg) {
+        fprintf(stderr, "alloc RICcontrolRequest_IEs_t failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+    controlReqMsg->criticality = Criticality_reject;
+    controlReqMsg->id = ProtocolIE_ID_id_RICcontrolMessage;
+    controlReqMsg->value.present = RICcontrolRequest_IEs__value_PR_RICcontrolMessage;
+    RICcontrolMessage_t *controlMsg = &controlReqMsg->value.choice.RICcontrolMessage;
+    controlMsg->buf = (uint8_t *)calloc(1, ricControlMsgSize);
+    if(!controlMsg->buf) {
+        fprintf(stderr, "alloc RICcontrolMessage_t buf failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    memcpy(controlMsg->buf, ricControlMsg, ricControlMsgSize);
+    controlMsg->size = ricControlMsgSize;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqMsg);
+
+    fprintf(stderr, "showing xer of asn_DEF_E2AP_PDU data\n");
+    xer_fprint(stderr, &asn_DEF_E2AP_PDU, init);
+    fprintf(stderr, "\n");
+    fprintf(stderr, "After xer of asn_DEF_E2AP_PDU data\n");
+   
+    return encode_E2AP_PDU(init, buffer, buf_size);
+}
+
+                                            
diff --git a/e2ap/wrapper.h b/e2ap/wrapper.h
new file mode 100644
index 0000000..af1ec2e
--- /dev/null
+++ b/e2ap/wrapper.h
@@ -0,0 +1,20 @@
+#ifndef	_WRAPPER_H_
+#define	_WRAPPER_H_
+
+#include "RICcontrolRequest.h"
+#include "E2AP-PDU.h"
+#include "InitiatingMessage.h"
+#include "SuccessfulOutcome.h"
+#include "UnsuccessfulOutcome.h"
+#include "ProtocolIE-Container.h"
+#include "ProtocolIE-Field.h"
+#include "RICactionDefinition.h"
+#include "RICsubsequentAction.h"
+#include "CauseRIC.h"
+
+size_t encode_E2AP_PDU(E2AP_PDU_t* pdu, void* buffer, size_t buf_size);
+E2AP_PDU_t* decode_E2AP_PDU(const void* buffer, size_t buf_size);
+
+/* RICcontrol */
+ssize_t e2ap_encode_ric_control_request_message(void *buffer, size_t buf_size, long ricRequestorID, long ricRequestSequenceNumber, long ranFunctionID, void *ricControlHdr, size_t ricControlHdrSize, void *ricControlMsg, size_t ricControlMsgSize);
+#endif /* _WRAPPER_H_ */
diff --git a/e2sm/headers/BIT_STRING.h b/e2sm/headers/BIT_STRING.h
new file mode 100644
index 0000000..c1bdbbc
--- /dev/null
+++ b/e2sm/headers/BIT_STRING.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BIT_STRING_H_
+#define	_BIT_STRING_H_
+
+#include <OCTET_STRING.h>	/* Some help from OCTET STRING */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct BIT_STRING_s {
+	uint8_t *buf;	/* BIT STRING body */
+	size_t size;	/* Size of the above buffer */
+
+	int bits_unused;/* Unused trailing bits in the last octet (0..7) */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} BIT_STRING_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
+extern asn_TYPE_operation_t asn_OP_BIT_STRING;
+extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
+
+asn_struct_print_f BIT_STRING_print;	/* Human-readable output */
+asn_struct_compare_f BIT_STRING_compare;
+asn_constr_check_f BIT_STRING_constraint;
+xer_type_encoder_f BIT_STRING_encode_xer;
+oer_type_decoder_f BIT_STRING_decode_oer;
+oer_type_encoder_f BIT_STRING_encode_oer;
+per_type_decoder_f BIT_STRING_decode_uper;
+per_type_encoder_f BIT_STRING_encode_uper;
+asn_random_fill_f  BIT_STRING_random_fill;
+
+#define BIT_STRING_free              OCTET_STRING_free
+#define BIT_STRING_decode_ber        OCTET_STRING_decode_ber
+#define BIT_STRING_encode_der        OCTET_STRING_encode_der
+#define BIT_STRING_decode_xer        OCTET_STRING_decode_xer_binary
+#define BIT_STRING_decode_aper       OCTET_STRING_decode_aper
+#define BIT_STRING_encode_aper       OCTET_STRING_encode_aper
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BIT_STRING_H_ */
diff --git a/e2sm/headers/BOOLEAN.h b/e2sm/headers/BOOLEAN.h
new file mode 100644
index 0000000..620acf7
--- /dev/null
+++ b/e2sm/headers/BOOLEAN.h
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BOOLEAN_H_
+#define	_BOOLEAN_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The underlying integer may contain various values, but everything
+ * non-zero is capped to 0xff by the DER encoder. The BER decoder may
+ * yield non-zero values different from 1, beware.
+ */
+typedef int BOOLEAN_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN;
+extern asn_TYPE_operation_t asn_OP_BOOLEAN;
+
+asn_struct_free_f BOOLEAN_free;
+asn_struct_print_f BOOLEAN_print;
+asn_struct_compare_f BOOLEAN_compare;
+ber_type_decoder_f BOOLEAN_decode_ber;
+der_type_encoder_f BOOLEAN_encode_der;
+oer_type_decoder_f BOOLEAN_decode_oer;
+oer_type_encoder_f BOOLEAN_encode_oer;
+per_type_decoder_f BOOLEAN_decode_uper;
+per_type_encoder_f BOOLEAN_encode_uper;
+per_type_decoder_f BOOLEAN_decode_aper;
+per_type_encoder_f BOOLEAN_encode_aper;
+xer_type_decoder_f BOOLEAN_decode_xer;
+xer_type_encoder_f BOOLEAN_encode_xer;
+asn_random_fill_f  BOOLEAN_random_fill;
+
+#define BOOLEAN_constraint     asn_generic_no_constraint
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BOOLEAN_H_ */
diff --git a/e2sm/headers/CSI-RS-Index.h b/e2sm/headers/CSI-RS-Index.h
new file mode 100644
index 0000000..12169da
--- /dev/null
+++ b/e2sm/headers/CSI-RS-Index.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_CSI_RS_Index_H_
+#define	_CSI_RS_Index_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* CSI-RS-Index */
+typedef long	 CSI_RS_Index_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CSI_RS_Index_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CSI_RS_Index;
+asn_struct_free_f CSI_RS_Index_free;
+asn_struct_print_f CSI_RS_Index_print;
+asn_constr_check_f CSI_RS_Index_constraint;
+ber_type_decoder_f CSI_RS_Index_decode_ber;
+der_type_encoder_f CSI_RS_Index_encode_der;
+xer_type_decoder_f CSI_RS_Index_decode_xer;
+xer_type_encoder_f CSI_RS_Index_encode_xer;
+oer_type_decoder_f CSI_RS_Index_decode_oer;
+oer_type_encoder_f CSI_RS_Index_encode_oer;
+per_type_decoder_f CSI_RS_Index_decode_uper;
+per_type_encoder_f CSI_RS_Index_encode_uper;
+per_type_decoder_f CSI_RS_Index_decode_aper;
+per_type_encoder_f CSI_RS_Index_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CSI_RS_Index_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/CUUPMeasurement-Container.h b/e2sm/headers/CUUPMeasurement-Container.h
new file mode 100644
index 0000000..1bd12fd
--- /dev/null
+++ b/e2sm/headers/CUUPMeasurement-Container.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_CUUPMeasurement_Container_H_
+#define	_CUUPMeasurement_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct PlmnID_Item;
+
+/* CUUPMeasurement-Container */
+typedef struct CUUPMeasurement_Container {
+	struct CUUPMeasurement_Container__plmnList {
+		A_SEQUENCE_OF(struct PlmnID_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} plmnList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CUUPMeasurement_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CUUPMeasurement_Container;
+extern asn_SEQUENCE_specifics_t asn_SPC_CUUPMeasurement_Container_specs_1;
+extern asn_TYPE_member_t asn_MBR_CUUPMeasurement_Container_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CUUPMeasurement_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/CellObjectID.h b/e2sm/headers/CellObjectID.h
new file mode 100644
index 0000000..36c987e
--- /dev/null
+++ b/e2sm/headers/CellObjectID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_CellObjectID_H_
+#define	_CellObjectID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <PrintableString.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* CellObjectID */
+typedef PrintableString_t	 CellObjectID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CellObjectID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CellObjectID;
+asn_struct_free_f CellObjectID_free;
+asn_struct_print_f CellObjectID_print;
+asn_constr_check_f CellObjectID_constraint;
+ber_type_decoder_f CellObjectID_decode_ber;
+der_type_encoder_f CellObjectID_encode_der;
+xer_type_decoder_f CellObjectID_decode_xer;
+xer_type_encoder_f CellObjectID_encode_xer;
+oer_type_decoder_f CellObjectID_decode_oer;
+oer_type_encoder_f CellObjectID_encode_oer;
+per_type_decoder_f CellObjectID_decode_uper;
+per_type_encoder_f CellObjectID_encode_uper;
+per_type_decoder_f CellObjectID_decode_aper;
+per_type_encoder_f CellObjectID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CellObjectID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/CellResourceReportListItem.h b/e2sm/headers/CellResourceReportListItem.h
new file mode 100644
index 0000000..85275f3
--- /dev/null
+++ b/e2sm/headers/CellResourceReportListItem.h
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_CellResourceReportListItem_H_
+#define	_CellResourceReportListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "NRCGI.h"
+#include <NativeInteger.h>
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ServedPlmnPerCellListItem;
+
+/* CellResourceReportListItem */
+typedef struct CellResourceReportListItem {
+	NRCGI_t	 nRCGI;
+	long	*dl_TotalofAvailablePRBs;	/* OPTIONAL */
+	long	*ul_TotalofAvailablePRBs;	/* OPTIONAL */
+	struct CellResourceReportListItem__servedPlmnPerCellList {
+		A_SEQUENCE_OF(struct ServedPlmnPerCellListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} servedPlmnPerCellList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CellResourceReportListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CellResourceReportListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_CellResourceReportListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_CellResourceReportListItem_1[4];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CellResourceReportListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/Criticality.h b/e2sm/headers/Criticality.h
new file mode 100644
index 0000000..9e817d4
--- /dev/null
+++ b/e2sm/headers/Criticality.h
@@ -0,0 +1,52 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_Criticality_H_
+#define	_Criticality_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Criticality {
+	Criticality_reject	= 0,
+	Criticality_ignore	= 1,
+	Criticality_notify	= 2
+} e_Criticality;
+
+/* Criticality */
+typedef long	 Criticality_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_Criticality;
+asn_struct_free_f Criticality_free;
+asn_struct_print_f Criticality_print;
+asn_constr_check_f Criticality_constraint;
+ber_type_decoder_f Criticality_decode_ber;
+der_type_encoder_f Criticality_encode_der;
+xer_type_decoder_f Criticality_decode_xer;
+xer_type_encoder_f Criticality_encode_xer;
+oer_type_decoder_f Criticality_decode_oer;
+oer_type_encoder_f Criticality_encode_oer;
+per_type_decoder_f Criticality_decode_uper;
+per_type_encoder_f Criticality_encode_uper;
+per_type_decoder_f Criticality_decode_aper;
+per_type_encoder_f Criticality_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Criticality_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-ActionDefinition-Format1.h b/e2sm/headers/E2SM-KPM-ActionDefinition-Format1.h
new file mode 100644
index 0000000..4a0e06a
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-ActionDefinition-Format1.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_ActionDefinition_Format1_H_
+#define	_E2SM_KPM_ActionDefinition_Format1_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "CellObjectID.h"
+#include "MeasurementInfoList.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2SM-KPM-ActionDefinition-Format1 */
+typedef struct E2SM_KPM_ActionDefinition_Format1 {
+	CellObjectID_t	 cellObjID;
+	MeasurementInfoList_t	 measInfoList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_ActionDefinition_Format1_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_ActionDefinition_Format1;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_ActionDefinition_Format1_specs_1;
+extern asn_TYPE_member_t asn_MBR_E2SM_KPM_ActionDefinition_Format1_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_ActionDefinition_Format1_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-ActionDefinition.h b/e2sm/headers/E2SM-KPM-ActionDefinition.h
new file mode 100644
index 0000000..f5bf906
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-ActionDefinition.h
@@ -0,0 +1,67 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_ActionDefinition_H_
+#define	_E2SM_KPM_ActionDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RIC-Style-Type.h"
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2SM_KPM_ActionDefinition__actionDefinition_formats_PR {
+	E2SM_KPM_ActionDefinition__actionDefinition_formats_PR_NOTHING,	/* No components present */
+	E2SM_KPM_ActionDefinition__actionDefinition_formats_PR_actionDefinition_Format1
+	/* Extensions may appear below */
+	
+} E2SM_KPM_ActionDefinition__actionDefinition_formats_PR;
+
+/* Forward declarations */
+struct E2SM_KPM_ActionDefinition_Format1;
+
+/* E2SM-KPM-ActionDefinition */
+typedef struct E2SM_KPM_ActionDefinition {
+	RIC_Style_Type_t	 ric_ReportStyle_Type;
+	struct E2SM_KPM_ActionDefinition__actionDefinition_formats {
+		E2SM_KPM_ActionDefinition__actionDefinition_formats_PR present;
+		union E2SM_KPM_ActionDefinition__actionDefinition_formats_u {
+			struct E2SM_KPM_ActionDefinition_Format1	*actionDefinition_Format1;
+			/*
+			 * This type is extensible,
+			 * possible extensions are below.
+			 */
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} actionDefinition_formats;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_ActionDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_ActionDefinition;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_ActionDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-EventTriggerDefinition-Format1.h b/e2sm/headers/E2SM-KPM-EventTriggerDefinition-Format1.h
new file mode 100644
index 0000000..6fae26e
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-EventTriggerDefinition-Format1.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_EventTriggerDefinition_Format1_H_
+#define	_E2SM_KPM_EventTriggerDefinition_Format1_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct Trigger_ConditionIE_Item;
+
+/* E2SM-KPM-EventTriggerDefinition-Format1 */
+typedef struct E2SM_KPM_EventTriggerDefinition_Format1 {
+	struct E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List {
+		A_SEQUENCE_OF(struct Trigger_ConditionIE_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *policyTest_List;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_EventTriggerDefinition_Format1_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_EventTriggerDefinition_Format1_specs_1;
+extern asn_TYPE_member_t asn_MBR_E2SM_KPM_EventTriggerDefinition_Format1_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_EventTriggerDefinition_Format1_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-EventTriggerDefinition.h b/e2sm/headers/E2SM-KPM-EventTriggerDefinition.h
new file mode 100644
index 0000000..2db9552
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-EventTriggerDefinition.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_EventTriggerDefinition_H_
+#define	_E2SM_KPM_EventTriggerDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2SM_KPM_EventTriggerDefinition_PR {
+	E2SM_KPM_EventTriggerDefinition_PR_NOTHING,	/* No components present */
+	E2SM_KPM_EventTriggerDefinition_PR_eventDefinition_Format1
+	/* Extensions may appear below */
+	
+} E2SM_KPM_EventTriggerDefinition_PR;
+
+/* Forward declarations */
+struct E2SM_KPM_EventTriggerDefinition_Format1;
+
+/* E2SM-KPM-EventTriggerDefinition */
+typedef struct E2SM_KPM_EventTriggerDefinition {
+	E2SM_KPM_EventTriggerDefinition_PR present;
+	union E2SM_KPM_EventTriggerDefinition_u {
+		struct E2SM_KPM_EventTriggerDefinition_Format1	*eventDefinition_Format1;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_EventTriggerDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_EventTriggerDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-IndicationHeader-Format1.h b/e2sm/headers/E2SM-KPM-IndicationHeader-Format1.h
new file mode 100644
index 0000000..677d458
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-IndicationHeader-Format1.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_IndicationHeader_Format1_H_
+#define	_E2SM_KPM_IndicationHeader_Format1_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "TimeStamp.h"
+#include "GlobalE2node-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2SM-KPM-IndicationHeader-Format1 */
+typedef struct E2SM_KPM_IndicationHeader_Format1 {
+	TimeStamp_t	 collectionStartTime;
+	GlobalE2node_ID_t	 id_GlobalE2node_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_IndicationHeader_Format1_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationHeader_Format1;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_IndicationHeader_Format1_specs_1;
+extern asn_TYPE_member_t asn_MBR_E2SM_KPM_IndicationHeader_Format1_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_IndicationHeader_Format1_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-IndicationHeader.h b/e2sm/headers/E2SM-KPM-IndicationHeader.h
new file mode 100644
index 0000000..9c6670c
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-IndicationHeader.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_IndicationHeader_H_
+#define	_E2SM_KPM_IndicationHeader_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2SM_KPM_IndicationHeader_PR {
+	E2SM_KPM_IndicationHeader_PR_NOTHING,	/* No components present */
+	E2SM_KPM_IndicationHeader_PR_indicationHeader_Format1
+	/* Extensions may appear below */
+	
+} E2SM_KPM_IndicationHeader_PR;
+
+/* Forward declarations */
+struct E2SM_KPM_IndicationHeader_Format1;
+
+/* E2SM-KPM-IndicationHeader */
+typedef struct E2SM_KPM_IndicationHeader {
+	E2SM_KPM_IndicationHeader_PR present;
+	union E2SM_KPM_IndicationHeader_u {
+		struct E2SM_KPM_IndicationHeader_Format1	*indicationHeader_Format1;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_IndicationHeader_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationHeader;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_IndicationHeader_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-IndicationMessage-Format1.h b/e2sm/headers/E2SM-KPM-IndicationMessage-Format1.h
new file mode 100644
index 0000000..ad255ab
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-IndicationMessage-Format1.h
@@ -0,0 +1,69 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_IndicationMessage_Format1_H_
+#define	_E2SM_KPM_IndicationMessage_Format1_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "CellObjectID.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct PM_Containers_Item;
+struct PM_Info_Item;
+struct PerUE_PM_Item;
+
+/* E2SM-KPM-IndicationMessage-Format1 */
+typedef struct E2SM_KPM_IndicationMessage_Format1 {
+	struct E2SM_KPM_IndicationMessage_Format1__pm_Containers {
+		A_SEQUENCE_OF(struct PM_Containers_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} pm_Containers;
+	CellObjectID_t	 cellObjectID;
+	struct E2SM_KPM_IndicationMessage_Format1__list_of_PM_Information {
+		A_SEQUENCE_OF(struct PM_Info_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *list_of_PM_Information;
+	struct E2SM_KPM_IndicationMessage_Format1__list_of_matched_UEs {
+		A_SEQUENCE_OF(struct PerUE_PM_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *list_of_matched_UEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_IndicationMessage_Format1_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationMessage_Format1;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_IndicationMessage_Format1_specs_1;
+extern asn_TYPE_member_t asn_MBR_E2SM_KPM_IndicationMessage_Format1_1[4];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_IndicationMessage_Format1_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-IndicationMessage.h b/e2sm/headers/E2SM-KPM-IndicationMessage.h
new file mode 100644
index 0000000..30bd902
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-IndicationMessage.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_IndicationMessage_H_
+#define	_E2SM_KPM_IndicationMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2SM_KPM_IndicationMessage_PR {
+	E2SM_KPM_IndicationMessage_PR_NOTHING,	/* No components present */
+	E2SM_KPM_IndicationMessage_PR_indicationMessage_Format1
+	/* Extensions may appear below */
+	
+} E2SM_KPM_IndicationMessage_PR;
+
+/* Forward declarations */
+struct E2SM_KPM_IndicationMessage_Format1;
+
+/* E2SM-KPM-IndicationMessage */
+typedef struct E2SM_KPM_IndicationMessage {
+	E2SM_KPM_IndicationMessage_PR present;
+	union E2SM_KPM_IndicationMessage_u {
+		struct E2SM_KPM_IndicationMessage_Format1	*indicationMessage_Format1;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_IndicationMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationMessage;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_IndicationMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-KPM-RANFunctionDefinition.h b/e2sm/headers/E2SM-KPM-RANFunctionDefinition.h
new file mode 100644
index 0000000..51118f8
--- /dev/null
+++ b/e2sm/headers/E2SM-KPM-RANFunctionDefinition.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_KPM_RANFunctionDefinition_H_
+#define	_E2SM_KPM_RANFunctionDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunction-Name.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RIC_EventTriggerStyle_Item;
+struct RIC_ReportStyle_Item;
+
+/* E2SM-KPM-RANFunctionDefinition */
+typedef struct E2SM_KPM_RANFunctionDefinition {
+	RANfunction_Name_t	 ranFunction_Name;
+	struct E2SM_KPM_RANFunctionDefinition__ric_EventTriggerStyle_List {
+		A_SEQUENCE_OF(struct RIC_EventTriggerStyle_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *ric_EventTriggerStyle_List;
+	struct E2SM_KPM_RANFunctionDefinition__ric_ReportStyle_List {
+		A_SEQUENCE_OF(struct RIC_ReportStyle_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *ric_ReportStyle_List;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_KPM_RANFunctionDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_RANFunctionDefinition;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_KPM_RANFunctionDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-RC-ControlHeader-Format1.h b/e2sm/headers/E2SM-RC-ControlHeader-Format1.h
new file mode 100644
index 0000000..641739c
--- /dev/null
+++ b/e2sm/headers/E2SM-RC-ControlHeader-Format1.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_RC_ControlHeader_Format1_H_
+#define	_E2SM_RC_ControlHeader_Format1_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "UE-Identity.h"
+#include "RIC-Style-Type.h"
+#include "RIC-ControlAction-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2SM-RC-ControlHeader-Format1 */
+typedef struct E2SM_RC_ControlHeader_Format1 {
+	UE_Identity_t	 ueId;
+	RIC_Style_Type_t	 ric_ControlStyle_Type;
+	RIC_ControlAction_ID_t	 ric_ControlAction_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_RC_ControlHeader_Format1_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlHeader_Format1;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2SM_RC_ControlHeader_Format1_specs_1;
+extern asn_TYPE_member_t asn_MBR_E2SM_RC_ControlHeader_Format1_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_RC_ControlHeader_Format1_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-RC-ControlHeader.h b/e2sm/headers/E2SM-RC-ControlHeader.h
new file mode 100644
index 0000000..aead9e3
--- /dev/null
+++ b/e2sm/headers/E2SM-RC-ControlHeader.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_RC_ControlHeader_H_
+#define	_E2SM_RC_ControlHeader_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2SM_RC_ControlHeader_PR {
+	E2SM_RC_ControlHeader_PR_NOTHING,	/* No components present */
+	E2SM_RC_ControlHeader_PR_controlHeader_Format1
+	/* Extensions may appear below */
+	
+} E2SM_RC_ControlHeader_PR;
+
+/* Forward declarations */
+struct E2SM_RC_ControlHeader_Format1;
+
+/* E2SM-RC-ControlHeader */
+typedef struct E2SM_RC_ControlHeader {
+	E2SM_RC_ControlHeader_PR present;
+	union E2SM_RC_ControlHeader_u {
+		struct E2SM_RC_ControlHeader_Format1	*controlHeader_Format1;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_RC_ControlHeader_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlHeader;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_RC_ControlHeader_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-RC-ControlMessage-Format1.h b/e2sm/headers/E2SM-RC-ControlMessage-Format1.h
new file mode 100644
index 0000000..ba58297
--- /dev/null
+++ b/e2sm/headers/E2SM-RC-ControlMessage-Format1.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_RC_ControlMessage_Format1_H_
+#define	_E2SM_RC_ControlMessage_Format1_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RANParameter_Item;
+
+/* E2SM-RC-ControlMessage-Format1 */
+typedef struct E2SM_RC_ControlMessage_Format1 {
+	struct E2SM_RC_ControlMessage_Format1__ranParameters_List {
+		A_SEQUENCE_OF(struct RANParameter_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *ranParameters_List;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_RC_ControlMessage_Format1_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlMessage_Format1;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2SM_RC_ControlMessage_Format1_specs_1;
+extern asn_TYPE_member_t asn_MBR_E2SM_RC_ControlMessage_Format1_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_RC_ControlMessage_Format1_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-RC-ControlMessage.h b/e2sm/headers/E2SM-RC-ControlMessage.h
new file mode 100644
index 0000000..9e3d76a
--- /dev/null
+++ b/e2sm/headers/E2SM-RC-ControlMessage.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_RC_ControlMessage_H_
+#define	_E2SM_RC_ControlMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2SM_RC_ControlMessage_PR {
+	E2SM_RC_ControlMessage_PR_NOTHING,	/* No components present */
+	E2SM_RC_ControlMessage_PR_controlMessage_Format1
+	/* Extensions may appear below */
+	
+} E2SM_RC_ControlMessage_PR;
+
+/* Forward declarations */
+struct E2SM_RC_ControlMessage_Format1;
+
+/* E2SM-RC-ControlMessage */
+typedef struct E2SM_RC_ControlMessage {
+	E2SM_RC_ControlMessage_PR present;
+	union E2SM_RC_ControlMessage_u {
+		struct E2SM_RC_ControlMessage_Format1	*controlMessage_Format1;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_RC_ControlMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlMessage;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_RC_ControlMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/E2SM-RC-RANFunctionDefinition.h b/e2sm/headers/E2SM-RC-RANFunctionDefinition.h
new file mode 100644
index 0000000..112fc9e
--- /dev/null
+++ b/e2sm/headers/E2SM-RC-RANFunctionDefinition.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_E2SM_RC_RANFunctionDefinition_H_
+#define	_E2SM_RC_RANFunctionDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunction-Name.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RIC_EventTriggerStyle_Item;
+struct RIC_ControlStyle_Item;
+
+/* E2SM-RC-RANFunctionDefinition */
+typedef struct E2SM_RC_RANFunctionDefinition {
+	RANfunction_Name_t	 ranFunction_Name;
+	struct E2SM_RC_RANFunctionDefinition__ric_EventTriggerStyle_List {
+		A_SEQUENCE_OF(struct RIC_EventTriggerStyle_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *ric_EventTriggerStyle_List;
+	struct E2SM_RC_RANFunctionDefinition__ric_ControlStyle_List {
+		A_SEQUENCE_OF(struct RIC_ControlStyle_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *ric_ControlStyle_List;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2SM_RC_RANFunctionDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2SM_RC_RANFunctionDefinition;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2SM_RC_RANFunctionDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ENB-ID-Choice.h b/e2sm/headers/ENB-ID-Choice.h
new file mode 100644
index 0000000..06a6ade
--- /dev/null
+++ b/e2sm/headers/ENB-ID-Choice.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ENB_ID_Choice_H_
+#define	_ENB_ID_Choice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENB_ID_Choice_PR {
+	ENB_ID_Choice_PR_NOTHING,	/* No components present */
+	ENB_ID_Choice_PR_enb_ID_macro,
+	ENB_ID_Choice_PR_enb_ID_shortmacro,
+	ENB_ID_Choice_PR_enb_ID_longmacro
+	/* Extensions may appear below */
+	
+} ENB_ID_Choice_PR;
+
+/* ENB-ID-Choice */
+typedef struct ENB_ID_Choice {
+	ENB_ID_Choice_PR present;
+	union ENB_ID_Choice_u {
+		BIT_STRING_t	 enb_ID_macro;
+		BIT_STRING_t	 enb_ID_shortmacro;
+		BIT_STRING_t	 enb_ID_longmacro;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENB_ID_Choice_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice;
+extern asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[3];
+extern asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENB_ID_Choice_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ENB-ID.h b/e2sm/headers/ENB-ID.h
new file mode 100644
index 0000000..d3593b2
--- /dev/null
+++ b/e2sm/headers/ENB-ID.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ENB_ID_H_
+#define	_ENB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENB_ID_PR {
+	ENB_ID_PR_NOTHING,	/* No components present */
+	ENB_ID_PR_macro_eNB_ID,
+	ENB_ID_PR_home_eNB_ID,
+	/* Extensions may appear below */
+	ENB_ID_PR_short_Macro_eNB_ID,
+	ENB_ID_PR_long_Macro_eNB_ID
+} ENB_ID_PR;
+
+/* ENB-ID */
+typedef struct ENB_ID {
+	ENB_ID_PR present;
+	union ENB_ID_u {
+		BIT_STRING_t	 macro_eNB_ID;
+		BIT_STRING_t	 home_eNB_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+		BIT_STRING_t	 short_Macro_eNB_ID;
+		BIT_STRING_t	 long_Macro_eNB_ID;
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENB_ID;
+extern asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENB_ID_1[4];
+extern asn_per_constraints_t asn_PER_type_ENB_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ENGNB-ID.h b/e2sm/headers/ENGNB-ID.h
new file mode 100644
index 0000000..8f1994c
--- /dev/null
+++ b/e2sm/headers/ENGNB-ID.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ENGNB_ID_H_
+#define	_ENGNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENGNB_ID_PR {
+	ENGNB_ID_PR_NOTHING,	/* No components present */
+	ENGNB_ID_PR_gNB_ID
+	/* Extensions may appear below */
+	
+} ENGNB_ID_PR;
+
+/* ENGNB-ID */
+typedef struct ENGNB_ID {
+	ENGNB_ID_PR present;
+	union ENGNB_ID_u {
+		BIT_STRING_t	 gNB_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENGNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENGNB_ID;
+extern asn_CHOICE_specifics_t asn_SPC_ENGNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENGNB_ID_1[1];
+extern asn_per_constraints_t asn_PER_type_ENGNB_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENGNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/EPC-CUUP-PM-Format.h b/e2sm/headers/EPC-CUUP-PM-Format.h
new file mode 100644
index 0000000..0846bdc
--- /dev/null
+++ b/e2sm/headers/EPC-CUUP-PM-Format.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_EPC_CUUP_PM_Format_H_
+#define	_EPC_CUUP_PM_Format_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct PerQCIReportListItemFormat;
+
+/* EPC-CUUP-PM-Format */
+typedef struct EPC_CUUP_PM_Format {
+	struct EPC_CUUP_PM_Format__perQCIReportList_cuup {
+		A_SEQUENCE_OF(struct PerQCIReportListItemFormat) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} perQCIReportList_cuup;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} EPC_CUUP_PM_Format_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_EPC_CUUP_PM_Format;
+extern asn_SEQUENCE_specifics_t asn_SPC_EPC_CUUP_PM_Format_specs_1;
+extern asn_TYPE_member_t asn_MBR_EPC_CUUP_PM_Format_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _EPC_CUUP_PM_Format_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/EPC-DU-PM-Container.h b/e2sm/headers/EPC-DU-PM-Container.h
new file mode 100644
index 0000000..354e3fd
--- /dev/null
+++ b/e2sm/headers/EPC-DU-PM-Container.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_EPC_DU_PM_Container_H_
+#define	_EPC_DU_PM_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct PerQCIReportListItem;
+
+/* EPC-DU-PM-Container */
+typedef struct EPC_DU_PM_Container {
+	struct EPC_DU_PM_Container__perQCIReportList_du {
+		A_SEQUENCE_OF(struct PerQCIReportListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} perQCIReportList_du;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} EPC_DU_PM_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_EPC_DU_PM_Container;
+extern asn_SEQUENCE_specifics_t asn_SPC_EPC_DU_PM_Container_specs_1;
+extern asn_TYPE_member_t asn_MBR_EPC_DU_PM_Container_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _EPC_DU_PM_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/FGC-CUUP-PM-Format.h b/e2sm/headers/FGC-CUUP-PM-Format.h
new file mode 100644
index 0000000..73b91e8
--- /dev/null
+++ b/e2sm/headers/FGC-CUUP-PM-Format.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_FGC_CUUP_PM_Format_H_
+#define	_FGC_CUUP_PM_Format_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct SliceToReportListItem;
+
+/* FGC-CUUP-PM-Format */
+typedef struct FGC_CUUP_PM_Format {
+	struct FGC_CUUP_PM_Format__sliceToReportList {
+		A_SEQUENCE_OF(struct SliceToReportListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} sliceToReportList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} FGC_CUUP_PM_Format_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_FGC_CUUP_PM_Format;
+extern asn_SEQUENCE_specifics_t asn_SPC_FGC_CUUP_PM_Format_specs_1;
+extern asn_TYPE_member_t asn_MBR_FGC_CUUP_PM_Format_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _FGC_CUUP_PM_Format_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/FGC-DU-PM-Container.h b/e2sm/headers/FGC-DU-PM-Container.h
new file mode 100644
index 0000000..0d7c224
--- /dev/null
+++ b/e2sm/headers/FGC-DU-PM-Container.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_FGC_DU_PM_Container_H_
+#define	_FGC_DU_PM_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct SlicePerPlmnPerCellListItem;
+
+/* FGC-DU-PM-Container */
+typedef struct FGC_DU_PM_Container {
+	struct FGC_DU_PM_Container__slicePerPlmnPerCellList {
+		A_SEQUENCE_OF(struct SlicePerPlmnPerCellListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} slicePerPlmnPerCellList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} FGC_DU_PM_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_FGC_DU_PM_Container;
+extern asn_SEQUENCE_specifics_t asn_SPC_FGC_DU_PM_Container_specs_1;
+extern asn_TYPE_member_t asn_MBR_FGC_DU_PM_Container_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _FGC_DU_PM_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/FQIPERSlicesPerPlmnListItem.h b/e2sm/headers/FQIPERSlicesPerPlmnListItem.h
new file mode 100644
index 0000000..93cbd5f
--- /dev/null
+++ b/e2sm/headers/FQIPERSlicesPerPlmnListItem.h
@@ -0,0 +1,47 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_FQIPERSlicesPerPlmnListItem_H_
+#define	_FQIPERSlicesPerPlmnListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "FiveQI.h"
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* FQIPERSlicesPerPlmnListItem */
+typedef struct FQIPERSlicesPerPlmnListItem {
+	FiveQI_t	 fiveQI;
+	INTEGER_t	*pDCPBytesDL;	/* OPTIONAL */
+	INTEGER_t	*pDCPBytesUL;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} FQIPERSlicesPerPlmnListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_FQIPERSlicesPerPlmnListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_FQIPERSlicesPerPlmnListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_FQIPERSlicesPerPlmnListItem_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _FQIPERSlicesPerPlmnListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/FQIPERSlicesPerPlmnPerCellListItem.h b/e2sm/headers/FQIPERSlicesPerPlmnPerCellListItem.h
new file mode 100644
index 0000000..c805b5f
--- /dev/null
+++ b/e2sm/headers/FQIPERSlicesPerPlmnPerCellListItem.h
@@ -0,0 +1,47 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_FQIPERSlicesPerPlmnPerCellListItem_H_
+#define	_FQIPERSlicesPerPlmnPerCellListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "FiveQI.h"
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* FQIPERSlicesPerPlmnPerCellListItem */
+typedef struct FQIPERSlicesPerPlmnPerCellListItem {
+	FiveQI_t	 fiveQI;
+	long	*dl_PRBUsage;	/* OPTIONAL */
+	long	*ul_PRBUsage;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} FQIPERSlicesPerPlmnPerCellListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_FQIPERSlicesPerPlmnPerCellListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_FQIPERSlicesPerPlmnPerCellListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_FQIPERSlicesPerPlmnPerCellListItem_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _FQIPERSlicesPerPlmnPerCellListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/FiveQI.h b/e2sm/headers/FiveQI.h
new file mode 100644
index 0000000..79e7340
--- /dev/null
+++ b/e2sm/headers/FiveQI.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_FiveQI_H_
+#define	_FiveQI_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* FiveQI */
+typedef long	 FiveQI_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_FiveQI_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_FiveQI;
+asn_struct_free_f FiveQI_free;
+asn_struct_print_f FiveQI_print;
+asn_constr_check_f FiveQI_constraint;
+ber_type_decoder_f FiveQI_decode_ber;
+der_type_encoder_f FiveQI_encode_der;
+xer_type_decoder_f FiveQI_decode_xer;
+xer_type_encoder_f FiveQI_encode_xer;
+oer_type_decoder_f FiveQI_decode_oer;
+oer_type_encoder_f FiveQI_encode_oer;
+per_type_decoder_f FiveQI_decode_uper;
+per_type_encoder_f FiveQI_encode_uper;
+per_type_decoder_f FiveQI_decode_aper;
+per_type_encoder_f FiveQI_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _FiveQI_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GNB-CU-UP-ID.h b/e2sm/headers/GNB-CU-UP-ID.h
new file mode 100644
index 0000000..23b6f3b
--- /dev/null
+++ b/e2sm/headers/GNB-CU-UP-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GNB_CU_UP_ID_H_
+#define	_GNB_CU_UP_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GNB-CU-UP-ID */
+typedef INTEGER_t	 GNB_CU_UP_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_GNB_CU_UP_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_GNB_CU_UP_ID;
+asn_struct_free_f GNB_CU_UP_ID_free;
+asn_struct_print_f GNB_CU_UP_ID_print;
+asn_constr_check_f GNB_CU_UP_ID_constraint;
+ber_type_decoder_f GNB_CU_UP_ID_decode_ber;
+der_type_encoder_f GNB_CU_UP_ID_encode_der;
+xer_type_decoder_f GNB_CU_UP_ID_decode_xer;
+xer_type_encoder_f GNB_CU_UP_ID_encode_xer;
+oer_type_decoder_f GNB_CU_UP_ID_decode_oer;
+oer_type_encoder_f GNB_CU_UP_ID_encode_oer;
+per_type_decoder_f GNB_CU_UP_ID_decode_uper;
+per_type_encoder_f GNB_CU_UP_ID_encode_uper;
+per_type_decoder_f GNB_CU_UP_ID_decode_aper;
+per_type_encoder_f GNB_CU_UP_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_CU_UP_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GNB-DU-ID.h b/e2sm/headers/GNB-DU-ID.h
new file mode 100644
index 0000000..d97a542
--- /dev/null
+++ b/e2sm/headers/GNB-DU-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GNB_DU_ID_H_
+#define	_GNB_DU_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GNB-DU-ID */
+typedef INTEGER_t	 GNB_DU_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_GNB_DU_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_GNB_DU_ID;
+asn_struct_free_f GNB_DU_ID_free;
+asn_struct_print_f GNB_DU_ID_print;
+asn_constr_check_f GNB_DU_ID_constraint;
+ber_type_decoder_f GNB_DU_ID_decode_ber;
+der_type_encoder_f GNB_DU_ID_encode_der;
+xer_type_decoder_f GNB_DU_ID_decode_xer;
+xer_type_encoder_f GNB_DU_ID_encode_xer;
+oer_type_decoder_f GNB_DU_ID_decode_oer;
+oer_type_encoder_f GNB_DU_ID_encode_oer;
+per_type_decoder_f GNB_DU_ID_decode_uper;
+per_type_encoder_f GNB_DU_ID_encode_uper;
+per_type_decoder_f GNB_DU_ID_decode_aper;
+per_type_encoder_f GNB_DU_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_DU_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GNB-ID-Choice.h b/e2sm/headers/GNB-ID-Choice.h
new file mode 100644
index 0000000..fd8b7ca
--- /dev/null
+++ b/e2sm/headers/GNB-ID-Choice.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GNB_ID_Choice_H_
+#define	_GNB_ID_Choice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum GNB_ID_Choice_PR {
+	GNB_ID_Choice_PR_NOTHING,	/* No components present */
+	GNB_ID_Choice_PR_gnb_ID
+	/* Extensions may appear below */
+	
+} GNB_ID_Choice_PR;
+
+/* GNB-ID-Choice */
+typedef struct GNB_ID_Choice {
+	GNB_ID_Choice_PR present;
+	union GNB_ID_Choice_u {
+		BIT_STRING_t	 gnb_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GNB_ID_Choice_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GNB_ID_Choice;
+extern asn_CHOICE_specifics_t asn_SPC_GNB_ID_Choice_specs_1;
+extern asn_TYPE_member_t asn_MBR_GNB_ID_Choice_1[1];
+extern asn_per_constraints_t asn_PER_type_GNB_ID_Choice_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_ID_Choice_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalE2node-ID.h b/e2sm/headers/GlobalE2node-ID.h
new file mode 100644
index 0000000..4c1f1be
--- /dev/null
+++ b/e2sm/headers/GlobalE2node-ID.h
@@ -0,0 +1,67 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalE2node_ID_H_
+#define	_GlobalE2node_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum GlobalE2node_ID_PR {
+	GlobalE2node_ID_PR_NOTHING,	/* No components present */
+	GlobalE2node_ID_PR_gNB,
+	GlobalE2node_ID_PR_en_gNB,
+	GlobalE2node_ID_PR_ng_eNB,
+	GlobalE2node_ID_PR_eNB
+	/* Extensions may appear below */
+	
+} GlobalE2node_ID_PR;
+
+/* Forward declarations */
+struct GlobalE2node_gNB_ID;
+struct GlobalE2node_en_gNB_ID;
+struct GlobalE2node_ng_eNB_ID;
+struct GlobalE2node_eNB_ID;
+
+/* GlobalE2node-ID */
+typedef struct GlobalE2node_ID {
+	GlobalE2node_ID_PR present;
+	union GlobalE2node_ID_u {
+		struct GlobalE2node_gNB_ID	*gNB;
+		struct GlobalE2node_en_gNB_ID	*en_gNB;
+		struct GlobalE2node_ng_eNB_ID	*ng_eNB;
+		struct GlobalE2node_eNB_ID	*eNB;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ID;
+extern asn_CHOICE_specifics_t asn_SPC_GlobalE2node_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_ID_1[4];
+extern asn_per_constraints_t asn_PER_type_GlobalE2node_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalE2node-eNB-ID.h b/e2sm/headers/GlobalE2node-eNB-ID.h
new file mode 100644
index 0000000..c38f8e7
--- /dev/null
+++ b/e2sm/headers/GlobalE2node-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalE2node_eNB_ID_H_
+#define	_GlobalE2node_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalENB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-eNB-ID */
+typedef struct GlobalE2node_eNB_ID {
+	GlobalENB_ID_t	 global_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalE2node-en-gNB-ID.h b/e2sm/headers/GlobalE2node-en-gNB-ID.h
new file mode 100644
index 0000000..795bc84
--- /dev/null
+++ b/e2sm/headers/GlobalE2node-en-gNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalE2node_en_gNB_ID_H_
+#define	_GlobalE2node_en_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalenGNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-en-gNB-ID */
+typedef struct GlobalE2node_en_gNB_ID {
+	GlobalenGNB_ID_t	 global_gNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_en_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_en_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_en_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_en_gNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_en_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalE2node-gNB-ID.h b/e2sm/headers/GlobalE2node-gNB-ID.h
new file mode 100644
index 0000000..d8121fe
--- /dev/null
+++ b/e2sm/headers/GlobalE2node-gNB-ID.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalE2node_gNB_ID_H_
+#define	_GlobalE2node_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalgNB-ID.h"
+#include "GNB-CU-UP-ID.h"
+#include "GNB-DU-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-gNB-ID */
+typedef struct GlobalE2node_gNB_ID {
+	GlobalgNB_ID_t	 global_gNB_ID;
+	GNB_CU_UP_ID_t	*gNB_CU_UP_ID;	/* OPTIONAL */
+	GNB_DU_ID_t	*gNB_DU_ID;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_gNB_ID_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalE2node-ng-eNB-ID.h b/e2sm/headers/GlobalE2node-ng-eNB-ID.h
new file mode 100644
index 0000000..f959fb8
--- /dev/null
+++ b/e2sm/headers/GlobalE2node-ng-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalE2node_ng_eNB_ID_H_
+#define	_GlobalE2node_ng_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalngeNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-ng-eNB-ID */
+typedef struct GlobalE2node_ng_eNB_ID {
+	GlobalngeNB_ID_t	 global_ng_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_ng_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ng_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_ng_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_ng_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_ng_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalENB-ID.h b/e2sm/headers/GlobalENB-ID.h
new file mode 100644
index 0000000..274bd8c
--- /dev/null
+++ b/e2sm/headers/GlobalENB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalENB_ID_H_
+#define	_GlobalENB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalENB-ID */
+typedef struct GlobalENB_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	ENB_ID_t	 eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalENB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalENB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalENB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalENB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalENB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalKPMnode-ID.h b/e2sm/headers/GlobalKPMnode-ID.h
new file mode 100644
index 0000000..bbac962
--- /dev/null
+++ b/e2sm/headers/GlobalKPMnode-ID.h
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#ifndef	_GlobalKPMnode_ID_H_
+#define	_GlobalKPMnode_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalKPMnode-gNB-ID.h"
+#include "GlobalKPMnode-en-gNB-ID.h"
+#include "GlobalKPMnode-ng-eNB-ID.h"
+#include "GlobalKPMnode-eNB-ID.h"
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum GlobalKPMnode_ID_PR {
+	GlobalKPMnode_ID_PR_NOTHING,	/* No components present */
+	GlobalKPMnode_ID_PR_gNB,
+	GlobalKPMnode_ID_PR_en_gNB,
+	GlobalKPMnode_ID_PR_ng_eNB,
+	GlobalKPMnode_ID_PR_eNB
+	/* Extensions may appear below */
+	
+} GlobalKPMnode_ID_PR;
+
+/* GlobalKPMnode-ID */
+typedef struct GlobalKPMnode_ID {
+	GlobalKPMnode_ID_PR present;
+	union GlobalKPMnode_ID_u {
+		GlobalKPMnode_gNB_ID_t	 gNB;
+		GlobalKPMnode_en_gNB_ID_t	 en_gNB;
+		GlobalKPMnode_ng_eNB_ID_t	 ng_eNB;
+		GlobalKPMnode_eNB_ID_t	 eNB;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalKPMnode_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_ID;
+extern asn_CHOICE_specifics_t asn_SPC_GlobalKPMnode_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalKPMnode_ID_1[4];
+extern asn_per_constraints_t asn_PER_type_GlobalKPMnode_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalKPMnode_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalKPMnode-eNB-ID.h b/e2sm/headers/GlobalKPMnode-eNB-ID.h
new file mode 100644
index 0000000..7ebf223
--- /dev/null
+++ b/e2sm/headers/GlobalKPMnode-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#ifndef	_GlobalKPMnode_eNB_ID_H_
+#define	_GlobalKPMnode_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalENB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalKPMnode-eNB-ID */
+typedef struct GlobalKPMnode_eNB_ID {
+	GlobalENB_ID_t	 global_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalKPMnode_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalKPMnode_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalKPMnode_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalKPMnode-en-gNB-ID.h b/e2sm/headers/GlobalKPMnode-en-gNB-ID.h
new file mode 100644
index 0000000..37f8a0d
--- /dev/null
+++ b/e2sm/headers/GlobalKPMnode-en-gNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#ifndef	_GlobalKPMnode_en_gNB_ID_H_
+#define	_GlobalKPMnode_en_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalenGNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalKPMnode-en-gNB-ID */
+typedef struct GlobalKPMnode_en_gNB_ID {
+	GlobalenGNB_ID_t	 global_gNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalKPMnode_en_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_en_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_en_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalKPMnode_en_gNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalKPMnode_en_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalKPMnode-gNB-ID.h b/e2sm/headers/GlobalKPMnode-gNB-ID.h
new file mode 100644
index 0000000..f0dcc67
--- /dev/null
+++ b/e2sm/headers/GlobalKPMnode-gNB-ID.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#ifndef	_GlobalKPMnode_gNB_ID_H_
+#define	_GlobalKPMnode_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalgNB-ID.h"
+#include "GNB-CU-UP-ID.h"
+#include "GNB-DU-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalKPMnode-gNB-ID */
+typedef struct GlobalKPMnode_gNB_ID {
+	GlobalgNB_ID_t	 global_gNB_ID;
+	GNB_CU_UP_ID_t	*gNB_CU_UP_ID;	/* OPTIONAL */
+	GNB_DU_ID_t	*gNB_DU_ID;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalKPMnode_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalKPMnode_gNB_ID_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalKPMnode_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalKPMnode-ng-eNB-ID.h b/e2sm/headers/GlobalKPMnode-ng-eNB-ID.h
new file mode 100644
index 0000000..faa0a22
--- /dev/null
+++ b/e2sm/headers/GlobalKPMnode-ng-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#ifndef	_GlobalKPMnode_ng_eNB_ID_H_
+#define	_GlobalKPMnode_ng_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalngeNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalKPMnode-ng-eNB-ID */
+typedef struct GlobalKPMnode_ng_eNB_ID {
+	GlobalngeNB_ID_t	 global_ng_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalKPMnode_ng_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_ng_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_ng_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalKPMnode_ng_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalKPMnode_ng_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalenGNB-ID.h b/e2sm/headers/GlobalenGNB-ID.h
new file mode 100644
index 0000000..40f06c8
--- /dev/null
+++ b/e2sm/headers/GlobalenGNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalenGNB_ID_H_
+#define	_GlobalenGNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENGNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalenGNB-ID */
+typedef struct GlobalenGNB_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	ENGNB_ID_t	 gNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalenGNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalenGNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalenGNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalenGNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalenGNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalgNB-ID.h b/e2sm/headers/GlobalgNB-ID.h
new file mode 100644
index 0000000..7b0364d
--- /dev/null
+++ b/e2sm/headers/GlobalgNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalgNB_ID_H_
+#define	_GlobalgNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "GNB-ID-Choice.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalgNB-ID */
+typedef struct GlobalgNB_ID {
+	PLMN_Identity_t	 plmn_id;
+	GNB_ID_Choice_t	 gnb_id;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalgNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalgNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalgNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalgNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalgNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/GlobalngeNB-ID.h b/e2sm/headers/GlobalngeNB-ID.h
new file mode 100644
index 0000000..a6ab832
--- /dev/null
+++ b/e2sm/headers/GlobalngeNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_GlobalngeNB_ID_H_
+#define	_GlobalngeNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENB-ID-Choice.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalngeNB-ID */
+typedef struct GlobalngeNB_ID {
+	PLMN_Identity_t	 plmn_id;
+	ENB_ID_Choice_t	 enb_id;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalngeNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalngeNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalngeNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalngeNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalngeNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/INTEGER.h b/e2sm/headers/INTEGER.h
new file mode 100644
index 0000000..f776c07
--- /dev/null
+++ b/e2sm/headers/INTEGER.h
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_INTEGER_H_
+#define	_INTEGER_H_
+
+#include <asn_application.h>
+#include <asn_codecs_prim.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ASN__PRIMITIVE_TYPE_t INTEGER_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_INTEGER;
+extern asn_TYPE_operation_t asn_OP_INTEGER;
+
+/* Map with <tag> to integer value association */
+typedef struct asn_INTEGER_enum_map_s {
+	long		 nat_value;	/* associated native integer value */
+	size_t		 enum_len;	/* strlen("tag") */
+	const char	*enum_name;	/* "tag" */
+} asn_INTEGER_enum_map_t;
+
+/* This type describes an enumeration for INTEGER and ENUMERATED types */
+typedef struct asn_INTEGER_specifics_s {
+	const asn_INTEGER_enum_map_t *value2enum;	/* N -> "tag"; sorted by N */
+	const unsigned int *enum2value;		/* "tag" => N; sorted by tag */
+	int map_count;				/* Elements in either map */
+	int extension;				/* This map is extensible */
+	int strict_enumeration;			/* Enumeration set is fixed */
+	int field_width;			/* Size of native integer */
+	int field_unsigned;			/* Signed=0, unsigned=1 */
+} asn_INTEGER_specifics_t;
+
+#define INTEGER_free    ASN__PRIMITIVE_TYPE_free
+#define INTEGER_decode_ber	ber_decode_primitive
+#define INTEGER_constraint	asn_generic_no_constraint
+asn_struct_print_f INTEGER_print;
+asn_struct_compare_f INTEGER_compare;
+der_type_encoder_f INTEGER_encode_der;
+xer_type_decoder_f INTEGER_decode_xer;
+xer_type_encoder_f INTEGER_encode_xer;
+oer_type_decoder_f INTEGER_decode_oer;
+oer_type_encoder_f INTEGER_encode_oer;
+per_type_decoder_f INTEGER_decode_uper;
+per_type_encoder_f INTEGER_encode_uper;
+per_type_decoder_f INTEGER_decode_aper;
+per_type_encoder_f INTEGER_encode_aper;
+asn_random_fill_f  INTEGER_random_fill;
+
+/***********************************
+ * Some handy conversion routines. *
+ ***********************************/
+
+/*
+ * Natiwe size-independent conversion of native integers to/from INTEGER.
+ * (l_size) is in bytes.
+ * Returns 0 if it was possible to convert, -1 otherwise.
+ * -1/EINVAL: Mandatory argument missing
+ * -1/ERANGE: Value encoded is out of range for long representation
+ * -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()).
+ */
+int asn_INTEGER2imax(const INTEGER_t *i, intmax_t *l);
+int asn_INTEGER2umax(const INTEGER_t *i, uintmax_t *l);
+int asn_imax2INTEGER(INTEGER_t *i, intmax_t l);
+int asn_umax2INTEGER(INTEGER_t *i, uintmax_t l);
+
+/*
+ * Size-specific conversion helpers.
+ */
+int asn_INTEGER2long(const INTEGER_t *i, long *l);
+int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l);
+int asn_long2INTEGER(INTEGER_t *i, long l);
+int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l);
+int asn_int642INTEGER(INTEGER_t *i, int64_t l);
+int asn_uint642INTEGER(INTEGER_t *i, uint64_t l);
+
+/* A version of strtol/strtoimax(3) with nicer error reporting. */
+enum asn_strtox_result_e {
+    ASN_STRTOX_ERROR_RANGE = -3,  /* Input outside of supported numeric range */
+    ASN_STRTOX_ERROR_INVAL = -2,  /* Invalid data encountered (e.g., "+-") */
+    ASN_STRTOX_EXPECT_MORE = -1,  /* More data expected (e.g. "+") */
+    ASN_STRTOX_OK          =  0,  /* Conversion succeded, number ends at (*end) */
+    ASN_STRTOX_EXTRA_DATA  =  1   /* Conversion succeded, but the string has extra stuff */
+};
+enum asn_strtox_result_e asn_strtol_lim(const char *str, const char **end,
+                                        long *l);
+enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end,
+                                         unsigned long *l);
+enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end,
+                                           intmax_t *l);
+enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end,
+                                           uintmax_t *l);
+
+/*
+ * Convert the integer value into the corresponding enumeration map entry.
+ */
+const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(
+    const asn_INTEGER_specifics_t *specs, long value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _INTEGER_H_ */
diff --git a/e2sm/headers/L3-RRC-Measurements.h b/e2sm/headers/L3-RRC-Measurements.h
new file mode 100644
index 0000000..eb51c5c
--- /dev/null
+++ b/e2sm/headers/L3-RRC-Measurements.h
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_L3_RRC_Measurements_H_
+#define	_L3_RRC_Measurements_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RRCEvent.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ServingCellMeasurements;
+struct MeasResultNeighCells;
+
+/* L3-RRC-Measurements */
+typedef struct L3_RRC_Measurements {
+	RRCEvent_t	 rrcEvent;
+	struct ServingCellMeasurements	*servingCellMeasurements;	/* OPTIONAL */
+	struct MeasResultNeighCells	*measResultNeighCells;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} L3_RRC_Measurements_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_L3_RRC_Measurements;
+extern asn_SEQUENCE_specifics_t asn_SPC_L3_RRC_Measurements_specs_1;
+extern asn_TYPE_member_t asn_MBR_L3_RRC_Measurements_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _L3_RRC_Measurements_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/Makefile.am.libasncodec b/e2sm/headers/Makefile.am.libasncodec
new file mode 100644
index 0000000..accc816
--- /dev/null
+++ b/e2sm/headers/Makefile.am.libasncodec
@@ -0,0 +1,344 @@
+ASN_MODULE_SRCS=	\
+	./gen_files/Criticality.c	\
+	./gen_files/Presence.c	\
+	./gen_files/ProcedureCode.c	\
+	./gen_files/ProtocolIE-ID.c	\
+	./gen_files/TriggeringMessage.c	\
+	./gen_files/E2SM-KPM-RANFunctionDefinition.c	\
+	./gen_files/RIC-ReportStyle-Item.c	\
+	./gen_files/E2SM-KPM-ActionDefinition.c	\
+	./gen_files/E2SM-KPM-ActionDefinition-Format1.c	\
+	./gen_files/E2SM-KPM-IndicationHeader.c	\
+	./gen_files/E2SM-KPM-IndicationHeader-Format1.c	\
+	./gen_files/E2SM-KPM-IndicationMessage.c	\
+	./gen_files/E2SM-KPM-IndicationMessage-Format1.c	\
+	./gen_files/PM-Containers-Item.c	\
+	./gen_files/PerUE-PM-Item.c	\
+	./gen_files/PM-Info-Item.c	\
+	./gen_files/PF-Container.c	\
+	./gen_files/ODU-PF-Container.c	\
+	./gen_files/CellResourceReportListItem.c	\
+	./gen_files/ServedPlmnPerCellListItem.c	\
+	./gen_files/FGC-DU-PM-Container.c	\
+	./gen_files/SlicePerPlmnPerCellListItem.c	\
+	./gen_files/FQIPERSlicesPerPlmnPerCellListItem.c	\
+	./gen_files/EPC-DU-PM-Container.c	\
+	./gen_files/PerQCIReportListItem.c	\
+	./gen_files/OCUCP-PF-Container.c	\
+	./gen_files/OCUUP-PF-Container.c	\
+	./gen_files/PF-ContainerListItem.c	\
+	./gen_files/CUUPMeasurement-Container.c	\
+	./gen_files/PlmnID-Item.c	\
+	./gen_files/FGC-CUUP-PM-Format.c	\
+	./gen_files/SliceToReportListItem.c	\
+	./gen_files/FQIPERSlicesPerPlmnListItem.c	\
+	./gen_files/EPC-CUUP-PM-Format.c	\
+	./gen_files/PerQCIReportListItemFormat.c	\
+	./gen_files/MeasurementValue.c	\
+	./gen_files/L3-RRC-Measurements.c	\
+	./gen_files/RRCEvent.c	\
+	./gen_files/ServingCellMeasurements.c	\
+	./gen_files/MeasResultServMOList.c	\
+	./gen_files/MeasResultServMO.c	\
+	./gen_files/MeasResultNR.c	\
+	./gen_files/MeasResultListEUTRA.c	\
+	./gen_files/MeasResultEUTRA.c	\
+	./gen_files/MeasResultPCell.c	\
+	./gen_files/MeasResultNeighCells.c	\
+	./gen_files/MeasResultListNR.c	\
+	./gen_files/PhysCellId.c	\
+	./gen_files/ServCellIndex.c	\
+	./gen_files/MeasQuantityResults.c	\
+	./gen_files/MeasQuantityResultsEUTRA.c	\
+	./gen_files/RSRP-RangeEUTRA.c	\
+	./gen_files/RSRQ-RangeEUTRA.c	\
+	./gen_files/SINR-RangeEUTRA.c	\
+	./gen_files/ResultsPerSSB-IndexList.c	\
+	./gen_files/ResultsPerSSB-Index.c	\
+	./gen_files/ResultsPerCSI-RS-IndexList.c	\
+	./gen_files/ResultsPerCSI-RS-Index.c	\
+	./gen_files/SSB-Index.c	\
+	./gen_files/CSI-RS-Index.c	\
+	./gen_files/RSRP-Range.c	\
+	./gen_files/RSRQ-Range.c	\
+	./gen_files/SINR-Range.c	\
+	./gen_files/TimeStamp.c	\
+	./gen_files/CellObjectID.c	\
+	./gen_files/MeasurementInfoList.c	\
+	./gen_files/MeasurementInfoItem.c	\
+	./gen_files/MeasurementType.c	\
+	./gen_files/NRCGI.c	\
+	./gen_files/NRCellIdentity.c	\
+	./gen_files/S-NSSAI.c	\
+	./gen_files/MeasurementTypeName.c	\
+	./gen_files/MeasurementTypeID.c	\
+	./gen_files/FiveQI.c	\
+	./gen_files/QCI.c	\
+	./gen_files/NI-Type.c	\
+	./gen_files/RAN-Container.c	\
+	./gen_files/E2SM-RC-RANFunctionDefinition.c	\
+	./gen_files/RANfunction-Name.c	\
+	./gen_files/RIC-EventTriggerStyle-Item.c	\
+	./gen_files/RIC-ControlStyle-Item.c	\
+	./gen_files/RIC-ControlAction-Item.c	\
+	./gen_files/RAN-ControlParameter-Item.c	\
+	./gen_files/E2SM-RC-ControlHeader.c	\
+	./gen_files/E2SM-RC-ControlHeader-Format1.c	\
+	./gen_files/E2SM-RC-ControlMessage.c	\
+	./gen_files/E2SM-RC-ControlMessage-Format1.c	\
+	./gen_files/RANParameter-Item.c	\
+	./gen_files/RANParameter-ValueType.c	\
+	./gen_files/RANParameter-ELEMENT.c	\
+	./gen_files/RANParameter-STRUCTURE.c	\
+	./gen_files/RANParameter-LIST.c	\
+	./gen_files/RANParameter-Value.c	\
+	./gen_files/UE-Identity.c	\
+	./gen_files/RIC-Style-Type.c	\
+	./gen_files/RIC-Style-Name.c	\
+	./gen_files/RIC-Format-Type.c	\
+	./gen_files/RANParameter-ID.c	\
+	./gen_files/RANParameter-Name.c	\
+	./gen_files/RIC-ControlAction-ID.c	\
+	./gen_files/RIC-ControlAction-Name.c	\
+	./gen_files/E2SM-KPM-EventTriggerDefinition.c	\
+	./gen_files/E2SM-KPM-EventTriggerDefinition-Format1.c	\
+	./gen_files/Trigger-ConditionIE-Item.c	\
+	./gen_files/RT-Period-IE.c	\
+	./gen_files/RANcallProcess-ID-string.c	\
+	./gen_files/PLMN-Identity.c	\
+	./gen_files/GlobalE2node-ID.c	\
+	./gen_files/GlobalE2node-en-gNB-ID.c	\
+	./gen_files/GlobalE2node-eNB-ID.c	\
+	./gen_files/GlobalE2node-gNB-ID.c	\
+	./gen_files/GlobalE2node-ng-eNB-ID.c	\
+	./gen_files/GlobalENB-ID.c	\
+	./gen_files/GlobalenGNB-ID.c	\
+	./gen_files/GlobalgNB-ID.c	\
+	./gen_files/GlobalngeNB-ID.c	\
+	./gen_files/GNB-ID-Choice.c	\
+	./gen_files/ENB-ID-Choice.c	\
+	./gen_files/ENB-ID.c	\
+	./gen_files/ENGNB-ID.c	\
+	./gen_files/GNB-CU-UP-ID.c	\
+	./gen_files/GNB-DU-ID.c
+
+ASN_MODULE_HDRS=	\
+	./gen_files/Criticality.h	\
+	./gen_files/Presence.h	\
+	./gen_files/ProcedureCode.h	\
+	./gen_files/ProtocolIE-ID.h	\
+	./gen_files/TriggeringMessage.h	\
+	./gen_files/E2SM-KPM-RANFunctionDefinition.h	\
+	./gen_files/RIC-ReportStyle-Item.h	\
+	./gen_files/E2SM-KPM-ActionDefinition.h	\
+	./gen_files/E2SM-KPM-ActionDefinition-Format1.h	\
+	./gen_files/E2SM-KPM-IndicationHeader.h	\
+	./gen_files/E2SM-KPM-IndicationHeader-Format1.h	\
+	./gen_files/E2SM-KPM-IndicationMessage.h	\
+	./gen_files/E2SM-KPM-IndicationMessage-Format1.h	\
+	./gen_files/PM-Containers-Item.h	\
+	./gen_files/PerUE-PM-Item.h	\
+	./gen_files/PM-Info-Item.h	\
+	./gen_files/PF-Container.h	\
+	./gen_files/ODU-PF-Container.h	\
+	./gen_files/CellResourceReportListItem.h	\
+	./gen_files/ServedPlmnPerCellListItem.h	\
+	./gen_files/FGC-DU-PM-Container.h	\
+	./gen_files/SlicePerPlmnPerCellListItem.h	\
+	./gen_files/FQIPERSlicesPerPlmnPerCellListItem.h	\
+	./gen_files/EPC-DU-PM-Container.h	\
+	./gen_files/PerQCIReportListItem.h	\
+	./gen_files/OCUCP-PF-Container.h	\
+	./gen_files/OCUUP-PF-Container.h	\
+	./gen_files/PF-ContainerListItem.h	\
+	./gen_files/CUUPMeasurement-Container.h	\
+	./gen_files/PlmnID-Item.h	\
+	./gen_files/FGC-CUUP-PM-Format.h	\
+	./gen_files/SliceToReportListItem.h	\
+	./gen_files/FQIPERSlicesPerPlmnListItem.h	\
+	./gen_files/EPC-CUUP-PM-Format.h	\
+	./gen_files/PerQCIReportListItemFormat.h	\
+	./gen_files/MeasurementValue.h	\
+	./gen_files/L3-RRC-Measurements.h	\
+	./gen_files/RRCEvent.h	\
+	./gen_files/ServingCellMeasurements.h	\
+	./gen_files/MeasResultServMOList.h	\
+	./gen_files/MeasResultServMO.h	\
+	./gen_files/MeasResultNR.h	\
+	./gen_files/MeasResultListEUTRA.h	\
+	./gen_files/MeasResultEUTRA.h	\
+	./gen_files/MeasResultPCell.h	\
+	./gen_files/MeasResultNeighCells.h	\
+	./gen_files/MeasResultListNR.h	\
+	./gen_files/PhysCellId.h	\
+	./gen_files/ServCellIndex.h	\
+	./gen_files/MeasQuantityResults.h	\
+	./gen_files/MeasQuantityResultsEUTRA.h	\
+	./gen_files/RSRP-RangeEUTRA.h	\
+	./gen_files/RSRQ-RangeEUTRA.h	\
+	./gen_files/SINR-RangeEUTRA.h	\
+	./gen_files/ResultsPerSSB-IndexList.h	\
+	./gen_files/ResultsPerSSB-Index.h	\
+	./gen_files/ResultsPerCSI-RS-IndexList.h	\
+	./gen_files/ResultsPerCSI-RS-Index.h	\
+	./gen_files/SSB-Index.h	\
+	./gen_files/CSI-RS-Index.h	\
+	./gen_files/RSRP-Range.h	\
+	./gen_files/RSRQ-Range.h	\
+	./gen_files/SINR-Range.h	\
+	./gen_files/TimeStamp.h	\
+	./gen_files/CellObjectID.h	\
+	./gen_files/MeasurementInfoList.h	\
+	./gen_files/MeasurementInfoItem.h	\
+	./gen_files/MeasurementType.h	\
+	./gen_files/NRCGI.h	\
+	./gen_files/NRCellIdentity.h	\
+	./gen_files/S-NSSAI.h	\
+	./gen_files/MeasurementTypeName.h	\
+	./gen_files/MeasurementTypeID.h	\
+	./gen_files/FiveQI.h	\
+	./gen_files/QCI.h	\
+	./gen_files/NI-Type.h	\
+	./gen_files/RAN-Container.h	\
+	./gen_files/E2SM-RC-RANFunctionDefinition.h	\
+	./gen_files/RANfunction-Name.h	\
+	./gen_files/RIC-EventTriggerStyle-Item.h	\
+	./gen_files/RIC-ControlStyle-Item.h	\
+	./gen_files/RIC-ControlAction-Item.h	\
+	./gen_files/RAN-ControlParameter-Item.h	\
+	./gen_files/E2SM-RC-ControlHeader.h	\
+	./gen_files/E2SM-RC-ControlHeader-Format1.h	\
+	./gen_files/E2SM-RC-ControlMessage.h	\
+	./gen_files/E2SM-RC-ControlMessage-Format1.h	\
+	./gen_files/RANParameter-Item.h	\
+	./gen_files/RANParameter-ValueType.h	\
+	./gen_files/RANParameter-ELEMENT.h	\
+	./gen_files/RANParameter-STRUCTURE.h	\
+	./gen_files/RANParameter-LIST.h	\
+	./gen_files/RANParameter-Value.h	\
+	./gen_files/UE-Identity.h	\
+	./gen_files/RIC-Style-Type.h	\
+	./gen_files/RIC-Style-Name.h	\
+	./gen_files/RIC-Format-Type.h	\
+	./gen_files/RANParameter-ID.h	\
+	./gen_files/RANParameter-Name.h	\
+	./gen_files/RIC-ControlAction-ID.h	\
+	./gen_files/RIC-ControlAction-Name.h	\
+	./gen_files/E2SM-KPM-EventTriggerDefinition.h	\
+	./gen_files/E2SM-KPM-EventTriggerDefinition-Format1.h	\
+	./gen_files/Trigger-ConditionIE-Item.h	\
+	./gen_files/RT-Period-IE.h	\
+	./gen_files/RANcallProcess-ID-string.h	\
+	./gen_files/PLMN-Identity.h	\
+	./gen_files/GlobalE2node-ID.h	\
+	./gen_files/GlobalE2node-en-gNB-ID.h	\
+	./gen_files/GlobalE2node-eNB-ID.h	\
+	./gen_files/GlobalE2node-gNB-ID.h	\
+	./gen_files/GlobalE2node-ng-eNB-ID.h	\
+	./gen_files/GlobalENB-ID.h	\
+	./gen_files/GlobalenGNB-ID.h	\
+	./gen_files/GlobalgNB-ID.h	\
+	./gen_files/GlobalngeNB-ID.h	\
+	./gen_files/GNB-ID-Choice.h	\
+	./gen_files/ENB-ID-Choice.h	\
+	./gen_files/ENB-ID.h	\
+	./gen_files/ENGNB-ID.h	\
+	./gen_files/GNB-CU-UP-ID.h	\
+	./gen_files/GNB-DU-ID.h
+
+ASN_MODULE_HDRS+=./gen_files/OPEN_TYPE.h
+ASN_MODULE_SRCS+=./gen_files/OPEN_TYPE.c
+ASN_MODULE_HDRS+=./gen_files/constr_CHOICE.h
+ASN_MODULE_HDRS+=./gen_files/BOOLEAN.h
+ASN_MODULE_SRCS+=./gen_files/BOOLEAN.c
+ASN_MODULE_HDRS+=./gen_files/INTEGER.h
+ASN_MODULE_SRCS+=./gen_files/INTEGER.c
+ASN_MODULE_HDRS+=./gen_files/NULL.h
+ASN_MODULE_SRCS+=./gen_files/NULL.c
+ASN_MODULE_HDRS+=./gen_files/NativeEnumerated.h
+ASN_MODULE_SRCS+=./gen_files/NativeEnumerated.c
+ASN_MODULE_HDRS+=./gen_files/NativeInteger.h
+ASN_MODULE_SRCS+=./gen_files/NativeInteger.c
+ASN_MODULE_HDRS+=./gen_files/NativeReal.h
+ASN_MODULE_SRCS+=./gen_files/NativeReal.c
+ASN_MODULE_HDRS+=./gen_files/REAL.h
+ASN_MODULE_HDRS+=./gen_files/PrintableString.h
+ASN_MODULE_SRCS+=./gen_files/PrintableString.c
+ASN_MODULE_HDRS+=./gen_files/OCTET_STRING.h
+ASN_MODULE_SRCS+=./gen_files/REAL.c
+ASN_MODULE_HDRS+=./gen_files/asn_SEQUENCE_OF.h
+ASN_MODULE_SRCS+=./gen_files/asn_SEQUENCE_OF.c
+ASN_MODULE_HDRS+=./gen_files/asn_SET_OF.h
+ASN_MODULE_SRCS+=./gen_files/asn_SET_OF.c
+ASN_MODULE_SRCS+=./gen_files/constr_CHOICE.c
+ASN_MODULE_HDRS+=./gen_files/constr_SEQUENCE.h
+ASN_MODULE_SRCS+=./gen_files/constr_SEQUENCE.c
+ASN_MODULE_HDRS+=./gen_files/constr_SEQUENCE_OF.h
+ASN_MODULE_SRCS+=./gen_files/constr_SEQUENCE_OF.c
+ASN_MODULE_HDRS+=./gen_files/constr_SET_OF.h
+ASN_MODULE_SRCS+=./gen_files/constr_SET_OF.c
+ASN_MODULE_HDRS+=./gen_files/asn_application.h
+ASN_MODULE_SRCS+=./gen_files/asn_application.c
+ASN_MODULE_HDRS+=./gen_files/asn_ioc.h
+ASN_MODULE_HDRS+=./gen_files/asn_system.h
+ASN_MODULE_HDRS+=./gen_files/asn_codecs.h
+ASN_MODULE_HDRS+=./gen_files/asn_internal.h
+ASN_MODULE_SRCS+=./gen_files/asn_internal.c
+ASN_MODULE_HDRS+=./gen_files/asn_random_fill.h
+ASN_MODULE_SRCS+=./gen_files/asn_random_fill.c
+ASN_MODULE_HDRS+=./gen_files/asn_bit_data.h
+ASN_MODULE_SRCS+=./gen_files/asn_bit_data.c
+ASN_MODULE_SRCS+=./gen_files/OCTET_STRING.c
+ASN_MODULE_HDRS+=./gen_files/BIT_STRING.h
+ASN_MODULE_SRCS+=./gen_files/BIT_STRING.c
+ASN_MODULE_SRCS+=./gen_files/asn_codecs_prim.c
+ASN_MODULE_HDRS+=./gen_files/asn_codecs_prim.h
+ASN_MODULE_HDRS+=./gen_files/ber_tlv_length.h
+ASN_MODULE_SRCS+=./gen_files/ber_tlv_length.c
+ASN_MODULE_HDRS+=./gen_files/ber_tlv_tag.h
+ASN_MODULE_SRCS+=./gen_files/ber_tlv_tag.c
+ASN_MODULE_HDRS+=./gen_files/ber_decoder.h
+ASN_MODULE_SRCS+=./gen_files/ber_decoder.c
+ASN_MODULE_HDRS+=./gen_files/der_encoder.h
+ASN_MODULE_SRCS+=./gen_files/der_encoder.c
+ASN_MODULE_HDRS+=./gen_files/constr_TYPE.h
+ASN_MODULE_SRCS+=./gen_files/constr_TYPE.c
+ASN_MODULE_HDRS+=./gen_files/constraints.h
+ASN_MODULE_SRCS+=./gen_files/constraints.c
+ASN_MODULE_HDRS+=./gen_files/xer_support.h
+ASN_MODULE_SRCS+=./gen_files/xer_support.c
+ASN_MODULE_HDRS+=./gen_files/xer_decoder.h
+ASN_MODULE_SRCS+=./gen_files/xer_decoder.c
+ASN_MODULE_HDRS+=./gen_files/xer_encoder.h
+ASN_MODULE_SRCS+=./gen_files/xer_encoder.c
+ASN_MODULE_HDRS+=./gen_files/per_support.h
+ASN_MODULE_SRCS+=./gen_files/per_support.c
+ASN_MODULE_HDRS+=./gen_files/per_decoder.h
+ASN_MODULE_SRCS+=./gen_files/per_decoder.c
+ASN_MODULE_HDRS+=./gen_files/per_encoder.h
+ASN_MODULE_SRCS+=./gen_files/per_encoder.c
+ASN_MODULE_HDRS+=./gen_files/per_opentype.h
+ASN_MODULE_SRCS+=./gen_files/per_opentype.c
+ASN_MODULE_HDRS+=./gen_files/oer_decoder.h
+ASN_MODULE_HDRS+=./gen_files/oer_encoder.h
+ASN_MODULE_HDRS+=./gen_files/oer_support.h
+ASN_MODULE_SRCS+=./gen_files/oer_decoder.c
+ASN_MODULE_SRCS+=./gen_files/oer_encoder.c
+ASN_MODULE_SRCS+=./gen_files/oer_support.c
+ASN_MODULE_SRCS+=./gen_files/OPEN_TYPE_oer.c
+ASN_MODULE_SRCS+=./gen_files/INTEGER_oer.c
+ASN_MODULE_SRCS+=./gen_files/BIT_STRING_oer.c
+ASN_MODULE_SRCS+=./gen_files/OCTET_STRING_oer.c
+ASN_MODULE_SRCS+=./gen_files/NativeInteger_oer.c
+ASN_MODULE_SRCS+=./gen_files/NativeEnumerated_oer.c
+ASN_MODULE_SRCS+=./gen_files/constr_CHOICE_oer.c
+ASN_MODULE_SRCS+=./gen_files/constr_SEQUENCE_oer.c
+ASN_MODULE_SRCS+=./gen_files/constr_SET_OF_oer.c
+
+ASN_MODULE_CFLAGS=
+
+lib_LTLIBRARIES+=libasncodec.la
+libasncodec_la_SOURCES=$(ASN_MODULE_SRCS) $(ASN_MODULE_HDRS)
+libasncodec_la_CPPFLAGS=-I$(top_srcdir)/./gen_files/
+libasncodec_la_CFLAGS=$(ASN_MODULE_CFLAGS)
+libasncodec_la_LDFLAGS=-lm
diff --git a/e2sm/headers/MatchingUEidList.h b/e2sm/headers/MatchingUEidList.h
new file mode 100644
index 0000000..b03c075
--- /dev/null
+++ b/e2sm/headers/MatchingUEidList.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-v02.00.03.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example -D E2SM-KPM-v02.00.03`
+ */
+
+#ifndef	_MatchingUEidList_H_
+#define	_MatchingUEidList_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MatchingUEidItem;
+
+/* MatchingUEidList */
+typedef struct MatchingUEidList {
+	A_SEQUENCE_OF(struct MatchingUEidItem) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MatchingUEidList_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MatchingUEidList;
+extern asn_SET_OF_specifics_t asn_SPC_MatchingUEidList_specs_1;
+extern asn_TYPE_member_t asn_MBR_MatchingUEidList_1[1];
+extern asn_per_constraints_t asn_PER_type_MatchingUEidList_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MatchingUEidList_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasQuantityResults.h b/e2sm/headers/MeasQuantityResults.h
new file mode 100644
index 0000000..a597b72
--- /dev/null
+++ b/e2sm/headers/MeasQuantityResults.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasQuantityResults_H_
+#define	_MeasQuantityResults_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RSRP-Range.h"
+#include "RSRQ-Range.h"
+#include "SINR-Range.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* MeasQuantityResults */
+typedef struct MeasQuantityResults {
+	RSRP_Range_t	*rsrp;	/* OPTIONAL */
+	RSRQ_Range_t	*rsrq;	/* OPTIONAL */
+	SINR_Range_t	*sinr;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasQuantityResults_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasQuantityResults;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasQuantityResults_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasQuantityResults_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasQuantityResults_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasQuantityResultsEUTRA.h b/e2sm/headers/MeasQuantityResultsEUTRA.h
new file mode 100644
index 0000000..1be9197
--- /dev/null
+++ b/e2sm/headers/MeasQuantityResultsEUTRA.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasQuantityResultsEUTRA_H_
+#define	_MeasQuantityResultsEUTRA_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RSRP-RangeEUTRA.h"
+#include "RSRQ-RangeEUTRA.h"
+#include "SINR-RangeEUTRA.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* MeasQuantityResultsEUTRA */
+typedef struct MeasQuantityResultsEUTRA {
+	RSRP_RangeEUTRA_t	*rsrp;	/* OPTIONAL */
+	RSRQ_RangeEUTRA_t	*rsrq;	/* OPTIONAL */
+	SINR_RangeEUTRA_t	*sinr;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasQuantityResultsEUTRA_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasQuantityResultsEUTRA;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasQuantityResultsEUTRA_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasQuantityResultsEUTRA_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasQuantityResultsEUTRA_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultEUTRA.h b/e2sm/headers/MeasResultEUTRA.h
new file mode 100644
index 0000000..61e8b9a
--- /dev/null
+++ b/e2sm/headers/MeasResultEUTRA.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultEUTRA_H_
+#define	_MeasResultEUTRA_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PhysCellId.h"
+#include "MeasQuantityResultsEUTRA.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* MeasResultEUTRA */
+typedef struct MeasResultEUTRA {
+	PhysCellId_t	 eutra_PhysCellId;
+	MeasQuantityResultsEUTRA_t	 measResult;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultEUTRA_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultEUTRA;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasResultEUTRA_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultEUTRA_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultEUTRA_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultListEUTRA.h b/e2sm/headers/MeasResultListEUTRA.h
new file mode 100644
index 0000000..5f9d8e6
--- /dev/null
+++ b/e2sm/headers/MeasResultListEUTRA.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultListEUTRA_H_
+#define	_MeasResultListEUTRA_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasResultEUTRA;
+
+/* MeasResultListEUTRA */
+typedef struct MeasResultListEUTRA {
+	A_SEQUENCE_OF(struct MeasResultEUTRA) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultListEUTRA_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultListEUTRA;
+extern asn_SET_OF_specifics_t asn_SPC_MeasResultListEUTRA_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultListEUTRA_1[1];
+extern asn_per_constraints_t asn_PER_type_MeasResultListEUTRA_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultListEUTRA_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultListNR.h b/e2sm/headers/MeasResultListNR.h
new file mode 100644
index 0000000..3617658
--- /dev/null
+++ b/e2sm/headers/MeasResultListNR.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultListNR_H_
+#define	_MeasResultListNR_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasResultNR;
+
+/* MeasResultListNR */
+typedef struct MeasResultListNR {
+	A_SEQUENCE_OF(struct MeasResultNR) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultListNR_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultListNR;
+extern asn_SET_OF_specifics_t asn_SPC_MeasResultListNR_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultListNR_1[1];
+extern asn_per_constraints_t asn_PER_type_MeasResultListNR_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultListNR_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultNR.h b/e2sm/headers/MeasResultNR.h
new file mode 100644
index 0000000..8f9e1d4
--- /dev/null
+++ b/e2sm/headers/MeasResultNR.h
@@ -0,0 +1,68 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultNR_H_
+#define	_MeasResultNR_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PhysCellId.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasQuantityResults;
+struct ResultsPerSSB_IndexList;
+struct ResultsPerCSI_RS_IndexList;
+
+/* MeasResultNR */
+typedef struct MeasResultNR {
+	PhysCellId_t	*physCellId;	/* OPTIONAL */
+	struct MeasResultNR__measResult {
+		struct MeasResultNR__measResult__cellResults {
+			struct MeasQuantityResults	*resultsSSB_Cell;	/* OPTIONAL */
+			struct MeasQuantityResults	*resultsCSI_RS_Cell;	/* OPTIONAL */
+			
+			/* Context for parsing across buffer boundaries */
+			asn_struct_ctx_t _asn_ctx;
+		} cellResults;
+		struct MeasResultNR__measResult__rsIndexResults {
+			struct ResultsPerSSB_IndexList	*resultsSSB_Indexes;	/* OPTIONAL */
+			struct ResultsPerCSI_RS_IndexList	*resultsCSI_RS_Indexes;	/* OPTIONAL */
+			
+			/* Context for parsing across buffer boundaries */
+			asn_struct_ctx_t _asn_ctx;
+		} *rsIndexResults;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} measResult;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultNR_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultNR;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasResultNR_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultNR_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultNR_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultNeighCells.h b/e2sm/headers/MeasResultNeighCells.h
new file mode 100644
index 0000000..f841bb5
--- /dev/null
+++ b/e2sm/headers/MeasResultNeighCells.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultNeighCells_H_
+#define	_MeasResultNeighCells_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum MeasResultNeighCells_PR {
+	MeasResultNeighCells_PR_NOTHING,	/* No components present */
+	MeasResultNeighCells_PR_measResultListNR,
+	MeasResultNeighCells_PR_measResultListEUTRA
+	/* Extensions may appear below */
+	
+} MeasResultNeighCells_PR;
+
+/* Forward declarations */
+struct MeasResultListNR;
+struct MeasResultListEUTRA;
+
+/* MeasResultNeighCells */
+typedef struct MeasResultNeighCells {
+	MeasResultNeighCells_PR present;
+	union MeasResultNeighCells_u {
+		struct MeasResultListNR	*measResultListNR;
+		struct MeasResultListEUTRA	*measResultListEUTRA;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultNeighCells_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultNeighCells;
+extern asn_CHOICE_specifics_t asn_SPC_MeasResultNeighCells_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultNeighCells_1[2];
+extern asn_per_constraints_t asn_PER_type_MeasResultNeighCells_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultNeighCells_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultPCell.h b/e2sm/headers/MeasResultPCell.h
new file mode 100644
index 0000000..ad0fb7e
--- /dev/null
+++ b/e2sm/headers/MeasResultPCell.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultPCell_H_
+#define	_MeasResultPCell_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PhysCellId.h"
+#include "RSRP-Range.h"
+#include "RSRQ-Range.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* MeasResultPCell */
+typedef struct MeasResultPCell {
+	PhysCellId_t	 eutra_PhysCellId;
+	RSRP_Range_t	 rsrpResult;
+	RSRQ_Range_t	 rsrqResult;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultPCell_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultPCell;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasResultPCell_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultPCell_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultPCell_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultServMO.h b/e2sm/headers/MeasResultServMO.h
new file mode 100644
index 0000000..67e3676
--- /dev/null
+++ b/e2sm/headers/MeasResultServMO.h
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultServMO_H_
+#define	_MeasResultServMO_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ServCellIndex.h"
+#include "MeasResultNR.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasResultNR;
+
+/* MeasResultServMO */
+typedef struct MeasResultServMO {
+	ServCellIndex_t	 servCellId;
+	MeasResultNR_t	 measResultServingCell;
+	struct MeasResultNR	*measResultBestNeighCell;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultServMO_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultServMO;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasResultServMO_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultServMO_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultServMO_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasResultServMOList.h b/e2sm/headers/MeasResultServMOList.h
new file mode 100644
index 0000000..422db0f
--- /dev/null
+++ b/e2sm/headers/MeasResultServMOList.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasResultServMOList_H_
+#define	_MeasResultServMOList_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasResultServMO;
+
+/* MeasResultServMOList */
+typedef struct MeasResultServMOList {
+	A_SEQUENCE_OF(struct MeasResultServMO) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasResultServMOList_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasResultServMOList;
+extern asn_SET_OF_specifics_t asn_SPC_MeasResultServMOList_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasResultServMOList_1[1];
+extern asn_per_constraints_t asn_PER_type_MeasResultServMOList_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasResultServMOList_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementCondUEidItem.h b/e2sm/headers/MeasurementCondUEidItem.h
new file mode 100644
index 0000000..e49d2b9
--- /dev/null
+++ b/e2sm/headers/MeasurementCondUEidItem.h
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-v02.00.03.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example -D E2SM-KPM-v02.00.03`
+ */
+
+#ifndef	_MeasurementCondUEidItem_H_
+#define	_MeasurementCondUEidItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "MeasurementType.h"
+#include "MatchingCondList.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MatchingUEidList;
+
+/* MeasurementCondUEidItem */
+typedef struct MeasurementCondUEidItem {
+	MeasurementType_t	 measType;
+	MatchingCondList_t	 matchingCond;
+	struct MatchingUEidList	*matchingUEidList;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasurementCondUEidItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementCondUEidItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasurementCondUEidItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasurementCondUEidItem_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementCondUEidItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementCondUEidList.h b/e2sm/headers/MeasurementCondUEidList.h
new file mode 100644
index 0000000..88768c1
--- /dev/null
+++ b/e2sm/headers/MeasurementCondUEidList.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-v02.00.03.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example -D E2SM-KPM-v02.00.03`
+ */
+
+#ifndef	_MeasurementCondUEidList_H_
+#define	_MeasurementCondUEidList_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasurementCondUEidItem;
+
+/* MeasurementCondUEidList */
+typedef struct MeasurementCondUEidList {
+	A_SEQUENCE_OF(struct MeasurementCondUEidItem) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasurementCondUEidList_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementCondUEidList;
+extern asn_SET_OF_specifics_t asn_SPC_MeasurementCondUEidList_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasurementCondUEidList_1[1];
+extern asn_per_constraints_t asn_PER_type_MeasurementCondUEidList_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementCondUEidList_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementInfoItem.h b/e2sm/headers/MeasurementInfoItem.h
new file mode 100644
index 0000000..171c1c5
--- /dev/null
+++ b/e2sm/headers/MeasurementInfoItem.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasurementInfoItem_H_
+#define	_MeasurementInfoItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "MeasurementType.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* MeasurementInfoItem */
+typedef struct MeasurementInfoItem {
+	MeasurementType_t	 measType;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasurementInfoItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementInfoItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_MeasurementInfoItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasurementInfoItem_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementInfoItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementInfoList.h b/e2sm/headers/MeasurementInfoList.h
new file mode 100644
index 0000000..f58fabe
--- /dev/null
+++ b/e2sm/headers/MeasurementInfoList.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasurementInfoList_H_
+#define	_MeasurementInfoList_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasurementInfoItem;
+
+/* MeasurementInfoList */
+typedef struct MeasurementInfoList {
+	A_SEQUENCE_OF(struct MeasurementInfoItem) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasurementInfoList_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementInfoList;
+extern asn_SET_OF_specifics_t asn_SPC_MeasurementInfoList_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasurementInfoList_1[1];
+extern asn_per_constraints_t asn_PER_type_MeasurementInfoList_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementInfoList_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementType.h b/e2sm/headers/MeasurementType.h
new file mode 100644
index 0000000..89b0266
--- /dev/null
+++ b/e2sm/headers/MeasurementType.h
@@ -0,0 +1,59 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasurementType_H_
+#define	_MeasurementType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "MeasurementTypeName.h"
+#include "MeasurementTypeID.h"
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum MeasurementType_PR {
+	MeasurementType_PR_NOTHING,	/* No components present */
+	MeasurementType_PR_measName,
+	MeasurementType_PR_measID
+	/* Extensions may appear below */
+	
+} MeasurementType_PR;
+
+/* MeasurementType */
+typedef struct MeasurementType {
+	MeasurementType_PR present;
+	union MeasurementType_u {
+		MeasurementTypeName_t	 measName;
+		MeasurementTypeID_t	 measID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasurementType_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementType;
+extern asn_CHOICE_specifics_t asn_SPC_MeasurementType_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasurementType_1[2];
+extern asn_per_constraints_t asn_PER_type_MeasurementType_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementType_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementTypeID.h b/e2sm/headers/MeasurementTypeID.h
new file mode 100644
index 0000000..bec93a3
--- /dev/null
+++ b/e2sm/headers/MeasurementTypeID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasurementTypeID_H_
+#define	_MeasurementTypeID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* MeasurementTypeID */
+typedef long	 MeasurementTypeID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_MeasurementTypeID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementTypeID;
+asn_struct_free_f MeasurementTypeID_free;
+asn_struct_print_f MeasurementTypeID_print;
+asn_constr_check_f MeasurementTypeID_constraint;
+ber_type_decoder_f MeasurementTypeID_decode_ber;
+der_type_encoder_f MeasurementTypeID_encode_der;
+xer_type_decoder_f MeasurementTypeID_decode_xer;
+xer_type_encoder_f MeasurementTypeID_encode_xer;
+oer_type_decoder_f MeasurementTypeID_decode_oer;
+oer_type_encoder_f MeasurementTypeID_encode_oer;
+per_type_decoder_f MeasurementTypeID_decode_uper;
+per_type_encoder_f MeasurementTypeID_encode_uper;
+per_type_decoder_f MeasurementTypeID_decode_aper;
+per_type_encoder_f MeasurementTypeID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementTypeID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementTypeName.h b/e2sm/headers/MeasurementTypeName.h
new file mode 100644
index 0000000..0d21344
--- /dev/null
+++ b/e2sm/headers/MeasurementTypeName.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasurementTypeName_H_
+#define	_MeasurementTypeName_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <PrintableString.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* MeasurementTypeName */
+typedef PrintableString_t	 MeasurementTypeName_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_MeasurementTypeName_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementTypeName;
+asn_struct_free_f MeasurementTypeName_free;
+asn_struct_print_f MeasurementTypeName_print;
+asn_constr_check_f MeasurementTypeName_constraint;
+ber_type_decoder_f MeasurementTypeName_decode_ber;
+der_type_encoder_f MeasurementTypeName_encode_der;
+xer_type_decoder_f MeasurementTypeName_decode_xer;
+xer_type_encoder_f MeasurementTypeName_encode_xer;
+oer_type_decoder_f MeasurementTypeName_decode_oer;
+oer_type_encoder_f MeasurementTypeName_encode_oer;
+per_type_decoder_f MeasurementTypeName_decode_uper;
+per_type_encoder_f MeasurementTypeName_encode_uper;
+per_type_decoder_f MeasurementTypeName_decode_aper;
+per_type_encoder_f MeasurementTypeName_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementTypeName_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/MeasurementValue.h b/e2sm/headers/MeasurementValue.h
new file mode 100644
index 0000000..f1d874a
--- /dev/null
+++ b/e2sm/headers/MeasurementValue.h
@@ -0,0 +1,67 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_MeasurementValue_H_
+#define	_MeasurementValue_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+#include <NativeReal.h>
+#include <NULL.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum MeasurementValue_PR {
+	MeasurementValue_PR_NOTHING,	/* No components present */
+	MeasurementValue_PR_valueInt,
+	MeasurementValue_PR_valueReal,
+	MeasurementValue_PR_noValue,
+	MeasurementValue_PR_valueRRC
+	/* Extensions may appear below */
+	
+} MeasurementValue_PR;
+
+/* Forward declarations */
+struct L3_RRC_Measurements;
+
+/* MeasurementValue */
+typedef struct MeasurementValue {
+	MeasurementValue_PR present;
+	union MeasurementValue_u {
+		long	 valueInt;
+		double	 valueReal;
+		NULL_t	 noValue;
+		struct L3_RRC_Measurements	*valueRRC;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} MeasurementValue_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_MeasurementValue;
+extern asn_CHOICE_specifics_t asn_SPC_MeasurementValue_specs_1;
+extern asn_TYPE_member_t asn_MBR_MeasurementValue_1[4];
+extern asn_per_constraints_t asn_PER_type_MeasurementValue_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _MeasurementValue_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/NI-Type.h b/e2sm/headers/NI-Type.h
new file mode 100644
index 0000000..f57d977
--- /dev/null
+++ b/e2sm/headers/NI-Type.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_NI_Type_H_
+#define	_NI_Type_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum NI_Type {
+	NI_Type_x2_u	= 0,
+	NI_Type_xn_u	= 1,
+	NI_Type_f1_u	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_NI_Type;
+
+/* NI-Type */
+typedef long	 NI_Type_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_NI_Type_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_NI_Type;
+extern const asn_INTEGER_specifics_t asn_SPC_NI_Type_specs_1;
+asn_struct_free_f NI_Type_free;
+asn_struct_print_f NI_Type_print;
+asn_constr_check_f NI_Type_constraint;
+ber_type_decoder_f NI_Type_decode_ber;
+der_type_encoder_f NI_Type_encode_der;
+xer_type_decoder_f NI_Type_decode_xer;
+xer_type_encoder_f NI_Type_encode_xer;
+oer_type_decoder_f NI_Type_decode_oer;
+oer_type_encoder_f NI_Type_encode_oer;
+per_type_decoder_f NI_Type_decode_uper;
+per_type_encoder_f NI_Type_encode_uper;
+per_type_decoder_f NI_Type_decode_aper;
+per_type_encoder_f NI_Type_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NI_Type_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/NRCGI.h b/e2sm/headers/NRCGI.h
new file mode 100644
index 0000000..11239c7
--- /dev/null
+++ b/e2sm/headers/NRCGI.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_NRCGI_H_
+#define	_NRCGI_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "NRCellIdentity.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* NRCGI */
+typedef struct NRCGI {
+	PLMN_Identity_t	 pLMN_Identity;
+	NRCellIdentity_t	 nRCellIdentity;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} NRCGI_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_NRCGI;
+extern asn_SEQUENCE_specifics_t asn_SPC_NRCGI_specs_1;
+extern asn_TYPE_member_t asn_MBR_NRCGI_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NRCGI_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/NRCellIdentity.h b/e2sm/headers/NRCellIdentity.h
new file mode 100644
index 0000000..fc489c7
--- /dev/null
+++ b/e2sm/headers/NRCellIdentity.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_NRCellIdentity_H_
+#define	_NRCellIdentity_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* NRCellIdentity */
+typedef BIT_STRING_t	 NRCellIdentity_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_NRCellIdentity_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_NRCellIdentity;
+asn_struct_free_f NRCellIdentity_free;
+asn_struct_print_f NRCellIdentity_print;
+asn_constr_check_f NRCellIdentity_constraint;
+ber_type_decoder_f NRCellIdentity_decode_ber;
+der_type_encoder_f NRCellIdentity_encode_der;
+xer_type_decoder_f NRCellIdentity_decode_xer;
+xer_type_encoder_f NRCellIdentity_encode_xer;
+oer_type_decoder_f NRCellIdentity_decode_oer;
+oer_type_encoder_f NRCellIdentity_encode_oer;
+per_type_decoder_f NRCellIdentity_decode_uper;
+per_type_encoder_f NRCellIdentity_encode_uper;
+per_type_decoder_f NRCellIdentity_decode_aper;
+per_type_encoder_f NRCellIdentity_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NRCellIdentity_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/NULL.h b/e2sm/headers/NULL.h
new file mode 100644
index 0000000..802d12c
--- /dev/null
+++ b/e2sm/headers/NULL.h
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_TYPE_NULL_H
+#define	ASN_TYPE_NULL_H
+
+#include <asn_application.h>
+#include <BOOLEAN.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The value of the NULL type is meaningless: see BOOLEAN if you want to
+ * carry true/false semantics.
+ */
+typedef int NULL_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_NULL;
+extern asn_TYPE_operation_t asn_OP_NULL;
+
+asn_struct_print_f NULL_print;
+asn_struct_compare_f NULL_compare;
+der_type_encoder_f NULL_encode_der;
+xer_type_decoder_f NULL_decode_xer;
+xer_type_encoder_f NULL_encode_xer;
+oer_type_decoder_f NULL_decode_oer;
+oer_type_encoder_f NULL_encode_oer;
+per_type_decoder_f NULL_decode_uper;
+per_type_encoder_f NULL_encode_uper;
+per_type_decoder_f NULL_decode_aper;
+per_type_encoder_f NULL_encode_aper;
+asn_random_fill_f  NULL_random_fill;
+
+#define NULL_free	BOOLEAN_free
+#define NULL_decode_ber	BOOLEAN_decode_ber
+#define NULL_constraint	asn_generic_no_constraint
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* NULL_H */
diff --git a/e2sm/headers/NativeEnumerated.h b/e2sm/headers/NativeEnumerated.h
new file mode 100644
index 0000000..459f0e6
--- /dev/null
+++ b/e2sm/headers/NativeEnumerated.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This type differs from the standard ENUMERATED in that it is modelled using
+ * the fixed machine type (long, int, short), so it can hold only values of
+ * limited length. There is no type (i.e., NativeEnumerated_t, any integer type
+ * will do).
+ * This type may be used when integer range is limited by subtype constraints.
+ */
+#ifndef	_NativeEnumerated_H_
+#define	_NativeEnumerated_H_
+
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated;
+extern asn_TYPE_operation_t asn_OP_NativeEnumerated;
+
+xer_type_encoder_f NativeEnumerated_encode_xer;
+oer_type_decoder_f NativeEnumerated_decode_oer;
+oer_type_encoder_f NativeEnumerated_encode_oer;
+per_type_decoder_f NativeEnumerated_decode_uper;
+per_type_encoder_f NativeEnumerated_encode_uper;
+per_type_decoder_f NativeEnumerated_decode_aper;
+per_type_encoder_f NativeEnumerated_encode_aper;
+
+#define NativeEnumerated_free       NativeInteger_free
+#define NativeEnumerated_print      NativeInteger_print
+#define NativeEnumerated_compare    NativeInteger_compare
+#define NativeEnumerated_random_fill NativeInteger_random_fill
+#define NativeEnumerated_constraint asn_generic_no_constraint
+#define NativeEnumerated_decode_ber NativeInteger_decode_ber
+#define NativeEnumerated_encode_der NativeInteger_encode_der
+#define NativeEnumerated_decode_xer NativeInteger_decode_xer
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NativeEnumerated_H_ */
diff --git a/e2sm/headers/NativeInteger.h b/e2sm/headers/NativeInteger.h
new file mode 100644
index 0000000..c74406a
--- /dev/null
+++ b/e2sm/headers/NativeInteger.h
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This type differs from the standard INTEGER in that it is modelled using
+ * the fixed machine type (long, int, short), so it can hold only values of
+ * limited length. There is no type (i.e., NativeInteger_t, any integer type
+ * will do).
+ * This type may be used when integer range is limited by subtype constraints.
+ */
+#ifndef	_NativeInteger_H_
+#define	_NativeInteger_H_
+
+#include <asn_application.h>
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern asn_TYPE_descriptor_t asn_DEF_NativeInteger;
+extern asn_TYPE_operation_t asn_OP_NativeInteger;
+
+asn_struct_free_f  NativeInteger_free;
+asn_struct_print_f NativeInteger_print;
+asn_struct_compare_f NativeInteger_compare;
+ber_type_decoder_f NativeInteger_decode_ber;
+der_type_encoder_f NativeInteger_encode_der;
+xer_type_decoder_f NativeInteger_decode_xer;
+xer_type_encoder_f NativeInteger_encode_xer;
+oer_type_decoder_f NativeInteger_decode_oer;
+oer_type_encoder_f NativeInteger_encode_oer;
+per_type_decoder_f NativeInteger_decode_uper;
+per_type_encoder_f NativeInteger_encode_uper;
+per_type_decoder_f NativeInteger_decode_aper;
+per_type_encoder_f NativeInteger_encode_aper;
+asn_random_fill_f  NativeInteger_random_fill;
+
+#define NativeInteger_constraint  asn_generic_no_constraint
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NativeInteger_H_ */
diff --git a/e2sm/headers/NativeReal.h b/e2sm/headers/NativeReal.h
new file mode 100644
index 0000000..1bfdc96
--- /dev/null
+++ b/e2sm/headers/NativeReal.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This type differs from the standard REAL in that it is modelled using
+ * the fixed machine type (double), so it can hold only values of
+ * limited precision. There is no explicit type (i.e., NativeReal_t).
+ * Use of this type is normally enabled by -fnative-types.
+ */
+#ifndef	ASN_TYPE_NativeReal_H
+#define	ASN_TYPE_NativeReal_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_NativeReal_specifics_s {
+    unsigned float_size; /* sizeof(float) or sizeof(double) */
+} asn_NativeReal_specifics_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_NativeReal;
+extern asn_TYPE_operation_t asn_OP_NativeReal;
+
+asn_struct_free_f  NativeReal_free;
+asn_struct_print_f NativeReal_print;
+asn_struct_compare_f NativeReal_compare;
+ber_type_decoder_f NativeReal_decode_ber;
+der_type_encoder_f NativeReal_encode_der;
+per_type_decoder_f NativeReal_decode_uper;
+per_type_encoder_f NativeReal_encode_uper;
+per_type_decoder_f NativeReal_decode_aper;
+per_type_encoder_f NativeReal_encode_aper;
+oer_type_decoder_f NativeReal_decode_oer;
+oer_type_encoder_f NativeReal_encode_oer;
+xer_type_decoder_f NativeReal_decode_xer;
+xer_type_encoder_f NativeReal_encode_xer;
+asn_random_fill_f  NativeReal_random_fill;
+
+#define NativeReal_constraint  asn_generic_no_constraint
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_TYPE_NativeReal_H */
diff --git a/e2sm/headers/OCTET_STRING.h b/e2sm/headers/OCTET_STRING.h
new file mode 100644
index 0000000..c2f8bae
--- /dev/null
+++ b/e2sm/headers/OCTET_STRING.h
@@ -0,0 +1,102 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_OCTET_STRING_H_
+#define	_OCTET_STRING_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct OCTET_STRING {
+	uint8_t *buf;	/* Buffer with consecutive OCTET_STRING bits */
+	size_t size;	/* Size of the buffer */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} OCTET_STRING_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING;
+extern asn_TYPE_operation_t asn_OP_OCTET_STRING;
+
+asn_struct_free_f OCTET_STRING_free;
+asn_struct_print_f OCTET_STRING_print;
+asn_struct_print_f OCTET_STRING_print_utf8;
+asn_struct_compare_f OCTET_STRING_compare;
+ber_type_decoder_f OCTET_STRING_decode_ber;
+der_type_encoder_f OCTET_STRING_encode_der;
+xer_type_decoder_f OCTET_STRING_decode_xer_hex;		/* Hexadecimal */
+xer_type_decoder_f OCTET_STRING_decode_xer_binary;	/* 01010111010 */
+xer_type_decoder_f OCTET_STRING_decode_xer_utf8;	/* ASCII/UTF-8 */
+xer_type_encoder_f OCTET_STRING_encode_xer;
+xer_type_encoder_f OCTET_STRING_encode_xer_utf8;
+oer_type_decoder_f OCTET_STRING_decode_oer;
+oer_type_encoder_f OCTET_STRING_encode_oer;
+per_type_decoder_f OCTET_STRING_decode_uper;
+per_type_encoder_f OCTET_STRING_encode_uper;
+per_type_decoder_f OCTET_STRING_decode_aper;
+per_type_encoder_f OCTET_STRING_encode_aper;
+asn_random_fill_f  OCTET_STRING_random_fill;
+
+#define OCTET_STRING_constraint  asn_generic_no_constraint
+#define OCTET_STRING_decode_xer  OCTET_STRING_decode_xer_hex
+
+/******************************
+ * Handy conversion routines. *
+ ******************************/
+
+/*
+ * This function clears the previous value of the OCTET STRING (if any)
+ * and then allocates a new memory with the specified content (str/size).
+ * If size = -1, the size of the original string will be determined
+ * using strlen(str).
+ * If str equals to NULL, the function will silently clear the
+ * current contents of the OCTET STRING.
+ * Returns 0 if it was possible to perform operation, -1 otherwise.
+ */
+int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size);
+
+/* Handy conversion from the C string into the OCTET STRING. */
+#define	OCTET_STRING_fromString(s, str)	OCTET_STRING_fromBuf(s, str, -1)
+
+/*
+ * Allocate and fill the new OCTET STRING and return a pointer to the newly
+ * allocated object. NULL is permitted in str: the function will just allocate
+ * empty OCTET STRING.
+ */
+OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td,
+                                         const char *str, int size);
+
+/****************************
+ * Internally useful stuff. *
+ ****************************/
+
+typedef struct asn_OCTET_STRING_specifics_s {
+    /*
+     * Target structure description.
+     */
+    unsigned struct_size;   /* Size of the structure */
+    unsigned ctx_offset;    /* Offset of the asn_struct_ctx_t member */
+
+    enum asn_OS_Subvariant {
+        ASN_OSUBV_ANY, /* The open type (ANY) */
+        ASN_OSUBV_BIT, /* BIT STRING */
+        ASN_OSUBV_STR, /* String types, not {BMP,Universal}String  */
+        ASN_OSUBV_U16, /* 16-bit character (BMPString) */
+        ASN_OSUBV_U32  /* 32-bit character (UniversalString) */
+    } subvariant;
+} asn_OCTET_STRING_specifics_t;
+
+extern asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs;
+
+size_t OCTET_STRING_random_length_constrained(
+    const asn_TYPE_descriptor_t *, const asn_encoding_constraints_t *,
+    size_t max_length);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _OCTET_STRING_H_ */
diff --git a/e2sm/headers/OCUCP-PF-Container.h b/e2sm/headers/OCUCP-PF-Container.h
new file mode 100644
index 0000000..5c1adfe
--- /dev/null
+++ b/e2sm/headers/OCUCP-PF-Container.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_OCUCP_PF_Container_H_
+#define	_OCUCP_PF_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* OCUCP-PF-Container */
+typedef struct OCUCP_PF_Container {
+	struct OCUCP_PF_Container__cu_CP_Resource_Status {
+		long	*numberOfActive_UEs;	/* OPTIONAL */
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} cu_CP_Resource_Status;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} OCUCP_PF_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_OCUCP_PF_Container;
+extern asn_SEQUENCE_specifics_t asn_SPC_OCUCP_PF_Container_specs_1;
+extern asn_TYPE_member_t asn_MBR_OCUCP_PF_Container_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _OCUCP_PF_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/OCUUP-PF-Container.h b/e2sm/headers/OCUUP-PF-Container.h
new file mode 100644
index 0000000..c1fc638
--- /dev/null
+++ b/e2sm/headers/OCUUP-PF-Container.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_OCUUP_PF_Container_H_
+#define	_OCUUP_PF_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct PF_ContainerListItem;
+
+/* OCUUP-PF-Container */
+typedef struct OCUUP_PF_Container {
+	struct OCUUP_PF_Container__pf_ContainerList {
+		A_SEQUENCE_OF(struct PF_ContainerListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} pf_ContainerList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} OCUUP_PF_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_OCUUP_PF_Container;
+extern asn_SEQUENCE_specifics_t asn_SPC_OCUUP_PF_Container_specs_1;
+extern asn_TYPE_member_t asn_MBR_OCUUP_PF_Container_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _OCUUP_PF_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ODU-PF-Container.h b/e2sm/headers/ODU-PF-Container.h
new file mode 100644
index 0000000..c49a4f7
--- /dev/null
+++ b/e2sm/headers/ODU-PF-Container.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ODU_PF_Container_H_
+#define	_ODU_PF_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct CellResourceReportListItem;
+
+/* ODU-PF-Container */
+typedef struct ODU_PF_Container {
+	struct ODU_PF_Container__cellResourceReportList {
+		A_SEQUENCE_OF(struct CellResourceReportListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} cellResourceReportList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ODU_PF_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ODU_PF_Container;
+extern asn_SEQUENCE_specifics_t asn_SPC_ODU_PF_Container_specs_1;
+extern asn_TYPE_member_t asn_MBR_ODU_PF_Container_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ODU_PF_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/OPEN_TYPE.h b/e2sm/headers/OPEN_TYPE.h
new file mode 100644
index 0000000..b0d023c
--- /dev/null
+++ b/e2sm/headers/OPEN_TYPE.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 2017-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_OPEN_TYPE_H
+#define ASN_OPEN_TYPE_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define OPEN_TYPE_free CHOICE_free
+#define OPEN_TYPE_print CHOICE_print
+#define OPEN_TYPE_compare CHOICE_compare
+#define OPEN_TYPE_constraint CHOICE_constraint
+#define OPEN_TYPE_decode_ber NULL
+#define OPEN_TYPE_encode_der CHOICE_encode_der
+#define OPEN_TYPE_decode_xer NULL
+#define OPEN_TYPE_encode_xer CHOICE_encode_xer
+#define OPEN_TYPE_decode_oer NULL
+#define OPEN_TYPE_encode_oer CHOICE_encode_oer
+#define OPEN_TYPE_decode_uper NULL
+#define OPEN_TYPE_decode_aper NULL
+
+extern asn_TYPE_operation_t asn_OP_OPEN_TYPE;
+
+/*
+ * Decode an Open Type which is potentially constraiend
+ * by the other members of the parent structure.
+ */
+asn_dec_rval_t OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 const asn_TYPE_member_t *element,
+                                 const void *ptr, size_t size);
+
+asn_dec_rval_t OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 const asn_TYPE_member_t *element,
+                                 const void *ptr, size_t size);
+
+asn_dec_rval_t OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 asn_TYPE_member_t *element, const void *ptr,
+                                 size_t size);
+
+asn_dec_rval_t OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *parent_type,
+                                  void *parent_structure,
+                                  const asn_TYPE_member_t *element,
+                                  asn_per_data_t *pd);
+
+asn_dec_rval_t OPEN_TYPE_aper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *parent_type,
+                                  void *parent_structure,
+                                  const asn_TYPE_member_t *element,
+                                  asn_per_data_t *pd);
+
+asn_enc_rval_t OPEN_TYPE_encode_uper(
+    const asn_TYPE_descriptor_t *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+asn_enc_rval_t OPEN_TYPE_encode_aper(
+    const asn_TYPE_descriptor_t *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_OPEN_TYPE_H */
diff --git a/e2sm/headers/PF-Container.h b/e2sm/headers/PF-Container.h
new file mode 100644
index 0000000..4dd9e95
--- /dev/null
+++ b/e2sm/headers/PF-Container.h
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PF_Container_H_
+#define	_PF_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum PF_Container_PR {
+	PF_Container_PR_NOTHING,	/* No components present */
+	PF_Container_PR_oDU,
+	PF_Container_PR_oCU_CP,
+	PF_Container_PR_oCU_UP
+} PF_Container_PR;
+
+/* Forward declarations */
+struct ODU_PF_Container;
+struct OCUCP_PF_Container;
+struct OCUUP_PF_Container;
+
+/* PF-Container */
+typedef struct PF_Container {
+	PF_Container_PR present;
+	union PF_Container_u {
+		struct ODU_PF_Container	*oDU;
+		struct OCUCP_PF_Container	*oCU_CP;
+		struct OCUUP_PF_Container	*oCU_UP;
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PF_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PF_Container;
+extern asn_CHOICE_specifics_t asn_SPC_PF_Container_specs_1;
+extern asn_TYPE_member_t asn_MBR_PF_Container_1[3];
+extern asn_per_constraints_t asn_PER_type_PF_Container_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PF_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PF-ContainerListItem.h b/e2sm/headers/PF-ContainerListItem.h
new file mode 100644
index 0000000..9d12f97
--- /dev/null
+++ b/e2sm/headers/PF-ContainerListItem.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PF_ContainerListItem_H_
+#define	_PF_ContainerListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "NI-Type.h"
+#include "CUUPMeasurement-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PF-ContainerListItem */
+typedef struct PF_ContainerListItem {
+	NI_Type_t	 interface_type;
+	CUUPMeasurement_Container_t	 o_CU_UP_PM_Container;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PF_ContainerListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PF_ContainerListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_PF_ContainerListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_PF_ContainerListItem_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PF_ContainerListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PLMN-Identity.h b/e2sm/headers/PLMN-Identity.h
new file mode 100644
index 0000000..c35c11f
--- /dev/null
+++ b/e2sm/headers/PLMN-Identity.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PLMN_Identity_H_
+#define	_PLMN_Identity_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PLMN-Identity */
+typedef OCTET_STRING_t	 PLMN_Identity_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_PLMN_Identity_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_PLMN_Identity;
+asn_struct_free_f PLMN_Identity_free;
+asn_struct_print_f PLMN_Identity_print;
+asn_constr_check_f PLMN_Identity_constraint;
+ber_type_decoder_f PLMN_Identity_decode_ber;
+der_type_encoder_f PLMN_Identity_encode_der;
+xer_type_decoder_f PLMN_Identity_decode_xer;
+xer_type_encoder_f PLMN_Identity_encode_xer;
+oer_type_decoder_f PLMN_Identity_decode_oer;
+oer_type_encoder_f PLMN_Identity_encode_oer;
+per_type_decoder_f PLMN_Identity_decode_uper;
+per_type_encoder_f PLMN_Identity_encode_uper;
+per_type_decoder_f PLMN_Identity_decode_aper;
+per_type_encoder_f PLMN_Identity_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PLMN_Identity_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PM-Containers-Item.h b/e2sm/headers/PM-Containers-Item.h
new file mode 100644
index 0000000..2525e83
--- /dev/null
+++ b/e2sm/headers/PM-Containers-Item.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PM_Containers_Item_H_
+#define	_PM_Containers_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RAN-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct PF_Container;
+
+/* PM-Containers-Item */
+typedef struct PM_Containers_Item {
+	struct PF_Container	*performanceContainer;	/* OPTIONAL */
+	RAN_Container_t	*theRANContainer;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PM_Containers_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PM_Containers_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_PM_Containers_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_PM_Containers_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PM_Containers_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PM-Info-Item.h b/e2sm/headers/PM-Info-Item.h
new file mode 100644
index 0000000..2716d8e
--- /dev/null
+++ b/e2sm/headers/PM-Info-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PM_Info_Item_H_
+#define	_PM_Info_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "MeasurementType.h"
+#include "MeasurementValue.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PM-Info-Item */
+typedef struct PM_Info_Item {
+	MeasurementType_t	 pmType;
+	MeasurementValue_t	 pmVal;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PM_Info_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PM_Info_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_PM_Info_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_PM_Info_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PM_Info_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PerQCIReportListItem.h b/e2sm/headers/PerQCIReportListItem.h
new file mode 100644
index 0000000..1f4c6bb
--- /dev/null
+++ b/e2sm/headers/PerQCIReportListItem.h
@@ -0,0 +1,47 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PerQCIReportListItem_H_
+#define	_PerQCIReportListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "QCI.h"
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PerQCIReportListItem */
+typedef struct PerQCIReportListItem {
+	QCI_t	 qci;
+	long	*dl_PRBUsage;	/* OPTIONAL */
+	long	*ul_PRBUsage;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PerQCIReportListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PerQCIReportListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_PerQCIReportListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_PerQCIReportListItem_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PerQCIReportListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PerQCIReportListItemFormat.h b/e2sm/headers/PerQCIReportListItemFormat.h
new file mode 100644
index 0000000..46b588e
--- /dev/null
+++ b/e2sm/headers/PerQCIReportListItemFormat.h
@@ -0,0 +1,47 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PerQCIReportListItemFormat_H_
+#define	_PerQCIReportListItemFormat_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "QCI.h"
+#include <INTEGER.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PerQCIReportListItemFormat */
+typedef struct PerQCIReportListItemFormat {
+	QCI_t	 drbqci;
+	INTEGER_t	*pDCPBytesDL;	/* OPTIONAL */
+	INTEGER_t	*pDCPBytesUL;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PerQCIReportListItemFormat_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PerQCIReportListItemFormat;
+extern asn_SEQUENCE_specifics_t asn_SPC_PerQCIReportListItemFormat_specs_1;
+extern asn_TYPE_member_t asn_MBR_PerQCIReportListItemFormat_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PerQCIReportListItemFormat_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PerUE-PM-Item.h b/e2sm/headers/PerUE-PM-Item.h
new file mode 100644
index 0000000..b2b2c4f
--- /dev/null
+++ b/e2sm/headers/PerUE-PM-Item.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PerUE_PM_Item_H_
+#define	_PerUE_PM_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "UE-Identity.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct PM_Info_Item;
+
+/* PerUE-PM-Item */
+typedef struct PerUE_PM_Item {
+	UE_Identity_t	 ueId;
+	struct PerUE_PM_Item__list_of_PM_Information {
+		A_SEQUENCE_OF(struct PM_Info_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *list_of_PM_Information;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PerUE_PM_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PerUE_PM_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_PerUE_PM_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_PerUE_PM_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PerUE_PM_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PhysCellId.h b/e2sm/headers/PhysCellId.h
new file mode 100644
index 0000000..c5de886
--- /dev/null
+++ b/e2sm/headers/PhysCellId.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PhysCellId_H_
+#define	_PhysCellId_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PhysCellId */
+typedef long	 PhysCellId_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_PhysCellId_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_PhysCellId;
+asn_struct_free_f PhysCellId_free;
+asn_struct_print_f PhysCellId_print;
+asn_constr_check_f PhysCellId_constraint;
+ber_type_decoder_f PhysCellId_decode_ber;
+der_type_encoder_f PhysCellId_encode_der;
+xer_type_decoder_f PhysCellId_decode_xer;
+xer_type_encoder_f PhysCellId_encode_xer;
+oer_type_decoder_f PhysCellId_decode_oer;
+oer_type_encoder_f PhysCellId_encode_oer;
+per_type_decoder_f PhysCellId_decode_uper;
+per_type_encoder_f PhysCellId_encode_uper;
+per_type_decoder_f PhysCellId_decode_aper;
+per_type_encoder_f PhysCellId_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PhysCellId_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PlmnID-Item.h b/e2sm/headers/PlmnID-Item.h
new file mode 100644
index 0000000..803068c
--- /dev/null
+++ b/e2sm/headers/PlmnID-Item.h
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_PlmnID_Item_H_
+#define	_PlmnID_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct FGC_CUUP_PM_Format;
+struct EPC_CUUP_PM_Format;
+
+/* PlmnID-Item */
+typedef struct PlmnID_Item {
+	PLMN_Identity_t	 pLMN_Identity;
+	struct FGC_CUUP_PM_Format	*cu_UP_PM_5GC;	/* OPTIONAL */
+	struct EPC_CUUP_PM_Format	*cu_UP_PM_EPC;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} PlmnID_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_PlmnID_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_PlmnID_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_PlmnID_Item_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PlmnID_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/Presence.h b/e2sm/headers/Presence.h
new file mode 100644
index 0000000..40bf8ff
--- /dev/null
+++ b/e2sm/headers/Presence.h
@@ -0,0 +1,52 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_Presence_H_
+#define	_Presence_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Presence {
+	Presence_optional	= 0,
+	Presence_conditional	= 1,
+	Presence_mandatory	= 2
+} e_Presence;
+
+/* Presence */
+typedef long	 Presence_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_Presence;
+asn_struct_free_f Presence_free;
+asn_struct_print_f Presence_print;
+asn_constr_check_f Presence_constraint;
+ber_type_decoder_f Presence_decode_ber;
+der_type_encoder_f Presence_encode_der;
+xer_type_decoder_f Presence_decode_xer;
+xer_type_encoder_f Presence_encode_xer;
+oer_type_decoder_f Presence_decode_oer;
+oer_type_encoder_f Presence_encode_oer;
+per_type_decoder_f Presence_decode_uper;
+per_type_encoder_f Presence_encode_uper;
+per_type_decoder_f Presence_decode_aper;
+per_type_encoder_f Presence_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Presence_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/PrintableString.h b/e2sm/headers/PrintableString.h
new file mode 100644
index 0000000..8c2b61a
--- /dev/null
+++ b/e2sm/headers/PrintableString.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PrintableString_H_
+#define	_PrintableString_H_
+
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef OCTET_STRING_t PrintableString_t;  /* Implemented via OCTET STRING */
+
+extern asn_TYPE_descriptor_t asn_DEF_PrintableString;
+extern asn_TYPE_operation_t asn_OP_PrintableString;
+
+asn_constr_check_f PrintableString_constraint;
+
+#define PrintableString_free            OCTET_STRING_free
+#define PrintableString_print           OCTET_STRING_print_utf8
+#define PrintableString_compare         OCTET_STRING_compare
+#define PrintableString_decode_ber      OCTET_STRING_decode_ber
+#define PrintableString_encode_der      OCTET_STRING_encode_der
+#define PrintableString_decode_xer      OCTET_STRING_decode_xer_utf8
+#define PrintableString_encode_xer      OCTET_STRING_encode_xer_utf8
+#define PrintableString_decode_uper     OCTET_STRING_decode_uper
+#define PrintableString_encode_uper     OCTET_STRING_encode_uper
+#define PrintableString_decode_aper     OCTET_STRING_decode_aper
+#define PrintableString_encode_aper     OCTET_STRING_encode_aper
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PrintableString_H_ */
diff --git a/e2sm/headers/ProcedureCode.h b/e2sm/headers/ProcedureCode.h
new file mode 100644
index 0000000..61daec2
--- /dev/null
+++ b/e2sm/headers/ProcedureCode.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ProcedureCode_H_
+#define	_ProcedureCode_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProcedureCode */
+typedef long	 ProcedureCode_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ProcedureCode;
+asn_struct_free_f ProcedureCode_free;
+asn_struct_print_f ProcedureCode_print;
+asn_constr_check_f ProcedureCode_constraint;
+ber_type_decoder_f ProcedureCode_decode_ber;
+der_type_encoder_f ProcedureCode_encode_der;
+xer_type_decoder_f ProcedureCode_decode_xer;
+xer_type_encoder_f ProcedureCode_encode_xer;
+oer_type_decoder_f ProcedureCode_decode_oer;
+oer_type_encoder_f ProcedureCode_encode_oer;
+per_type_decoder_f ProcedureCode_decode_uper;
+per_type_encoder_f ProcedureCode_encode_uper;
+per_type_decoder_f ProcedureCode_decode_aper;
+per_type_encoder_f ProcedureCode_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProcedureCode_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ProtocolIE-ID.h b/e2sm/headers/ProtocolIE-ID.h
new file mode 100644
index 0000000..c306f09
--- /dev/null
+++ b/e2sm/headers/ProtocolIE-ID.h
@@ -0,0 +1,92 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ProtocolIE_ID_H_
+#define	_ProtocolIE_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProtocolIE-ID */
+typedef long	 ProtocolIE_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_ID;
+asn_struct_free_f ProtocolIE_ID_free;
+asn_struct_print_f ProtocolIE_ID_print;
+asn_constr_check_f ProtocolIE_ID_constraint;
+ber_type_decoder_f ProtocolIE_ID_decode_ber;
+der_type_encoder_f ProtocolIE_ID_encode_der;
+xer_type_decoder_f ProtocolIE_ID_decode_xer;
+xer_type_encoder_f ProtocolIE_ID_encode_xer;
+oer_type_decoder_f ProtocolIE_ID_decode_oer;
+oer_type_encoder_f ProtocolIE_ID_encode_oer;
+per_type_decoder_f ProtocolIE_ID_decode_uper;
+per_type_encoder_f ProtocolIE_ID_encode_uper;
+per_type_decoder_f ProtocolIE_ID_decode_aper;
+per_type_encoder_f ProtocolIE_ID_encode_aper;
+#define ProtocolIE_ID_id_Cause	((ProtocolIE_ID_t)1)
+#define ProtocolIE_ID_id_CriticalityDiagnostics	((ProtocolIE_ID_t)2)
+#define ProtocolIE_ID_id_GlobalE2node_ID	((ProtocolIE_ID_t)3)
+#define ProtocolIE_ID_id_GlobalRIC_ID	((ProtocolIE_ID_t)4)
+#define ProtocolIE_ID_id_RANfunctionID	((ProtocolIE_ID_t)5)
+#define ProtocolIE_ID_id_RANfunctionID_Item	((ProtocolIE_ID_t)6)
+#define ProtocolIE_ID_id_RANfunctionIEcause_Item	((ProtocolIE_ID_t)7)
+#define ProtocolIE_ID_id_RANfunction_Item	((ProtocolIE_ID_t)8)
+#define ProtocolIE_ID_id_RANfunctionsAccepted	((ProtocolIE_ID_t)9)
+#define ProtocolIE_ID_id_RANfunctionsAdded	((ProtocolIE_ID_t)10)
+#define ProtocolIE_ID_id_RANfunctionsDeleted	((ProtocolIE_ID_t)11)
+#define ProtocolIE_ID_id_RANfunctionsModified	((ProtocolIE_ID_t)12)
+#define ProtocolIE_ID_id_RANfunctionsRejected	((ProtocolIE_ID_t)13)
+#define ProtocolIE_ID_id_RICaction_Admitted_Item	((ProtocolIE_ID_t)14)
+#define ProtocolIE_ID_id_RICactionID	((ProtocolIE_ID_t)15)
+#define ProtocolIE_ID_id_RICaction_NotAdmitted_Item	((ProtocolIE_ID_t)16)
+#define ProtocolIE_ID_id_RICactions_Admitted	((ProtocolIE_ID_t)17)
+#define ProtocolIE_ID_id_RICactions_NotAdmitted	((ProtocolIE_ID_t)18)
+#define ProtocolIE_ID_id_RICaction_ToBeSetup_Item	((ProtocolIE_ID_t)19)
+#define ProtocolIE_ID_id_RICcallProcessID	((ProtocolIE_ID_t)20)
+#define ProtocolIE_ID_id_RICcontrolAckRequest	((ProtocolIE_ID_t)21)
+#define ProtocolIE_ID_id_RICcontrolHeader	((ProtocolIE_ID_t)22)
+#define ProtocolIE_ID_id_RICcontrolMessage	((ProtocolIE_ID_t)23)
+#define ProtocolIE_ID_id_RICcontrolStatus	((ProtocolIE_ID_t)24)
+#define ProtocolIE_ID_id_RICindicationHeader	((ProtocolIE_ID_t)25)
+#define ProtocolIE_ID_id_RICindicationMessage	((ProtocolIE_ID_t)26)
+#define ProtocolIE_ID_id_RICindicationSN	((ProtocolIE_ID_t)27)
+#define ProtocolIE_ID_id_RICindicationType	((ProtocolIE_ID_t)28)
+#define ProtocolIE_ID_id_RICrequestID	((ProtocolIE_ID_t)29)
+#define ProtocolIE_ID_id_RICsubscriptionDetails	((ProtocolIE_ID_t)30)
+#define ProtocolIE_ID_id_TimeToWait	((ProtocolIE_ID_t)31)
+#define ProtocolIE_ID_id_RICcontrolOutcome	((ProtocolIE_ID_t)32)
+#define ProtocolIE_ID_id_E2nodeComponentConfigUpdate	((ProtocolIE_ID_t)33)
+#define ProtocolIE_ID_id_E2nodeComponentConfigUpdate_Item	((ProtocolIE_ID_t)34)
+#define ProtocolIE_ID_id_E2nodeComponentConfigUpdateAck	((ProtocolIE_ID_t)35)
+#define ProtocolIE_ID_id_E2nodeComponentConfigUpdateAck_Item	((ProtocolIE_ID_t)36)
+#define ProtocolIE_ID_id_E2connectionSetup	((ProtocolIE_ID_t)39)
+#define ProtocolIE_ID_id_E2connectionSetupFailed	((ProtocolIE_ID_t)40)
+#define ProtocolIE_ID_id_E2connectionSetupFailed_Item	((ProtocolIE_ID_t)41)
+#define ProtocolIE_ID_id_E2connectionFailed_Item	((ProtocolIE_ID_t)42)
+#define ProtocolIE_ID_id_E2connectionUpdate_Item	((ProtocolIE_ID_t)43)
+#define ProtocolIE_ID_id_E2connectionUpdateAdd	((ProtocolIE_ID_t)44)
+#define ProtocolIE_ID_id_E2connectionUpdateModify	((ProtocolIE_ID_t)45)
+#define ProtocolIE_ID_id_E2connectionUpdateRemove	((ProtocolIE_ID_t)46)
+#define ProtocolIE_ID_id_E2connectionUpdateRemove_Item	((ProtocolIE_ID_t)47)
+#define ProtocolIE_ID_id_TNLinformation	((ProtocolIE_ID_t)48)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/QCI.h b/e2sm/headers/QCI.h
new file mode 100644
index 0000000..41fd4c0
--- /dev/null
+++ b/e2sm/headers/QCI.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_QCI_H_
+#define	_QCI_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* QCI */
+typedef long	 QCI_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_QCI_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_QCI;
+asn_struct_free_f QCI_free;
+asn_struct_print_f QCI_print;
+asn_constr_check_f QCI_constraint;
+ber_type_decoder_f QCI_decode_ber;
+der_type_encoder_f QCI_encode_der;
+xer_type_decoder_f QCI_decode_xer;
+xer_type_encoder_f QCI_encode_xer;
+oer_type_decoder_f QCI_decode_oer;
+oer_type_encoder_f QCI_encode_oer;
+per_type_decoder_f QCI_decode_uper;
+per_type_encoder_f QCI_encode_uper;
+per_type_decoder_f QCI_decode_aper;
+per_type_encoder_f QCI_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _QCI_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RAN-Container.h b/e2sm/headers/RAN-Container.h
new file mode 100644
index 0000000..ad65e6f
--- /dev/null
+++ b/e2sm/headers/RAN-Container.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RAN_Container_H_
+#define	_RAN_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RAN-Container */
+typedef OCTET_STRING_t	 RAN_Container_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RAN_Container;
+asn_struct_free_f RAN_Container_free;
+asn_struct_print_f RAN_Container_print;
+asn_constr_check_f RAN_Container_constraint;
+ber_type_decoder_f RAN_Container_decode_ber;
+der_type_encoder_f RAN_Container_encode_der;
+xer_type_decoder_f RAN_Container_decode_xer;
+xer_type_encoder_f RAN_Container_encode_xer;
+oer_type_decoder_f RAN_Container_decode_oer;
+oer_type_encoder_f RAN_Container_encode_oer;
+per_type_decoder_f RAN_Container_decode_uper;
+per_type_encoder_f RAN_Container_encode_uper;
+per_type_decoder_f RAN_Container_decode_aper;
+per_type_encoder_f RAN_Container_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RAN_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RAN-ControlParameter-Item.h b/e2sm/headers/RAN-ControlParameter-Item.h
new file mode 100644
index 0000000..68f5082
--- /dev/null
+++ b/e2sm/headers/RAN-ControlParameter-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RAN_ControlParameter_Item_H_
+#define	_RAN_ControlParameter_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANParameter-ID.h"
+#include "RANParameter-Name.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RAN-ControlParameter-Item */
+typedef struct RAN_ControlParameter_Item {
+	RANParameter_ID_t	 ranParameter_ID;
+	RANParameter_Name_t	 ranParameter_Name;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RAN_ControlParameter_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RAN_ControlParameter_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RAN_ControlParameter_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RAN_ControlParameter_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RAN_ControlParameter_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-ELEMENT.h b/e2sm/headers/RANParameter-ELEMENT.h
new file mode 100644
index 0000000..200e3ed
--- /dev/null
+++ b/e2sm/headers/RANParameter-ELEMENT.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_ELEMENT_H_
+#define	_RANParameter_ELEMENT_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BOOLEAN.h>
+#include "RANParameter-Value.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANParameter-ELEMENT */
+typedef struct RANParameter_ELEMENT {
+	BOOLEAN_t	 keyFlag;
+	RANParameter_Value_t	 ranParameter_Value;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANParameter_ELEMENT_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_ELEMENT;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANParameter_ELEMENT_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANParameter_ELEMENT_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_ELEMENT_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-ID.h b/e2sm/headers/RANParameter-ID.h
new file mode 100644
index 0000000..74f3479
--- /dev/null
+++ b/e2sm/headers/RANParameter-ID.h
@@ -0,0 +1,47 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_ID_H_
+#define	_RANParameter_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANParameter-ID */
+typedef unsigned long	 RANParameter_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RANParameter_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_ID;
+extern const asn_INTEGER_specifics_t asn_SPC_RANParameter_ID_specs_1;
+asn_struct_free_f RANParameter_ID_free;
+asn_struct_print_f RANParameter_ID_print;
+asn_constr_check_f RANParameter_ID_constraint;
+ber_type_decoder_f RANParameter_ID_decode_ber;
+der_type_encoder_f RANParameter_ID_encode_der;
+xer_type_decoder_f RANParameter_ID_decode_xer;
+xer_type_encoder_f RANParameter_ID_encode_xer;
+oer_type_decoder_f RANParameter_ID_decode_oer;
+oer_type_encoder_f RANParameter_ID_encode_oer;
+per_type_decoder_f RANParameter_ID_decode_uper;
+per_type_encoder_f RANParameter_ID_encode_uper;
+per_type_decoder_f RANParameter_ID_decode_aper;
+per_type_encoder_f RANParameter_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-Item.h b/e2sm/headers/RANParameter-Item.h
new file mode 100644
index 0000000..922c61a
--- /dev/null
+++ b/e2sm/headers/RANParameter-Item.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_Item_H_
+#define	_RANParameter_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANParameter-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RANParameter_ValueType;
+
+/* RANParameter-Item */
+typedef struct RANParameter_Item {
+	RANParameter_ID_t	 ranParameterItem_ID;
+	struct RANParameter_ValueType	*ranParameterItem_valueType;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANParameter_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANParameter_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANParameter_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-LIST.h b/e2sm/headers/RANParameter-LIST.h
new file mode 100644
index 0000000..603482c
--- /dev/null
+++ b/e2sm/headers/RANParameter-LIST.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_LIST_H_
+#define	_RANParameter_LIST_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RANParameter_STRUCTURE;
+
+/* RANParameter-LIST */
+typedef struct RANParameter_LIST {
+	struct RANParameter_LIST__list_of_ranParameter_Structures {
+		A_SEQUENCE_OF(struct RANParameter_STRUCTURE) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} list_of_ranParameter_Structures;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANParameter_LIST_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_LIST;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANParameter_LIST_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANParameter_LIST_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_LIST_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-Name.h b/e2sm/headers/RANParameter-Name.h
new file mode 100644
index 0000000..5f1b997
--- /dev/null
+++ b/e2sm/headers/RANParameter-Name.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_Name_H_
+#define	_RANParameter_Name_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <PrintableString.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANParameter-Name */
+typedef PrintableString_t	 RANParameter_Name_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RANParameter_Name_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_Name;
+asn_struct_free_f RANParameter_Name_free;
+asn_struct_print_f RANParameter_Name_print;
+asn_constr_check_f RANParameter_Name_constraint;
+ber_type_decoder_f RANParameter_Name_decode_ber;
+der_type_encoder_f RANParameter_Name_encode_der;
+xer_type_decoder_f RANParameter_Name_decode_xer;
+xer_type_encoder_f RANParameter_Name_encode_xer;
+oer_type_decoder_f RANParameter_Name_decode_oer;
+oer_type_encoder_f RANParameter_Name_encode_oer;
+per_type_decoder_f RANParameter_Name_decode_uper;
+per_type_encoder_f RANParameter_Name_encode_uper;
+per_type_decoder_f RANParameter_Name_decode_aper;
+per_type_encoder_f RANParameter_Name_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_Name_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-STRUCTURE.h b/e2sm/headers/RANParameter-STRUCTURE.h
new file mode 100644
index 0000000..7904936
--- /dev/null
+++ b/e2sm/headers/RANParameter-STRUCTURE.h
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_STRUCTURE_H_
+#define	_RANParameter_STRUCTURE_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RANParameter_Item;
+
+/* RANParameter-STRUCTURE */
+typedef struct RANParameter_STRUCTURE {
+	struct RANParameter_STRUCTURE__sequence_of_ranParameters {
+		A_SEQUENCE_OF(struct RANParameter_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} sequence_of_ranParameters;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANParameter_STRUCTURE_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_STRUCTURE;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANParameter_STRUCTURE_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANParameter_STRUCTURE_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_STRUCTURE_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-Value.h b/e2sm/headers/RANParameter-Value.h
new file mode 100644
index 0000000..92e3759
--- /dev/null
+++ b/e2sm/headers/RANParameter-Value.h
@@ -0,0 +1,59 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_Value_H_
+#define	_RANParameter_Value_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+#include <OCTET_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RANParameter_Value_PR {
+	RANParameter_Value_PR_NOTHING,	/* No components present */
+	RANParameter_Value_PR_valueInt,
+	RANParameter_Value_PR_valueOctS
+	/* Extensions may appear below */
+	
+} RANParameter_Value_PR;
+
+/* RANParameter-Value */
+typedef struct RANParameter_Value {
+	RANParameter_Value_PR present;
+	union RANParameter_Value_u {
+		long	 valueInt;
+		OCTET_STRING_t	 valueOctS;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANParameter_Value_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_Value;
+extern asn_CHOICE_specifics_t asn_SPC_RANParameter_Value_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANParameter_Value_1[2];
+extern asn_per_constraints_t asn_PER_type_RANParameter_Value_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_Value_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANParameter-ValueType.h b/e2sm/headers/RANParameter-ValueType.h
new file mode 100644
index 0000000..162ad29
--- /dev/null
+++ b/e2sm/headers/RANParameter-ValueType.h
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANParameter_ValueType_H_
+#define	_RANParameter_ValueType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RANParameter_ValueType_PR {
+	RANParameter_ValueType_PR_NOTHING,	/* No components present */
+	RANParameter_ValueType_PR_ranParameter_Element,
+	RANParameter_ValueType_PR_ranParameter_Structure,
+	RANParameter_ValueType_PR_ranParameter_List
+	/* Extensions may appear below */
+	
+} RANParameter_ValueType_PR;
+
+/* Forward declarations */
+struct RANParameter_ELEMENT;
+struct RANParameter_STRUCTURE;
+struct RANParameter_LIST;
+
+/* RANParameter-ValueType */
+typedef struct RANParameter_ValueType {
+	RANParameter_ValueType_PR present;
+	union RANParameter_ValueType_u {
+		struct RANParameter_ELEMENT	*ranParameter_Element;
+		struct RANParameter_STRUCTURE	*ranParameter_Structure;
+		struct RANParameter_LIST	*ranParameter_List;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANParameter_ValueType_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANParameter_ValueType;
+extern asn_CHOICE_specifics_t asn_SPC_RANParameter_ValueType_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANParameter_ValueType_1[3];
+extern asn_per_constraints_t asn_PER_type_RANParameter_ValueType_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANParameter_ValueType_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANcallProcess-ID-string.h b/e2sm/headers/RANcallProcess-ID-string.h
new file mode 100644
index 0000000..c24a061
--- /dev/null
+++ b/e2sm/headers/RANcallProcess-ID-string.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANcallProcess_ID_string_H_
+#define	_RANcallProcess_ID_string_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <PrintableString.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANcallProcess-ID-string */
+typedef PrintableString_t	 RANcallProcess_ID_string_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANcallProcess_ID_string;
+asn_struct_free_f RANcallProcess_ID_string_free;
+asn_struct_print_f RANcallProcess_ID_string_print;
+asn_constr_check_f RANcallProcess_ID_string_constraint;
+ber_type_decoder_f RANcallProcess_ID_string_decode_ber;
+der_type_encoder_f RANcallProcess_ID_string_encode_der;
+xer_type_decoder_f RANcallProcess_ID_string_decode_xer;
+xer_type_encoder_f RANcallProcess_ID_string_encode_xer;
+oer_type_decoder_f RANcallProcess_ID_string_decode_oer;
+oer_type_encoder_f RANcallProcess_ID_string_encode_oer;
+per_type_decoder_f RANcallProcess_ID_string_decode_uper;
+per_type_encoder_f RANcallProcess_ID_string_encode_uper;
+per_type_decoder_f RANcallProcess_ID_string_decode_aper;
+per_type_encoder_f RANcallProcess_ID_string_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANcallProcess_ID_string_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RANfunction-Name.h b/e2sm/headers/RANfunction-Name.h
new file mode 100644
index 0000000..22f5c95
--- /dev/null
+++ b/e2sm/headers/RANfunction-Name.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RANfunction_Name_H_
+#define	_RANfunction_Name_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <PrintableString.h>
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunction-Name */
+typedef struct RANfunction_Name {
+	PrintableString_t	 ranFunction_ShortName;
+	PrintableString_t	 ranFunction_E2SM_OID;
+	PrintableString_t	 ranFunction_Description;
+	long	*ranFunction_Instance;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunction_Name_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunction_Name;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunction_Name_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunction_Name_1[4];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunction_Name_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/REAL.h b/e2sm/headers/REAL.h
new file mode 100644
index 0000000..fce6714
--- /dev/null
+++ b/e2sm/headers/REAL.h
@@ -0,0 +1,67 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_TYPE_REAL_H
+#define	ASN_TYPE_REAL_H
+
+#include <asn_application.h>
+#include <asn_codecs_prim.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ASN__PRIMITIVE_TYPE_t REAL_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_REAL;
+extern asn_TYPE_operation_t asn_OP_REAL;
+
+asn_struct_print_f REAL_print;
+asn_struct_compare_f REAL_compare;
+oer_type_decoder_f REAL_decode_oer;
+oer_type_encoder_f REAL_encode_oer;
+per_type_decoder_f REAL_decode_uper;
+per_type_encoder_f REAL_encode_uper;
+per_type_decoder_f REAL_decode_aper;
+per_type_encoder_f REAL_encode_aper;
+xer_type_decoder_f REAL_decode_xer;
+xer_type_encoder_f REAL_encode_xer;
+asn_random_fill_f  REAL_random_fill;
+
+#define REAL_free          ASN__PRIMITIVE_TYPE_free,
+#define REAL_constraint    asn_generic_no_constraint
+#define REAL_decode_ber    ber_decode_primitive
+#define REAL_encode_der    der_encode_primitive
+
+/***********************************
+ * Some handy conversion routines. *
+ ***********************************/
+
+ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key);
+
+/*
+ * Convert between native double type and REAL representation (DER).
+ * RETURN VALUES:
+ *  0: Value converted successfully
+ * -1: An error occured while converting the value: invalid format.
+ */
+int asn_REAL2double(const REAL_t *real_ptr, double *d);
+int asn_double2REAL(REAL_t *real_ptr, double d);
+
+/*
+ * Downcast double to float while checking that no overflow occurs.
+ * This allows stricter control of the input data.
+ * RETURN VALUES:
+ *  0: The conversion was successful (perhaps with a loss of precision)
+ * -1: The conversion created overflow into infinities.
+ * The (outcome) is ALWAYS set to a value you'd expect from the
+ * standard silent float to double conversion behavior.
+ */
+int asn_double2float(double d, float *outcome);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_TYPE_REAL_H */
diff --git a/e2sm/headers/RIC-ControlAction-ID.h b/e2sm/headers/RIC-ControlAction-ID.h
new file mode 100644
index 0000000..78dab02
--- /dev/null
+++ b/e2sm/headers/RIC-ControlAction-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_ControlAction_ID_H_
+#define	_RIC_ControlAction_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RIC-ControlAction-ID */
+typedef long	 RIC_ControlAction_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RIC_ControlAction_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RIC_ControlAction_ID;
+asn_struct_free_f RIC_ControlAction_ID_free;
+asn_struct_print_f RIC_ControlAction_ID_print;
+asn_constr_check_f RIC_ControlAction_ID_constraint;
+ber_type_decoder_f RIC_ControlAction_ID_decode_ber;
+der_type_encoder_f RIC_ControlAction_ID_encode_der;
+xer_type_decoder_f RIC_ControlAction_ID_decode_xer;
+xer_type_encoder_f RIC_ControlAction_ID_encode_xer;
+oer_type_decoder_f RIC_ControlAction_ID_decode_oer;
+oer_type_encoder_f RIC_ControlAction_ID_encode_oer;
+per_type_decoder_f RIC_ControlAction_ID_decode_uper;
+per_type_encoder_f RIC_ControlAction_ID_encode_uper;
+per_type_decoder_f RIC_ControlAction_ID_decode_aper;
+per_type_encoder_f RIC_ControlAction_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_ControlAction_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-ControlAction-Item.h b/e2sm/headers/RIC-ControlAction-Item.h
new file mode 100644
index 0000000..c064c3a
--- /dev/null
+++ b/e2sm/headers/RIC-ControlAction-Item.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_ControlAction_Item_H_
+#define	_RIC_ControlAction_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RIC-ControlAction-ID.h"
+#include "RIC-ControlAction-Name.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RAN_ControlParameter_Item;
+
+/* RIC-ControlAction-Item */
+typedef struct RIC_ControlAction_Item {
+	RIC_ControlAction_ID_t	 ric_ControlAction_ID;
+	RIC_ControlAction_Name_t	 ric_ControlAction_Name;
+	struct RIC_ControlAction_Item__ran_ControlParameters_List {
+		A_SEQUENCE_OF(struct RAN_ControlParameter_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *ran_ControlParameters_List;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RIC_ControlAction_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RIC_ControlAction_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RIC_ControlAction_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RIC_ControlAction_Item_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_ControlAction_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-ControlAction-Name.h b/e2sm/headers/RIC-ControlAction-Name.h
new file mode 100644
index 0000000..7e2d351
--- /dev/null
+++ b/e2sm/headers/RIC-ControlAction-Name.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_ControlAction_Name_H_
+#define	_RIC_ControlAction_Name_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <PrintableString.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RIC-ControlAction-Name */
+typedef PrintableString_t	 RIC_ControlAction_Name_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RIC_ControlAction_Name_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RIC_ControlAction_Name;
+asn_struct_free_f RIC_ControlAction_Name_free;
+asn_struct_print_f RIC_ControlAction_Name_print;
+asn_constr_check_f RIC_ControlAction_Name_constraint;
+ber_type_decoder_f RIC_ControlAction_Name_decode_ber;
+der_type_encoder_f RIC_ControlAction_Name_encode_der;
+xer_type_decoder_f RIC_ControlAction_Name_decode_xer;
+xer_type_encoder_f RIC_ControlAction_Name_encode_xer;
+oer_type_decoder_f RIC_ControlAction_Name_decode_oer;
+oer_type_encoder_f RIC_ControlAction_Name_encode_oer;
+per_type_decoder_f RIC_ControlAction_Name_decode_uper;
+per_type_encoder_f RIC_ControlAction_Name_encode_uper;
+per_type_decoder_f RIC_ControlAction_Name_decode_aper;
+per_type_encoder_f RIC_ControlAction_Name_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_ControlAction_Name_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-ControlStyle-Item.h b/e2sm/headers/RIC-ControlStyle-Item.h
new file mode 100644
index 0000000..a24d639
--- /dev/null
+++ b/e2sm/headers/RIC-ControlStyle-Item.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_ControlStyle_Item_H_
+#define	_RIC_ControlStyle_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RIC-Style-Type.h"
+#include "RIC-Style-Name.h"
+#include "RIC-Format-Type.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RIC_ControlAction_Item;
+
+/* RIC-ControlStyle-Item */
+typedef struct RIC_ControlStyle_Item {
+	RIC_Style_Type_t	 ric_ControlStyle_Type;
+	RIC_Style_Name_t	 ric_ControlStyle_Name;
+	struct RIC_ControlStyle_Item__ric_ControlAction_List {
+		A_SEQUENCE_OF(struct RIC_ControlAction_Item) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} *ric_ControlAction_List;
+	RIC_Format_Type_t	 ric_ControlHeaderFormat_Type;
+	RIC_Format_Type_t	 ric_ControlMessageFormat_Type;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RIC_ControlStyle_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RIC_ControlStyle_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RIC_ControlStyle_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RIC_ControlStyle_Item_1[5];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_ControlStyle_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-EventTriggerStyle-Item.h b/e2sm/headers/RIC-EventTriggerStyle-Item.h
new file mode 100644
index 0000000..dbff4fc
--- /dev/null
+++ b/e2sm/headers/RIC-EventTriggerStyle-Item.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_EventTriggerStyle_Item_H_
+#define	_RIC_EventTriggerStyle_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RIC-Style-Type.h"
+#include "RIC-Style-Name.h"
+#include "RIC-Format-Type.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RIC-EventTriggerStyle-Item */
+typedef struct RIC_EventTriggerStyle_Item {
+	RIC_Style_Type_t	 ric_EventTriggerStyle_Type;
+	RIC_Style_Name_t	 ric_EventTriggerStyle_Name;
+	RIC_Format_Type_t	 ric_EventTriggerFormat_Type;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RIC_EventTriggerStyle_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RIC_EventTriggerStyle_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RIC_EventTriggerStyle_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RIC_EventTriggerStyle_Item_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_EventTriggerStyle_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-Format-Type.h b/e2sm/headers/RIC-Format-Type.h
new file mode 100644
index 0000000..7d06e5f
--- /dev/null
+++ b/e2sm/headers/RIC-Format-Type.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_Format_Type_H_
+#define	_RIC_Format_Type_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RIC-Format-Type */
+typedef long	 RIC_Format_Type_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RIC_Format_Type;
+asn_struct_free_f RIC_Format_Type_free;
+asn_struct_print_f RIC_Format_Type_print;
+asn_constr_check_f RIC_Format_Type_constraint;
+ber_type_decoder_f RIC_Format_Type_decode_ber;
+der_type_encoder_f RIC_Format_Type_encode_der;
+xer_type_decoder_f RIC_Format_Type_decode_xer;
+xer_type_encoder_f RIC_Format_Type_encode_xer;
+oer_type_decoder_f RIC_Format_Type_decode_oer;
+oer_type_encoder_f RIC_Format_Type_encode_oer;
+per_type_decoder_f RIC_Format_Type_decode_uper;
+per_type_encoder_f RIC_Format_Type_encode_uper;
+per_type_decoder_f RIC_Format_Type_decode_aper;
+per_type_encoder_f RIC_Format_Type_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_Format_Type_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-ReportStyle-Item.h b/e2sm/headers/RIC-ReportStyle-Item.h
new file mode 100644
index 0000000..7e963fb
--- /dev/null
+++ b/e2sm/headers/RIC-ReportStyle-Item.h
@@ -0,0 +1,49 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_ReportStyle_Item_H_
+#define	_RIC_ReportStyle_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RIC-Style-Type.h"
+#include "RIC-Style-Name.h"
+#include "RIC-Format-Type.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RIC-ReportStyle-Item */
+typedef struct RIC_ReportStyle_Item {
+	RIC_Style_Type_t	 ric_ReportStyle_Type;
+	RIC_Style_Name_t	 ric_ReportStyle_Name;
+	RIC_Format_Type_t	 ric_ReportIndicationHeaderFormat_Type;
+	RIC_Format_Type_t	 ric_ReportIndicationMessageFormat_Type;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RIC_ReportStyle_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RIC_ReportStyle_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RIC_ReportStyle_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RIC_ReportStyle_Item_1[4];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_ReportStyle_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-Style-Name.h b/e2sm/headers/RIC-Style-Name.h
new file mode 100644
index 0000000..95f3cdd
--- /dev/null
+++ b/e2sm/headers/RIC-Style-Name.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_Style_Name_H_
+#define	_RIC_Style_Name_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <PrintableString.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RIC-Style-Name */
+typedef PrintableString_t	 RIC_Style_Name_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RIC_Style_Name_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RIC_Style_Name;
+asn_struct_free_f RIC_Style_Name_free;
+asn_struct_print_f RIC_Style_Name_print;
+asn_constr_check_f RIC_Style_Name_constraint;
+ber_type_decoder_f RIC_Style_Name_decode_ber;
+der_type_encoder_f RIC_Style_Name_encode_der;
+xer_type_decoder_f RIC_Style_Name_decode_xer;
+xer_type_encoder_f RIC_Style_Name_encode_xer;
+oer_type_decoder_f RIC_Style_Name_decode_oer;
+oer_type_encoder_f RIC_Style_Name_encode_oer;
+per_type_decoder_f RIC_Style_Name_decode_uper;
+per_type_encoder_f RIC_Style_Name_encode_uper;
+per_type_decoder_f RIC_Style_Name_decode_aper;
+per_type_encoder_f RIC_Style_Name_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_Style_Name_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RIC-Style-Type.h b/e2sm/headers/RIC-Style-Type.h
new file mode 100644
index 0000000..aad553e
--- /dev/null
+++ b/e2sm/headers/RIC-Style-Type.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RIC_Style_Type_H_
+#define	_RIC_Style_Type_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RIC-Style-Type */
+typedef long	 RIC_Style_Type_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RIC_Style_Type;
+asn_struct_free_f RIC_Style_Type_free;
+asn_struct_print_f RIC_Style_Type_print;
+asn_constr_check_f RIC_Style_Type_constraint;
+ber_type_decoder_f RIC_Style_Type_decode_ber;
+der_type_encoder_f RIC_Style_Type_encode_der;
+xer_type_decoder_f RIC_Style_Type_decode_xer;
+xer_type_encoder_f RIC_Style_Type_encode_xer;
+oer_type_decoder_f RIC_Style_Type_decode_oer;
+oer_type_encoder_f RIC_Style_Type_encode_oer;
+per_type_decoder_f RIC_Style_Type_decode_uper;
+per_type_encoder_f RIC_Style_Type_encode_uper;
+per_type_decoder_f RIC_Style_Type_decode_aper;
+per_type_encoder_f RIC_Style_Type_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RIC_Style_Type_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RRCEvent.h b/e2sm/headers/RRCEvent.h
new file mode 100644
index 0000000..ea91c31
--- /dev/null
+++ b/e2sm/headers/RRCEvent.h
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RRCEvent_H_
+#define	_RRCEvent_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RRCEvent {
+	RRCEvent_b1	= 0,
+	RRCEvent_a3	= 1,
+	RRCEvent_a5	= 2,
+	RRCEvent_periodic	= 3
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RRCEvent;
+
+/* RRCEvent */
+typedef long	 RRCEvent_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RRCEvent_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RRCEvent;
+extern const asn_INTEGER_specifics_t asn_SPC_RRCEvent_specs_1;
+asn_struct_free_f RRCEvent_free;
+asn_struct_print_f RRCEvent_print;
+asn_constr_check_f RRCEvent_constraint;
+ber_type_decoder_f RRCEvent_decode_ber;
+der_type_encoder_f RRCEvent_encode_der;
+xer_type_decoder_f RRCEvent_decode_xer;
+xer_type_encoder_f RRCEvent_encode_xer;
+oer_type_decoder_f RRCEvent_decode_oer;
+oer_type_encoder_f RRCEvent_encode_oer;
+per_type_decoder_f RRCEvent_decode_uper;
+per_type_encoder_f RRCEvent_encode_uper;
+per_type_decoder_f RRCEvent_decode_aper;
+per_type_encoder_f RRCEvent_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RRCEvent_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RSRP-Range.h b/e2sm/headers/RSRP-Range.h
new file mode 100644
index 0000000..1d1caa4
--- /dev/null
+++ b/e2sm/headers/RSRP-Range.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RSRP_Range_H_
+#define	_RSRP_Range_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RSRP-Range */
+typedef long	 RSRP_Range_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RSRP_Range_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RSRP_Range;
+asn_struct_free_f RSRP_Range_free;
+asn_struct_print_f RSRP_Range_print;
+asn_constr_check_f RSRP_Range_constraint;
+ber_type_decoder_f RSRP_Range_decode_ber;
+der_type_encoder_f RSRP_Range_encode_der;
+xer_type_decoder_f RSRP_Range_decode_xer;
+xer_type_encoder_f RSRP_Range_encode_xer;
+oer_type_decoder_f RSRP_Range_decode_oer;
+oer_type_encoder_f RSRP_Range_encode_oer;
+per_type_decoder_f RSRP_Range_decode_uper;
+per_type_encoder_f RSRP_Range_encode_uper;
+per_type_decoder_f RSRP_Range_decode_aper;
+per_type_encoder_f RSRP_Range_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RSRP_Range_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RSRP-RangeEUTRA.h b/e2sm/headers/RSRP-RangeEUTRA.h
new file mode 100644
index 0000000..98352ab
--- /dev/null
+++ b/e2sm/headers/RSRP-RangeEUTRA.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RSRP_RangeEUTRA_H_
+#define	_RSRP_RangeEUTRA_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RSRP-RangeEUTRA */
+typedef long	 RSRP_RangeEUTRA_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RSRP_RangeEUTRA_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RSRP_RangeEUTRA;
+asn_struct_free_f RSRP_RangeEUTRA_free;
+asn_struct_print_f RSRP_RangeEUTRA_print;
+asn_constr_check_f RSRP_RangeEUTRA_constraint;
+ber_type_decoder_f RSRP_RangeEUTRA_decode_ber;
+der_type_encoder_f RSRP_RangeEUTRA_encode_der;
+xer_type_decoder_f RSRP_RangeEUTRA_decode_xer;
+xer_type_encoder_f RSRP_RangeEUTRA_encode_xer;
+oer_type_decoder_f RSRP_RangeEUTRA_decode_oer;
+oer_type_encoder_f RSRP_RangeEUTRA_encode_oer;
+per_type_decoder_f RSRP_RangeEUTRA_decode_uper;
+per_type_encoder_f RSRP_RangeEUTRA_encode_uper;
+per_type_decoder_f RSRP_RangeEUTRA_decode_aper;
+per_type_encoder_f RSRP_RangeEUTRA_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RSRP_RangeEUTRA_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RSRQ-Range.h b/e2sm/headers/RSRQ-Range.h
new file mode 100644
index 0000000..81543fb
--- /dev/null
+++ b/e2sm/headers/RSRQ-Range.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RSRQ_Range_H_
+#define	_RSRQ_Range_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RSRQ-Range */
+typedef long	 RSRQ_Range_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RSRQ_Range_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RSRQ_Range;
+asn_struct_free_f RSRQ_Range_free;
+asn_struct_print_f RSRQ_Range_print;
+asn_constr_check_f RSRQ_Range_constraint;
+ber_type_decoder_f RSRQ_Range_decode_ber;
+der_type_encoder_f RSRQ_Range_encode_der;
+xer_type_decoder_f RSRQ_Range_decode_xer;
+xer_type_encoder_f RSRQ_Range_encode_xer;
+oer_type_decoder_f RSRQ_Range_decode_oer;
+oer_type_encoder_f RSRQ_Range_encode_oer;
+per_type_decoder_f RSRQ_Range_decode_uper;
+per_type_encoder_f RSRQ_Range_encode_uper;
+per_type_decoder_f RSRQ_Range_decode_aper;
+per_type_encoder_f RSRQ_Range_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RSRQ_Range_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RSRQ-RangeEUTRA.h b/e2sm/headers/RSRQ-RangeEUTRA.h
new file mode 100644
index 0000000..28a4e2b
--- /dev/null
+++ b/e2sm/headers/RSRQ-RangeEUTRA.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RSRQ_RangeEUTRA_H_
+#define	_RSRQ_RangeEUTRA_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RSRQ-RangeEUTRA */
+typedef long	 RSRQ_RangeEUTRA_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RSRQ_RangeEUTRA_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RSRQ_RangeEUTRA;
+asn_struct_free_f RSRQ_RangeEUTRA_free;
+asn_struct_print_f RSRQ_RangeEUTRA_print;
+asn_constr_check_f RSRQ_RangeEUTRA_constraint;
+ber_type_decoder_f RSRQ_RangeEUTRA_decode_ber;
+der_type_encoder_f RSRQ_RangeEUTRA_encode_der;
+xer_type_decoder_f RSRQ_RangeEUTRA_decode_xer;
+xer_type_encoder_f RSRQ_RangeEUTRA_encode_xer;
+oer_type_decoder_f RSRQ_RangeEUTRA_decode_oer;
+oer_type_encoder_f RSRQ_RangeEUTRA_encode_oer;
+per_type_decoder_f RSRQ_RangeEUTRA_decode_uper;
+per_type_encoder_f RSRQ_RangeEUTRA_encode_uper;
+per_type_decoder_f RSRQ_RangeEUTRA_decode_aper;
+per_type_encoder_f RSRQ_RangeEUTRA_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RSRQ_RangeEUTRA_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/RT-Period-IE.h b/e2sm/headers/RT-Period-IE.h
new file mode 100644
index 0000000..33bcf46
--- /dev/null
+++ b/e2sm/headers/RT-Period-IE.h
@@ -0,0 +1,74 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_RT_Period_IE_H_
+#define	_RT_Period_IE_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RT_Period_IE {
+	RT_Period_IE_ms10	= 0,
+	RT_Period_IE_ms20	= 1,
+	RT_Period_IE_ms32	= 2,
+	RT_Period_IE_ms40	= 3,
+	RT_Period_IE_ms60	= 4,
+	RT_Period_IE_ms64	= 5,
+	RT_Period_IE_ms70	= 6,
+	RT_Period_IE_ms80	= 7,
+	RT_Period_IE_ms128	= 8,
+	RT_Period_IE_ms160	= 9,
+	RT_Period_IE_ms256	= 10,
+	RT_Period_IE_ms320	= 11,
+	RT_Period_IE_ms512	= 12,
+	RT_Period_IE_ms640	= 13,
+	RT_Period_IE_ms1024	= 14,
+	RT_Period_IE_ms1280	= 15,
+	RT_Period_IE_ms2048	= 16,
+	RT_Period_IE_ms2560	= 17,
+	RT_Period_IE_ms5120	= 18,
+	RT_Period_IE_ms10240	= 19
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RT_Period_IE;
+
+/* RT-Period-IE */
+typedef long	 RT_Period_IE_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RT_Period_IE_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RT_Period_IE;
+extern const asn_INTEGER_specifics_t asn_SPC_RT_Period_IE_specs_1;
+asn_struct_free_f RT_Period_IE_free;
+asn_struct_print_f RT_Period_IE_print;
+asn_constr_check_f RT_Period_IE_constraint;
+ber_type_decoder_f RT_Period_IE_decode_ber;
+der_type_encoder_f RT_Period_IE_encode_der;
+xer_type_decoder_f RT_Period_IE_decode_xer;
+xer_type_encoder_f RT_Period_IE_encode_xer;
+oer_type_decoder_f RT_Period_IE_decode_oer;
+oer_type_encoder_f RT_Period_IE_encode_oer;
+per_type_decoder_f RT_Period_IE_decode_uper;
+per_type_encoder_f RT_Period_IE_encode_uper;
+per_type_decoder_f RT_Period_IE_decode_aper;
+per_type_encoder_f RT_Period_IE_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RT_Period_IE_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ResultsPerCSI-RS-Index.h b/e2sm/headers/ResultsPerCSI-RS-Index.h
new file mode 100644
index 0000000..ba43d10
--- /dev/null
+++ b/e2sm/headers/ResultsPerCSI-RS-Index.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ResultsPerCSI_RS_Index_H_
+#define	_ResultsPerCSI_RS_Index_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "CSI-RS-Index.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasQuantityResults;
+
+/* ResultsPerCSI-RS-Index */
+typedef struct ResultsPerCSI_RS_Index {
+	CSI_RS_Index_t	 csi_RS_Index;
+	struct MeasQuantityResults	*csi_RS_Results;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResultsPerCSI_RS_Index_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResultsPerCSI_RS_Index;
+extern asn_SEQUENCE_specifics_t asn_SPC_ResultsPerCSI_RS_Index_specs_1;
+extern asn_TYPE_member_t asn_MBR_ResultsPerCSI_RS_Index_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResultsPerCSI_RS_Index_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ResultsPerCSI-RS-IndexList.h b/e2sm/headers/ResultsPerCSI-RS-IndexList.h
new file mode 100644
index 0000000..5cde4f3
--- /dev/null
+++ b/e2sm/headers/ResultsPerCSI-RS-IndexList.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ResultsPerCSI_RS_IndexList_H_
+#define	_ResultsPerCSI_RS_IndexList_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ResultsPerCSI_RS_Index;
+
+/* ResultsPerCSI-RS-IndexList */
+typedef struct ResultsPerCSI_RS_IndexList {
+	A_SEQUENCE_OF(struct ResultsPerCSI_RS_Index) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResultsPerCSI_RS_IndexList_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResultsPerCSI_RS_IndexList;
+extern asn_SET_OF_specifics_t asn_SPC_ResultsPerCSI_RS_IndexList_specs_1;
+extern asn_TYPE_member_t asn_MBR_ResultsPerCSI_RS_IndexList_1[1];
+extern asn_per_constraints_t asn_PER_type_ResultsPerCSI_RS_IndexList_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResultsPerCSI_RS_IndexList_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ResultsPerSSB-Index.h b/e2sm/headers/ResultsPerSSB-Index.h
new file mode 100644
index 0000000..df936b6
--- /dev/null
+++ b/e2sm/headers/ResultsPerSSB-Index.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ResultsPerSSB_Index_H_
+#define	_ResultsPerSSB_Index_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "SSB-Index.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct MeasQuantityResults;
+
+/* ResultsPerSSB-Index */
+typedef struct ResultsPerSSB_Index {
+	SSB_Index_t	 ssb_Index;
+	struct MeasQuantityResults	*ssb_Results;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResultsPerSSB_Index_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResultsPerSSB_Index;
+extern asn_SEQUENCE_specifics_t asn_SPC_ResultsPerSSB_Index_specs_1;
+extern asn_TYPE_member_t asn_MBR_ResultsPerSSB_Index_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResultsPerSSB_Index_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ResultsPerSSB-IndexList.h b/e2sm/headers/ResultsPerSSB-IndexList.h
new file mode 100644
index 0000000..209f40c
--- /dev/null
+++ b/e2sm/headers/ResultsPerSSB-IndexList.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ResultsPerSSB_IndexList_H_
+#define	_ResultsPerSSB_IndexList_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ResultsPerSSB_Index;
+
+/* ResultsPerSSB-IndexList */
+typedef struct ResultsPerSSB_IndexList {
+	A_SEQUENCE_OF(struct ResultsPerSSB_Index) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResultsPerSSB_IndexList_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResultsPerSSB_IndexList;
+extern asn_SET_OF_specifics_t asn_SPC_ResultsPerSSB_IndexList_specs_1;
+extern asn_TYPE_member_t asn_MBR_ResultsPerSSB_IndexList_1[1];
+extern asn_per_constraints_t asn_PER_type_ResultsPerSSB_IndexList_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResultsPerSSB_IndexList_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/S-NSSAI.h b/e2sm/headers/S-NSSAI.h
new file mode 100644
index 0000000..c379f99
--- /dev/null
+++ b/e2sm/headers/S-NSSAI.h
@@ -0,0 +1,41 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_S_NSSAI_H_
+#define	_S_NSSAI_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* S-NSSAI */
+typedef struct S_NSSAI {
+	OCTET_STRING_t	 sST;
+	OCTET_STRING_t	*sD;	/* OPTIONAL */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} S_NSSAI_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_S_NSSAI;
+extern asn_SEQUENCE_specifics_t asn_SPC_S_NSSAI_specs_1;
+extern asn_TYPE_member_t asn_MBR_S_NSSAI_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _S_NSSAI_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/SINR-Range.h b/e2sm/headers/SINR-Range.h
new file mode 100644
index 0000000..8caa08b
--- /dev/null
+++ b/e2sm/headers/SINR-Range.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_SINR_Range_H_
+#define	_SINR_Range_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* SINR-Range */
+typedef long	 SINR_Range_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_SINR_Range_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_SINR_Range;
+asn_struct_free_f SINR_Range_free;
+asn_struct_print_f SINR_Range_print;
+asn_constr_check_f SINR_Range_constraint;
+ber_type_decoder_f SINR_Range_decode_ber;
+der_type_encoder_f SINR_Range_encode_der;
+xer_type_decoder_f SINR_Range_decode_xer;
+xer_type_encoder_f SINR_Range_encode_xer;
+oer_type_decoder_f SINR_Range_decode_oer;
+oer_type_encoder_f SINR_Range_encode_oer;
+per_type_decoder_f SINR_Range_decode_uper;
+per_type_encoder_f SINR_Range_encode_uper;
+per_type_decoder_f SINR_Range_decode_aper;
+per_type_encoder_f SINR_Range_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _SINR_Range_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/SINR-RangeEUTRA.h b/e2sm/headers/SINR-RangeEUTRA.h
new file mode 100644
index 0000000..5cbb7dc
--- /dev/null
+++ b/e2sm/headers/SINR-RangeEUTRA.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_SINR_RangeEUTRA_H_
+#define	_SINR_RangeEUTRA_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* SINR-RangeEUTRA */
+typedef long	 SINR_RangeEUTRA_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_SINR_RangeEUTRA_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_SINR_RangeEUTRA;
+asn_struct_free_f SINR_RangeEUTRA_free;
+asn_struct_print_f SINR_RangeEUTRA_print;
+asn_constr_check_f SINR_RangeEUTRA_constraint;
+ber_type_decoder_f SINR_RangeEUTRA_decode_ber;
+der_type_encoder_f SINR_RangeEUTRA_encode_der;
+xer_type_decoder_f SINR_RangeEUTRA_decode_xer;
+xer_type_encoder_f SINR_RangeEUTRA_encode_xer;
+oer_type_decoder_f SINR_RangeEUTRA_decode_oer;
+oer_type_encoder_f SINR_RangeEUTRA_encode_oer;
+per_type_decoder_f SINR_RangeEUTRA_decode_uper;
+per_type_encoder_f SINR_RangeEUTRA_encode_uper;
+per_type_decoder_f SINR_RangeEUTRA_decode_aper;
+per_type_encoder_f SINR_RangeEUTRA_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _SINR_RangeEUTRA_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/SSB-Index.h b/e2sm/headers/SSB-Index.h
new file mode 100644
index 0000000..3d9d6fc
--- /dev/null
+++ b/e2sm/headers/SSB-Index.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_SSB_Index_H_
+#define	_SSB_Index_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* SSB-Index */
+typedef long	 SSB_Index_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_SSB_Index_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_SSB_Index;
+asn_struct_free_f SSB_Index_free;
+asn_struct_print_f SSB_Index_print;
+asn_constr_check_f SSB_Index_constraint;
+ber_type_decoder_f SSB_Index_decode_ber;
+der_type_encoder_f SSB_Index_encode_der;
+xer_type_decoder_f SSB_Index_decode_xer;
+xer_type_encoder_f SSB_Index_encode_xer;
+oer_type_decoder_f SSB_Index_decode_oer;
+oer_type_encoder_f SSB_Index_encode_oer;
+per_type_decoder_f SSB_Index_decode_uper;
+per_type_encoder_f SSB_Index_encode_uper;
+per_type_decoder_f SSB_Index_decode_aper;
+per_type_encoder_f SSB_Index_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _SSB_Index_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ServCellIndex.h b/e2sm/headers/ServCellIndex.h
new file mode 100644
index 0000000..27f2d62
--- /dev/null
+++ b/e2sm/headers/ServCellIndex.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ServCellIndex_H_
+#define	_ServCellIndex_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ServCellIndex */
+typedef long	 ServCellIndex_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_ServCellIndex_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ServCellIndex;
+asn_struct_free_f ServCellIndex_free;
+asn_struct_print_f ServCellIndex_print;
+asn_constr_check_f ServCellIndex_constraint;
+ber_type_decoder_f ServCellIndex_decode_ber;
+der_type_encoder_f ServCellIndex_encode_der;
+xer_type_decoder_f ServCellIndex_decode_xer;
+xer_type_encoder_f ServCellIndex_encode_xer;
+oer_type_decoder_f ServCellIndex_decode_oer;
+oer_type_encoder_f ServCellIndex_encode_oer;
+per_type_decoder_f ServCellIndex_decode_uper;
+per_type_encoder_f ServCellIndex_encode_uper;
+per_type_decoder_f ServCellIndex_decode_aper;
+per_type_encoder_f ServCellIndex_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ServCellIndex_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ServedPlmnPerCellListItem.h b/e2sm/headers/ServedPlmnPerCellListItem.h
new file mode 100644
index 0000000..fbde179
--- /dev/null
+++ b/e2sm/headers/ServedPlmnPerCellListItem.h
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ServedPlmnPerCellListItem_H_
+#define	_ServedPlmnPerCellListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct FGC_DU_PM_Container;
+struct EPC_DU_PM_Container;
+
+/* ServedPlmnPerCellListItem */
+typedef struct ServedPlmnPerCellListItem {
+	PLMN_Identity_t	 pLMN_Identity;
+	struct FGC_DU_PM_Container	*du_PM_5GC;	/* OPTIONAL */
+	struct EPC_DU_PM_Container	*du_PM_EPC;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ServedPlmnPerCellListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ServedPlmnPerCellListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_ServedPlmnPerCellListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_ServedPlmnPerCellListItem_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ServedPlmnPerCellListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/ServingCellMeasurements.h b/e2sm/headers/ServingCellMeasurements.h
new file mode 100644
index 0000000..22f8aa2
--- /dev/null
+++ b/e2sm/headers/ServingCellMeasurements.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_ServingCellMeasurements_H_
+#define	_ServingCellMeasurements_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ServingCellMeasurements_PR {
+	ServingCellMeasurements_PR_NOTHING,	/* No components present */
+	ServingCellMeasurements_PR_nr_measResultServingMOList,
+	ServingCellMeasurements_PR_eutra_measResultPCell
+	/* Extensions may appear below */
+	
+} ServingCellMeasurements_PR;
+
+/* Forward declarations */
+struct MeasResultServMOList;
+struct MeasResultPCell;
+
+/* ServingCellMeasurements */
+typedef struct ServingCellMeasurements {
+	ServingCellMeasurements_PR present;
+	union ServingCellMeasurements_u {
+		struct MeasResultServMOList	*nr_measResultServingMOList;
+		struct MeasResultPCell	*eutra_measResultPCell;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ServingCellMeasurements_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ServingCellMeasurements;
+extern asn_CHOICE_specifics_t asn_SPC_ServingCellMeasurements_specs_1;
+extern asn_TYPE_member_t asn_MBR_ServingCellMeasurements_1[2];
+extern asn_per_constraints_t asn_PER_type_ServingCellMeasurements_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ServingCellMeasurements_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/SlicePerPlmnPerCellListItem.h b/e2sm/headers/SlicePerPlmnPerCellListItem.h
new file mode 100644
index 0000000..406a845
--- /dev/null
+++ b/e2sm/headers/SlicePerPlmnPerCellListItem.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_SlicePerPlmnPerCellListItem_H_
+#define	_SlicePerPlmnPerCellListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "S-NSSAI.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct FQIPERSlicesPerPlmnPerCellListItem;
+
+/* SlicePerPlmnPerCellListItem */
+typedef struct SlicePerPlmnPerCellListItem {
+	S_NSSAI_t	 sliceID;
+	struct SlicePerPlmnPerCellListItem__fQIPERSlicesPerPlmnPerCellList {
+		A_SEQUENCE_OF(struct FQIPERSlicesPerPlmnPerCellListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} fQIPERSlicesPerPlmnPerCellList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} SlicePerPlmnPerCellListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_SlicePerPlmnPerCellListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_SlicePerPlmnPerCellListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_SlicePerPlmnPerCellListItem_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _SlicePerPlmnPerCellListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/SliceToReportListItem.h b/e2sm/headers/SliceToReportListItem.h
new file mode 100644
index 0000000..9bc8c7e
--- /dev/null
+++ b/e2sm/headers/SliceToReportListItem.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_SliceToReportListItem_H_
+#define	_SliceToReportListItem_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "S-NSSAI.h"
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct FQIPERSlicesPerPlmnListItem;
+
+/* SliceToReportListItem */
+typedef struct SliceToReportListItem {
+	S_NSSAI_t	 sliceID;
+	struct SliceToReportListItem__fQIPERSlicesPerPlmnList {
+		A_SEQUENCE_OF(struct FQIPERSlicesPerPlmnListItem) list;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} fQIPERSlicesPerPlmnList;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} SliceToReportListItem_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_SliceToReportListItem;
+extern asn_SEQUENCE_specifics_t asn_SPC_SliceToReportListItem_specs_1;
+extern asn_TYPE_member_t asn_MBR_SliceToReportListItem_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _SliceToReportListItem_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/TimeStamp.h b/e2sm/headers/TimeStamp.h
new file mode 100644
index 0000000..71f9724
--- /dev/null
+++ b/e2sm/headers/TimeStamp.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_TimeStamp_H_
+#define	_TimeStamp_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* TimeStamp */
+typedef OCTET_STRING_t	 TimeStamp_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_TimeStamp_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_TimeStamp;
+asn_struct_free_f TimeStamp_free;
+asn_struct_print_f TimeStamp_print;
+asn_constr_check_f TimeStamp_constraint;
+ber_type_decoder_f TimeStamp_decode_ber;
+der_type_encoder_f TimeStamp_encode_der;
+xer_type_decoder_f TimeStamp_decode_xer;
+xer_type_encoder_f TimeStamp_encode_xer;
+oer_type_decoder_f TimeStamp_decode_oer;
+oer_type_encoder_f TimeStamp_encode_oer;
+per_type_decoder_f TimeStamp_decode_uper;
+per_type_encoder_f TimeStamp_encode_uper;
+per_type_decoder_f TimeStamp_decode_aper;
+per_type_encoder_f TimeStamp_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TimeStamp_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/Trigger-ConditionIE-Item.h b/e2sm/headers/Trigger-ConditionIE-Item.h
new file mode 100644
index 0000000..fda0039
--- /dev/null
+++ b/e2sm/headers/Trigger-ConditionIE-Item.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_Trigger_ConditionIE_Item_H_
+#define	_Trigger_ConditionIE_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RT-Period-IE.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Trigger-ConditionIE-Item */
+typedef struct Trigger_ConditionIE_Item {
+	RT_Period_IE_t	 report_Period_IE;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} Trigger_ConditionIE_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_Trigger_ConditionIE_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_Trigger_ConditionIE_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_Trigger_ConditionIE_Item_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Trigger_ConditionIE_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/TriggeringMessage.h b/e2sm/headers/TriggeringMessage.h
new file mode 100644
index 0000000..c2c1987
--- /dev/null
+++ b/e2sm/headers/TriggeringMessage.h
@@ -0,0 +1,52 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_TriggeringMessage_H_
+#define	_TriggeringMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum TriggeringMessage {
+	TriggeringMessage_initiating_message	= 0,
+	TriggeringMessage_successful_outcome	= 1,
+	TriggeringMessage_unsuccessfull_outcome	= 2
+} e_TriggeringMessage;
+
+/* TriggeringMessage */
+typedef long	 TriggeringMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_TriggeringMessage;
+asn_struct_free_f TriggeringMessage_free;
+asn_struct_print_f TriggeringMessage_print;
+asn_constr_check_f TriggeringMessage_constraint;
+ber_type_decoder_f TriggeringMessage_decode_ber;
+der_type_encoder_f TriggeringMessage_encode_der;
+xer_type_decoder_f TriggeringMessage_decode_xer;
+xer_type_encoder_f TriggeringMessage_encode_xer;
+oer_type_decoder_f TriggeringMessage_decode_oer;
+oer_type_encoder_f TriggeringMessage_encode_oer;
+per_type_decoder_f TriggeringMessage_decode_uper;
+per_type_encoder_f TriggeringMessage_encode_uper;
+per_type_decoder_f TriggeringMessage_decode_aper;
+per_type_encoder_f TriggeringMessage_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TriggeringMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/UE-Identity.h b/e2sm/headers/UE-Identity.h
new file mode 100644
index 0000000..9f62ee5
--- /dev/null
+++ b/e2sm/headers/UE-Identity.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#ifndef	_UE_Identity_H_
+#define	_UE_Identity_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* UE-Identity */
+typedef OCTET_STRING_t	 UE_Identity_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_UE_Identity;
+asn_struct_free_f UE_Identity_free;
+asn_struct_print_f UE_Identity_print;
+asn_constr_check_f UE_Identity_constraint;
+ber_type_decoder_f UE_Identity_decode_ber;
+der_type_encoder_f UE_Identity_encode_der;
+xer_type_decoder_f UE_Identity_decode_xer;
+xer_type_encoder_f UE_Identity_encode_xer;
+oer_type_decoder_f UE_Identity_decode_oer;
+oer_type_encoder_f UE_Identity_encode_oer;
+per_type_decoder_f UE_Identity_decode_uper;
+per_type_encoder_f UE_Identity_encode_uper;
+per_type_decoder_f UE_Identity_decode_aper;
+per_type_encoder_f UE_Identity_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _UE_Identity_H_ */
+#include <asn_internal.h>
diff --git a/e2sm/headers/asn_SEQUENCE_OF.h b/e2sm/headers/asn_SEQUENCE_OF.h
new file mode 100644
index 0000000..e35bc44
--- /dev/null
+++ b/e2sm/headers/asn_SEQUENCE_OF.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_SEQUENCE_OF_H
+#define	ASN_SEQUENCE_OF_H
+
+#include <asn_SET_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * SEQUENCE OF is the same as SET OF with a tiny difference:
+ * the delete operation preserves the initial order of elements
+ * and thus MAY operate in non-constant time.
+ */
+#define	A_SEQUENCE_OF(type)	A_SET_OF(type)
+
+#define	ASN_SEQUENCE_ADD(headptr, ptr)		\
+	asn_sequence_add((headptr), (ptr))
+
+/***********************************************
+ * Implementation of the SEQUENCE OF structure.
+ */
+
+#define	asn_sequence_add	asn_set_add
+#define	asn_sequence_empty	asn_set_empty
+
+/*
+ * Delete the element from the set by its number (base 0).
+ * This is NOT a constant-time operation.
+ * The order of elements is preserved.
+ * If _do_free is given AND the (*free) is initialized, the element
+ * will be freed using the custom (*free) function as well.
+ */
+void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free);
+
+/*
+ * Cope with different conversions requirements to/from void in C and C++.
+ * This is mostly useful for support library.
+ */
+typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_;
+#define _A_SEQUENCE_FROM_VOID(ptr)	((asn_anonymous_sequence_ *)(ptr))
+#define _A_CSEQUENCE_FROM_VOID(ptr) 	((const asn_anonymous_sequence_ *)(ptr))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_SEQUENCE_OF_H */
diff --git a/e2sm/headers/asn_SET_OF.h b/e2sm/headers/asn_SET_OF.h
new file mode 100644
index 0000000..882e1a4
--- /dev/null
+++ b/e2sm/headers/asn_SET_OF.h
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_SET_OF_H
+#define	ASN_SET_OF_H
+
+#ifdef __cplusplus
+#define A_SET_OF(type)                   \
+    struct {                             \
+        type **array;                    \
+        int count; /* Meaningful size */ \
+        int size;  /* Allocated size */  \
+        void (*free)(decltype(*array));  \
+    }
+#else   /* C */
+#define A_SET_OF(type)                   \
+    struct {                             \
+        type **array;                    \
+        int count; /* Meaningful size */ \
+        int size;  /* Allocated size */  \
+        void (*free)(type *);    \
+    }
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define	ASN_SET_ADD(headptr, ptr)		\
+	asn_set_add((headptr), (ptr))
+
+/*******************************************
+ * Implementation of the SET OF structure.
+ */
+
+/*
+ * Add another structure into the set by its pointer.
+ * RETURN VALUES:
+ * 0 for success and -1/errno for failure.
+ */
+int  asn_set_add(void *asn_set_of_x, void *ptr);
+
+/*
+ * Delete the element from the set by its number (base 0).
+ * This is a constant-time operation. The order of elements before the
+ * deleted ones is guaranteed, the order of elements after the deleted
+ * one is NOT guaranteed.
+ * If _do_free is given AND the (*free) is initialized, the element
+ * will be freed using the custom (*free) function as well.
+ */
+void asn_set_del(void *asn_set_of_x, int number, int _do_free);
+
+/*
+ * Empty the contents of the set. Will free the elements, if (*free) is given.
+ * Will NOT free the set itself.
+ */
+void asn_set_empty(void *asn_set_of_x);
+
+/*
+ * Cope with different conversions requirements to/from void in C and C++.
+ * This is mostly useful for support library.
+ */
+typedef A_SET_OF(void) asn_anonymous_set_;
+#define _A_SET_FROM_VOID(ptr)		((asn_anonymous_set_ *)(ptr))
+#define _A_CSET_FROM_VOID(ptr)		((const asn_anonymous_set_ *)(ptr))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_SET_OF_H */
diff --git a/e2sm/headers/asn_application.h b/e2sm/headers/asn_application.h
new file mode 100644
index 0000000..034f646
--- /dev/null
+++ b/e2sm/headers/asn_application.h
@@ -0,0 +1,171 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Application-level ASN.1 callbacks.
+ */
+#ifndef	ASN_APPLICATION_H
+#define	ASN_APPLICATION_H
+
+#include "asn_system.h"		/* for platform-dependent types */
+#include "asn_codecs.h"		/* for ASN.1 codecs specifics */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * A selection of ASN.1 Transfer Syntaxes to use with generalized
+ * encoders and decoders declared further in this .h file.
+ */
+enum asn_transfer_syntax {
+    /* Avoid appearance of a default transfer syntax. */
+    ATS_INVALID = 0,
+    /* Plaintext output (not conforming to any standard), for debugging. */
+    ATS_NONSTANDARD_PLAINTEXT,
+    /* Returns a randomly generated structure. */
+    ATS_RANDOM,
+    /*
+     * X.690:
+     * BER: Basic Encoding Rules.
+     * DER: Distinguished Encoding Rules.
+     * CER: Canonical Encoding Rules.
+     * DER and CER are more strict variants of BER.
+     */
+    ATS_BER,
+    ATS_DER,
+    ATS_CER, /* Only decoding is supported */
+    /*
+     * X.696:
+     * OER: Octet Encoding Rules.
+     * CANONICAL-OER is a more strict variant of BASIC-OER.
+     */
+    ATS_BASIC_OER,
+    ATS_CANONICAL_OER,
+    /*
+     * X.691:
+     * PER: Packed Encoding Rules.
+     * CANONICAL-PER is a more strict variant of BASIC-PER.
+     * NOTE: Produces or consumes a complete encoding (X.691 (08/2015) #11.1).
+     */
+    ATS_UNALIGNED_BASIC_PER,
+    ATS_UNALIGNED_CANONICAL_PER,
+    ATS_ALIGNED_BASIC_PER,
+    ATS_ALIGNED_CANONICAL_PER,
+    /*
+     * X.693:
+     * XER: XML Encoding Rules.
+     * CANONICAL-XER is a more strict variant of BASIC-XER.
+     */
+    ATS_BASIC_XER,
+    ATS_CANONICAL_XER
+};
+
+/*
+ * A generic encoder for any supported transfer syntax.
+ * RETURN VALUES:
+ * The (.encoded) field of the return value is REDEFINED to mean the following:
+ * >=0: The computed size of the encoded data. Can exceed the (buffer_size).
+ *  -1: Error encoding the structure. See the error code in (errno):
+ *      EINVAL: Incorrect parameters to the function, such as NULLs.
+ *      ENOENT: Encoding transfer syntax is not defined (for this type).
+ *      EBADF:  The structure has invalid form or content constraint failed.
+ *      The (.failed_type) and (.structure_ptr) MIGHT be set to the appropriate
+ *      values at the place of failure, if at all possible.
+ * WARNING: The (.encoded) field of the return value can exceed the buffer_size.
+ * This is similar to snprintf(3) contract which might return values
+ * greater than the buffer size.
+ */
+asn_enc_rval_t asn_encode_to_buffer(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode, void *buffer, size_t buffer_size);
+
+/*
+ * A variant of asn_encode_to_buffer() with automatically allocated buffer.
+ * RETURN VALUES:
+ * On success, returns a newly allocated (.buffer) containing the whole message.
+ * The message size is returned in (.result.encoded).
+ * On failure:
+ *  (.buffer) is NULL,
+ *  (.result.encoded) as in asn_encode_to_buffer(),
+ *  The errno codes as in asn_encode_to_buffer(), plus the following:
+ *      ENOMEM: Memory allocation failed due to system or internal limits.
+ * The user is responsible for freeing the (.buffer).
+ */
+typedef struct asn_encode_to_new_buffer_result_s {
+    void *buffer;   /* NULL if failed to encode. */
+    asn_enc_rval_t result;
+} asn_encode_to_new_buffer_result_t;
+asn_encode_to_new_buffer_result_t asn_encode_to_new_buffer(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode);
+
+
+/*
+ * Generic type of an application-defined callback to return various
+ * types of data to the application.
+ * EXPECTED RETURN VALUES:
+ *  -1: Failed to consume bytes. Abort the mission.
+ * Non-negative return values indicate success, and ignored.
+ */
+typedef int(asn_app_consume_bytes_f)(const void *buffer, size_t size,
+                                     void *application_specific_key);
+
+
+/*
+ * A generic encoder for any supported transfer syntax.
+ * Returns the comprehensive encoding result descriptor (see asn_codecs.h).
+ * RETURN VALUES:
+ * The negative (.encoded) field of the return values is accompanied with the
+ * following error codes (errno):
+ *      EINVAL: Incorrect parameters to the function, such as NULLs.
+ *      ENOENT: Encoding transfer syntax is not defined (for this type).
+ *      EBADF:  The structure has invalid form or content constraint failed.
+ *      EIO:    The (callback) has returned negative value during encoding.
+ */
+asn_enc_rval_t asn_encode(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode,
+    asn_app_consume_bytes_f *callback, void *callback_key);
+
+
+/*
+ * A generic decoder for any supported transfer syntax.
+ */
+asn_dec_rval_t asn_decode(
+    const asn_codec_ctx_t *opt_codec_parameters, enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_decode,
+    void **structure_ptr, /* Pointer to a target structure's pointer */
+    const void *buffer,   /* Data to be decoded */
+    size_t size           /* Size of that buffer */
+);
+
+
+/*
+ * A callback of this type is called whenever constraint validation fails
+ * on some ASN.1 type. See "constraints.h" for more details on constraint
+ * validation.
+ * This callback specifies a descriptor of the ASN.1 type which failed
+ * the constraint check, as well as human readable message on what
+ * particular constraint has failed.
+ */
+typedef void (asn_app_constraint_failed_f)(void *application_specific_key,
+	const struct asn_TYPE_descriptor_s *type_descriptor_which_failed,
+	const void *structure_which_failed_ptr,
+	const char *error_message_format, ...) CC_PRINTFLIKE(4, 5);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#include "constr_TYPE.h"	/* for asn_TYPE_descriptor_t */
+
+#endif	/* ASN_APPLICATION_H */
diff --git a/e2sm/headers/asn_bit_data.h b/e2sm/headers/asn_bit_data.h
new file mode 100644
index 0000000..59de7af
--- /dev/null
+++ b/e2sm/headers/asn_bit_data.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_BIT_DATA
+#define	ASN_BIT_DATA
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This structure describes a position inside an incoming PER bit stream.
+ */
+typedef struct asn_bit_data_s {
+  const uint8_t *buffer;  /* Pointer to the octet stream */
+         size_t  nboff;   /* Bit offset to the meaningful bit */
+         size_t  nbits;   /* Number of bits in the stream */
+         size_t  moved;   /* Number of bits moved through this bit stream */
+  int (*refill)(struct asn_bit_data_s *);
+  void *refill_key;
+} asn_bit_data_t;
+
+/*
+ * Create a contiguous non-refillable bit data structure.
+ * Can be freed by FREEMEM().
+ */
+asn_bit_data_t *asn_bit_data_new_contiguous(const void *data, size_t size_bits);
+
+/*
+ * Extract a small number of bits (<= 31) from the specified PER data pointer.
+ * This function returns -1 if the specified number of bits could not be
+ * extracted due to EOD or other conditions.
+ */
+int32_t asn_get_few_bits(asn_bit_data_t *, int get_nbits);
+
+/* Undo the immediately preceeding "get_few_bits" operation */
+void asn_get_undo(asn_bit_data_t *, int get_nbits);
+
+/*
+ * Extract a large number of bits from the specified PER data pointer.
+ * This function returns -1 if the specified number of bits could not be
+ * extracted due to EOD or other conditions.
+ */
+int asn_get_many_bits(asn_bit_data_t *, uint8_t *dst, int right_align,
+			int get_nbits);
+
+/* Non-thread-safe debugging function, don't use it */
+char *asn_bit_data_string(asn_bit_data_t *);
+
+/*
+ * This structure supports forming bit output.
+ */
+typedef struct asn_bit_outp_s {
+	uint8_t *buffer;	/* Pointer into the (tmpspace) */
+	size_t nboff;		/* Bit offset to the meaningful bit */
+	size_t nbits;		/* Number of bits left in (tmpspace) */
+	uint8_t tmpspace[32];	/* Preliminary storage to hold data */
+	int (*output)(const void *data, size_t size, void *op_key);
+	void *op_key;		/* Key for (output) data callback */
+	size_t flushed_bytes;	/* Bytes already flushed through (output) */
+} asn_bit_outp_t;
+
+/* Output a small number of bits (<= 31) */
+int asn_put_few_bits(asn_bit_outp_t *, uint32_t bits, int obits);
+
+/* Output a large number of bits */
+int asn_put_many_bits(asn_bit_outp_t *, const uint8_t *src, int put_nbits);
+
+/*
+ * Flush whole bytes (0 or more) through (outper) member.
+ * The least significant bits which are not used are guaranteed to be set to 0.
+ * Returns -1 if callback returns -1. Otherwise, 0.
+ */
+int asn_put_aligned_flush(asn_bit_outp_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_BIT_DATA */
diff --git a/e2sm/headers/asn_codecs.h b/e2sm/headers/asn_codecs.h
new file mode 100644
index 0000000..e75c270
--- /dev/null
+++ b/e2sm/headers/asn_codecs.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_CODECS_H
+#define	ASN_CODECS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * This structure defines a set of parameters that may be passed
+ * to every ASN.1 encoder or decoder function.
+ * WARNING: if max_stack_size member is set, and you are calling the
+ *   function pointers of the asn_TYPE_descriptor_t directly,
+ *   this structure must be ALLOCATED ON THE STACK!
+ *   If you can't always satisfy this requirement, use ber_decode(),
+ *   xer_decode() and uper_decode() functions instead.
+ */
+typedef struct asn_codec_ctx_s {
+	/*
+	 * Limit the decoder routines to use no (much) more stack than a given
+	 * number of bytes. Most of decoders are stack-based, and this
+	 * would protect against stack overflows if the number of nested
+	 * encodings is high.
+	 * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based,
+	 * and are safe from this kind of overflow.
+	 * A value from getrlimit(RLIMIT_STACK) may be used to initialize
+	 * this variable. Be careful in multithreaded environments, as the
+	 * stack size is rather limited.
+	 */
+	size_t  max_stack_size; /* 0 disables stack bounds checking */
+} asn_codec_ctx_t;
+
+/*
+ * Type of the return value of the encoding functions (der_encode, xer_encode).
+ */
+typedef struct asn_enc_rval_s {
+	/*
+	 * Number of bytes encoded.
+	 * -1 indicates failure to encode the structure.
+	 * In this case, the members below this one are meaningful.
+	 */
+	ssize_t encoded;
+
+	/*
+	 * Members meaningful when (encoded == -1), for post mortem analysis.
+	 */
+
+	/* Type which cannot be encoded */
+	const struct asn_TYPE_descriptor_s *failed_type;
+
+	/* Pointer to the structure of that type */
+	const void *structure_ptr;
+} asn_enc_rval_t;
+#define	ASN__ENCODE_FAILED do {					\
+	asn_enc_rval_t tmp_error;				\
+	tmp_error.encoded = -1;					\
+	tmp_error.failed_type = td;				\
+	tmp_error.structure_ptr = sptr;				\
+	ASN_DEBUG("Failed to encode element %s", td ? td->name : "");	\
+	return tmp_error;					\
+} while(0)
+#define	ASN__ENCODED_OK(rval) do {				\
+	rval.structure_ptr = 0;					\
+	rval.failed_type = 0;					\
+	return rval;						\
+} while(0)
+
+/*
+ * Type of the return value of the decoding functions (ber_decode, xer_decode)
+ * 
+ * Please note that the number of consumed bytes is ALWAYS meaningful,
+ * even if code==RC_FAIL. This is to indicate the number of successfully
+ * decoded bytes, hence providing a possibility to fail with more diagnostics
+ * (i.e., print the offending remainder of the buffer).
+ */
+enum asn_dec_rval_code_e {
+	RC_OK,		/* Decoded successfully */
+	RC_WMORE,	/* More data expected, call again */
+	RC_FAIL		/* Failure to decode data */
+};
+typedef struct asn_dec_rval_s {
+	enum asn_dec_rval_code_e code;	/* Result code */
+	size_t consumed;		/* Number of bytes consumed */
+} asn_dec_rval_t;
+#define	ASN__DECODE_FAILED do {					\
+	asn_dec_rval_t tmp_error;				\
+	tmp_error.code = RC_FAIL;				\
+	tmp_error.consumed = 0;					\
+	ASN_DEBUG("Failed to decode element %s", td ? td->name : "");	\
+	return tmp_error;					\
+} while(0)
+#define	ASN__DECODE_STARVED do {				\
+	asn_dec_rval_t tmp_error;				\
+	tmp_error.code = RC_WMORE;				\
+	tmp_error.consumed = 0;					\
+	return tmp_error;					\
+} while(0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_CODECS_H */
diff --git a/e2sm/headers/asn_codecs_prim.h b/e2sm/headers/asn_codecs_prim.h
new file mode 100644
index 0000000..fbc5576
--- /dev/null
+++ b/e2sm/headers/asn_codecs_prim.h
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_CODECS_PRIM_H
+#define	ASN_CODECS_PRIM_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct ASN__PRIMITIVE_TYPE_s {
+    uint8_t *buf;   /* Buffer with consecutive primitive encoding bytes */
+    size_t size;    /* Size of the buffer */
+} ASN__PRIMITIVE_TYPE_t;	/* Do not use this type directly! */
+
+asn_struct_free_f ASN__PRIMITIVE_TYPE_free;
+ber_type_decoder_f ber_decode_primitive;
+der_type_encoder_f der_encode_primitive;
+
+/*
+ * A callback specification for the xer_decode_primitive() function below.
+ */
+enum xer_pbd_rval {
+    XPBD_SYSTEM_FAILURE,  /* System failure (memory shortage, etc) */
+    XPBD_DECODER_LIMIT,   /* Hit some decoder limitation or deficiency */
+    XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */
+    XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */
+    XPBD_BODY_CONSUMED    /* Body is recognized and consumed */
+};
+typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)(
+    const asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf,
+    size_t chunk_size);
+
+/*
+ * Specific function to decode simple primitive types.
+ * Also see xer_decode_general() in xer_decoder.h
+ */
+asn_dec_rval_t xer_decode_primitive(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+    size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size,
+    xer_primitive_body_decoder_f *prim_body_decoder);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_CODECS_PRIM_H */
diff --git a/e2sm/headers/asn_constant.h b/e2sm/headers/asn_constant.h
new file mode 100644
index 0000000..df0a143
--- /dev/null
+++ b/e2sm/headers/asn_constant.h
@@ -0,0 +1,40 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ */
+
+#ifndef _ASN_CONSTANT_H
+#define _ASN_CONSTANT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define maxCellReport (8)
+#define maxNrofSSBs_1 (63)
+#define maxNrofCSI_RS_ResourcesRRM_1 (95)
+#define maxNrofServingCells (32)
+#define maxNrofServingCells_1 (31)
+#define maxNrofIndexesToReport2 (64)
+#define maxnoofMeasurementInfo (65535)
+#define maxofMessageProtocolTests (15)
+#define maxnoofQCI (256)
+#define maxnoofQoSFlows (64)
+#define maxnoofSliceItems (1024)
+#define maxnoofContainerListItems (3)
+#define maxCellingNBDU (512)
+#define maxofContainers (8)
+#define maxPLMN (12)
+#define maxnoofUEs (65535)
+#define maxnoofPMMeasurements (2147483647)
+#define maxnoofRICStyles (63)
+#define maxnoofAssociatedRANInfo (4294967295)
+#define maxnoofParametersInStructure (4294967295)
+#define maxnoofItemsInList (4294967295)
+#define maxnoofControlAction (65535)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ASN_CONSTANT_H */
diff --git a/e2sm/headers/asn_internal.h b/e2sm/headers/asn_internal.h
new file mode 100644
index 0000000..c4105ad
--- /dev/null
+++ b/e2sm/headers/asn_internal.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Declarations internally useful for the ASN.1 support code.
+ */
+#ifndef	ASN_INTERNAL_H
+#define	ASN_INTERNAL_H
+#define __EXTENSIONS__          /* for Sun */
+
+#include "asn_application.h"	/* Application-visible API */
+
+#ifndef	__NO_ASSERT_H__		/* Include assert.h only for internal use. */
+#include <assert.h>		/* for assert() macro */
+#endif
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* Environment version might be used to avoid running with the old library */
+#define	ASN1C_ENVIRONMENT_VERSION	923	/* Compile-time version */
+int get_asn1c_environment_version(void);	/* Run-time version */
+
+#define	CALLOC(nmemb, size)	calloc(nmemb, size)
+#define	MALLOC(size)		malloc(size)
+#define	REALLOC(oldptr, size)	realloc(oldptr, size)
+#define	FREEMEM(ptr)		free(ptr)
+
+#define	asn_debug_indent	0
+#define ASN_DEBUG_INDENT_ADD(i) do{}while(0)
+
+#ifdef  EMIT_ASN_DEBUG
+#warning "Use ASN_EMIT_DEBUG instead of EMIT_ASN_DEBUG"
+#define ASN_EMIT_DEBUG  EMIT_ASN_DEBUG
+#endif
+
+/*
+ * A macro for debugging the ASN.1 internals.
+ * You may enable or override it.
+ */
+#ifndef	ASN_DEBUG	/* If debugging code is not defined elsewhere... */
+#if	ASN_EMIT_DEBUG == 1	/* And it was asked to emit this code... */
+#if !defined(BELL_LABS) /* Bell Labs */
+  //#if __STDC_VERSION__ >= 199901L
+#ifdef	ASN_THREAD_SAFE
+/* Thread safety requires sacrifice in output indentation:
+ * Retain empty definition of ASN_DEBUG_INDENT_ADD. */
+#else	/* !ASN_THREAD_SAFE */
+#undef  ASN_DEBUG_INDENT_ADD
+#undef  asn_debug_indent
+int asn_debug_indent;
+#define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0)
+#endif	/* ASN_THREAD_SAFE */
+#if defined(BELL_LABS) /* Bell Labs version */
+extern int logAsn1c(const char *filename, int linenumber, const char *format, ...);  
+#define	ASN_DEBUG(fmt, args...)	do {		        \
+    (void) logAsn1c(__FILE__, __LINE__, fmt, ##args);	\
+  } while(0)
+#else  
+#define	ASN_DEBUG(fmt, args...)	do {			\
+		int adi = asn_debug_indent;		\
+		while(adi--) fprintf(stderr, " ");	\
+		fprintf(stderr, fmt, ##args);		\
+		fprintf(stderr, " (%s:%d)\n",		\
+			__FILE__, __LINE__);		\
+	} while(0)
+#endif /* BELL_LABS */  
+#else	/* !C99 */
+void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...);
+#define	ASN_DEBUG	ASN_DEBUG_f
+#endif	/* C99 */
+#else	/* ASN_EMIT_DEBUG != 1 */
+#if __STDC_VERSION__ >= 199901L
+#define ASN_DEBUG(...) do{}while(0)
+#else   /* not C99 */
+static void CC_PRINTFLIKE(1, 2) ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
+#endif  /* C99 or better */
+#endif	/* ASN_EMIT_DEBUG */
+#endif	/* ASN_DEBUG */
+
+/*
+ * Print to a callback.
+ * The callback is expected to return negative values on error.
+ * 0 and positive values are treated as success.
+ * RETURN VALUES:
+ *  -1: Failed to format or invoke the callback.
+ *  >0: Size of the data that got delivered to the callback.
+ */
+ssize_t CC_PRINTFLIKE(3, 4)
+asn__format_to_callback(
+    int (*callback)(const void *, size_t, void *key), void *key,
+    const char *fmt, ...);
+
+/*
+ * Invoke the application-supplied callback and fail, if something is wrong.
+ */
+#define ASN__E_cbc(buf, size) (cb((buf), (size), app_key) < 0)
+#define ASN__E_CALLBACK(size, foo) \
+    do {                           \
+        if(foo) goto cb_failed;    \
+        er.encoded += (size);      \
+    } while(0)
+#define ASN__CALLBACK(buf, size) ASN__E_CALLBACK(size, ASN__E_cbc(buf, size))
+#define ASN__CALLBACK2(buf1, size1, buf2, size2) \
+    ASN__E_CALLBACK((size1) + (size2),           \
+                    ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2))
+#define ASN__CALLBACK3(buf1, size1, buf2, size2, buf3, size3)          \
+    ASN__E_CALLBACK((size1) + (size2) + (size3),                       \
+                    ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2) \
+                        || ASN__E_cbc(buf3, size3))
+
+#define ASN__TEXT_INDENT(nl, level)                                          \
+    do {                                                                     \
+        int tmp_level = (level);                                             \
+        int tmp_nl = ((nl) != 0);                                            \
+        int tmp_i;                                                           \
+        if(tmp_nl) ASN__CALLBACK("\n", 1);                                   \
+        if(tmp_level < 0) tmp_level = 0;                                     \
+        for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) ASN__CALLBACK("    ", 4); \
+    } while(0)
+
+#define	_i_INDENT(nl)	do {                        \
+        int tmp_i;                                  \
+        if((nl) && cb("\n", 1, app_key) < 0)        \
+            return -1;                              \
+        for(tmp_i = 0; tmp_i < ilevel; tmp_i++)     \
+            if(cb("    ", 4, app_key) < 0)          \
+                return -1;                          \
+    } while(0)
+
+/*
+ * Check stack against overflow, if limit is set.
+ */
+#define	ASN__DEFAULT_STACK_MAX	(30000)
+static int CC_NOTUSED
+ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
+	if(ctx && ctx->max_stack_size) {
+
+		/* ctx MUST be allocated on the stack */
+		ptrdiff_t usedstack = ((const char *)ctx - (const char *)&ctx);
+		if(usedstack > 0) usedstack = -usedstack; /* grows up! */
+
+		/* double negative required to avoid int wrap-around */
+		if(usedstack < -(ptrdiff_t)ctx->max_stack_size) {
+			ASN_DEBUG("Stack limit %ld reached",
+				(long)ctx->max_stack_size);
+			return -1;
+		}
+	}
+	return 0;
+}
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* ASN_INTERNAL_H */
diff --git a/e2sm/headers/asn_ioc.h b/e2sm/headers/asn_ioc.h
new file mode 100644
index 0000000..7de210e
--- /dev/null
+++ b/e2sm/headers/asn_ioc.h
@@ -0,0 +1,51 @@
+/*
+ * Run-time support for Information Object Classes.
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_IOC_H
+#define	ASN_IOC_H
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;
+struct asn_ioc_cell_s;
+
+/*
+ * X.681, #13
+ */
+typedef struct asn_ioc_set_s {
+    size_t rows_count;
+    size_t columns_count;
+    const struct asn_ioc_cell_s *rows;
+} asn_ioc_set_t;
+
+
+typedef struct asn_ioc_cell_s {
+    const char *field_name; /* Is equal to corresponding column_name */
+    enum {
+        aioc__undefined = 0,
+        aioc__value,
+        aioc__type,
+        aioc__open_type,
+    } cell_kind;
+    struct asn_TYPE_descriptor_s *type_descriptor;
+    const void *value_sptr;
+    struct {
+        size_t types_count;
+        struct {
+            unsigned choice_position;
+        } *types;
+    } open_type;
+} asn_ioc_cell_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_IOC_H */
diff --git a/e2sm/headers/asn_random_fill.h b/e2sm/headers/asn_random_fill.h
new file mode 100644
index 0000000..47f9b8a
--- /dev/null
+++ b/e2sm/headers/asn_random_fill.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_RANDOM_FILL
+#define	ASN_RANDOM_FILL
+
+/* Forward declarations */
+struct asn_TYPE_descriptor_s;
+struct asn_encoding_constraints_s;
+
+/*
+ * Initialize a structure with random data according to the type specification
+ * and optional member constraints.
+ * ARGUMENTS:
+ *  (max_length)        - See (approx_max_length_limit).
+ *  (memb_constraints)  - Member constraints, if exist.
+ *                        The type can be constrained differently according
+ *                        to PER and OER specifications, so we find a value
+ *                        at the intersection of these constraints.
+ * In case the return differs from ARFILL_OK, the (struct_ptr) contents
+ * and (current_length) value remain in their original state.
+ */
+typedef struct asn_random_fill_result_s {
+    enum {
+        ARFILL_FAILED = -1, /* System error (memory?) */
+        ARFILL_OK = 0,      /* Initialization succeeded */
+        ARFILL_SKIPPED = 1  /* Not done due to (length?) constraint */
+    } code;
+    size_t length; /* Approximate number of bytes created. */
+} asn_random_fill_result_t;
+typedef asn_random_fill_result_t(asn_random_fill_f)(
+    const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+    const struct asn_encoding_constraints_s *memb_constraints,
+    size_t max_length);
+
+/*
+ * Returns 0 if the structure was properly initialized, -1 otherwise.
+ * The (approx_max_length_limit) specifies the approximate limit of the
+ * resulting structure in units closely resembling bytes. The actual result
+ * might be several times larger or smaller than the length limit.
+ */
+int asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+                    size_t approx_max_length_limit);
+
+/*
+ * Returns a random number between min and max.
+ */
+intmax_t asn_random_between(intmax_t min, intmax_t max);
+
+#endif	/* ASN_RANDOM_FILL */
diff --git a/e2sm/headers/asn_system.h b/e2sm/headers/asn_system.h
new file mode 100644
index 0000000..898f122
--- /dev/null
+++ b/e2sm/headers/asn_system.h
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Miscellaneous system-dependent types.
+ */
+#ifndef	ASN_SYSTEM_H
+#define	ASN_SYSTEM_H
+
+#ifdef	HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE 1
+#endif
+
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE /* for snprintf() on some linux systems  */
+#endif
+
+#include <stdio.h>	/* For snprintf(3) */
+#include <stdlib.h>	/* For *alloc(3) */
+#include <string.h>	/* For memcpy(3) */
+#include <sys/types.h>	/* For size_t */
+#include <limits.h>	/* For LONG_MAX */
+#include <stdarg.h>	/* For va_start */
+#include <stddef.h>	/* for offsetof and ptrdiff_t */
+
+#ifdef	_WIN32
+
+#include <malloc.h>
+#define	 snprintf	_snprintf
+#define	 vsnprintf	_vsnprintf
+
+/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */
+#define sys_ntohl(l)	((((l) << 24)  & 0xff000000)	\
+			| (((l) << 8) & 0xff0000)	\
+			| (((l) >> 8)  & 0xff00)	\
+			| ((l >> 24) & 0xff))
+
+#ifdef _MSC_VER			/* MSVS.Net */
+#ifndef __cplusplus
+#define inline __inline
+#endif
+#ifndef	ASSUMESTDTYPES	/* Standard types have been defined elsewhere */
+#define	ssize_t		SSIZE_T
+#if _MSC_VER < 1600
+typedef	char		int8_t;
+typedef	short		int16_t;
+typedef	int		int32_t;
+typedef	unsigned char	uint8_t;
+typedef	unsigned short	uint16_t;
+typedef	unsigned int	uint32_t;
+#else /* _MSC_VER >= 1600 */
+#include <stdint.h>
+#endif /* _MSC_VER < 1600 */
+#endif	/* ASSUMESTDTYPES */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <float.h>
+#define isnan _isnan
+#define finite _finite
+#define copysign _copysign
+#ifdef WIN32	//MCHECK
+	#define ilogb ilogb
+#else
+	#define	ilogb	_logb
+#endif
+#else	/* !_MSC_VER */
+#include <stdint.h>
+#endif	/* _MSC_VER */
+
+#else	/* !_WIN32 */
+
+#if defined(__vxworks)
+#include <types/vxTypes.h>
+#else	/* !defined(__vxworks) */
+
+#include <inttypes.h>	/* C99 specifies this file */
+#include <netinet/in.h> /* for ntohl() */
+#define	sys_ntohl(foo)	ntohl(foo)
+#endif	/* defined(__vxworks) */
+
+#endif	/* _WIN32 */
+
+#if	__GNUC__ >= 3 || defined(__clang__)
+#define CC_ATTRIBUTE(attr)    __attribute__((attr))
+#else
+#define CC_ATTRIBUTE(attr)
+#endif
+#define CC_PRINTFLIKE(fmt, var)     CC_ATTRIBUTE(format(printf, fmt, var))
+#define	CC_NOTUSED                  CC_ATTRIBUTE(unused)
+#ifndef CC_ATTR_NO_SANITIZE
+#define CC_ATTR_NO_SANITIZE(what)   CC_ATTRIBUTE(no_sanitize(what))
+#endif
+
+/* Figure out if thread safety is requested */
+#if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT))
+#define	ASN_THREAD_SAFE
+#endif	/* Thread safety */
+
+#ifndef	offsetof	/* If not defined by <stddef.h> */
+#define	offsetof(s, m)	((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0))
+#endif	/* offsetof */
+
+#ifndef	MIN		/* Suitable for comparing primitive types (integers) */
+#if defined(__GNUC__)
+#define	MIN(a,b)	({ __typeof a _a = a; __typeof b _b = b;	\
+	((_a)<(_b)?(_a):(_b)); })
+#else	/* !__GNUC__ */
+#define	MIN(a,b)	((a)<(b)?(a):(b))	/* Unsafe variant */
+#endif /* __GNUC__ */
+#endif	/* MIN */
+
+#if __STDC_VERSION__ >= 199901L
+#ifndef SIZE_MAX
+#define SIZE_MAX   ((~((size_t)0)) >> 1)
+#endif
+
+#ifndef RSIZE_MAX   /* C11, Annex K */
+#define RSIZE_MAX   (SIZE_MAX >> 1)
+#endif
+#ifndef RSSIZE_MAX   /* Halve signed size even further than unsigned */
+#define RSSIZE_MAX   ((ssize_t)(RSIZE_MAX >> 1))
+#endif
+#else   /* Old compiler */
+#undef  SIZE_MAX
+#undef  RSIZE_MAX
+#undef  RSSIZE_MAX
+#define SIZE_MAX   ((~((size_t)0)) >> 1)
+#define RSIZE_MAX   (SIZE_MAX >> 1)
+#define RSSIZE_MAX   ((ssize_t)(RSIZE_MAX >> 1))
+#endif
+
+#if __STDC_VERSION__ >= 199901L
+#define ASN_PRI_SIZE "zu"
+#define ASN_PRI_SSIZE "zd"
+#define ASN_PRIuMAX PRIuMAX
+#define ASN_PRIdMAX PRIdMAX
+#else
+#define ASN_PRI_SIZE "lu"
+#define ASN_PRI_SSIZE "ld"
+#if LLONG_MAX > LONG_MAX
+#define ASN_PRIuMAX "llu"
+#define ASN_PRIdMAX "lld"
+#else
+#define ASN_PRIuMAX "lu"
+#define ASN_PRIdMAX "ld"
+#endif
+#endif
+
+#endif	/* ASN_SYSTEM_H */
diff --git a/e2sm/headers/ber_decoder.h b/e2sm/headers/ber_decoder.h
new file mode 100644
index 0000000..1ac2a5e
--- /dev/null
+++ b/e2sm/headers/ber_decoder.h
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_DECODER_H_
+#define	_BER_DECODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_codec_ctx_s;		/* Forward declaration */
+
+/*
+ * The BER decoder of any type.
+ * This function may be invoked directly from the application.
+ * Decodes BER, DER and CER data (DER and CER are different subsets of BER).
+ *
+ * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding
+ * which is compliant with ber_decode().
+ */
+asn_dec_rval_t ber_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of that buffer */
+);
+
+/*
+ * Type of generic function which decodes the byte stream into the structure.
+ */
+typedef asn_dec_rval_t(ber_type_decoder_f)(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const void *buf_ptr, size_t size, int tag_mode);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Check that all tags correspond to the type definition (as given in head).
+ * On return, last_length would contain either a non-negative length of the
+ * value part of the last TLV, or the negative number of expected
+ * "end of content" sequences. The number may only be negative if the
+ * head->last_tag_form is non-zero.
+ */
+asn_dec_rval_t ber_check_tags(
+    const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    asn_struct_ctx_t *opt_ctx, /* saved decoding context */
+    const void *ptr, size_t size,
+    int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+    int last_tag_form, /* {-1,0:1}: any, primitive, constr */
+    ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_DECODER_H_ */
diff --git a/e2sm/headers/ber_tlv_length.h b/e2sm/headers/ber_tlv_length.h
new file mode 100644
index 0000000..d1e4d48
--- /dev/null
+++ b/e2sm/headers/ber_tlv_length.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_TLV_LENGTH_H_
+#define	_BER_TLV_LENGTH_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ssize_t ber_tlv_len_t;
+
+/*
+ * This function tries to fetch the length of the BER TLV value and place it
+ * in *len_r.
+ * RETURN VALUES:
+ *	 0:	More data expected than bufptr contains.
+ *	-1:	Fatal error deciphering length.
+ *	>0:	Number of bytes used from bufptr.
+ * On return with >0, len_r is constrained as -1..MAX, where -1 mean
+ * that the value is of indefinite length.
+ */
+ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
+	ber_tlv_len_t *len_r);
+
+/*
+ * This function expects bufptr to be positioned over L in TLV.
+ * It returns number of bytes occupied by L and V together, suitable
+ * for skipping. The function properly handles indefinite length.
+ * RETURN VALUES:
+ * 	Standard {-1,0,>0} convention.
+ */
+ssize_t ber_skip_length(
+	const struct asn_codec_ctx_s *opt_codec_ctx,	/* optional context */
+	int _is_constructed, const void *bufptr, size_t size);
+
+/*
+ * This function serializes the length (L from TLV) in DER format.
+ * It always returns number of bytes necessary to represent the length,
+ * it is a caller's responsibility to check the return value
+ * against the supplied buffer's size.
+ */
+size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_TLV_LENGTH_H_ */
diff --git a/e2sm/headers/ber_tlv_tag.h b/e2sm/headers/ber_tlv_tag.h
new file mode 100644
index 0000000..ce227ad
--- /dev/null
+++ b/e2sm/headers/ber_tlv_tag.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_TLV_TAG_H_
+#define	_BER_TLV_TAG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum asn_tag_class {
+	ASN_TAG_CLASS_UNIVERSAL		= 0,	/* 0b00 */
+	ASN_TAG_CLASS_APPLICATION	= 1,	/* 0b01 */
+	ASN_TAG_CLASS_CONTEXT		= 2,	/* 0b10 */
+	ASN_TAG_CLASS_PRIVATE		= 3	/* 0b11 */
+};
+typedef unsigned ber_tlv_tag_t;	/* BER TAG from Tag-Length-Value */
+
+/*
+ * Tag class is encoded together with tag value for optimization purposes.
+ */
+#define	BER_TAG_CLASS(tag)	((tag) & 0x3)
+#define	BER_TAG_VALUE(tag)	((tag) >> 2)
+#define	BER_TLV_CONSTRUCTED(tagptr)	(((*(const uint8_t *)tagptr)&0x20)?1:0)
+
+#define	BER_TAGS_EQUAL(tag1, tag2)	((tag1) == (tag2))
+
+/*
+ * Several functions for printing the TAG in the canonical form
+ * (i.e. "[PRIVATE 0]").
+ * Return values correspond to their libc counterparts (if any).
+ */
+ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen);
+ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *);
+char *ber_tlv_tag_string(ber_tlv_tag_t tag);
+
+
+/*
+ * This function tries to fetch the tag from the input stream.
+ * RETURN VALUES:
+ * 	 0:	More data expected than bufptr contains.
+ * 	-1:	Fatal error deciphering tag.
+ *	>0:	Number of bytes used from bufptr. tag_r will contain the tag.
+ */
+ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r);
+
+/*
+ * This function serializes the tag (T from TLV) in BER format.
+ * It always returns number of bytes necessary to represent the tag,
+ * it is a caller's responsibility to check the return value
+ * against the supplied buffer's size.
+ */
+size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_TLV_TAG_H_ */
diff --git a/e2sm/headers/constr_CHOICE.h b/e2sm/headers/constr_CHOICE.h
new file mode 100644
index 0000000..a1999ed
--- /dev/null
+++ b/e2sm/headers/constr_CHOICE.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_CHOICE_H_
+#define	_CONSTR_CHOICE_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_CHOICE_specifics_s {
+	/*
+	 * Target structure description.
+	 */
+	unsigned struct_size;       /* Size of the target structure. */
+	unsigned ctx_offset;        /* Offset of the asn_codec_ctx_t member */
+	unsigned pres_offset;       /* Identifier of the present member */
+	unsigned pres_size;         /* Size of the identifier (enum) */
+
+	/*
+	 * Tags to members mapping table.
+	 */
+	const asn_TYPE_tag2member_t *tag2el;
+	unsigned tag2el_count;
+
+	/* Canonical ordering of CHOICE elements, for PER */
+	const unsigned *to_canonical_order;
+	const unsigned *from_canonical_order;
+
+	/*
+	 * Extensions-related stuff.
+	 */
+	signed ext_start; /* First member of extensions, or -1 */
+} asn_CHOICE_specifics_t;
+
+/*
+ * A set specialized functions dealing with the CHOICE type.
+ */
+asn_struct_free_f CHOICE_free;
+asn_struct_print_f CHOICE_print;
+asn_struct_compare_f CHOICE_compare;
+asn_constr_check_f CHOICE_constraint;
+ber_type_decoder_f CHOICE_decode_ber;
+der_type_encoder_f CHOICE_encode_der;
+xer_type_decoder_f CHOICE_decode_xer;
+xer_type_encoder_f CHOICE_encode_xer;
+oer_type_decoder_f CHOICE_decode_oer;
+oer_type_encoder_f CHOICE_encode_oer;
+per_type_decoder_f CHOICE_decode_uper;
+per_type_encoder_f CHOICE_encode_uper;
+per_type_decoder_f CHOICE_decode_aper;
+per_type_encoder_f CHOICE_encode_aper;
+asn_outmost_tag_f CHOICE_outmost_tag;
+asn_random_fill_f CHOICE_random_fill;
+extern asn_TYPE_operation_t asn_OP_CHOICE;
+
+/*
+ * Return the 1-based choice variant presence index.
+ * Returns 0 in case of error.
+ */
+unsigned CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td,
+                                     const void *structure_ptr);
+
+/*
+ * Sets or resets the 1-based choice variant presence index.
+ * In case a previous index is not zero, the currently selected structure
+ * member is freed and zeroed-out first.
+ * Returns 0 on success and -1 on error.
+ */
+int CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td,
+                                void *structure_ptr, unsigned present);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_CHOICE_H_ */
diff --git a/e2sm/headers/constr_SEQUENCE.h b/e2sm/headers/constr_SEQUENCE.h
new file mode 100644
index 0000000..a22ed3a
--- /dev/null
+++ b/e2sm/headers/constr_SEQUENCE.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_SEQUENCE_H_
+#define	_CONSTR_SEQUENCE_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_SEQUENCE_specifics_s {
+	/*
+	 * Target structure description.
+	 */
+	unsigned struct_size;	/* Size of the target structure. */
+	unsigned ctx_offset;	/* Offset of the asn_struct_ctx_t member */
+
+	/*
+	 * Tags to members mapping table (sorted).
+	 */
+	const asn_TYPE_tag2member_t *tag2el;
+	unsigned tag2el_count;
+
+	/*
+	 * Optional members of the extensions root (roms) or additions (aoms).
+	 * Meaningful for PER.
+	 */
+	const int *oms;         /* Optional MemberS */
+	unsigned roms_count;    /* Root optional members count */
+	unsigned aoms_count;    /* Additions optional members count */
+
+	/*
+	 * Description of an extensions group.
+	 * Root components are clustered at the beginning of the structure,
+	 * whereas extensions are clustered at the end. -1 means not extensible.
+	 */
+	signed first_extension;       /* First extension addition */
+} asn_SEQUENCE_specifics_t;
+
+
+/*
+ * A set specialized functions dealing with the SEQUENCE type.
+ */
+asn_struct_free_f SEQUENCE_free;
+asn_struct_print_f SEQUENCE_print;
+asn_struct_compare_f SEQUENCE_compare;
+asn_constr_check_f SEQUENCE_constraint;
+ber_type_decoder_f SEQUENCE_decode_ber;
+der_type_encoder_f SEQUENCE_encode_der;
+xer_type_decoder_f SEQUENCE_decode_xer;
+xer_type_encoder_f SEQUENCE_encode_xer;
+oer_type_decoder_f SEQUENCE_decode_oer;
+oer_type_encoder_f SEQUENCE_encode_oer;
+per_type_decoder_f SEQUENCE_decode_uper;
+per_type_encoder_f SEQUENCE_encode_uper;
+per_type_decoder_f SEQUENCE_decode_aper;
+per_type_encoder_f SEQUENCE_encode_aper;
+asn_random_fill_f  SEQUENCE_random_fill;
+extern asn_TYPE_operation_t asn_OP_SEQUENCE;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_SEQUENCE_H_ */
diff --git a/e2sm/headers/constr_SEQUENCE_OF.h b/e2sm/headers/constr_SEQUENCE_OF.h
new file mode 100644
index 0000000..6857f0f
--- /dev/null
+++ b/e2sm/headers/constr_SEQUENCE_OF.h
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_SEQUENCE_OF_H_
+#define	_CONSTR_SEQUENCE_OF_H_
+
+#include <asn_application.h>
+#include <constr_SET_OF.h>		/* Implemented using SET OF */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * A set specialized functions dealing with the SEQUENCE OF type.
+ * Generally implemented using SET OF.
+ */
+asn_struct_compare_f SEQUENCE_OF_compare;
+der_type_encoder_f SEQUENCE_OF_encode_der;
+xer_type_encoder_f SEQUENCE_OF_encode_xer;
+per_type_encoder_f SEQUENCE_OF_encode_uper;
+per_type_encoder_f SEQUENCE_OF_encode_aper;
+extern asn_TYPE_operation_t asn_OP_SEQUENCE_OF;
+
+#define	SEQUENCE_OF_free	SET_OF_free
+#define	SEQUENCE_OF_print	SET_OF_print
+#define	SEQUENCE_OF_constraint	SET_OF_constraint
+#define	SEQUENCE_OF_decode_ber	SET_OF_decode_ber
+#define	SEQUENCE_OF_decode_xer	SET_OF_decode_xer
+#define	SEQUENCE_OF_decode_oer  SET_OF_decode_oer
+#define	SEQUENCE_OF_encode_oer  SET_OF_encode_oer
+#define	SEQUENCE_OF_decode_uper	SET_OF_decode_uper
+#define	SEQUENCE_OF_decode_aper	SET_OF_decode_aper
+#define	SEQUENCE_OF_random_fill SET_OF_random_fill
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_SET_OF_H_ */
diff --git a/e2sm/headers/constr_SET_OF.h b/e2sm/headers/constr_SET_OF.h
new file mode 100644
index 0000000..7681062
--- /dev/null
+++ b/e2sm/headers/constr_SET_OF.h
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	CONSTR_SET_OF_H
+#define	CONSTR_SET_OF_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_SET_OF_specifics_s {
+    /*
+     * Target structure description.
+     */
+    unsigned struct_size;       /* Size of the target structure. */
+    unsigned ctx_offset;        /* Offset of the asn_struct_ctx_t member */
+
+    /* XER-specific stuff */
+    int as_XMLValueList; /* The member type must be encoded like this */
+} asn_SET_OF_specifics_t;
+
+/*
+ * A set specialized functions dealing with the SET OF type.
+ */
+asn_struct_free_f SET_OF_free;
+asn_struct_print_f SET_OF_print;
+asn_struct_compare_f SET_OF_compare;
+asn_constr_check_f SET_OF_constraint;
+ber_type_decoder_f SET_OF_decode_ber;
+der_type_encoder_f SET_OF_encode_der;
+xer_type_decoder_f SET_OF_decode_xer;
+xer_type_encoder_f SET_OF_encode_xer;
+oer_type_decoder_f SET_OF_decode_oer;
+oer_type_encoder_f SET_OF_encode_oer;
+per_type_decoder_f SET_OF_decode_uper;
+per_type_encoder_f SET_OF_encode_uper;
+per_type_decoder_f SET_OF_decode_aper;
+per_type_encoder_f SET_OF_encode_aper;
+asn_random_fill_f  SET_OF_random_fill;
+extern asn_TYPE_operation_t asn_OP_SET_OF;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* CONSTR_SET_OF_H */
diff --git a/e2sm/headers/constr_TYPE.h b/e2sm/headers/constr_TYPE.h
new file mode 100644
index 0000000..d80dea5
--- /dev/null
+++ b/e2sm/headers/constr_TYPE.h
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This file contains the declaration structure called "ASN.1 Type Definition",
+ * which holds all information necessary for encoding and decoding routines.
+ * This structure even contains pointer to these encoding and decoding routines
+ * for each defined ASN.1 type.
+ */
+#ifndef	_CONSTR_TYPE_H_
+#define	_CONSTR_TYPE_H_
+
+#include <ber_tlv_length.h>
+#include <ber_tlv_tag.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_TYPE_member_s;	/* Forward declaration */
+
+/*
+ * This type provides the context information for various ASN.1 routines,
+ * primarily ones doing decoding. A member _asn_ctx of this type must be
+ * included into certain target language's structures, such as compound types.
+ */
+typedef struct asn_struct_ctx_s {
+	short phase;		/* Decoding phase */
+	short step;		/* Elementary step of a phase */
+	int context;		/* Other context information */
+	void *ptr;		/* Decoder-specific stuff (stack elements) */
+	ber_tlv_len_t left;	/* Number of bytes left, -1 for indefinite */
+} asn_struct_ctx_t;
+
+#include <ber_decoder.h>	/* Basic Encoding Rules decoder */
+#include <der_encoder.h>	/* Distinguished Encoding Rules encoder */
+#include <xer_decoder.h>	/* Decoder of XER (XML, text) */
+#include <xer_encoder.h>	/* Encoder into XER (XML, text) */
+#include <per_decoder.h>	/* Packet Encoding Rules decoder */
+#include <per_encoder.h>	/* Packet Encoding Rules encoder */
+#include <constraints.h>	/* Subtype constraints support */
+#include <asn_random_fill.h>	/* Random structures support */
+
+#ifdef  ASN_DISABLE_OER_SUPPORT
+typedef void (oer_type_decoder_f)(void);
+typedef void (oer_type_encoder_f)(void);
+typedef void asn_oer_constraints_t;
+#else
+#include <oer_decoder.h>	/* Octet Encoding Rules encoder */
+#include <oer_encoder.h>	/* Octet Encoding Rules encoder */
+#endif
+
+/*
+ * Free the structure according to its specification.
+ * Use one of ASN_STRUCT_{FREE,RESET,CONTENTS_ONLY} macros instead.
+ * Do not use directly.
+ */
+enum asn_struct_free_method {
+    ASFM_FREE_EVERYTHING,   /* free(struct_ptr) and underlying members */
+    ASFM_FREE_UNDERLYING,   /* free underlying members */
+    ASFM_FREE_UNDERLYING_AND_RESET   /* FREE_UNDERLYING + memset(0) */
+};
+typedef void (asn_struct_free_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		void *struct_ptr, enum asn_struct_free_method);
+
+/*
+ * Free the structure including freeing the memory pointed to by ptr itself.
+ */
+#define ASN_STRUCT_FREE(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_EVERYTHING)
+
+/*
+ * Free the memory used by the members of the structure without freeing the
+ * the structure pointer itself.
+ * ZERO-OUT the structure to the safe clean state.
+ * (Retaining the pointer may be useful in case the structure is allocated
+ *  statically or arranged on the stack, yet its elements are dynamic.)
+ */
+#define ASN_STRUCT_RESET(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING_AND_RESET)
+
+/*
+ * Free memory used by the members of the structure without freeing
+ * the structure pointer itself.
+ * (Retaining the pointer may be useful in case the structure is allocated
+ *  statically or arranged on the stack, yet its elements are dynamic.)
+ * AVOID using it in the application code;
+ * Use a safer ASN_STRUCT_RESET() instead.
+ */
+#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING)
+
+/*
+ * Print the structure according to its specification.
+ */
+typedef int(asn_struct_print_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr,
+    int level, /* Indentation level */
+    asn_app_consume_bytes_f *callback, void *app_key);
+
+/*
+ * Compare two structs between each other.
+ * Returns <0 if struct_A is "smaller" than struct_B, >0 if "greater",
+ * and =0 if "equal to", for some type-specific, stable definition of
+ * "smaller", "greater" and "equal to".
+ */
+typedef int (asn_struct_compare_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		const void *struct_A,
+		const void *struct_B);
+
+/*
+ * Return the outmost tag of the type.
+ * If the type is untagged CHOICE, the dynamic operation is performed.
+ * NOTE: This function pointer type is only useful internally.
+ * Do not use it in your application.
+ */
+typedef ber_tlv_tag_t (asn_outmost_tag_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag);
+/* The instance of the above function type; used internally. */
+asn_outmost_tag_f asn_TYPE_outmost_tag;
+
+/*
+ * Fetch the desired type of the Open Type based on the
+ * Information Object Set driven constraints.
+ */
+typedef struct asn_type_selector_result_s {
+    const struct asn_TYPE_descriptor_s *type_descriptor; /* Type encoded. */
+    unsigned presence_index; /* Associated choice variant. */
+} asn_type_selector_result_t;
+typedef asn_type_selector_result_t(asn_type_selector_f)(
+    const struct asn_TYPE_descriptor_s *parent_type_descriptor,
+    const void *parent_structure_ptr);
+
+/*
+ * Generalized functions for dealing with the speciic type.
+ * May be directly invoked by applications.
+ */
+typedef struct asn_TYPE_operation_s {
+    asn_struct_free_f *free_struct;     /* Free the structure */
+    asn_struct_print_f *print_struct;   /* Human readable output */
+    asn_struct_compare_f *compare_struct; /* Compare two structures */
+    ber_type_decoder_f *ber_decoder;      /* Generic BER decoder */
+    der_type_encoder_f *der_encoder;      /* Canonical DER encoder */
+    xer_type_decoder_f *xer_decoder;      /* Generic XER decoder */
+    xer_type_encoder_f *xer_encoder;      /* [Canonical] XER encoder */
+    oer_type_decoder_f *oer_decoder;      /* Generic OER decoder */
+    oer_type_encoder_f *oer_encoder;      /* Canonical OER encoder */
+    per_type_decoder_f *uper_decoder;     /* Unaligned PER decoder */
+    per_type_encoder_f *uper_encoder;     /* Unaligned PER encoder */
+    per_type_decoder_f *aper_decoder;     /* Aligned PER decoder */
+    per_type_encoder_f *aper_encoder;     /* Aligned PER encoder */
+    asn_random_fill_f *random_fill;       /* Initialize with a random value */
+    asn_outmost_tag_f *outmost_tag;       /* <optional, internal> */
+} asn_TYPE_operation_t;
+
+/*
+ * A constraints tuple specifying both the OER and PER constraints.
+ */
+typedef struct asn_encoding_constraints_s {
+    const struct asn_oer_constraints_s *oer_constraints;
+    const struct asn_per_constraints_s *per_constraints;
+    asn_constr_check_f *general_constraints;
+} asn_encoding_constraints_t;
+
+/*
+ * The definitive description of the destination language's structure.
+ */
+typedef struct asn_TYPE_descriptor_s {
+    const char *name;       /* A name of the ASN.1 type. "" in some cases. */
+    const char *xml_tag;    /* Name used in XML tag */
+
+    /*
+     * Generalized functions for dealing with the specific type.
+     * May be directly invoked by applications.
+     */
+    asn_TYPE_operation_t *op;
+
+    /***********************************************************************
+     * Internally useful members. Not to be used by applications directly. *
+     **********************************************************************/
+
+    /*
+     * Tags that are expected to occur.
+     */
+    const ber_tlv_tag_t *tags;      /* Effective tags sequence for this type */
+    unsigned tags_count;            /* Number of tags which are expected */
+    const ber_tlv_tag_t *all_tags;  /* Every tag for BER/containment */
+    unsigned all_tags_count;        /* Number of tags */
+
+    /* OER, PER, and general constraints */
+    asn_encoding_constraints_t encoding_constraints;
+
+    /*
+     * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE).
+     */
+    struct asn_TYPE_member_s *elements;
+    unsigned elements_count;
+
+    /*
+     * Additional information describing the type, used by appropriate
+     * functions above.
+     */
+    const void *specifics;
+} asn_TYPE_descriptor_t;
+
+/*
+ * This type describes an element of the constructed type,
+ * i.e. SEQUENCE, SET, CHOICE, etc.
+ */
+  enum asn_TYPE_flags_e {
+    ATF_NOFLAGS,
+    ATF_POINTER = 0x01,   /* Represented by the pointer */
+    ATF_OPEN_TYPE = 0x02, /* Open Type */
+    ATF_ANY_TYPE = 0x04   /* ANY type (deprecated!) */
+  };
+typedef struct asn_TYPE_member_s {
+    enum asn_TYPE_flags_e flags; /* Element's presentation flags */
+    unsigned optional;      /* Following optional members, including current */
+    unsigned memb_offset;   /* Offset of the element */
+    ber_tlv_tag_t tag;      /* Outmost (most immediate) tag */
+    int tag_mode;           /* IMPLICIT/no/EXPLICIT tag at current level */
+    asn_TYPE_descriptor_t *type;            /* Member type descriptor */
+    asn_type_selector_f *type_selector;     /* IoS runtime type selector */
+    asn_encoding_constraints_t encoding_constraints;
+    int (*default_value_cmp)(const void *sptr); /* Compare DEFAULT <value> */
+    int (*default_value_set)(void **sptr);      /* Set DEFAULT <value> */
+    const char *name; /* ASN.1 identifier of the element */
+} asn_TYPE_member_t;
+
+/*
+ * BER tag to element number mapping.
+ */
+typedef struct asn_TYPE_tag2member_s {
+    ber_tlv_tag_t el_tag;   /* Outmost tag of the member */
+    unsigned el_no;         /* Index of the associated member, base 0 */
+    int toff_first;         /* First occurence of the el_tag, relative */
+    int toff_last;          /* Last occurence of the el_tag, relative */
+} asn_TYPE_tag2member_t;
+
+/*
+ * This function prints out the contents of the target language's structure
+ * (struct_ptr) into the file pointer (stream) in human readable form.
+ * RETURN VALUES:
+ * 	 0: The structure is printed.
+ * 	-1: Problem dumping the structure.
+ * (See also xer_fprint() in xer_encoder.h)
+ */
+int asn_fprint(FILE *stream, /* Destination stream descriptor */
+               const asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */
+               const void *struct_ptr);         /* Structure to be printed */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_TYPE_H_ */
diff --git a/e2sm/headers/constraints.h b/e2sm/headers/constraints.h
new file mode 100644
index 0000000..0bd86a9
--- /dev/null
+++ b/e2sm/headers/constraints.h
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN1_CONSTRAINTS_VALIDATOR_H
+#define	ASN1_CONSTRAINTS_VALIDATOR_H
+
+#include <asn_system.h>		/* Platform-dependent types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;		/* Forward declaration */
+
+/*
+ * Validate the structure according to the ASN.1 constraints.
+ * If errbuf and errlen are given, they shall be pointing to the appropriate
+ * buffer space and its length before calling this function. Alternatively,
+ * they could be passed as NULL's. If constraints validation fails,
+ * errlen will contain the actual number of bytes taken from the errbuf
+ * to encode an error message (properly 0-terminated).
+ * 
+ * RETURN VALUES:
+ * This function returns 0 in case all ASN.1 constraints are met
+ * and -1 if one or more constraints were failed.
+ */
+int asn_check_constraints(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Target language's structure */
+    char *errbuf,           /* Returned error description */
+    size_t *errlen          /* Length of the error description */
+);
+
+
+/*
+ * Generic type for constraint checking callback,
+ * associated with every type descriptor.
+ */
+typedef int(asn_constr_check_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr,
+    asn_app_constraint_failed_f *optional_callback, /* Log the error */
+    void *optional_app_key /* Opaque key passed to a callback */
+);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+asn_constr_check_f asn_generic_no_constraint;	/* No constraint whatsoever */
+asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */
+
+/*
+ * Invoke the callback with a complete error message.
+ */
+#define	ASN__CTFAIL	if(ctfailcb) ctfailcb
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN1_CONSTRAINTS_VALIDATOR_H */
diff --git a/e2sm/headers/der_encoder.h b/e2sm/headers/der_encoder.h
new file mode 100644
index 0000000..e93944e
--- /dev/null
+++ b/e2sm/headers/der_encoder.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_DER_ENCODER_H_
+#define	_DER_ENCODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The DER encoder of any type. May be invoked by the application.
+ * Produces DER- and BER-compliant encoding. (DER is a subset of BER).
+ *
+ * NOTE: Use the ber_decode() function (ber_decoder.h) to decode data
+ * produced by der_encode().
+ */
+asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/* A variant of der_encode() which encodes data into the pre-allocated buffer */
+asn_enc_rval_t der_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (maximum) */
+);
+
+/*
+ * Type of the generic DER encoder.
+ */
+typedef asn_enc_rval_t(der_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    int tag_mode,           /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+    ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key /* Arbitrary callback argument */
+);
+
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Write out leading TL[v] sequence according to the type definition.
+ */
+ssize_t der_write_tags(const struct asn_TYPE_descriptor_s *type_descriptor,
+                       size_t struct_length,
+                       int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+                       int last_tag_form, /* {0,!0}: prim, constructed */
+                       ber_tlv_tag_t tag,
+                       asn_app_consume_bytes_f *consume_bytes_cb,
+                       void *app_key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _DER_ENCODER_H_ */
diff --git a/e2sm/headers/oer_decoder.h b/e2sm/headers/oer_decoder.h
new file mode 100644
index 0000000..40992e9
--- /dev/null
+++ b/e2sm/headers/oer_decoder.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_DECODER_H
+#define	OER_DECODER_H
+
+#include <asn_application.h>
+#include <oer_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_codec_ctx_s;		/* Forward declaration */
+
+/*
+ * The Octet Encoding Rules (OER, X.696 08/2015) decoder for any given type.
+ * This function may be invoked directly by the application.
+ * Parses CANONICAL-OER and BASIC-OER.
+ */
+asn_dec_rval_t oer_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
+	const struct asn_TYPE_descriptor_s *type_descriptor,
+	void **struct_ptr,	/* Pointer to a target structure's pointer */
+	const void *buffer,	/* Data to be decoded */
+	size_t size		/* Size of that buffer */
+	);
+
+/*
+ * Type of generic function which decodes the byte stream into the structure.
+ */
+typedef asn_dec_rval_t(oer_type_decoder_f)(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    void **struct_ptr,
+    const void *buf_ptr,
+    size_t size);
+
+/*
+ * Swallow the Open Type (X.696 (08/2015), #30) into /dev/null.
+ * RETURN VALUES:
+ *      -1:     Fatal error deciphering length.
+ *       0:     More data expected than bufptr contains.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_open_type_skip(const void *bufptr, size_t size);
+
+/*
+ * Read the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                          const struct asn_TYPE_descriptor_s *td,
+                          const asn_oer_constraints_t *constraints,
+                          void **struct_ptr, const void *bufptr, size_t size);
+
+/*
+ * Length-prefixed buffer decoding for primitive types.
+ */
+oer_type_decoder_f oer_decode_primitive;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_DECODER_H */
diff --git a/e2sm/headers/oer_encoder.h b/e2sm/headers/oer_encoder.h
new file mode 100644
index 0000000..6a7b681
--- /dev/null
+++ b/e2sm/headers/oer_encoder.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_ENCODER_H
+#define	OER_ENCODER_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The Octet Encoding Rules (OER, X.696 08/2015) encoder for any type.
+ * This function may be invoked directly by the application.
+ * Produces CANONICAL-OER output compatible with CANONICAL-OER
+ * and BASIC-OER decoders.
+ */
+asn_enc_rval_t oer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/* A variant of oer_encode() which encodes data into the pre-allocated buffer */
+asn_enc_rval_t oer_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (maximum) */
+);
+
+/*
+ * Type of the generic OER encoder.
+ */
+typedef asn_enc_rval_t(oer_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    const void *struct_ptr,                    /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+/*
+ * Write out the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *  -1: Fatal error encoding the type.
+ *  >0: Number of bytes serialized.
+ */
+ssize_t oer_open_type_put(const struct asn_TYPE_descriptor_s *td,
+                          const asn_oer_constraints_t *constraints,
+                          const void *struct_ptr,
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key);
+
+
+/*
+ * Length-prefixed buffer encoding for primitive types.
+ */
+oer_type_encoder_f oer_encode_primitive;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_ENCODER_H */
diff --git a/e2sm/headers/oer_support.h b/e2sm/headers/oer_support.h
new file mode 100644
index 0000000..dbc9b5f
--- /dev/null
+++ b/e2sm/headers/oer_support.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_SUPPORT_H
+#define	OER_SUPPORT_H
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Pre-computed OER constraints.
+ */
+typedef struct asn_oer_constraint_number_s {
+    unsigned width;    /* ±8,4,2,1 fixed bytes */
+    unsigned positive; /* 1 for unsigned number, 0 for signed */
+} asn_oer_constraint_number_t;
+typedef struct asn_oer_constraints_s {
+    asn_oer_constraint_number_t value;
+    ssize_t size;    /* -1 (no constraint) or >= 0 */
+} asn_oer_constraints_t;
+
+
+/*
+ * Fetch the length determinant (X.696 (08/2015), #8.6) into *len_r.
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_fetch_length(const void *bufptr, size_t size, size_t *len_r);
+
+/*
+ * Serialize OER length. Returns the number of bytes serialized
+ * or -1 if a given callback returned with negative result.
+ */
+ssize_t oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, void *app_key);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_SUPPORT_H */
diff --git a/e2sm/headers/per_decoder.h b/e2sm/headers/per_decoder.h
new file mode 100644
index 0000000..eea474a
--- /dev/null
+++ b/e2sm/headers/per_decoder.h
@@ -0,0 +1,82 @@
+/*-
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_DECODER_H_
+#define	_PER_DECODER_H_
+
+#include <asn_application.h>
+#include <per_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * Unaligned PER decoder of a "complete encoding" as per X.691 (08/2015) #11.1.
+ * On success, this call always returns (.consumed >= 1), as per #11.1.3.
+ */
+asn_dec_rval_t uper_decode_complete(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of data buffer */
+);
+
+/*
+ * Unaligned PER decoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This call returns the number of BITS read from the stream. Beware.
+ */
+asn_dec_rval_t uper_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size,        /* Size of the input data buffer, in bytes */
+    int skip_bits,      /* Number of unused leading bits, 0..7 */
+    int unused_bits     /* Number of unused tailing bits, 0..7 */
+);
+
+/*
+ * Aligned PER decoder of a "complete encoding" as per X.691#10.1.
+ * On success, this call always returns (.consumed >= 1), in BITS, as per X.691#10.1.3.
+ */
+asn_dec_rval_t aper_decode_complete(
+       const struct asn_codec_ctx_s *opt_codec_ctx,
+       const struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
+       void **struct_ptr,	/* Pointer to a target structure's pointer */
+       const void *buffer,	/* Data to be decoded */
+       size_t size		/* Size of data buffer */
+									);
+
+/*
+ * Aligned PER decoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This call returns the number of BITS read from the stream. Beware.
+ */
+asn_dec_rval_t aper_decode(
+      const struct asn_codec_ctx_s *opt_codec_ctx,
+      const struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
+      void **struct_ptr,	/* Pointer to a target structure's pointer */
+      const void *buffer,	/* Data to be decoded */
+      size_t size,		/* Size of data buffer */
+      int skip_bits,		/* Number of unused leading bits, 0..7 */
+      int unused_bits		/* Number of unused tailing bits, 0..7 */
+      );
+
+/*
+ * Type of the type-specific PER decoder function.
+ */
+typedef asn_dec_rval_t(per_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints, void **struct_ptr,
+    asn_per_data_t *per_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_DECODER_H_ */
diff --git a/e2sm/headers/per_encoder.h b/e2sm/headers/per_encoder.h
new file mode 100644
index 0000000..b615ef0
--- /dev/null
+++ b/e2sm/headers/per_encoder.h
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2006-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_ENCODER_H_
+#define	_PER_ENCODER_H_
+
+#include <asn_application.h>
+#include <per_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * Unaligned PER encoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This function returns the number of encoded bits in the .encoded
+ * field of the return value. Use the following formula to convert to bytes:
+ * 	bytes = ((.encoded + 7) / 8)
+ */
+asn_enc_rval_t uper_encode(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,                    /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+asn_enc_rval_t aper_encode(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,                     /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb,  /* Data collector */
+    void *app_key                               /* Arbitrary callback argument */
+);
+
+/*
+ * A variant of uper_encode() which encodes data into the existing buffer
+ * WARNING: This function returns the number of encoded bits in the .encoded
+ * field of the return value.
+ */
+asn_enc_rval_t uper_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (max) */
+);
+
+asn_enc_rval_t aper_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,  /* Structure to be encoded */
+    void *buffer,            /* Pre-allocated buffer */
+    size_t buffer_size       /* Initial buffer size (max) */
+);
+/*
+ * A variant of uper_encode_to_buffer() which allocates buffer itself.
+ * Returns the number of bytes in the buffer or -1 in case of failure.
+ * WARNING: This function produces a "Production of the complete encoding",
+ * with length of at least one octet. Contrast this to precise bit-packing
+ * encoding of uper_encode() and uper_encode_to_buffer().
+ */
+ssize_t uper_encode_to_new_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void **buffer_r         /* Buffer allocated and returned */
+);
+
+ssize_t
+aper_encode_to_new_buffer(
+    const struct asn_TYPE_descriptor_s *td,
+    const asn_per_constraints_t *constraints,
+    const void *sptr,
+    void **buffer_r
+);
+
+/*
+ * Type of the generic PER encoder function.
+ */
+typedef asn_enc_rval_t(per_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_ENCODER_H_ */
diff --git a/e2sm/headers/per_opentype.h b/e2sm/headers/per_opentype.h
new file mode 100644
index 0000000..1493b2d
--- /dev/null
+++ b/e2sm/headers/per_opentype.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_OPENTYPE_H_
+#define	_PER_OPENTYPE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+asn_dec_rval_t uper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *td,
+                                  const asn_per_constraints_t *constraints,
+                                  void **sptr, asn_per_data_t *pd);
+
+int uper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx,
+                        asn_per_data_t *pd);
+
+/*
+ * X.691 (2015/08), #11.2
+ * Returns -1 if error is encountered. 0 if all OK.
+ */
+int uper_open_type_put(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po);
+
+asn_dec_rval_t aper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *td,
+                                  const asn_per_constraints_t *constraints,
+                                  void **sptr, asn_per_data_t *pd);
+
+
+int aper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd);
+
+int aper_open_type_put(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_OPENTYPE_H_ */
diff --git a/e2sm/headers/per_support.h b/e2sm/headers/per_support.h
new file mode 100644
index 0000000..23079c9
--- /dev/null
+++ b/e2sm/headers/per_support.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_SUPPORT_H_
+#define	_PER_SUPPORT_H_
+
+#include <asn_system.h>		/* Platform-specific types */
+#include <asn_bit_data.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Pre-computed PER constraints.
+ */
+typedef struct asn_per_constraint_s {
+	enum asn_per_constraint_flags {
+		APC_UNCONSTRAINED	= 0x0,	/* No PER visible constraints */
+		APC_SEMI_CONSTRAINED	= 0x1,	/* Constrained at "lb" */
+		APC_CONSTRAINED		= 0x2,	/* Fully constrained */
+		APC_EXTENSIBLE		= 0x4	/* May have extension */
+	} flags;
+	int  range_bits;		/* Full number of bits in the range */
+	int  effective_bits;		/* Effective bits */
+	long lower_bound;		/* "lb" value */
+	long upper_bound;		/* "ub" value */
+} asn_per_constraint_t;
+typedef struct asn_per_constraints_s {
+	asn_per_constraint_t value;
+	asn_per_constraint_t size;
+	int (*value2code)(unsigned int value);
+	int (*code2value)(unsigned int code);
+} asn_per_constraints_t;
+
+/* Temporary compatibility layer. Will get removed. */
+typedef struct asn_bit_data_s asn_per_data_t;
+#define per_get_few_bits(data, bits)   asn_get_few_bits(data, bits)
+#define per_get_undo(data, bits)   asn_get_undo(data, bits)
+#define per_get_many_bits(data, dst, align, bits) \
+    asn_get_many_bits(data, dst, align, bits)
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Get the length "n" from the Unaligned PER stream.
+ */
+ssize_t uper_get_length(asn_per_data_t *pd, int effective_bound_bits,
+                        size_t lower_bound, int *repeat);
+
+ssize_t aper_get_length(asn_per_data_t *pd, int range,
+                        int effective_bound_bits, int *repeat);
+
+/*
+ * Get the normally small length "n".
+ */
+ssize_t uper_get_nslength(asn_per_data_t *pd);
+ssize_t aper_get_nslength(asn_per_data_t *pd);
+
+/*
+ * Get the normally small non-negative whole number.
+ */
+ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
+ssize_t aper_get_nsnnwn(asn_per_data_t *pd, int range);
+
+/* X.691-2008/11, #11.5.6 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits);
+
+
+/* Temporary compatibility layer. Will get removed. */
+typedef struct asn_bit_outp_s asn_per_outp_t;
+#define per_put_few_bits(out, bits, obits) asn_put_few_bits(out, bits, obits)
+#define per_put_many_bits(out, src, nbits) asn_put_many_bits(out, src, nbits)
+#define per_put_aligned_flush(out) asn_put_aligned_flush(out)
+
+
+/*
+ * Rebase the given value as an offset into the range specified by the
+ * lower bound (lb) and upper bound (ub).
+ * RETURN VALUES:
+ *  -1: Conversion failed due to range problems.
+ *   0: Conversion was successful.
+ */
+int per_long_range_rebase(long v, long lb, long ub, unsigned long *output);
+/* The inverse operation: restores the value by the offset and its bounds. */
+int per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp);
+
+/* X.691-2008/11, #11.5 */
+int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Put the length "whole_length" to the Unaligned PER stream.
+ * If (opt_need_eom) is given, it will be set to 1 if final 0-length is needed.
+ * In that case, invoke uper_put_length(po, 0, 0) after encoding the last block.
+ * This function returns the number of units which may be flushed
+ * in the next units saving iteration.
+ */
+ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length,
+                        int *opt_need_eom);
+
+ssize_t aper_put_length(asn_per_outp_t *po, int range, size_t length);
+
+/* Align the current bit position to octet bundary */
+int aper_put_align(asn_per_outp_t *po);
+int32_t aper_get_align(asn_per_data_t *pd);
+
+/*
+ * Put the normally small length "n" to the Unaligned PER stream.
+ * Returns 0 or -1.
+ */
+int uper_put_nslength(asn_per_outp_t *po, size_t length);
+
+int aper_put_nslength(asn_per_outp_t *po, size_t length);
+
+/*
+ * Put the normally small non-negative whole number.
+ */
+int uper_put_nsnnwn(asn_per_outp_t *po, int n);
+
+int aper_put_nsnnwn(asn_per_outp_t *po, int range, int number);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_SUPPORT_H_ */
diff --git a/e2sm/headers/xer_decoder.h b/e2sm/headers/xer_decoder.h
new file mode 100644
index 0000000..b951c41
--- /dev/null
+++ b/e2sm/headers/xer_decoder.h
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_DECODER_H_
+#define	_XER_DECODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The XER decoder of any ASN.1 type. May be invoked by the application.
+ * Decodes CANONICAL-XER and BASIC-XER.
+ */
+asn_dec_rval_t xer_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of data buffer */
+);
+
+/*
+ * Type of the type-specific XER decoder function.
+ */
+typedef asn_dec_rval_t(xer_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const char *opt_mname, /* Member name */
+    const void *buf_ptr, size_t size);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Generalized function for decoding the primitive values.
+ * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8
+ * and others. This function should not be used by applications, as its API
+ * is subject to changes.
+ */
+asn_dec_rval_t xer_decode_general(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    asn_struct_ctx_t *ctx, /* Type decoder context */
+    void *struct_key,      /* Treated as opaque pointer */
+    const char *xml_tag,   /* Expected XML tag name */
+    const void *buf_ptr, size_t size,
+    int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf,
+                                      size_t chunk_size),
+    ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf,
+                             size_t chunk_size, int have_more));
+
+
+/*
+ * Fetch the next XER (XML) token from the stream.
+ * The function returns the number of bytes occupied by the chunk type,
+ * returned in the _ch_type. The _ch_type is only set (and valid) when
+ * the return value is >= 0.
+ */
+  typedef enum pxer_chunk_type {
+	PXER_WMORE,     /* Chunk type is not clear, more data expected. */
+	PXER_TAG,	    /* Complete XER tag */
+	PXER_TEXT,	    /* Plain text between XER tags */
+	PXER_COMMENT	/* A comment, may be part of */
+  } pxer_chunk_type_e;
+ssize_t xer_next_token(int *stateContext,
+	const void *buffer, size_t size, pxer_chunk_type_e *_ch_type);
+
+/*
+ * This function checks the buffer against the tag name is expected to occur.
+ */
+  typedef enum xer_check_tag {
+	XCT_BROKEN	= 0,	/* The tag is broken */
+	XCT_OPENING	= 1,	/* This is the <opening> tag */
+	XCT_CLOSING	= 2,	/* This is the </closing> tag */
+	XCT_BOTH	= 3,	/* This is the <modified/> tag */
+	XCT__UNK__MASK	= 4,	/* Mask of everything unexpected */
+	XCT_UNKNOWN_OP	= 5,	/* Unexpected <opening> tag */
+	XCT_UNKNOWN_CL	= 6,	/* Unexpected </closing> tag */
+	XCT_UNKNOWN_BO	= 7	/* Unexpected <modified/> tag */
+  } xer_check_tag_e;
+xer_check_tag_e xer_check_tag(const void *buf_ptr, int size,
+		const char *need_tag);
+
+/*
+ * Get the number of bytes consisting entirely of XER whitespace characters.
+ * RETURN VALUES:
+ * >=0:	Number of whitespace characters in the string.
+ */
+size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size);
+
+/*
+ * Skip the series of anticipated extensions.
+ */
+int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_DECODER_H_ */
diff --git a/e2sm/headers/xer_encoder.h b/e2sm/headers/xer_encoder.h
new file mode 100644
index 0000000..9d75922
--- /dev/null
+++ b/e2sm/headers/xer_encoder.h
@@ -0,0 +1,83 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_ENCODER_H_
+#define	_XER_ENCODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */
+enum xer_encoder_flags_e {
+	/* Mode of encoding */
+	XER_F_BASIC	= 0x01,	/* BASIC-XER (pretty-printing) */
+	XER_F_CANONICAL	= 0x02	/* Canonical XER (strict rules) */
+};
+
+/*
+ * The XER encoder of any type. May be invoked by the application.
+ * Produces CANONICAL-XER and BASIC-XER depending on the (xer_flags).
+ */
+asn_enc_rval_t xer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          enum xer_encoder_flags_e xer_flags,
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/*
+ * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC)
+ * output into the chosen file pointer.
+ * RETURN VALUES:
+ * 	 0: The structure is printed.
+ * 	-1: Problem printing the structure.
+ * WARNING: No sensible errno value is returned.
+ */
+int xer_fprint(FILE *stream, const struct asn_TYPE_descriptor_s *td,
+               const void *struct_ptr);
+
+/*
+ * A helper function that uses XER encoding/decoding to verify that:
+ * - Both structures encode into the same BASIC XER.
+ * - Both resulting XER byte streams can be decoded back.
+ * - Both decoded structures encode into the same BASIC XER (round-trip).
+ * All of this verifies equivalence between structures and a round-trip.
+ * ARGUMENTS:
+ *  (opt_debug_stream)  - If specified, prints ongoing details.
+ */
+enum xer_equivalence_e {
+    XEQ_SUCCESS,          /* The only completely positive return value */
+    XEQ_FAILURE,          /* General failure */
+    XEQ_ENCODE1_FAILED,   /* First sructure XER encoding failed */
+    XEQ_ENCODE2_FAILED,   /* Second structure XER encoding failed */
+    XEQ_DIFFERENT,        /* Structures encoded into different XER */
+    XEQ_DECODE_FAILED,    /* Decode of the XER data failed */
+    XEQ_ROUND_TRIP_FAILED /* Bad round-trip */
+};
+enum xer_equivalence_e xer_equivalent(
+    const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct1,
+    const void *struct2, FILE *opt_debug_stream);
+
+/*
+ * Type of the generic XER encoder.
+ */
+typedef asn_enc_rval_t(xer_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    int ilevel,             /* Level of indentation */
+    enum xer_encoder_flags_e xer_flags,
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_ENCODER_H_ */
diff --git a/e2sm/headers/xer_support.h b/e2sm/headers/xer_support.h
new file mode 100644
index 0000000..c3a36e7
--- /dev/null
+++ b/e2sm/headers/xer_support.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com.
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_SUPPORT_H_
+#define	_XER_SUPPORT_H_
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Types of data transferred to the application.
+ */
+typedef enum {
+	PXML_TEXT,	/* Plain text between XML tags. */
+	PXML_TAG,	/* A tag, starting with '<'. */
+	PXML_COMMENT,	/* An XML comment, including "<!--" and "-->". */
+	/* 
+	 * The following chunk types are reported if the chunk
+	 * terminates the specified XML element.
+	 */
+	PXML_TAG_END,		/* Tag ended */
+	PXML_COMMENT_END	/* Comment ended */
+} pxml_chunk_type_e;
+
+/*
+ * Callback function that is called by the parser when parsed data is
+ * available. The _opaque is the pointer to a field containing opaque user 
+ * data specified in pxml_create() call. The chunk type is _type and the text 
+ * data is the piece of buffer identified by _bufid (as supplied to
+ * pxml_feed() call) starting at offset _offset and of _size bytes size. 
+ * The chunk is NOT '\0'-terminated.
+ */
+typedef int (pxml_callback_f)(pxml_chunk_type_e _type,
+	const void *_chunk_data, size_t _chunk_size, void *_key);
+
+/*
+ * Parse the given buffer as it were a chunk of XML data.
+ * Invoke the specified callback each time the meaninful data is found.
+ * This function returns number of bytes consumed from the bufer.
+ * It will always be lesser than or equal to the specified _size.
+ * The next invocation of this function must account the difference.
+ */
+ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size,
+	pxml_callback_f *cb, void *_key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_SUPPORT_H_ */
diff --git a/e2sm/lib/BIT_STRING.c b/e2sm/lib/BIT_STRING.c
new file mode 100644
index 0000000..e8d7354
--- /dev/null
+++ b/e2sm/lib/BIT_STRING.c
@@ -0,0 +1,656 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <BIT_STRING.h>
+#include <asn_internal.h>
+
+/*
+ * BIT STRING basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
+};
+asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
+	sizeof(BIT_STRING_t),
+	offsetof(BIT_STRING_t, _asn_ctx),
+	ASN_OSUBV_BIT
+};
+asn_TYPE_operation_t asn_OP_BIT_STRING = {
+	OCTET_STRING_free,         /* Implemented in terms of OCTET STRING */
+	BIT_STRING_print,
+	BIT_STRING_compare,
+	OCTET_STRING_decode_ber,   /* Implemented in terms of OCTET STRING */
+	OCTET_STRING_encode_der,   /* Implemented in terms of OCTET STRING */
+	OCTET_STRING_decode_xer_binary,
+	BIT_STRING_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	BIT_STRING_decode_oer,
+	BIT_STRING_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	BIT_STRING_decode_uper,	/* Unaligned PER decoder */
+	BIT_STRING_encode_uper,	/* Unaligned PER encoder */
+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+	BIT_STRING_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
+	"BIT STRING",
+	"BIT_STRING",
+	&asn_OP_BIT_STRING,
+	asn_DEF_BIT_STRING_tags,
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
+	asn_DEF_BIT_STRING_tags,	/* Same as above */
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
+	{ 0, 0, BIT_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_BIT_STRING_specs
+};
+
+/*
+ * BIT STRING generic constraint.
+ */
+int
+BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+
+	if(st && st->buf) {
+		if((st->size == 0 && st->bits_unused)
+		|| st->bits_unused < 0 || st->bits_unused > 7) {
+			ASN__CTFAIL(app_key, td, sptr,
+				"%s: invalid padding byte (%s:%d)",
+				td->name, __FILE__, __LINE__);
+			return -1;
+		}
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	return 0;
+}
+
+static const char *_bit_pattern[16] = {
+	"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
+	"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
+};
+
+asn_enc_rval_t
+BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      int ilevel, enum xer_encoder_flags_e flags,
+                      asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_enc_rval_t er = {0, 0, 0};
+	char scratch[128];
+	char *p = scratch;
+	char *scend = scratch + (sizeof(scratch) - 10);
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	int xcan = (flags & XER_F_CANONICAL);
+	uint8_t *buf;
+	uint8_t *end;
+
+	if(!st || !st->buf)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	buf = st->buf;
+	end = buf + st->size - 1;	/* Last byte is special */
+
+	/*
+	 * Binary dump
+	 */
+	for(; buf < end; buf++) {
+		int v = *buf;
+		int nline = xcan?0:(((buf - st->buf) % 8) == 0);
+		if(p >= scend || nline) {
+			ASN__CALLBACK(scratch, p - scratch);
+			p = scratch;
+			if(nline) ASN__TEXT_INDENT(1, ilevel);
+		}
+		memcpy(p + 0, _bit_pattern[v >> 4], 4);
+		memcpy(p + 4, _bit_pattern[v & 0x0f], 4);
+		p += 8;
+	}
+
+	if(!xcan && ((buf - st->buf) % 8) == 0)
+		ASN__TEXT_INDENT(1, ilevel);
+	ASN__CALLBACK(scratch, p - scratch);
+	p = scratch;
+
+	if(buf == end) {
+		int v = *buf;
+		int ubits = st->bits_unused;
+		int i;
+		for(i = 7; i >= ubits; i--)
+			*p++ = (v & (1 << i)) ? 0x31 : 0x30;
+		ASN__CALLBACK(scratch, p - scratch);
+	}
+
+	if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+
+/*
+ * BIT STRING specific contents printer.
+ */
+int
+BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                 asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	char scratch[64];
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	uint8_t *buf;
+	uint8_t *end;
+	char *p = scratch;
+
+	(void)td;	/* Unused argument */
+
+	if(!st || !st->buf)
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	ilevel++;
+	buf = st->buf;
+	end = buf + st->size;
+
+	/*
+	 * Hexadecimal dump.
+	 */
+	for(; buf < end; buf++) {
+		if((buf - st->buf) % 16 == 0 && (st->size > 16)
+				&& buf != st->buf) {
+			_i_INDENT(1);
+			/* Dump the string */
+			if(cb(scratch, p - scratch, app_key) < 0) return -1;
+			p = scratch;
+		}
+		*p++ = h2c[*buf >> 4];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x20;
+	}
+
+	if(p > scratch) {
+		p--;	/* Eat the tailing space */
+
+		if((st->size > 16)) {
+			_i_INDENT(1);
+		}
+
+		/* Dump the incomplete 16-bytes row */
+		if(cb(scratch, p - scratch, app_key) < 0)
+			return -1;
+	}
+
+    if(st->bits_unused) {
+        int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
+                           st->bits_unused, st->bits_unused == 1 ? "" : "s");
+        assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
+        if(ret > 0 && ret < (ssize_t)sizeof(scratch)
+           && cb(scratch, ret, app_key) < 0)
+            return -1;
+    }
+
+	return 0;
+}
+
+/*
+ * Non-destructively remove the trailing 0-bits from the given bit string.
+ */
+static const BIT_STRING_t *
+BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
+    const uint8_t *b;
+    union {
+        const uint8_t *c_buf;
+        uint8_t *nc_buf;
+    } unconst;
+
+    if(st->size == 0) {
+        assert(st->bits_unused == 0);
+        return st;
+    } else {
+        for(b = &st->buf[st->size - 1]; b > st->buf && *b == 0; b--) {
+            ;
+        }
+        /* b points to the last byte which may contain data */
+        if(*b) {
+            int unused = 7;
+            uint8_t v = *b;
+            v &= -(int8_t)v;
+            if(v & 0x0F) unused -= 4;
+            if(v & 0x33) unused -= 2;
+            if(v & 0x55) unused -= 1;
+            tmp->size = b-st->buf + 1;
+            tmp->bits_unused = unused;
+        } else {
+            tmp->size = b-st->buf;
+            tmp->bits_unused = 0;
+        }
+
+        assert(b >= st->buf);
+    }
+
+    unconst.c_buf = st->buf;
+    tmp->buf = unconst.nc_buf;
+    return tmp;
+}
+
+/*
+ * Lexicographically compare the common prefix of both strings,
+ * and if it is the same return -1 for the smallest string.
+ */
+int
+BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                   const void *bptr) {
+    /*
+     * Remove information about trailing bits, since
+     * X.680 (08/2015) #22.7 "ensure that different semantics are not"
+     * "associated with [values that differ only in] the trailing 0 bits."
+     */
+    BIT_STRING_t compact_a, compact_b;
+    const BIT_STRING_t *a = BIT_STRING__compactify(aptr, &compact_a);
+    const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics;
+
+    assert(specs && specs->subvariant == ASN_OSUBV_BIT);
+
+    if(a && b) {
+        size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
+        int ret = memcmp(a->buf, b->buf, common_prefix_size);
+        if(ret == 0) {
+            /* Figure out which string with equal prefixes is longer. */
+            if(a->size < b->size) {
+                return -1;
+            } else if(a->size > b->size) {
+                return 1;
+            } else {
+                /* Figure out how many unused bits */
+                if(a->bits_unused > b->bits_unused) {
+                    return -1;
+                } else if(a->bits_unused < b->bits_unused) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+        } else {
+            return ret;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+#undef  RETURN
+#define RETURN(_code)                       \
+    do {                                    \
+        asn_dec_rval_t tmprval;             \
+        tmprval.code = _code;               \
+        tmprval.consumed = consumed_myself; \
+        return tmprval;                     \
+    } while(0)
+
+static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = {
+    APC_SEMI_CONSTRAINED, -1, -1, 0, 0};
+
+asn_dec_rval_t
+BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                       const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints, void **sptr,
+                       asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_BIT_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		csiz = &pc->size;
+	} else {
+		csiz = &asn_DEF_BIT_STRING_constraint_size;
+	}
+
+	if(specs->subvariant != ASN_OSUBV_BIT) {
+		ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant);
+		RETURN(RC_FAIL);
+    }
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_BIT_STRING_constraint_size;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+        st->size = (csiz->upper_bound + 7) >> 3;
+        st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+        ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound);
+        ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound);
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += csiz->upper_bound;
+		st->buf[st->size] = 0;
+        st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7;
+        RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		ssize_t len_bits;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
+		                          &repeat);
+		if(raw_len < 0) RETURN(RC_WMORE);
+        if(raw_len == 0 && st->buf) break;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+        len_bits = raw_len;
+        len_bytes = (len_bits + 7) >> 3;
+        if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7);
+        /* len_bits be multiple of 16K if repeat is set */
+        p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+        ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
+        if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_BIT_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *csiz;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	BIT_STRING_t compact_bstr;  /* Do not modify this directly! */
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;		/* Lies not within extension root */
+	size_t size_in_bits;
+	const uint8_t *buf;
+	int ret;
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(specs->subvariant == ASN_OSUBV_BIT) {
+        if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7))
+            ASN__ENCODE_FAILED;
+    } else {
+		ASN__ENCODE_FAILED;
+    }
+
+	if(pc) {
+        csiz = &pc->size;
+    } else {
+		csiz = &asn_DEF_BIT_STRING_constraint_size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+    /* Figure out the size without the trailing bits */
+    st = BIT_STRING__compactify(st, &compact_bstr);
+    size_in_bits = 8 * st->size - st->bits_unused;
+
+    ASN_DEBUG(
+        "Encoding %s into %" ASN_PRI_SIZE " bits"
+        " (%ld..%ld, effective %d)%s",
+        td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound,
+        csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+    /* Figure out whether size lies within PER visible constraint */
+
+    if(csiz->effective_bits >= 0) {
+        if((ssize_t)size_in_bits > csiz->upper_bound) {
+            if(ct_extensible) {
+                csiz = &asn_DEF_BIT_STRING_constraint_size;
+                inext = 1;
+            } else {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    } else {
+        inext = 0;
+    }
+
+    if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+    if(csiz->effective_bits >= 0 && !inext) {
+        int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
+        ASN_DEBUG(
+            "Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual "
+            "value %" ASN_PRI_SSIZE "",
+            st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits,
+            add_trailer,
+            add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound);
+        ret = per_put_few_bits(
+            po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound,
+            csiz->effective_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        ret = per_put_many_bits(po, st->buf, size_in_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        if(add_trailer) {
+            static const uint8_t zeros[16];
+            size_t trailing_zero_bits = csiz->lower_bound - size_in_bits;
+            while(trailing_zero_bits > 0) {
+                if(trailing_zero_bits > 8 * sizeof(zeros)) {
+                    ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros));
+                    trailing_zero_bits -= 8 * sizeof(zeros);
+                } else {
+                    ret = per_put_many_bits(po, zeros, trailing_zero_bits);
+                    trailing_zero_bits = 0;
+                }
+                if(ret) ASN__ENCODE_FAILED;
+            }
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
+
+    buf = st->buf;
+    do {
+        int need_eom = 0;
+        ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom);
+        if(maySave < 0) ASN__ENCODE_FAILED;
+
+        ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits);
+
+        ret = per_put_many_bits(po, buf, maySave);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += maySave >> 3;
+        size_in_bits -= maySave;
+        assert(!(maySave & 0x07) || !size_in_bits);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size_in_bits);
+
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+asn_random_fill_result_t
+BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                       const asn_encoding_constraints_t *constraints,
+                       size_t max_length) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_BIT_STRING_specs;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    static unsigned lengths[] = {0,     1,     2,     3,     4,     8,
+                                 126,   127,   128,   16383, 16384, 16385,
+                                 65534, 65535, 65536, 65537};
+    uint8_t *buf;
+    uint8_t *bend;
+    uint8_t *b;
+    size_t rnd_bits, rnd_len;
+    BIT_STRING_t *st;
+
+    if(max_length == 0) return result_skipped;
+
+    switch(specs->subvariant) {
+    case ASN_OSUBV_ANY:
+        return result_failed;
+    case ASN_OSUBV_BIT:
+        break;
+    default:
+        break;
+    }
+
+    /* Figure out how far we should go */
+    rnd_bits = lengths[asn_random_between(
+        0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_CONSTRAINED) {
+            long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
+                                             ? pc->upper_bound
+                                             : (ssize_t)max_length;
+            if(max_length < (size_t)pc->lower_bound) {
+                return result_skipped;
+            }
+            if(pc->flags & APC_EXTENSIBLE) {
+                switch(asn_random_between(0, 5)) {
+                case 0:
+                    if(pc->lower_bound > 0) {
+                        rnd_bits = pc->lower_bound - 1;
+                        break;
+                    }
+                    /* Fall through */
+                case 1:
+                    rnd_bits = pc->upper_bound + 1;
+                    break;
+                case 2:
+                    /* Keep rnd_bits from the table */
+                    if(rnd_bits < max_length) {
+                        break;
+                    }
+                    /* Fall through */
+                default:
+                    rnd_bits = asn_random_between(pc->lower_bound,
+                                                  suggested_upper_bound);
+                }
+            } else {
+                rnd_bits =
+                    asn_random_between(pc->lower_bound, suggested_upper_bound);
+            }
+        } else {
+            rnd_bits = asn_random_between(0, max_length - 1);
+        }
+    } else if(rnd_bits >= max_length) {
+        rnd_bits = asn_random_between(0, max_length - 1);
+    }
+
+    rnd_len = (rnd_bits + 7) / 8;
+    buf = CALLOC(1, rnd_len + 1);
+    if(!buf) return result_failed;
+
+    bend = &buf[rnd_len];
+
+    for(b = buf; b < bend; b++) {
+        *(uint8_t *)b = asn_random_between(0, 255);
+    }
+    *b = 0; /* Zero-terminate just in case. */
+
+    if(*sptr) {
+        st = *sptr;
+        FREEMEM(st->buf);
+    } else {
+        st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) {
+            FREEMEM(buf);
+            return result_failed;
+        }
+    }
+
+    st->buf = buf;
+    st->size = rnd_len;
+    st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
+    if(st->bits_unused) {
+        assert(st->size > 0);
+        st->buf[st->size-1] &= 0xff << st->bits_unused;
+    }
+
+    result_ok.length = st->size;
+    return result_ok;
+}
diff --git a/e2sm/lib/BIT_STRING_oer.c b/e2sm/lib/BIT_STRING_oer.c
new file mode 100644
index 0000000..aff5075
--- /dev/null
+++ b/e2sm/lib/BIT_STRING_oer.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <BIT_STRING.h>
+#include <errno.h>
+
+asn_dec_rval_t
+BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                      const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints, void **sptr,
+                      const void *ptr, size_t size) {
+    BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+
+    (void)opt_codec_ctx;
+
+    if(!st) {
+        st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        expected_length = (ct_size + 7) >> 3;
+        st->bits_unused = (8 - (ct_size & 7)) & 7;
+    } else {
+        /*
+         * X.696 (08/2015) #13.3.1
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
+        if(len_len > 0) {
+            ptr = (const char *)ptr + len_len;
+            size -= len_len;
+        } else if(len_len == 0) {
+            ASN__DECODE_STARVED;
+        } else if(len_len < 0) {
+            ASN__DECODE_FAILED;
+        }
+
+        if(expected_length < 1) {
+            ASN__DECODE_FAILED;
+        } else if(expected_length > size) {
+            ASN__DECODE_STARVED;
+        }
+
+        st->bits_unused = ((const uint8_t *)ptr)[0];
+        if(st->bits_unused & ~7) {
+            ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name);
+            ASN__DECODE_FAILED;
+        }
+        ptr = (const char *)ptr + 1;
+        size--;
+        expected_length--;
+        rval.consumed = len_len + 1;
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+        if(expected_length > 0) {
+            buf[expected_length - 1] &= (0xff << st->bits_unused);
+        }
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints,
+                      const void *sptr, asn_app_consume_bytes_f *cb,
+                      void *app_key) {
+    const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+    asn_enc_rval_t erval = {0, 0, 0};
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    size_t trailing_zeros = 0;
+    int fix_last_byte = 0;
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    if(st->bits_unused & ~7) {
+        ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range",
+                  st->bits_unused);
+        ASN__ENCODE_FAILED;
+    }
+    if(st->bits_unused && !(st->size && st->buf)) {
+        ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name,
+                  st->bits_unused);
+        ASN__ENCODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        size_t ct_bytes = (ct_size + 7) >> 3;
+        if(st->size > ct_bytes) {
+            ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "",
+                      td->name, 8 * st->size - st->bits_unused, ct_size);
+            ASN__ENCODE_FAILED;
+        }
+        trailing_zeros = ct_bytes - st->size;   /* Allow larger constraint */
+    } else {
+        uint8_t ub = st->bits_unused & 7;
+        ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key);
+        if(len_len < 0) ASN__ENCODE_FAILED;
+        if(cb(&ub, 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        erval.encoded += len_len + 1;
+    }
+
+    if(st->bits_unused) {
+        if(st->buf[st->size - 1] & (0xff << st->bits_unused)) {
+            fix_last_byte = 1;
+        }
+    }
+
+    if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    if(fix_last_byte) {
+        uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused);
+        if(cb(&b, 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+    erval.encoded += st->size;
+
+    if(trailing_zeros) {
+        static uint8_t zeros[16];
+        while(trailing_zeros > 0) {
+            int ret;
+            if(trailing_zeros < sizeof(zeros)) {
+                ret = cb(zeros, trailing_zeros, app_key);
+                erval.encoded += trailing_zeros;
+            } else {
+                ret = cb(zeros, sizeof(zeros), app_key);
+                erval.encoded += sizeof(zeros);
+            }
+            if(ret < 0) ASN__ENCODE_FAILED;
+        }
+    }
+
+    return erval;
+}
+
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/BOOLEAN.c b/e2sm/lib/BOOLEAN.c
new file mode 100644
index 0000000..25831e2
--- /dev/null
+++ b/e2sm/lib/BOOLEAN.c
@@ -0,0 +1,492 @@
+/*-
+ * Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+#include <BOOLEAN.h>
+
+/*
+ * BOOLEAN basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (1 << 2))
+};
+asn_TYPE_operation_t asn_OP_BOOLEAN = {
+	BOOLEAN_free,
+	BOOLEAN_print,
+	BOOLEAN_compare,
+	BOOLEAN_decode_ber,
+	BOOLEAN_encode_der,
+	BOOLEAN_decode_xer,
+	BOOLEAN_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	BOOLEAN_decode_oer,
+	BOOLEAN_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	BOOLEAN_decode_uper,	/* Unaligned PER decoder */
+	BOOLEAN_encode_uper,	/* Unaligned PER encoder */
+	BOOLEAN_decode_aper,	/* Aligned PER decoder */
+	BOOLEAN_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	BOOLEAN_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
+	"BOOLEAN",
+	"BOOLEAN",
+	&asn_OP_BOOLEAN,
+	asn_DEF_BOOLEAN_tags,
+	sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
+	asn_DEF_BOOLEAN_tags,	/* Same as above */
+	sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+/*
+ * Decode BOOLEAN type.
+ */
+asn_dec_rval_t
+BOOLEAN_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void **bool_value,
+                   const void *buf_ptr, size_t size, int tag_mode) {
+    BOOLEAN_t *st = (BOOLEAN_t *)*bool_value;
+	asn_dec_rval_t rval;
+	ber_tlv_len_t length;
+	ber_tlv_len_t lidx;
+
+	if(st == NULL) {
+		st = (BOOLEAN_t *)(*bool_value = CALLOC(1, sizeof(*st)));
+		if(st == NULL) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+			return rval;
+		}
+	}
+
+	ASN_DEBUG("Decoding %s as BOOLEAN (tm=%d)",
+		td->name, tag_mode);
+
+	/*
+	 * Check tags.
+	 */
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+		tag_mode, 0, &length, 0);
+	if(rval.code != RC_OK)
+		return rval;
+
+	ASN_DEBUG("Boolean length is %d bytes", (int)length);
+
+	buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+	size -= rval.consumed;
+	if(length > (ber_tlv_len_t)size) {
+		rval.code = RC_WMORE;
+		rval.consumed = 0;
+		return rval;
+	}
+
+	/*
+	 * Compute boolean value.
+	 */
+	for(*st = 0, lidx = 0;
+		(lidx < length) && *st == 0; lidx++) {
+		/*
+		 * Very simple approach: read bytes until the end or
+		 * value is already TRUE.
+		 * BOOLEAN is not supposed to contain meaningful data anyway.
+		 */
+		*st |= ((const uint8_t *)buf_ptr)[lidx];
+	}
+
+	rval.code = RC_OK;
+	rval.consumed += length;
+
+	ASN_DEBUG("Took %ld/%ld bytes to encode %s, value=%d",
+		(long)rval.consumed, (long)length,
+		td->name, *st);
+	
+	return rval;
+}
+
+asn_enc_rval_t
+BOOLEAN_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                   void *app_key) {
+	asn_enc_rval_t erval = {0,0,0};
+	const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
+
+	erval.encoded = der_write_tags(td, 1, tag_mode, 0, tag, cb, app_key);
+	if(erval.encoded == -1) {
+		erval.failed_type = td;
+		erval.structure_ptr = sptr;
+		return erval;
+	}
+
+	if(cb) {
+		uint8_t bool_value;
+
+		bool_value = *st ? 0xff : 0; /* 0xff mandated by DER */
+
+		if(cb(&bool_value, 1, app_key) < 0) {
+			erval.encoded = -1;
+			erval.failed_type = td;
+			erval.structure_ptr = sptr;
+			return erval;
+		}
+	}
+
+	erval.encoded += 1;
+
+	ASN__ENCODED_OK(erval);
+}
+
+
+/*
+ * Decode the chunk of XML text encoding INTEGER.
+ */
+static enum xer_pbd_rval
+BOOLEAN__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
+                         const void *chunk_buf, size_t chunk_size) {
+    BOOLEAN_t *st = (BOOLEAN_t *)sptr;
+	const char *p = (const char *)chunk_buf;
+
+	(void)td;
+
+	if(chunk_size && p[0] == 0x3c /* '<' */) {
+		switch(xer_check_tag(chunk_buf, chunk_size, "false")) {
+		case XCT_BOTH:
+			/* "<false/>" */
+			*st = 0;
+			break;
+		case XCT_UNKNOWN_BO:
+			if(xer_check_tag(chunk_buf, chunk_size, "true")
+					!= XCT_BOTH)
+				return XPBD_BROKEN_ENCODING;
+			/* "<true/>" */
+			*st = 1;	/* Or 0xff as in DER?.. */
+			break;
+		default:
+			return XPBD_BROKEN_ENCODING;
+		}
+		return XPBD_BODY_CONSUMED;
+	} else {
+		return XPBD_BROKEN_ENCODING;
+	}
+}
+
+
+asn_dec_rval_t
+BOOLEAN_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void **sptr,
+                   const char *opt_mname, const void *buf_ptr, size_t size) {
+    return xer_decode_primitive(opt_codec_ctx, td,
+		sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size,
+		BOOLEAN__xer_body_decode);
+}
+
+asn_enc_rval_t
+BOOLEAN_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+	int ilevel, enum xer_encoder_flags_e flags,
+		asn_app_consume_bytes_f *cb, void *app_key) {
+	const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
+	asn_enc_rval_t er = {0, 0, 0};
+
+	(void)ilevel;
+	(void)flags;
+
+	if(!st) ASN__ENCODE_FAILED;
+
+	if(*st) {
+		ASN__CALLBACK("<true/>", 7);
+	} else {
+		ASN__CALLBACK("<false/>", 8);
+	}
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+int
+BOOLEAN_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+              asn_app_consume_bytes_f *cb, void *app_key) {
+    const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
+	const char *buf;
+	size_t buflen;
+
+	(void)td;	/* Unused argument */
+	(void)ilevel;	/* Unused argument */
+
+	if(st) {
+		if(*st) {
+			buf = "TRUE";
+			buflen = 4;
+		} else {
+			buf = "FALSE";
+			buflen = 5;
+		}
+	} else {
+		buf = "<absent>";
+		buflen = 8;
+	}
+
+	return (cb(buf, buflen, app_key) < 0) ? -1 : 0;
+}
+
+void
+BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr,
+             enum asn_struct_free_method method) {
+    if(td && ptr) {
+        switch(method) {
+        case ASFM_FREE_EVERYTHING:
+            FREEMEM(ptr);
+            break;
+        case ASFM_FREE_UNDERLYING:
+            break;
+        case ASFM_FREE_UNDERLYING_AND_RESET:
+            memset(ptr, 0, sizeof(BOOLEAN_t));
+            break;
+        }
+    }
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+BOOLEAN_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr,
+                    asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+	BOOLEAN_t *st = (BOOLEAN_t *)*sptr;
+
+	(void)opt_codec_ctx;
+    (void)td;
+	(void)constraints;
+
+	if(!st) {
+		st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	/*
+	 * Extract a single bit
+	 */
+	switch(per_get_few_bits(pd, 1)) {
+	case 1: *st = 1; break;
+	case 0: *st = 0; break;
+	case -1: default: ASN__DECODE_STARVED;
+	}
+
+	ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE");
+
+	rv.code = RC_OK;
+	rv.consumed = 1;
+	return rv;
+}
+
+
+asn_enc_rval_t
+BOOLEAN_encode_uper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, const void *sptr,
+                    asn_per_outp_t *po) {
+    const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+
+	(void)constraints;
+
+	if(!st) ASN__ENCODE_FAILED;
+
+	if(per_put_few_bits(po, *st ? 1 : 0, 1))
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+BOOLEAN_decode_aper(const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv;
+	BOOLEAN_t *st = (BOOLEAN_t *)*sptr;
+
+	(void)opt_codec_ctx;
+	(void)constraints;
+	(void)td;
+
+	if(!st) {
+		st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	/*
+	 * Extract a single bit
+	 */
+	switch(per_get_few_bits(pd, 1)) {
+	case 1:
+		*st = 1;
+		break;
+	case 0:
+		*st = 0;
+		break;
+	case -1:
+	default:
+		ASN__DECODE_STARVED;
+	}
+
+	ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE");
+
+	rv.code = RC_OK;
+	rv.consumed = 1;
+	return rv;
+}
+
+asn_enc_rval_t
+BOOLEAN_encode_aper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints,
+                    const void *sptr, asn_per_outp_t *po) {
+	const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+
+	(void)constraints;
+
+	if(!st) ASN__ENCODE_FAILED;
+
+	if(per_put_few_bits(po, *st ? 1 : 0, 1))
+        	ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif /* ASN_DISABLE_PER_SUPPORT */
+
+#ifndef  ASN_DISABLE_OER_SUPPORT
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+BOOLEAN_encode_oer(const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, const void *sptr,
+                   asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = { 1, 0, 0 };
+    const BOOLEAN_t *st = sptr;
+    uint8_t bool_value = *st ? 0xff : 0; /* 0xff mandated by OER */
+
+    (void)td;
+    (void)constraints;  /* Constraints are unused in OER */
+
+    if(cb(&bool_value, 1, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        ASN__ENCODED_OK(er);
+    }
+}
+
+asn_dec_rval_t
+BOOLEAN_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, void **sptr,
+                   const void *ptr, size_t size) {
+    asn_dec_rval_t ok = {RC_OK, 1};
+    BOOLEAN_t *st;
+
+    (void)opt_codec_ctx;
+    (void)td;
+    (void)constraints; /* Constraints are unused in OER */
+
+    if(size < 1) {
+        ASN__DECODE_STARVED;
+    }
+
+    if(!(st = *sptr)) {
+        st = (BOOLEAN_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    *st = *(const uint8_t *)ptr;
+
+    return ok;
+}
+
+
+
+#endif
+
+int
+BOOLEAN_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                const void *bptr) {
+    const BOOLEAN_t *a = aptr;
+    const BOOLEAN_t *b = bptr;
+
+    (void)td;
+
+    if(a && b) {
+        if(!*a == !*b) {    /* TRUE can be encoded by any non-zero byte. */
+            return 0;
+        } else if(!*a) {
+            return -1;
+        } else {
+            return 1;
+        }
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+asn_random_fill_result_t
+BOOLEAN_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                    const asn_encoding_constraints_t *constraints,
+                    size_t max_length) {
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    BOOLEAN_t *st = *sptr;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (BOOLEAN_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->value;
+        if(pc->flags & APC_CONSTRAINED) {
+            *st = asn_random_between(pc->lower_bound, pc->upper_bound);
+            return result_ok;
+        }
+    }
+
+    /* Simulate booleans that are sloppily set and biased. */
+    switch(asn_random_between(0, 7)) {
+    case 0:
+    case 1:
+    case 2:
+        *st = 0; break;
+    case 3: *st = -1; break;
+    case 4: *st = 1; break;
+    case 5: *st = INT_MIN; break;
+    case 6: *st = INT_MAX; break;
+    default:
+        *st = asn_random_between(INT_MIN, INT_MAX);
+        break;
+    }
+    return result_ok;
+}
diff --git a/e2sm/lib/CSI-RS-Index.c b/e2sm/lib/CSI-RS-Index.c
new file mode 100644
index 0000000..327aeb9
--- /dev/null
+++ b/e2sm/lib/CSI-RS-Index.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "CSI-RS-Index.h"
+
+int
+CSI_RS_Index_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 95)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CSI_RS_Index_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..95) */,
+	-1};
+asn_per_constraints_t asn_PER_type_CSI_RS_Index_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  95 }	/* (0..95) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_CSI_RS_Index_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CSI_RS_Index = {
+	"CSI-RS-Index",
+	"CSI-RS-Index",
+	&asn_OP_NativeInteger,
+	asn_DEF_CSI_RS_Index_tags_1,
+	sizeof(asn_DEF_CSI_RS_Index_tags_1)
+		/sizeof(asn_DEF_CSI_RS_Index_tags_1[0]), /* 1 */
+	asn_DEF_CSI_RS_Index_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CSI_RS_Index_tags_1)
+		/sizeof(asn_DEF_CSI_RS_Index_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CSI_RS_Index_constr_1, &asn_PER_type_CSI_RS_Index_constr_1, CSI_RS_Index_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/CUUPMeasurement-Container.c b/e2sm/lib/CUUPMeasurement-Container.c
new file mode 100644
index 0000000..0e768d8
--- /dev/null
+++ b/e2sm/lib/CUUPMeasurement-Container.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "CUUPMeasurement-Container.h"
+
+#include "PlmnID-Item.h"
+static int
+memb_plmnList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 12)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_plmnList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..12)) */};
+static asn_per_constraints_t asn_PER_type_plmnList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  12 }	/* (SIZE(1..12)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_plmnList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..12)) */};
+static asn_per_constraints_t asn_PER_memb_plmnList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  12 }	/* (SIZE(1..12)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_plmnList_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PlmnID_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_plmnList_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_plmnList_specs_2 = {
+	sizeof(struct CUUPMeasurement_Container__plmnList),
+	offsetof(struct CUUPMeasurement_Container__plmnList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_plmnList_2 = {
+	"plmnList",
+	"plmnList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_plmnList_tags_2,
+	sizeof(asn_DEF_plmnList_tags_2)
+		/sizeof(asn_DEF_plmnList_tags_2[0]) - 1, /* 1 */
+	asn_DEF_plmnList_tags_2,	/* Same as above */
+	sizeof(asn_DEF_plmnList_tags_2)
+		/sizeof(asn_DEF_plmnList_tags_2[0]), /* 2 */
+	{ &asn_OER_type_plmnList_constr_2, &asn_PER_type_plmnList_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_plmnList_2,
+	1,	/* Single element */
+	&asn_SPC_plmnList_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_CUUPMeasurement_Container_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct CUUPMeasurement_Container, plmnList),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_plmnList_2,
+		0,
+		{ &asn_OER_memb_plmnList_constr_2, &asn_PER_memb_plmnList_constr_2,  memb_plmnList_constraint_1 },
+		0, 0, /* No default value */
+		"plmnList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_CUUPMeasurement_Container_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_CUUPMeasurement_Container_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* plmnList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_CUUPMeasurement_Container_specs_1 = {
+	sizeof(struct CUUPMeasurement_Container),
+	offsetof(struct CUUPMeasurement_Container, _asn_ctx),
+	asn_MAP_CUUPMeasurement_Container_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_CUUPMeasurement_Container = {
+	"CUUPMeasurement-Container",
+	"CUUPMeasurement-Container",
+	&asn_OP_SEQUENCE,
+	asn_DEF_CUUPMeasurement_Container_tags_1,
+	sizeof(asn_DEF_CUUPMeasurement_Container_tags_1)
+		/sizeof(asn_DEF_CUUPMeasurement_Container_tags_1[0]), /* 1 */
+	asn_DEF_CUUPMeasurement_Container_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CUUPMeasurement_Container_tags_1)
+		/sizeof(asn_DEF_CUUPMeasurement_Container_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_CUUPMeasurement_Container_1,
+	1,	/* Elements count */
+	&asn_SPC_CUUPMeasurement_Container_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/CellObjectID.c b/e2sm/lib/CellObjectID.c
new file mode 100644
index 0000000..b6da12b
--- /dev/null
+++ b/e2sm/lib/CellObjectID.c
@@ -0,0 +1,109 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "CellObjectID.h"
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_1[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+	const int *table = permitted_alphabet_table_1;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+int
+CellObjectID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size <= 400)
+		 && !check_permitted_alphabet_1(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_CellObjectID_1_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+		return -1;
+	return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_CellObjectID_1_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+		return -1;
+	return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using PrintableString,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CellObjectID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+asn_per_constraints_t asn_PER_type_CellObjectID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  9,  9,  0,  400 }	/* (SIZE(0..400,...)) */,
+	asn_PER_MAP_CellObjectID_1_v2c,	/* Value to PER code map */
+	asn_PER_MAP_CellObjectID_1_c2v	/* PER code to value map */
+};
+static const ber_tlv_tag_t asn_DEF_CellObjectID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CellObjectID = {
+	"CellObjectID",
+	"CellObjectID",
+	&asn_OP_PrintableString,
+	asn_DEF_CellObjectID_tags_1,
+	sizeof(asn_DEF_CellObjectID_tags_1)
+		/sizeof(asn_DEF_CellObjectID_tags_1[0]), /* 1 */
+	asn_DEF_CellObjectID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CellObjectID_tags_1)
+		/sizeof(asn_DEF_CellObjectID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CellObjectID_constr_1, &asn_PER_type_CellObjectID_constr_1, CellObjectID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/CellResourceReportListItem.c b/e2sm/lib/CellResourceReportListItem.c
new file mode 100644
index 0000000..a7ce4ae
--- /dev/null
+++ b/e2sm/lib/CellResourceReportListItem.c
@@ -0,0 +1,228 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "CellResourceReportListItem.h"
+
+#include "ServedPlmnPerCellListItem.h"
+static int
+memb_dl_TotalofAvailablePRBs_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 273)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_ul_TotalofAvailablePRBs_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 273)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_servedPlmnPerCellList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 12)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..12)) */};
+static asn_per_constraints_t asn_PER_type_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  12 }	/* (SIZE(1..12)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_dl_TotalofAvailablePRBs_constr_3 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..273) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_dl_TotalofAvailablePRBs_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 9,  9,  0,  273 }	/* (0..273) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ul_TotalofAvailablePRBs_constr_4 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..273) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_ul_TotalofAvailablePRBs_constr_4 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 9,  9,  0,  273 }	/* (0..273) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..12)) */};
+static asn_per_constraints_t asn_PER_memb_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  12 }	/* (SIZE(1..12)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_servedPlmnPerCellList_5[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ServedPlmnPerCellListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_servedPlmnPerCellList_tags_5[] = {
+	(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_servedPlmnPerCellList_specs_5 = {
+	sizeof(struct CellResourceReportListItem__servedPlmnPerCellList),
+	offsetof(struct CellResourceReportListItem__servedPlmnPerCellList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_servedPlmnPerCellList_5 = {
+	"servedPlmnPerCellList",
+	"servedPlmnPerCellList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_servedPlmnPerCellList_tags_5,
+	sizeof(asn_DEF_servedPlmnPerCellList_tags_5)
+		/sizeof(asn_DEF_servedPlmnPerCellList_tags_5[0]) - 1, /* 1 */
+	asn_DEF_servedPlmnPerCellList_tags_5,	/* Same as above */
+	sizeof(asn_DEF_servedPlmnPerCellList_tags_5)
+		/sizeof(asn_DEF_servedPlmnPerCellList_tags_5[0]), /* 2 */
+	{ &asn_OER_type_servedPlmnPerCellList_constr_5, &asn_PER_type_servedPlmnPerCellList_constr_5, SEQUENCE_OF_constraint },
+	asn_MBR_servedPlmnPerCellList_5,
+	1,	/* Single element */
+	&asn_SPC_servedPlmnPerCellList_specs_5	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_CellResourceReportListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct CellResourceReportListItem, nRCGI),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NRCGI,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"nRCGI"
+		},
+	{ ATF_POINTER, 2, offsetof(struct CellResourceReportListItem, dl_TotalofAvailablePRBs),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_dl_TotalofAvailablePRBs_constr_3, &asn_PER_memb_dl_TotalofAvailablePRBs_constr_3,  memb_dl_TotalofAvailablePRBs_constraint_1 },
+		0, 0, /* No default value */
+		"dl-TotalofAvailablePRBs"
+		},
+	{ ATF_POINTER, 1, offsetof(struct CellResourceReportListItem, ul_TotalofAvailablePRBs),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_ul_TotalofAvailablePRBs_constr_4, &asn_PER_memb_ul_TotalofAvailablePRBs_constr_4,  memb_ul_TotalofAvailablePRBs_constraint_1 },
+		0, 0, /* No default value */
+		"ul-TotalofAvailablePRBs"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct CellResourceReportListItem, servedPlmnPerCellList),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		0,
+		&asn_DEF_servedPlmnPerCellList_5,
+		0,
+		{ &asn_OER_memb_servedPlmnPerCellList_constr_5, &asn_PER_memb_servedPlmnPerCellList_constr_5,  memb_servedPlmnPerCellList_constraint_1 },
+		0, 0, /* No default value */
+		"servedPlmnPerCellList"
+		},
+};
+static const int asn_MAP_CellResourceReportListItem_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_CellResourceReportListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_CellResourceReportListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nRCGI */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* dl-TotalofAvailablePRBs */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ul-TotalofAvailablePRBs */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* servedPlmnPerCellList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_CellResourceReportListItem_specs_1 = {
+	sizeof(struct CellResourceReportListItem),
+	offsetof(struct CellResourceReportListItem, _asn_ctx),
+	asn_MAP_CellResourceReportListItem_tag2el_1,
+	4,	/* Count of tags in the map */
+	asn_MAP_CellResourceReportListItem_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	4,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_CellResourceReportListItem = {
+	"CellResourceReportListItem",
+	"CellResourceReportListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_CellResourceReportListItem_tags_1,
+	sizeof(asn_DEF_CellResourceReportListItem_tags_1)
+		/sizeof(asn_DEF_CellResourceReportListItem_tags_1[0]), /* 1 */
+	asn_DEF_CellResourceReportListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CellResourceReportListItem_tags_1)
+		/sizeof(asn_DEF_CellResourceReportListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_CellResourceReportListItem_1,
+	4,	/* Elements count */
+	&asn_SPC_CellResourceReportListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/Criticality.c b/e2sm/lib/Criticality.c
new file mode 100644
index 0000000..7f57c68
--- /dev/null
+++ b/e2sm/lib/Criticality.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "Criticality.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_Criticality_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_Criticality_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_Criticality_value2enum_1[] = {
+	{ 0,	6,	"reject" },
+	{ 1,	6,	"ignore" },
+	{ 2,	6,	"notify" }
+};
+static const unsigned int asn_MAP_Criticality_enum2value_1[] = {
+	1,	/* ignore(1) */
+	2,	/* notify(2) */
+	0	/* reject(0) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1 = {
+	asn_MAP_Criticality_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_Criticality_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	0,	/* Enumeration is not extensible */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_Criticality_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Criticality = {
+	"Criticality",
+	"Criticality",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_Criticality_tags_1,
+	sizeof(asn_DEF_Criticality_tags_1)
+		/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
+	asn_DEF_Criticality_tags_1,	/* Same as above */
+	sizeof(asn_DEF_Criticality_tags_1)
+		/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
+	{ &asn_OER_type_Criticality_constr_1, &asn_PER_type_Criticality_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_Criticality_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-ActionDefinition-Format1.c b/e2sm/lib/E2SM-KPM-ActionDefinition-Format1.c
new file mode 100644
index 0000000..5d94a4d
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-ActionDefinition-Format1.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-ActionDefinition-Format1.h"
+
+asn_TYPE_member_t asn_MBR_E2SM_KPM_ActionDefinition_Format1_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_ActionDefinition_Format1, cellObjID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CellObjectID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cellObjID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_ActionDefinition_Format1, measInfoList),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasurementInfoList,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measInfoList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2SM_KPM_ActionDefinition_Format1_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_ActionDefinition_Format1_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cellObjID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* measInfoList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_ActionDefinition_Format1_specs_1 = {
+	sizeof(struct E2SM_KPM_ActionDefinition_Format1),
+	offsetof(struct E2SM_KPM_ActionDefinition_Format1, _asn_ctx),
+	asn_MAP_E2SM_KPM_ActionDefinition_Format1_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_ActionDefinition_Format1 = {
+	"E2SM-KPM-ActionDefinition-Format1",
+	"E2SM-KPM-ActionDefinition-Format1",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_KPM_ActionDefinition_Format1_tags_1,
+	sizeof(asn_DEF_E2SM_KPM_ActionDefinition_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_ActionDefinition_Format1_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_KPM_ActionDefinition_Format1_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_KPM_ActionDefinition_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_ActionDefinition_Format1_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_KPM_ActionDefinition_Format1_1,
+	2,	/* Elements count */
+	&asn_SPC_E2SM_KPM_ActionDefinition_Format1_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-ActionDefinition.c b/e2sm/lib/E2SM-KPM-ActionDefinition.c
new file mode 100644
index 0000000..1566aa5
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-ActionDefinition.c
@@ -0,0 +1,108 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-ActionDefinition.h"
+
+#include "E2SM-KPM-ActionDefinition-Format1.h"
+static asn_oer_constraints_t asn_OER_type_actionDefinition_formats_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_actionDefinition_formats_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_actionDefinition_formats_3[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2SM_KPM_ActionDefinition__actionDefinition_formats, choice.actionDefinition_Format1),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_E2SM_KPM_ActionDefinition_Format1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"actionDefinition-Format1"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_actionDefinition_formats_tag2el_3[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* actionDefinition-Format1 */
+};
+static asn_CHOICE_specifics_t asn_SPC_actionDefinition_formats_specs_3 = {
+	sizeof(struct E2SM_KPM_ActionDefinition__actionDefinition_formats),
+	offsetof(struct E2SM_KPM_ActionDefinition__actionDefinition_formats, _asn_ctx),
+	offsetof(struct E2SM_KPM_ActionDefinition__actionDefinition_formats, present),
+	sizeof(((struct E2SM_KPM_ActionDefinition__actionDefinition_formats *)0)->present),
+	asn_MAP_actionDefinition_formats_tag2el_3,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_actionDefinition_formats_3 = {
+	"actionDefinition-formats",
+	"actionDefinition-formats",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_actionDefinition_formats_constr_3, &asn_PER_type_actionDefinition_formats_constr_3, CHOICE_constraint },
+	asn_MBR_actionDefinition_formats_3,
+	1,	/* Elements count */
+	&asn_SPC_actionDefinition_formats_specs_3	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_E2SM_KPM_ActionDefinition_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_ActionDefinition, ric_ReportStyle_Type),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ReportStyle-Type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_ActionDefinition, actionDefinition_formats),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_actionDefinition_formats_3,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"actionDefinition-formats"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2SM_KPM_ActionDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_ActionDefinition_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ric-ReportStyle-Type */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* actionDefinition-formats */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_ActionDefinition_specs_1 = {
+	sizeof(struct E2SM_KPM_ActionDefinition),
+	offsetof(struct E2SM_KPM_ActionDefinition, _asn_ctx),
+	asn_MAP_E2SM_KPM_ActionDefinition_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_ActionDefinition = {
+	"E2SM-KPM-ActionDefinition",
+	"E2SM-KPM-ActionDefinition",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_KPM_ActionDefinition_tags_1,
+	sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_KPM_ActionDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_KPM_ActionDefinition_1,
+	2,	/* Elements count */
+	&asn_SPC_E2SM_KPM_ActionDefinition_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-EventTriggerDefinition-Format1.c b/e2sm/lib/E2SM-KPM-EventTriggerDefinition-Format1.c
new file mode 100644
index 0000000..314e7f6
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-EventTriggerDefinition-Format1.c
@@ -0,0 +1,132 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-EventTriggerDefinition-Format1.h"
+
+#include "Trigger-ConditionIE-Item.h"
+static int
+memb_policyTest_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 15)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_policyTest_List_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..15)) */};
+static asn_per_constraints_t asn_PER_type_policyTest_List_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  15 }	/* (SIZE(1..15)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_policyTest_List_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..15)) */};
+static asn_per_constraints_t asn_PER_memb_policyTest_List_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  15 }	/* (SIZE(1..15)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_policyTest_List_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_Trigger_ConditionIE_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_policyTest_List_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_policyTest_List_specs_2 = {
+	sizeof(struct E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List),
+	offsetof(struct E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_policyTest_List_2 = {
+	"policyTest-List",
+	"policyTest-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_policyTest_List_tags_2,
+	sizeof(asn_DEF_policyTest_List_tags_2)
+		/sizeof(asn_DEF_policyTest_List_tags_2[0]) - 1, /* 1 */
+	asn_DEF_policyTest_List_tags_2,	/* Same as above */
+	sizeof(asn_DEF_policyTest_List_tags_2)
+		/sizeof(asn_DEF_policyTest_List_tags_2[0]), /* 2 */
+	{ &asn_OER_type_policyTest_List_constr_2, &asn_PER_type_policyTest_List_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_policyTest_List_2,
+	1,	/* Single element */
+	&asn_SPC_policyTest_List_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2SM_KPM_EventTriggerDefinition_Format1_1[] = {
+	{ ATF_POINTER, 1, offsetof(struct E2SM_KPM_EventTriggerDefinition_Format1, policyTest_List),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_policyTest_List_2,
+		0,
+		{ &asn_OER_memb_policyTest_List_constr_2, &asn_PER_memb_policyTest_List_constr_2,  memb_policyTest_List_constraint_1 },
+		0, 0, /* No default value */
+		"policyTest-List"
+		},
+};
+static const int asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_oms_1[] = { 0 };
+static const ber_tlv_tag_t asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* policyTest-List */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_EventTriggerDefinition_Format1_specs_1 = {
+	sizeof(struct E2SM_KPM_EventTriggerDefinition_Format1),
+	offsetof(struct E2SM_KPM_EventTriggerDefinition_Format1, _asn_ctx),
+	asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_tag2el_1,
+	1,	/* Count of tags in the map */
+	asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1 = {
+	"E2SM-KPM-EventTriggerDefinition-Format1",
+	"E2SM-KPM-EventTriggerDefinition-Format1",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1,
+	sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_KPM_EventTriggerDefinition_Format1_1,
+	1,	/* Elements count */
+	&asn_SPC_E2SM_KPM_EventTriggerDefinition_Format1_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-EventTriggerDefinition.c b/e2sm/lib/E2SM-KPM-EventTriggerDefinition.c
new file mode 100644
index 0000000..144313d
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-EventTriggerDefinition.c
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-EventTriggerDefinition.h"
+
+#include "E2SM-KPM-EventTriggerDefinition-Format1.h"
+static asn_oer_constraints_t asn_OER_type_E2SM_KPM_EventTriggerDefinition_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_E2SM_KPM_EventTriggerDefinition_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_E2SM_KPM_EventTriggerDefinition_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2SM_KPM_EventTriggerDefinition, choice.eventDefinition_Format1),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eventDefinition-Format1"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_EventTriggerDefinition_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* eventDefinition-Format1 */
+};
+static asn_CHOICE_specifics_t asn_SPC_E2SM_KPM_EventTriggerDefinition_specs_1 = {
+	sizeof(struct E2SM_KPM_EventTriggerDefinition),
+	offsetof(struct E2SM_KPM_EventTriggerDefinition, _asn_ctx),
+	offsetof(struct E2SM_KPM_EventTriggerDefinition, present),
+	sizeof(((struct E2SM_KPM_EventTriggerDefinition *)0)->present),
+	asn_MAP_E2SM_KPM_EventTriggerDefinition_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition = {
+	"E2SM-KPM-EventTriggerDefinition",
+	"E2SM-KPM-EventTriggerDefinition",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_E2SM_KPM_EventTriggerDefinition_constr_1, &asn_PER_type_E2SM_KPM_EventTriggerDefinition_constr_1, CHOICE_constraint },
+	asn_MBR_E2SM_KPM_EventTriggerDefinition_1,
+	1,	/* Elements count */
+	&asn_SPC_E2SM_KPM_EventTriggerDefinition_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-IndicationHeader-Format1.c b/e2sm/lib/E2SM-KPM-IndicationHeader-Format1.c
new file mode 100644
index 0000000..be23bda
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-IndicationHeader-Format1.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-IndicationHeader-Format1.h"
+
+asn_TYPE_member_t asn_MBR_E2SM_KPM_IndicationHeader_Format1_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_IndicationHeader_Format1, collectionStartTime),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_TimeStamp,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"collectionStartTime"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_IndicationHeader_Format1, id_GlobalE2node_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"id-GlobalE2node-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_IndicationHeader_Format1_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* collectionStartTime */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* id-GlobalE2node-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_IndicationHeader_Format1_specs_1 = {
+	sizeof(struct E2SM_KPM_IndicationHeader_Format1),
+	offsetof(struct E2SM_KPM_IndicationHeader_Format1, _asn_ctx),
+	asn_MAP_E2SM_KPM_IndicationHeader_Format1_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationHeader_Format1 = {
+	"E2SM-KPM-IndicationHeader-Format1",
+	"E2SM-KPM-IndicationHeader-Format1",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1,
+	sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_KPM_IndicationHeader_Format1_1,
+	2,	/* Elements count */
+	&asn_SPC_E2SM_KPM_IndicationHeader_Format1_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-IndicationHeader.c b/e2sm/lib/E2SM-KPM-IndicationHeader.c
new file mode 100644
index 0000000..40f09a3
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-IndicationHeader.c
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-IndicationHeader.h"
+
+#include "E2SM-KPM-IndicationHeader-Format1.h"
+static asn_oer_constraints_t asn_OER_type_E2SM_KPM_IndicationHeader_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_E2SM_KPM_IndicationHeader_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_E2SM_KPM_IndicationHeader_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2SM_KPM_IndicationHeader, choice.indicationHeader_Format1),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_E2SM_KPM_IndicationHeader_Format1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"indicationHeader-Format1"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_IndicationHeader_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* indicationHeader-Format1 */
+};
+static asn_CHOICE_specifics_t asn_SPC_E2SM_KPM_IndicationHeader_specs_1 = {
+	sizeof(struct E2SM_KPM_IndicationHeader),
+	offsetof(struct E2SM_KPM_IndicationHeader, _asn_ctx),
+	offsetof(struct E2SM_KPM_IndicationHeader, present),
+	sizeof(((struct E2SM_KPM_IndicationHeader *)0)->present),
+	asn_MAP_E2SM_KPM_IndicationHeader_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationHeader = {
+	"E2SM-KPM-IndicationHeader",
+	"E2SM-KPM-IndicationHeader",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_E2SM_KPM_IndicationHeader_constr_1, &asn_PER_type_E2SM_KPM_IndicationHeader_constr_1, CHOICE_constraint },
+	asn_MBR_E2SM_KPM_IndicationHeader_1,
+	1,	/* Elements count */
+	&asn_SPC_E2SM_KPM_IndicationHeader_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-IndicationMessage-Format1.c b/e2sm/lib/E2SM-KPM-IndicationMessage-Format1.c
new file mode 100644
index 0000000..ea21e14
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-IndicationMessage-Format1.c
@@ -0,0 +1,322 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-IndicationMessage-Format1.h"
+
+#include "PM-Containers-Item.h"
+#include "PM-Info-Item.h"
+#include "PerUE-PM-Item.h"
+static int
+memb_pm_Containers_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 8)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_list_of_PM_Information_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 2147483647)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_list_of_matched_UEs_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 65535)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_pm_Containers_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..8)) */};
+static asn_per_constraints_t asn_PER_type_pm_Containers_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 3,  3,  1,  8 }	/* (SIZE(1..8)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_list_of_PM_Information_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..2147483647)) */};
+static asn_per_constraints_t asn_PER_type_list_of_PM_Information_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 31, -1,  1,  2147483647 }	/* (SIZE(1..2147483647)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_list_of_matched_UEs_constr_7 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..65535)) */};
+static asn_per_constraints_t asn_PER_type_list_of_matched_UEs_constr_7 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  1,  65535 }	/* (SIZE(1..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_pm_Containers_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..8)) */};
+static asn_per_constraints_t asn_PER_memb_pm_Containers_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 3,  3,  1,  8 }	/* (SIZE(1..8)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_list_of_PM_Information_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..2147483647)) */};
+static asn_per_constraints_t asn_PER_memb_list_of_PM_Information_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 31, -1,  1,  2147483647 }	/* (SIZE(1..2147483647)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_list_of_matched_UEs_constr_7 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..65535)) */};
+static asn_per_constraints_t asn_PER_memb_list_of_matched_UEs_constr_7 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  1,  65535 }	/* (SIZE(1..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_pm_Containers_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PM_Containers_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_pm_Containers_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_pm_Containers_specs_2 = {
+	sizeof(struct E2SM_KPM_IndicationMessage_Format1__pm_Containers),
+	offsetof(struct E2SM_KPM_IndicationMessage_Format1__pm_Containers, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_pm_Containers_2 = {
+	"pm-Containers",
+	"pm-Containers",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_pm_Containers_tags_2,
+	sizeof(asn_DEF_pm_Containers_tags_2)
+		/sizeof(asn_DEF_pm_Containers_tags_2[0]) - 1, /* 1 */
+	asn_DEF_pm_Containers_tags_2,	/* Same as above */
+	sizeof(asn_DEF_pm_Containers_tags_2)
+		/sizeof(asn_DEF_pm_Containers_tags_2[0]), /* 2 */
+	{ &asn_OER_type_pm_Containers_constr_2, &asn_PER_type_pm_Containers_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_pm_Containers_2,
+	1,	/* Single element */
+	&asn_SPC_pm_Containers_specs_2	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_list_of_PM_Information_5[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PM_Info_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_list_of_PM_Information_tags_5[] = {
+	(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_list_of_PM_Information_specs_5 = {
+	sizeof(struct E2SM_KPM_IndicationMessage_Format1__list_of_PM_Information),
+	offsetof(struct E2SM_KPM_IndicationMessage_Format1__list_of_PM_Information, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_list_of_PM_Information_5 = {
+	"list-of-PM-Information",
+	"list-of-PM-Information",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_list_of_PM_Information_tags_5,
+	sizeof(asn_DEF_list_of_PM_Information_tags_5)
+		/sizeof(asn_DEF_list_of_PM_Information_tags_5[0]) - 1, /* 1 */
+	asn_DEF_list_of_PM_Information_tags_5,	/* Same as above */
+	sizeof(asn_DEF_list_of_PM_Information_tags_5)
+		/sizeof(asn_DEF_list_of_PM_Information_tags_5[0]), /* 2 */
+	{ &asn_OER_type_list_of_PM_Information_constr_5, &asn_PER_type_list_of_PM_Information_constr_5, SEQUENCE_OF_constraint },
+	asn_MBR_list_of_PM_Information_5,
+	1,	/* Single element */
+	&asn_SPC_list_of_PM_Information_specs_5	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_list_of_matched_UEs_7[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PerUE_PM_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_list_of_matched_UEs_tags_7[] = {
+	(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_list_of_matched_UEs_specs_7 = {
+	sizeof(struct E2SM_KPM_IndicationMessage_Format1__list_of_matched_UEs),
+	offsetof(struct E2SM_KPM_IndicationMessage_Format1__list_of_matched_UEs, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_list_of_matched_UEs_7 = {
+	"list-of-matched-UEs",
+	"list-of-matched-UEs",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_list_of_matched_UEs_tags_7,
+	sizeof(asn_DEF_list_of_matched_UEs_tags_7)
+		/sizeof(asn_DEF_list_of_matched_UEs_tags_7[0]) - 1, /* 1 */
+	asn_DEF_list_of_matched_UEs_tags_7,	/* Same as above */
+	sizeof(asn_DEF_list_of_matched_UEs_tags_7)
+		/sizeof(asn_DEF_list_of_matched_UEs_tags_7[0]), /* 2 */
+	{ &asn_OER_type_list_of_matched_UEs_constr_7, &asn_PER_type_list_of_matched_UEs_constr_7, SEQUENCE_OF_constraint },
+	asn_MBR_list_of_matched_UEs_7,
+	1,	/* Single element */
+	&asn_SPC_list_of_matched_UEs_specs_7	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2SM_KPM_IndicationMessage_Format1_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_IndicationMessage_Format1, pm_Containers),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_pm_Containers_2,
+		0,
+		{ &asn_OER_memb_pm_Containers_constr_2, &asn_PER_memb_pm_Containers_constr_2,  memb_pm_Containers_constraint_1 },
+		0, 0, /* No default value */
+		"pm-Containers"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_IndicationMessage_Format1, cellObjectID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CellObjectID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cellObjectID"
+		},
+	{ ATF_POINTER, 2, offsetof(struct E2SM_KPM_IndicationMessage_Format1, list_of_PM_Information),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		0,
+		&asn_DEF_list_of_PM_Information_5,
+		0,
+		{ &asn_OER_memb_list_of_PM_Information_constr_5, &asn_PER_memb_list_of_PM_Information_constr_5,  memb_list_of_PM_Information_constraint_1 },
+		0, 0, /* No default value */
+		"list-of-PM-Information"
+		},
+	{ ATF_POINTER, 1, offsetof(struct E2SM_KPM_IndicationMessage_Format1, list_of_matched_UEs),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		0,
+		&asn_DEF_list_of_matched_UEs_7,
+		0,
+		{ &asn_OER_memb_list_of_matched_UEs_constr_7, &asn_PER_memb_list_of_matched_UEs_constr_7,  memb_list_of_matched_UEs_constraint_1 },
+		0, 0, /* No default value */
+		"list-of-matched-UEs"
+		},
+};
+static const int asn_MAP_E2SM_KPM_IndicationMessage_Format1_oms_1[] = { 2, 3 };
+static const ber_tlv_tag_t asn_DEF_E2SM_KPM_IndicationMessage_Format1_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_IndicationMessage_Format1_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pm-Containers */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* cellObjectID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* list-of-PM-Information */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* list-of-matched-UEs */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_IndicationMessage_Format1_specs_1 = {
+	sizeof(struct E2SM_KPM_IndicationMessage_Format1),
+	offsetof(struct E2SM_KPM_IndicationMessage_Format1, _asn_ctx),
+	asn_MAP_E2SM_KPM_IndicationMessage_Format1_tag2el_1,
+	4,	/* Count of tags in the map */
+	asn_MAP_E2SM_KPM_IndicationMessage_Format1_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	4,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationMessage_Format1 = {
+	"E2SM-KPM-IndicationMessage-Format1",
+	"E2SM-KPM-IndicationMessage-Format1",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_KPM_IndicationMessage_Format1_tags_1,
+	sizeof(asn_DEF_E2SM_KPM_IndicationMessage_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_IndicationMessage_Format1_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_KPM_IndicationMessage_Format1_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_KPM_IndicationMessage_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_IndicationMessage_Format1_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_KPM_IndicationMessage_Format1_1,
+	4,	/* Elements count */
+	&asn_SPC_E2SM_KPM_IndicationMessage_Format1_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-IndicationMessage.c b/e2sm/lib/E2SM-KPM-IndicationMessage.c
new file mode 100644
index 0000000..0b1e701
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-IndicationMessage.c
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-IndicationMessage.h"
+
+#include "E2SM-KPM-IndicationMessage-Format1.h"
+static asn_oer_constraints_t asn_OER_type_E2SM_KPM_IndicationMessage_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_E2SM_KPM_IndicationMessage_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_E2SM_KPM_IndicationMessage_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2SM_KPM_IndicationMessage, choice.indicationMessage_Format1),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_E2SM_KPM_IndicationMessage_Format1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"indicationMessage-Format1"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_IndicationMessage_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* indicationMessage-Format1 */
+};
+static asn_CHOICE_specifics_t asn_SPC_E2SM_KPM_IndicationMessage_specs_1 = {
+	sizeof(struct E2SM_KPM_IndicationMessage),
+	offsetof(struct E2SM_KPM_IndicationMessage, _asn_ctx),
+	offsetof(struct E2SM_KPM_IndicationMessage, present),
+	sizeof(((struct E2SM_KPM_IndicationMessage *)0)->present),
+	asn_MAP_E2SM_KPM_IndicationMessage_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationMessage = {
+	"E2SM-KPM-IndicationMessage",
+	"E2SM-KPM-IndicationMessage",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_E2SM_KPM_IndicationMessage_constr_1, &asn_PER_type_E2SM_KPM_IndicationMessage_constr_1, CHOICE_constraint },
+	asn_MBR_E2SM_KPM_IndicationMessage_1,
+	1,	/* Elements count */
+	&asn_SPC_E2SM_KPM_IndicationMessage_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-KPM-RANFunctionDefinition.c b/e2sm/lib/E2SM-KPM-RANFunctionDefinition.c
new file mode 100644
index 0000000..d87fe15
--- /dev/null
+++ b/e2sm/lib/E2SM-KPM-RANFunctionDefinition.c
@@ -0,0 +1,232 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-KPM-RANFunctionDefinition.h"
+
+#include "RIC-EventTriggerStyle-Item.h"
+#include "RIC-ReportStyle-Item.h"
+static int
+memb_ric_EventTriggerStyle_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 63)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_ric_ReportStyle_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 63)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_type_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ric_ReportStyle_List_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_type_ric_ReportStyle_List_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_memb_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ric_ReportStyle_List_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_memb_ric_ReportStyle_List_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_ric_EventTriggerStyle_List_3[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RIC_EventTriggerStyle_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ric_EventTriggerStyle_List_tags_3[] = {
+	(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_ric_EventTriggerStyle_List_specs_3 = {
+	sizeof(struct E2SM_KPM_RANFunctionDefinition__ric_EventTriggerStyle_List),
+	offsetof(struct E2SM_KPM_RANFunctionDefinition__ric_EventTriggerStyle_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ric_EventTriggerStyle_List_3 = {
+	"ric-EventTriggerStyle-List",
+	"ric-EventTriggerStyle-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ric_EventTriggerStyle_List_tags_3,
+	sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3)
+		/sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3[0]) - 1, /* 1 */
+	asn_DEF_ric_EventTriggerStyle_List_tags_3,	/* Same as above */
+	sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3)
+		/sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3[0]), /* 2 */
+	{ &asn_OER_type_ric_EventTriggerStyle_List_constr_3, &asn_PER_type_ric_EventTriggerStyle_List_constr_3, SEQUENCE_OF_constraint },
+	asn_MBR_ric_EventTriggerStyle_List_3,
+	1,	/* Single element */
+	&asn_SPC_ric_EventTriggerStyle_List_specs_3	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_ric_ReportStyle_List_5[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RIC_ReportStyle_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ric_ReportStyle_List_tags_5[] = {
+	(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_ric_ReportStyle_List_specs_5 = {
+	sizeof(struct E2SM_KPM_RANFunctionDefinition__ric_ReportStyle_List),
+	offsetof(struct E2SM_KPM_RANFunctionDefinition__ric_ReportStyle_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ric_ReportStyle_List_5 = {
+	"ric-ReportStyle-List",
+	"ric-ReportStyle-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ric_ReportStyle_List_tags_5,
+	sizeof(asn_DEF_ric_ReportStyle_List_tags_5)
+		/sizeof(asn_DEF_ric_ReportStyle_List_tags_5[0]) - 1, /* 1 */
+	asn_DEF_ric_ReportStyle_List_tags_5,	/* Same as above */
+	sizeof(asn_DEF_ric_ReportStyle_List_tags_5)
+		/sizeof(asn_DEF_ric_ReportStyle_List_tags_5[0]), /* 2 */
+	{ &asn_OER_type_ric_ReportStyle_List_constr_5, &asn_PER_type_ric_ReportStyle_List_constr_5, SEQUENCE_OF_constraint },
+	asn_MBR_ric_ReportStyle_List_5,
+	1,	/* Single element */
+	&asn_SPC_ric_ReportStyle_List_specs_5	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_E2SM_KPM_RANFunctionDefinition_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_RANFunctionDefinition, ranFunction_Name),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunction_Name,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunction-Name"
+		},
+	{ ATF_POINTER, 2, offsetof(struct E2SM_KPM_RANFunctionDefinition, ric_EventTriggerStyle_List),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		0,
+		&asn_DEF_ric_EventTriggerStyle_List_3,
+		0,
+		{ &asn_OER_memb_ric_EventTriggerStyle_List_constr_3, &asn_PER_memb_ric_EventTriggerStyle_List_constr_3,  memb_ric_EventTriggerStyle_List_constraint_1 },
+		0, 0, /* No default value */
+		"ric-EventTriggerStyle-List"
+		},
+	{ ATF_POINTER, 1, offsetof(struct E2SM_KPM_RANFunctionDefinition, ric_ReportStyle_List),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		0,
+		&asn_DEF_ric_ReportStyle_List_5,
+		0,
+		{ &asn_OER_memb_ric_ReportStyle_List_constr_5, &asn_PER_memb_ric_ReportStyle_List_constr_5,  memb_ric_ReportStyle_List_constraint_1 },
+		0, 0, /* No default value */
+		"ric-ReportStyle-List"
+		},
+};
+static const int asn_MAP_E2SM_KPM_RANFunctionDefinition_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_E2SM_KPM_RANFunctionDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_RANFunctionDefinition_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunction-Name */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ric-EventTriggerStyle-List */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ric-ReportStyle-List */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_RANFunctionDefinition_specs_1 = {
+	sizeof(struct E2SM_KPM_RANFunctionDefinition),
+	offsetof(struct E2SM_KPM_RANFunctionDefinition, _asn_ctx),
+	asn_MAP_E2SM_KPM_RANFunctionDefinition_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_E2SM_KPM_RANFunctionDefinition_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_RANFunctionDefinition = {
+	"E2SM-KPM-RANFunctionDefinition",
+	"E2SM-KPM-RANFunctionDefinition",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_KPM_RANFunctionDefinition_tags_1,
+	sizeof(asn_DEF_E2SM_KPM_RANFunctionDefinition_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_RANFunctionDefinition_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_KPM_RANFunctionDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_KPM_RANFunctionDefinition_tags_1)
+		/sizeof(asn_DEF_E2SM_KPM_RANFunctionDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_KPM_RANFunctionDefinition_1,
+	3,	/* Elements count */
+	&asn_SPC_E2SM_KPM_RANFunctionDefinition_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-RC-ControlHeader-Format1.c b/e2sm/lib/E2SM-RC-ControlHeader-Format1.c
new file mode 100644
index 0000000..e953ec7
--- /dev/null
+++ b/e2sm/lib/E2SM-RC-ControlHeader-Format1.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-RC-ControlHeader-Format1.h"
+
+asn_TYPE_member_t asn_MBR_E2SM_RC_ControlHeader_Format1_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_RC_ControlHeader_Format1, ueId),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_UE_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ueId"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_RC_ControlHeader_Format1, ric_ControlStyle_Type),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlStyle-Type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_RC_ControlHeader_Format1, ric_ControlAction_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_ControlAction_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlAction-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2SM_RC_ControlHeader_Format1_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_RC_ControlHeader_Format1_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ueId */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ric-ControlStyle-Type */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ric-ControlAction-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2SM_RC_ControlHeader_Format1_specs_1 = {
+	sizeof(struct E2SM_RC_ControlHeader_Format1),
+	offsetof(struct E2SM_RC_ControlHeader_Format1, _asn_ctx),
+	asn_MAP_E2SM_RC_ControlHeader_Format1_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlHeader_Format1 = {
+	"E2SM-RC-ControlHeader-Format1",
+	"E2SM-RC-ControlHeader-Format1",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_RC_ControlHeader_Format1_tags_1,
+	sizeof(asn_DEF_E2SM_RC_ControlHeader_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_RC_ControlHeader_Format1_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_RC_ControlHeader_Format1_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_RC_ControlHeader_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_RC_ControlHeader_Format1_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_RC_ControlHeader_Format1_1,
+	3,	/* Elements count */
+	&asn_SPC_E2SM_RC_ControlHeader_Format1_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-RC-ControlHeader.c b/e2sm/lib/E2SM-RC-ControlHeader.c
new file mode 100644
index 0000000..8de1e6c
--- /dev/null
+++ b/e2sm/lib/E2SM-RC-ControlHeader.c
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-RC-ControlHeader.h"
+
+#include "E2SM-RC-ControlHeader-Format1.h"
+static asn_oer_constraints_t asn_OER_type_E2SM_RC_ControlHeader_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_E2SM_RC_ControlHeader_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_E2SM_RC_ControlHeader_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2SM_RC_ControlHeader, choice.controlHeader_Format1),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_E2SM_RC_ControlHeader_Format1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"controlHeader-Format1"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_RC_ControlHeader_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* controlHeader-Format1 */
+};
+static asn_CHOICE_specifics_t asn_SPC_E2SM_RC_ControlHeader_specs_1 = {
+	sizeof(struct E2SM_RC_ControlHeader),
+	offsetof(struct E2SM_RC_ControlHeader, _asn_ctx),
+	offsetof(struct E2SM_RC_ControlHeader, present),
+	sizeof(((struct E2SM_RC_ControlHeader *)0)->present),
+	asn_MAP_E2SM_RC_ControlHeader_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlHeader = {
+	"E2SM-RC-ControlHeader",
+	"E2SM-RC-ControlHeader",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_E2SM_RC_ControlHeader_constr_1, &asn_PER_type_E2SM_RC_ControlHeader_constr_1, CHOICE_constraint },
+	asn_MBR_E2SM_RC_ControlHeader_1,
+	1,	/* Elements count */
+	&asn_SPC_E2SM_RC_ControlHeader_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-RC-ControlMessage-Format1.c b/e2sm/lib/E2SM-RC-ControlMessage-Format1.c
new file mode 100644
index 0000000..7ba5bba
--- /dev/null
+++ b/e2sm/lib/E2SM-RC-ControlMessage-Format1.c
@@ -0,0 +1,132 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-RC-ControlMessage-Format1.h"
+
+#include "RANParameter-Item.h"
+static int
+memb_ranParameters_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 4294967295)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_ranParameters_List_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_type_ranParameters_List_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ranParameters_List_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_memb_ranParameters_List_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_ranParameters_List_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANParameter_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ranParameters_List_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_ranParameters_List_specs_2 = {
+	sizeof(struct E2SM_RC_ControlMessage_Format1__ranParameters_List),
+	offsetof(struct E2SM_RC_ControlMessage_Format1__ranParameters_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ranParameters_List_2 = {
+	"ranParameters-List",
+	"ranParameters-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ranParameters_List_tags_2,
+	sizeof(asn_DEF_ranParameters_List_tags_2)
+		/sizeof(asn_DEF_ranParameters_List_tags_2[0]) - 1, /* 1 */
+	asn_DEF_ranParameters_List_tags_2,	/* Same as above */
+	sizeof(asn_DEF_ranParameters_List_tags_2)
+		/sizeof(asn_DEF_ranParameters_List_tags_2[0]), /* 2 */
+	{ &asn_OER_type_ranParameters_List_constr_2, &asn_PER_type_ranParameters_List_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_ranParameters_List_2,
+	1,	/* Single element */
+	&asn_SPC_ranParameters_List_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2SM_RC_ControlMessage_Format1_1[] = {
+	{ ATF_POINTER, 1, offsetof(struct E2SM_RC_ControlMessage_Format1, ranParameters_List),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_ranParameters_List_2,
+		0,
+		{ &asn_OER_memb_ranParameters_List_constr_2, &asn_PER_memb_ranParameters_List_constr_2,  memb_ranParameters_List_constraint_1 },
+		0, 0, /* No default value */
+		"ranParameters-List"
+		},
+};
+static const int asn_MAP_E2SM_RC_ControlMessage_Format1_oms_1[] = { 0 };
+static const ber_tlv_tag_t asn_DEF_E2SM_RC_ControlMessage_Format1_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_RC_ControlMessage_Format1_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* ranParameters-List */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2SM_RC_ControlMessage_Format1_specs_1 = {
+	sizeof(struct E2SM_RC_ControlMessage_Format1),
+	offsetof(struct E2SM_RC_ControlMessage_Format1, _asn_ctx),
+	asn_MAP_E2SM_RC_ControlMessage_Format1_tag2el_1,
+	1,	/* Count of tags in the map */
+	asn_MAP_E2SM_RC_ControlMessage_Format1_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlMessage_Format1 = {
+	"E2SM-RC-ControlMessage-Format1",
+	"E2SM-RC-ControlMessage-Format1",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_RC_ControlMessage_Format1_tags_1,
+	sizeof(asn_DEF_E2SM_RC_ControlMessage_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_RC_ControlMessage_Format1_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_RC_ControlMessage_Format1_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_RC_ControlMessage_Format1_tags_1)
+		/sizeof(asn_DEF_E2SM_RC_ControlMessage_Format1_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_RC_ControlMessage_Format1_1,
+	1,	/* Elements count */
+	&asn_SPC_E2SM_RC_ControlMessage_Format1_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-RC-ControlMessage.c b/e2sm/lib/E2SM-RC-ControlMessage.c
new file mode 100644
index 0000000..15a6afe
--- /dev/null
+++ b/e2sm/lib/E2SM-RC-ControlMessage.c
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-RC-ControlMessage.h"
+
+#include "E2SM-RC-ControlMessage-Format1.h"
+static asn_oer_constraints_t asn_OER_type_E2SM_RC_ControlMessage_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_E2SM_RC_ControlMessage_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_E2SM_RC_ControlMessage_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2SM_RC_ControlMessage, choice.controlMessage_Format1),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_E2SM_RC_ControlMessage_Format1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"controlMessage-Format1"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_RC_ControlMessage_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* controlMessage-Format1 */
+};
+static asn_CHOICE_specifics_t asn_SPC_E2SM_RC_ControlMessage_specs_1 = {
+	sizeof(struct E2SM_RC_ControlMessage),
+	offsetof(struct E2SM_RC_ControlMessage, _asn_ctx),
+	offsetof(struct E2SM_RC_ControlMessage, present),
+	sizeof(((struct E2SM_RC_ControlMessage *)0)->present),
+	asn_MAP_E2SM_RC_ControlMessage_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_RC_ControlMessage = {
+	"E2SM-RC-ControlMessage",
+	"E2SM-RC-ControlMessage",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_E2SM_RC_ControlMessage_constr_1, &asn_PER_type_E2SM_RC_ControlMessage_constr_1, CHOICE_constraint },
+	asn_MBR_E2SM_RC_ControlMessage_1,
+	1,	/* Elements count */
+	&asn_SPC_E2SM_RC_ControlMessage_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/E2SM-RC-RANFunctionDefinition.c b/e2sm/lib/E2SM-RC-RANFunctionDefinition.c
new file mode 100644
index 0000000..e3ff8fe
--- /dev/null
+++ b/e2sm/lib/E2SM-RC-RANFunctionDefinition.c
@@ -0,0 +1,232 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "E2SM-RC-RANFunctionDefinition.h"
+
+#include "RIC-EventTriggerStyle-Item.h"
+#include "RIC-ControlStyle-Item.h"
+static int
+memb_ric_EventTriggerStyle_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 63)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_ric_ControlStyle_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 63)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_type_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ric_ControlStyle_List_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_type_ric_ControlStyle_List_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_memb_ric_EventTriggerStyle_List_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ric_ControlStyle_List_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..63)) */};
+static asn_per_constraints_t asn_PER_memb_ric_ControlStyle_List_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  63 }	/* (SIZE(1..63)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_ric_EventTriggerStyle_List_3[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RIC_EventTriggerStyle_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ric_EventTriggerStyle_List_tags_3[] = {
+	(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_ric_EventTriggerStyle_List_specs_3 = {
+	sizeof(struct E2SM_RC_RANFunctionDefinition__ric_EventTriggerStyle_List),
+	offsetof(struct E2SM_RC_RANFunctionDefinition__ric_EventTriggerStyle_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ric_EventTriggerStyle_List_3 = {
+	"ric-EventTriggerStyle-List",
+	"ric-EventTriggerStyle-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ric_EventTriggerStyle_List_tags_3,
+	sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3)
+		/sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3[0]) - 1, /* 1 */
+	asn_DEF_ric_EventTriggerStyle_List_tags_3,	/* Same as above */
+	sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3)
+		/sizeof(asn_DEF_ric_EventTriggerStyle_List_tags_3[0]), /* 2 */
+	{ &asn_OER_type_ric_EventTriggerStyle_List_constr_3, &asn_PER_type_ric_EventTriggerStyle_List_constr_3, SEQUENCE_OF_constraint },
+	asn_MBR_ric_EventTriggerStyle_List_3,
+	1,	/* Single element */
+	&asn_SPC_ric_EventTriggerStyle_List_specs_3	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_ric_ControlStyle_List_5[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RIC_ControlStyle_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ric_ControlStyle_List_tags_5[] = {
+	(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_ric_ControlStyle_List_specs_5 = {
+	sizeof(struct E2SM_RC_RANFunctionDefinition__ric_ControlStyle_List),
+	offsetof(struct E2SM_RC_RANFunctionDefinition__ric_ControlStyle_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ric_ControlStyle_List_5 = {
+	"ric-ControlStyle-List",
+	"ric-ControlStyle-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ric_ControlStyle_List_tags_5,
+	sizeof(asn_DEF_ric_ControlStyle_List_tags_5)
+		/sizeof(asn_DEF_ric_ControlStyle_List_tags_5[0]) - 1, /* 1 */
+	asn_DEF_ric_ControlStyle_List_tags_5,	/* Same as above */
+	sizeof(asn_DEF_ric_ControlStyle_List_tags_5)
+		/sizeof(asn_DEF_ric_ControlStyle_List_tags_5[0]), /* 2 */
+	{ &asn_OER_type_ric_ControlStyle_List_constr_5, &asn_PER_type_ric_ControlStyle_List_constr_5, SEQUENCE_OF_constraint },
+	asn_MBR_ric_ControlStyle_List_5,
+	1,	/* Single element */
+	&asn_SPC_ric_ControlStyle_List_specs_5	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_E2SM_RC_RANFunctionDefinition_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_RC_RANFunctionDefinition, ranFunction_Name),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunction_Name,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunction-Name"
+		},
+	{ ATF_POINTER, 2, offsetof(struct E2SM_RC_RANFunctionDefinition, ric_EventTriggerStyle_List),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		0,
+		&asn_DEF_ric_EventTriggerStyle_List_3,
+		0,
+		{ &asn_OER_memb_ric_EventTriggerStyle_List_constr_3, &asn_PER_memb_ric_EventTriggerStyle_List_constr_3,  memb_ric_EventTriggerStyle_List_constraint_1 },
+		0, 0, /* No default value */
+		"ric-EventTriggerStyle-List"
+		},
+	{ ATF_POINTER, 1, offsetof(struct E2SM_RC_RANFunctionDefinition, ric_ControlStyle_List),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		0,
+		&asn_DEF_ric_ControlStyle_List_5,
+		0,
+		{ &asn_OER_memb_ric_ControlStyle_List_constr_5, &asn_PER_memb_ric_ControlStyle_List_constr_5,  memb_ric_ControlStyle_List_constraint_1 },
+		0, 0, /* No default value */
+		"ric-ControlStyle-List"
+		},
+};
+static const int asn_MAP_E2SM_RC_RANFunctionDefinition_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_E2SM_RC_RANFunctionDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2SM_RC_RANFunctionDefinition_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunction-Name */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ric-EventTriggerStyle-List */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ric-ControlStyle-List */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2SM_RC_RANFunctionDefinition_specs_1 = {
+	sizeof(struct E2SM_RC_RANFunctionDefinition),
+	offsetof(struct E2SM_RC_RANFunctionDefinition, _asn_ctx),
+	asn_MAP_E2SM_RC_RANFunctionDefinition_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_E2SM_RC_RANFunctionDefinition_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2SM_RC_RANFunctionDefinition = {
+	"E2SM-RC-RANFunctionDefinition",
+	"E2SM-RC-RANFunctionDefinition",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2SM_RC_RANFunctionDefinition_tags_1,
+	sizeof(asn_DEF_E2SM_RC_RANFunctionDefinition_tags_1)
+		/sizeof(asn_DEF_E2SM_RC_RANFunctionDefinition_tags_1[0]), /* 1 */
+	asn_DEF_E2SM_RC_RANFunctionDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2SM_RC_RANFunctionDefinition_tags_1)
+		/sizeof(asn_DEF_E2SM_RC_RANFunctionDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2SM_RC_RANFunctionDefinition_1,
+	3,	/* Elements count */
+	&asn_SPC_E2SM_RC_RANFunctionDefinition_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ENB-ID-Choice.c b/e2sm/lib/ENB-ID-Choice.c
new file mode 100644
index 0000000..8ce2abe
--- /dev/null
+++ b/e2sm/lib/ENB-ID-Choice.c
@@ -0,0 +1,192 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ENB-ID-Choice.h"
+
+static int
+memb_enb_ID_macro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_enb_ID_shortmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 18)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_enb_ID_longmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 21)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	18	/* (SIZE(18..18)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  18,  18 }	/* (SIZE(18..18)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	21	/* (SIZE(21..21)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  21,  21 }	/* (SIZE(21..21)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_macro),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_macro_constr_2, &asn_PER_memb_enb_ID_macro_constr_2,  memb_enb_ID_macro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-macro"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_shortmacro),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_shortmacro_constr_3, &asn_PER_memb_enb_ID_shortmacro_constr_3,  memb_enb_ID_shortmacro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-shortmacro"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_longmacro),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_longmacro_constr_4, &asn_PER_memb_enb_ID_longmacro_constr_4,  memb_enb_ID_longmacro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-longmacro"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_Choice_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* enb-ID-macro */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* enb-ID-shortmacro */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* enb-ID-longmacro */
+};
+asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1 = {
+	sizeof(struct ENB_ID_Choice),
+	offsetof(struct ENB_ID_Choice, _asn_ctx),
+	offsetof(struct ENB_ID_Choice, present),
+	sizeof(((struct ENB_ID_Choice *)0)->present),
+	asn_MAP_ENB_ID_Choice_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0,
+	3	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice = {
+	"ENB-ID-Choice",
+	"ENB-ID-Choice",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENB_ID_Choice_constr_1, &asn_PER_type_ENB_ID_Choice_constr_1, CHOICE_constraint },
+	asn_MBR_ENB_ID_Choice_1,
+	3,	/* Elements count */
+	&asn_SPC_ENB_ID_Choice_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ENB-ID.c b/e2sm/lib/ENB-ID.c
new file mode 100644
index 0000000..e2a5f89
--- /dev/null
+++ b/e2sm/lib/ENB-ID.c
@@ -0,0 +1,241 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ENB-ID.h"
+
+static int
+memb_macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_home_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 28)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_short_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 18)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_long_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 21)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	28	/* (SIZE(28..28)) */};
+static asn_per_constraints_t asn_PER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  28,  28 }	/* (SIZE(28..28)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	18	/* (SIZE(18..18)) */};
+static asn_per_constraints_t asn_PER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  18,  18 }	/* (SIZE(18..18)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
+	{ 0, 0 },
+	21	/* (SIZE(21..21)) */};
+static asn_per_constraints_t asn_PER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  21,  21 }	/* (SIZE(21..21)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENB_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENB_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_macro_eNB_ID_constr_2, &asn_PER_memb_macro_eNB_ID_constr_2,  memb_macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"macro-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.home_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_home_eNB_ID_constr_3, &asn_PER_memb_home_eNB_ID_constr_3,  memb_home_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"home-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.short_Macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_short_Macro_eNB_ID_constr_5, &asn_PER_memb_short_Macro_eNB_ID_constr_5,  memb_short_Macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"short-Macro-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.long_Macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_long_Macro_eNB_ID_constr_6, &asn_PER_memb_long_Macro_eNB_ID_constr_6,  memb_long_Macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"long-Macro-eNB-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* macro-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* home-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* short-Macro-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* long-Macro-eNB-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1 = {
+	sizeof(struct ENB_ID),
+	offsetof(struct ENB_ID, _asn_ctx),
+	offsetof(struct ENB_ID, present),
+	sizeof(((struct ENB_ID *)0)->present),
+	asn_MAP_ENB_ID_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	2	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENB_ID = {
+	"ENB-ID",
+	"ENB-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENB_ID_constr_1, &asn_PER_type_ENB_ID_constr_1, CHOICE_constraint },
+	asn_MBR_ENB_ID_1,
+	4,	/* Elements count */
+	&asn_SPC_ENB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ENGNB-ID.c b/e2sm/lib/ENGNB-ID.c
new file mode 100644
index 0000000..5577266
--- /dev/null
+++ b/e2sm/lib/ENGNB-ID.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ENGNB-ID.h"
+
+static int
+memb_gNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size >= 22 && size <= 32)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_gNB_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(22..32)) */};
+static asn_per_constraints_t asn_PER_memb_gNB_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  22,  32 }	/* (SIZE(22..32)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENGNB_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENGNB_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENGNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENGNB_ID, choice.gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_gNB_ID_constr_2, &asn_PER_memb_gNB_ID_constr_2,  memb_gNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"gNB-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENGNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gNB-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_ENGNB_ID_specs_1 = {
+	sizeof(struct ENGNB_ID),
+	offsetof(struct ENGNB_ID, _asn_ctx),
+	offsetof(struct ENGNB_ID, present),
+	sizeof(((struct ENGNB_ID *)0)->present),
+	asn_MAP_ENGNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENGNB_ID = {
+	"ENGNB-ID",
+	"ENGNB-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENGNB_ID_constr_1, &asn_PER_type_ENGNB_ID_constr_1, CHOICE_constraint },
+	asn_MBR_ENGNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_ENGNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/EPC-CUUP-PM-Format.c b/e2sm/lib/EPC-CUUP-PM-Format.c
new file mode 100644
index 0000000..5fb414a
--- /dev/null
+++ b/e2sm/lib/EPC-CUUP-PM-Format.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "EPC-CUUP-PM-Format.h"
+
+#include "PerQCIReportListItemFormat.h"
+static int
+memb_perQCIReportList_cuup_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 256)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_perQCIReportList_cuup_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..256)) */};
+static asn_per_constraints_t asn_PER_type_perQCIReportList_cuup_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 8,  8,  1,  256 }	/* (SIZE(1..256)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_perQCIReportList_cuup_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..256)) */};
+static asn_per_constraints_t asn_PER_memb_perQCIReportList_cuup_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 8,  8,  1,  256 }	/* (SIZE(1..256)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_perQCIReportList_cuup_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PerQCIReportListItemFormat,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_perQCIReportList_cuup_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_perQCIReportList_cuup_specs_2 = {
+	sizeof(struct EPC_CUUP_PM_Format__perQCIReportList_cuup),
+	offsetof(struct EPC_CUUP_PM_Format__perQCIReportList_cuup, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_perQCIReportList_cuup_2 = {
+	"perQCIReportList-cuup",
+	"perQCIReportList-cuup",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_perQCIReportList_cuup_tags_2,
+	sizeof(asn_DEF_perQCIReportList_cuup_tags_2)
+		/sizeof(asn_DEF_perQCIReportList_cuup_tags_2[0]) - 1, /* 1 */
+	asn_DEF_perQCIReportList_cuup_tags_2,	/* Same as above */
+	sizeof(asn_DEF_perQCIReportList_cuup_tags_2)
+		/sizeof(asn_DEF_perQCIReportList_cuup_tags_2[0]), /* 2 */
+	{ &asn_OER_type_perQCIReportList_cuup_constr_2, &asn_PER_type_perQCIReportList_cuup_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_perQCIReportList_cuup_2,
+	1,	/* Single element */
+	&asn_SPC_perQCIReportList_cuup_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_EPC_CUUP_PM_Format_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct EPC_CUUP_PM_Format, perQCIReportList_cuup),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_perQCIReportList_cuup_2,
+		0,
+		{ &asn_OER_memb_perQCIReportList_cuup_constr_2, &asn_PER_memb_perQCIReportList_cuup_constr_2,  memb_perQCIReportList_cuup_constraint_1 },
+		0, 0, /* No default value */
+		"perQCIReportList-cuup"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_EPC_CUUP_PM_Format_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_EPC_CUUP_PM_Format_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* perQCIReportList-cuup */
+};
+asn_SEQUENCE_specifics_t asn_SPC_EPC_CUUP_PM_Format_specs_1 = {
+	sizeof(struct EPC_CUUP_PM_Format),
+	offsetof(struct EPC_CUUP_PM_Format, _asn_ctx),
+	asn_MAP_EPC_CUUP_PM_Format_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_EPC_CUUP_PM_Format = {
+	"EPC-CUUP-PM-Format",
+	"EPC-CUUP-PM-Format",
+	&asn_OP_SEQUENCE,
+	asn_DEF_EPC_CUUP_PM_Format_tags_1,
+	sizeof(asn_DEF_EPC_CUUP_PM_Format_tags_1)
+		/sizeof(asn_DEF_EPC_CUUP_PM_Format_tags_1[0]), /* 1 */
+	asn_DEF_EPC_CUUP_PM_Format_tags_1,	/* Same as above */
+	sizeof(asn_DEF_EPC_CUUP_PM_Format_tags_1)
+		/sizeof(asn_DEF_EPC_CUUP_PM_Format_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_EPC_CUUP_PM_Format_1,
+	1,	/* Elements count */
+	&asn_SPC_EPC_CUUP_PM_Format_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/EPC-DU-PM-Container.c b/e2sm/lib/EPC-DU-PM-Container.c
new file mode 100644
index 0000000..801080e
--- /dev/null
+++ b/e2sm/lib/EPC-DU-PM-Container.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "EPC-DU-PM-Container.h"
+
+#include "PerQCIReportListItem.h"
+static int
+memb_perQCIReportList_du_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 256)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_perQCIReportList_du_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..256)) */};
+static asn_per_constraints_t asn_PER_type_perQCIReportList_du_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 8,  8,  1,  256 }	/* (SIZE(1..256)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_perQCIReportList_du_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..256)) */};
+static asn_per_constraints_t asn_PER_memb_perQCIReportList_du_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 8,  8,  1,  256 }	/* (SIZE(1..256)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_perQCIReportList_du_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PerQCIReportListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_perQCIReportList_du_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_perQCIReportList_du_specs_2 = {
+	sizeof(struct EPC_DU_PM_Container__perQCIReportList_du),
+	offsetof(struct EPC_DU_PM_Container__perQCIReportList_du, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_perQCIReportList_du_2 = {
+	"perQCIReportList-du",
+	"perQCIReportList-du",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_perQCIReportList_du_tags_2,
+	sizeof(asn_DEF_perQCIReportList_du_tags_2)
+		/sizeof(asn_DEF_perQCIReportList_du_tags_2[0]) - 1, /* 1 */
+	asn_DEF_perQCIReportList_du_tags_2,	/* Same as above */
+	sizeof(asn_DEF_perQCIReportList_du_tags_2)
+		/sizeof(asn_DEF_perQCIReportList_du_tags_2[0]), /* 2 */
+	{ &asn_OER_type_perQCIReportList_du_constr_2, &asn_PER_type_perQCIReportList_du_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_perQCIReportList_du_2,
+	1,	/* Single element */
+	&asn_SPC_perQCIReportList_du_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_EPC_DU_PM_Container_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct EPC_DU_PM_Container, perQCIReportList_du),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_perQCIReportList_du_2,
+		0,
+		{ &asn_OER_memb_perQCIReportList_du_constr_2, &asn_PER_memb_perQCIReportList_du_constr_2,  memb_perQCIReportList_du_constraint_1 },
+		0, 0, /* No default value */
+		"perQCIReportList-du"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_EPC_DU_PM_Container_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_EPC_DU_PM_Container_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* perQCIReportList-du */
+};
+asn_SEQUENCE_specifics_t asn_SPC_EPC_DU_PM_Container_specs_1 = {
+	sizeof(struct EPC_DU_PM_Container),
+	offsetof(struct EPC_DU_PM_Container, _asn_ctx),
+	asn_MAP_EPC_DU_PM_Container_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_EPC_DU_PM_Container = {
+	"EPC-DU-PM-Container",
+	"EPC-DU-PM-Container",
+	&asn_OP_SEQUENCE,
+	asn_DEF_EPC_DU_PM_Container_tags_1,
+	sizeof(asn_DEF_EPC_DU_PM_Container_tags_1)
+		/sizeof(asn_DEF_EPC_DU_PM_Container_tags_1[0]), /* 1 */
+	asn_DEF_EPC_DU_PM_Container_tags_1,	/* Same as above */
+	sizeof(asn_DEF_EPC_DU_PM_Container_tags_1)
+		/sizeof(asn_DEF_EPC_DU_PM_Container_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_EPC_DU_PM_Container_1,
+	1,	/* Elements count */
+	&asn_SPC_EPC_DU_PM_Container_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/FGC-CUUP-PM-Format.c b/e2sm/lib/FGC-CUUP-PM-Format.c
new file mode 100644
index 0000000..634e092
--- /dev/null
+++ b/e2sm/lib/FGC-CUUP-PM-Format.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "FGC-CUUP-PM-Format.h"
+
+#include "SliceToReportListItem.h"
+static int
+memb_sliceToReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 1024)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_sliceToReportList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..1024)) */};
+static asn_per_constraints_t asn_PER_type_sliceToReportList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 10,  10,  1,  1024 }	/* (SIZE(1..1024)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_sliceToReportList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..1024)) */};
+static asn_per_constraints_t asn_PER_memb_sliceToReportList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 10,  10,  1,  1024 }	/* (SIZE(1..1024)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_sliceToReportList_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_SliceToReportListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_sliceToReportList_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_sliceToReportList_specs_2 = {
+	sizeof(struct FGC_CUUP_PM_Format__sliceToReportList),
+	offsetof(struct FGC_CUUP_PM_Format__sliceToReportList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_sliceToReportList_2 = {
+	"sliceToReportList",
+	"sliceToReportList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_sliceToReportList_tags_2,
+	sizeof(asn_DEF_sliceToReportList_tags_2)
+		/sizeof(asn_DEF_sliceToReportList_tags_2[0]) - 1, /* 1 */
+	asn_DEF_sliceToReportList_tags_2,	/* Same as above */
+	sizeof(asn_DEF_sliceToReportList_tags_2)
+		/sizeof(asn_DEF_sliceToReportList_tags_2[0]), /* 2 */
+	{ &asn_OER_type_sliceToReportList_constr_2, &asn_PER_type_sliceToReportList_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_sliceToReportList_2,
+	1,	/* Single element */
+	&asn_SPC_sliceToReportList_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_FGC_CUUP_PM_Format_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct FGC_CUUP_PM_Format, sliceToReportList),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_sliceToReportList_2,
+		0,
+		{ &asn_OER_memb_sliceToReportList_constr_2, &asn_PER_memb_sliceToReportList_constr_2,  memb_sliceToReportList_constraint_1 },
+		0, 0, /* No default value */
+		"sliceToReportList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_FGC_CUUP_PM_Format_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_FGC_CUUP_PM_Format_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* sliceToReportList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_FGC_CUUP_PM_Format_specs_1 = {
+	sizeof(struct FGC_CUUP_PM_Format),
+	offsetof(struct FGC_CUUP_PM_Format, _asn_ctx),
+	asn_MAP_FGC_CUUP_PM_Format_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_FGC_CUUP_PM_Format = {
+	"FGC-CUUP-PM-Format",
+	"FGC-CUUP-PM-Format",
+	&asn_OP_SEQUENCE,
+	asn_DEF_FGC_CUUP_PM_Format_tags_1,
+	sizeof(asn_DEF_FGC_CUUP_PM_Format_tags_1)
+		/sizeof(asn_DEF_FGC_CUUP_PM_Format_tags_1[0]), /* 1 */
+	asn_DEF_FGC_CUUP_PM_Format_tags_1,	/* Same as above */
+	sizeof(asn_DEF_FGC_CUUP_PM_Format_tags_1)
+		/sizeof(asn_DEF_FGC_CUUP_PM_Format_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_FGC_CUUP_PM_Format_1,
+	1,	/* Elements count */
+	&asn_SPC_FGC_CUUP_PM_Format_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/FGC-DU-PM-Container.c b/e2sm/lib/FGC-DU-PM-Container.c
new file mode 100644
index 0000000..859867f
--- /dev/null
+++ b/e2sm/lib/FGC-DU-PM-Container.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "FGC-DU-PM-Container.h"
+
+#include "SlicePerPlmnPerCellListItem.h"
+static int
+memb_slicePerPlmnPerCellList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 1024)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_slicePerPlmnPerCellList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..1024)) */};
+static asn_per_constraints_t asn_PER_type_slicePerPlmnPerCellList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 10,  10,  1,  1024 }	/* (SIZE(1..1024)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_slicePerPlmnPerCellList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..1024)) */};
+static asn_per_constraints_t asn_PER_memb_slicePerPlmnPerCellList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 10,  10,  1,  1024 }	/* (SIZE(1..1024)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_slicePerPlmnPerCellList_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_SlicePerPlmnPerCellListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_slicePerPlmnPerCellList_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_slicePerPlmnPerCellList_specs_2 = {
+	sizeof(struct FGC_DU_PM_Container__slicePerPlmnPerCellList),
+	offsetof(struct FGC_DU_PM_Container__slicePerPlmnPerCellList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_slicePerPlmnPerCellList_2 = {
+	"slicePerPlmnPerCellList",
+	"slicePerPlmnPerCellList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_slicePerPlmnPerCellList_tags_2,
+	sizeof(asn_DEF_slicePerPlmnPerCellList_tags_2)
+		/sizeof(asn_DEF_slicePerPlmnPerCellList_tags_2[0]) - 1, /* 1 */
+	asn_DEF_slicePerPlmnPerCellList_tags_2,	/* Same as above */
+	sizeof(asn_DEF_slicePerPlmnPerCellList_tags_2)
+		/sizeof(asn_DEF_slicePerPlmnPerCellList_tags_2[0]), /* 2 */
+	{ &asn_OER_type_slicePerPlmnPerCellList_constr_2, &asn_PER_type_slicePerPlmnPerCellList_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_slicePerPlmnPerCellList_2,
+	1,	/* Single element */
+	&asn_SPC_slicePerPlmnPerCellList_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_FGC_DU_PM_Container_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct FGC_DU_PM_Container, slicePerPlmnPerCellList),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_slicePerPlmnPerCellList_2,
+		0,
+		{ &asn_OER_memb_slicePerPlmnPerCellList_constr_2, &asn_PER_memb_slicePerPlmnPerCellList_constr_2,  memb_slicePerPlmnPerCellList_constraint_1 },
+		0, 0, /* No default value */
+		"slicePerPlmnPerCellList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_FGC_DU_PM_Container_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_FGC_DU_PM_Container_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* slicePerPlmnPerCellList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_FGC_DU_PM_Container_specs_1 = {
+	sizeof(struct FGC_DU_PM_Container),
+	offsetof(struct FGC_DU_PM_Container, _asn_ctx),
+	asn_MAP_FGC_DU_PM_Container_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_FGC_DU_PM_Container = {
+	"FGC-DU-PM-Container",
+	"FGC-DU-PM-Container",
+	&asn_OP_SEQUENCE,
+	asn_DEF_FGC_DU_PM_Container_tags_1,
+	sizeof(asn_DEF_FGC_DU_PM_Container_tags_1)
+		/sizeof(asn_DEF_FGC_DU_PM_Container_tags_1[0]), /* 1 */
+	asn_DEF_FGC_DU_PM_Container_tags_1,	/* Same as above */
+	sizeof(asn_DEF_FGC_DU_PM_Container_tags_1)
+		/sizeof(asn_DEF_FGC_DU_PM_Container_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_FGC_DU_PM_Container_1,
+	1,	/* Elements count */
+	&asn_SPC_FGC_DU_PM_Container_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/FQIPERSlicesPerPlmnListItem.c b/e2sm/lib/FQIPERSlicesPerPlmnListItem.c
new file mode 100644
index 0000000..e875ee2
--- /dev/null
+++ b/e2sm/lib/FQIPERSlicesPerPlmnListItem.c
@@ -0,0 +1,150 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "FQIPERSlicesPerPlmnListItem.h"
+
+static int
+memb_pDCPBytesDL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 10000000000)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_pDCPBytesUL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 10000000000)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_pDCPBytesDL_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_pDCPBytesDL_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  34, -1,  0,  10000000000 }	/* (0..10000000000,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_pDCPBytesUL_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_pDCPBytesUL_constr_4 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  34, -1,  0,  10000000000 }	/* (0..10000000000,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_FQIPERSlicesPerPlmnListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct FQIPERSlicesPerPlmnListItem, fiveQI),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_FiveQI,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"fiveQI"
+		},
+	{ ATF_POINTER, 2, offsetof(struct FQIPERSlicesPerPlmnListItem, pDCPBytesDL),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_INTEGER,
+		0,
+		{ &asn_OER_memb_pDCPBytesDL_constr_3, &asn_PER_memb_pDCPBytesDL_constr_3,  memb_pDCPBytesDL_constraint_1 },
+		0, 0, /* No default value */
+		"pDCPBytesDL"
+		},
+	{ ATF_POINTER, 1, offsetof(struct FQIPERSlicesPerPlmnListItem, pDCPBytesUL),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_INTEGER,
+		0,
+		{ &asn_OER_memb_pDCPBytesUL_constr_4, &asn_PER_memb_pDCPBytesUL_constr_4,  memb_pDCPBytesUL_constraint_1 },
+		0, 0, /* No default value */
+		"pDCPBytesUL"
+		},
+};
+static const int asn_MAP_FQIPERSlicesPerPlmnListItem_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_FQIPERSlicesPerPlmnListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_FQIPERSlicesPerPlmnListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* fiveQI */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* pDCPBytesDL */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* pDCPBytesUL */
+};
+asn_SEQUENCE_specifics_t asn_SPC_FQIPERSlicesPerPlmnListItem_specs_1 = {
+	sizeof(struct FQIPERSlicesPerPlmnListItem),
+	offsetof(struct FQIPERSlicesPerPlmnListItem, _asn_ctx),
+	asn_MAP_FQIPERSlicesPerPlmnListItem_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_FQIPERSlicesPerPlmnListItem_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_FQIPERSlicesPerPlmnListItem = {
+	"FQIPERSlicesPerPlmnListItem",
+	"FQIPERSlicesPerPlmnListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_FQIPERSlicesPerPlmnListItem_tags_1,
+	sizeof(asn_DEF_FQIPERSlicesPerPlmnListItem_tags_1)
+		/sizeof(asn_DEF_FQIPERSlicesPerPlmnListItem_tags_1[0]), /* 1 */
+	asn_DEF_FQIPERSlicesPerPlmnListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_FQIPERSlicesPerPlmnListItem_tags_1)
+		/sizeof(asn_DEF_FQIPERSlicesPerPlmnListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_FQIPERSlicesPerPlmnListItem_1,
+	3,	/* Elements count */
+	&asn_SPC_FQIPERSlicesPerPlmnListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/FQIPERSlicesPerPlmnPerCellListItem.c b/e2sm/lib/FQIPERSlicesPerPlmnPerCellListItem.c
new file mode 100644
index 0000000..d69f8a1
--- /dev/null
+++ b/e2sm/lib/FQIPERSlicesPerPlmnPerCellListItem.c
@@ -0,0 +1,138 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "FQIPERSlicesPerPlmnPerCellListItem.h"
+
+static int
+memb_dl_PRBUsage_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 273)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_ul_PRBUsage_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 273)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_dl_PRBUsage_constr_3 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..273) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_dl_PRBUsage_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 9,  9,  0,  273 }	/* (0..273) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ul_PRBUsage_constr_4 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..273) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_ul_PRBUsage_constr_4 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 9,  9,  0,  273 }	/* (0..273) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_FQIPERSlicesPerPlmnPerCellListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct FQIPERSlicesPerPlmnPerCellListItem, fiveQI),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_FiveQI,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"fiveQI"
+		},
+	{ ATF_POINTER, 2, offsetof(struct FQIPERSlicesPerPlmnPerCellListItem, dl_PRBUsage),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_dl_PRBUsage_constr_3, &asn_PER_memb_dl_PRBUsage_constr_3,  memb_dl_PRBUsage_constraint_1 },
+		0, 0, /* No default value */
+		"dl-PRBUsage"
+		},
+	{ ATF_POINTER, 1, offsetof(struct FQIPERSlicesPerPlmnPerCellListItem, ul_PRBUsage),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_ul_PRBUsage_constr_4, &asn_PER_memb_ul_PRBUsage_constr_4,  memb_ul_PRBUsage_constraint_1 },
+		0, 0, /* No default value */
+		"ul-PRBUsage"
+		},
+};
+static const int asn_MAP_FQIPERSlicesPerPlmnPerCellListItem_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_FQIPERSlicesPerPlmnPerCellListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_FQIPERSlicesPerPlmnPerCellListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* fiveQI */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* dl-PRBUsage */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ul-PRBUsage */
+};
+asn_SEQUENCE_specifics_t asn_SPC_FQIPERSlicesPerPlmnPerCellListItem_specs_1 = {
+	sizeof(struct FQIPERSlicesPerPlmnPerCellListItem),
+	offsetof(struct FQIPERSlicesPerPlmnPerCellListItem, _asn_ctx),
+	asn_MAP_FQIPERSlicesPerPlmnPerCellListItem_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_FQIPERSlicesPerPlmnPerCellListItem_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_FQIPERSlicesPerPlmnPerCellListItem = {
+	"FQIPERSlicesPerPlmnPerCellListItem",
+	"FQIPERSlicesPerPlmnPerCellListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_FQIPERSlicesPerPlmnPerCellListItem_tags_1,
+	sizeof(asn_DEF_FQIPERSlicesPerPlmnPerCellListItem_tags_1)
+		/sizeof(asn_DEF_FQIPERSlicesPerPlmnPerCellListItem_tags_1[0]), /* 1 */
+	asn_DEF_FQIPERSlicesPerPlmnPerCellListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_FQIPERSlicesPerPlmnPerCellListItem_tags_1)
+		/sizeof(asn_DEF_FQIPERSlicesPerPlmnPerCellListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_FQIPERSlicesPerPlmnPerCellListItem_1,
+	3,	/* Elements count */
+	&asn_SPC_FQIPERSlicesPerPlmnPerCellListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/FiveQI.c b/e2sm/lib/FiveQI.c
new file mode 100644
index 0000000..15d32c9
--- /dev/null
+++ b/e2sm/lib/FiveQI.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "FiveQI.h"
+
+int
+FiveQI_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_FiveQI_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_FiveQI_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  0,  255 }	/* (0..255,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_FiveQI_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_FiveQI = {
+	"FiveQI",
+	"FiveQI",
+	&asn_OP_NativeInteger,
+	asn_DEF_FiveQI_tags_1,
+	sizeof(asn_DEF_FiveQI_tags_1)
+		/sizeof(asn_DEF_FiveQI_tags_1[0]), /* 1 */
+	asn_DEF_FiveQI_tags_1,	/* Same as above */
+	sizeof(asn_DEF_FiveQI_tags_1)
+		/sizeof(asn_DEF_FiveQI_tags_1[0]), /* 1 */
+	{ &asn_OER_type_FiveQI_constr_1, &asn_PER_type_FiveQI_constr_1, FiveQI_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/GNB-CU-UP-ID.c b/e2sm/lib/GNB-CU-UP-ID.c
new file mode 100644
index 0000000..a6e0e86
--- /dev/null
+++ b/e2sm/lib/GNB-CU-UP-ID.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GNB-CU-UP-ID.h"
+
+int
+GNB_CU_UP_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 68719476735)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_GNB_CU_UP_ID_constr_1 CC_NOTUSED = {
+	{ 8, 1 }	/* (0..68719476735) */,
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_CU_UP_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 36, -1,  0,  68719476735 }	/* (0..68719476735) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_GNB_CU_UP_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_CU_UP_ID = {
+	"GNB-CU-UP-ID",
+	"GNB-CU-UP-ID",
+	&asn_OP_INTEGER,
+	asn_DEF_GNB_CU_UP_ID_tags_1,
+	sizeof(asn_DEF_GNB_CU_UP_ID_tags_1)
+		/sizeof(asn_DEF_GNB_CU_UP_ID_tags_1[0]), /* 1 */
+	asn_DEF_GNB_CU_UP_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GNB_CU_UP_ID_tags_1)
+		/sizeof(asn_DEF_GNB_CU_UP_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_GNB_CU_UP_ID_constr_1, &asn_PER_type_GNB_CU_UP_ID_constr_1, GNB_CU_UP_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/GNB-DU-ID.c b/e2sm/lib/GNB-DU-ID.c
new file mode 100644
index 0000000..bae29c8
--- /dev/null
+++ b/e2sm/lib/GNB-DU-ID.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GNB-DU-ID.h"
+
+int
+GNB_DU_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 68719476735)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_GNB_DU_ID_constr_1 CC_NOTUSED = {
+	{ 8, 1 }	/* (0..68719476735) */,
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_DU_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 36, -1,  0,  68719476735 }	/* (0..68719476735) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_GNB_DU_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_DU_ID = {
+	"GNB-DU-ID",
+	"GNB-DU-ID",
+	&asn_OP_INTEGER,
+	asn_DEF_GNB_DU_ID_tags_1,
+	sizeof(asn_DEF_GNB_DU_ID_tags_1)
+		/sizeof(asn_DEF_GNB_DU_ID_tags_1[0]), /* 1 */
+	asn_DEF_GNB_DU_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GNB_DU_ID_tags_1)
+		/sizeof(asn_DEF_GNB_DU_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_GNB_DU_ID_constr_1, &asn_PER_type_GNB_DU_ID_constr_1, GNB_DU_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/GNB-ID-Choice.c b/e2sm/lib/GNB-ID-Choice.c
new file mode 100644
index 0000000..34d5450
--- /dev/null
+++ b/e2sm/lib/GNB-ID-Choice.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GNB-ID-Choice.h"
+
+static int
+memb_gnb_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size >= 22 && size <= 32)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_gnb_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(22..32)) */};
+static asn_per_constraints_t asn_PER_memb_gnb_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  22,  32 }	/* (SIZE(22..32)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_GNB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GNB_ID_Choice_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GNB_ID_Choice, choice.gnb_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_gnb_ID_constr_2, &asn_PER_memb_gnb_ID_constr_2,  memb_gnb_ID_constraint_1 },
+		0, 0, /* No default value */
+		"gnb-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_GNB_ID_Choice_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gnb-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_GNB_ID_Choice_specs_1 = {
+	sizeof(struct GNB_ID_Choice),
+	offsetof(struct GNB_ID_Choice, _asn_ctx),
+	offsetof(struct GNB_ID_Choice, present),
+	sizeof(((struct GNB_ID_Choice *)0)->present),
+	asn_MAP_GNB_ID_Choice_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_ID_Choice = {
+	"GNB-ID-Choice",
+	"GNB-ID-Choice",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_GNB_ID_Choice_constr_1, &asn_PER_type_GNB_ID_Choice_constr_1, CHOICE_constraint },
+	asn_MBR_GNB_ID_Choice_1,
+	1,	/* Elements count */
+	&asn_SPC_GNB_ID_Choice_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalE2node-ID.c b/e2sm/lib/GlobalE2node-ID.c
new file mode 100644
index 0000000..07879f0
--- /dev/null
+++ b/e2sm/lib/GlobalE2node-ID.c
@@ -0,0 +1,89 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalE2node-ID.h"
+
+#include "GlobalE2node-gNB-ID.h"
+#include "GlobalE2node-en-gNB-ID.h"
+#include "GlobalE2node-ng-eNB-ID.h"
+#include "GlobalE2node-eNB-ID.h"
+static asn_oer_constraints_t asn_OER_type_GlobalE2node_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_GlobalE2node_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GlobalE2node_ID_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.gNB),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.en_gNB),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_en_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"en-gNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.ng_eNB),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_ng_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ng-eNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.eNB),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eNB"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* en-gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ng-eNB */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* eNB */
+};
+asn_CHOICE_specifics_t asn_SPC_GlobalE2node_ID_specs_1 = {
+	sizeof(struct GlobalE2node_ID),
+	offsetof(struct GlobalE2node_ID, _asn_ctx),
+	offsetof(struct GlobalE2node_ID, present),
+	sizeof(((struct GlobalE2node_ID *)0)->present),
+	asn_MAP_GlobalE2node_ID_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	4	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ID = {
+	"GlobalE2node-ID",
+	"GlobalE2node-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_GlobalE2node_ID_constr_1, &asn_PER_type_GlobalE2node_ID_constr_1, CHOICE_constraint },
+	asn_MBR_GlobalE2node_ID_1,
+	4,	/* Elements count */
+	&asn_SPC_GlobalE2node_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalE2node-eNB-ID.c b/e2sm/lib/GlobalE2node-eNB-ID.c
new file mode 100644
index 0000000..5848da9
--- /dev/null
+++ b/e2sm/lib/GlobalE2node-eNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalE2node-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_eNB_ID, global_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalENB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_eNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_eNB_ID),
+	offsetof(struct GlobalE2node_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_eNB_ID = {
+	"GlobalE2node-eNB-ID",
+	"GlobalE2node-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalE2node-en-gNB-ID.c b/e2sm/lib/GlobalE2node-en-gNB-ID.c
new file mode 100644
index 0000000..53c81ad
--- /dev/null
+++ b/e2sm/lib/GlobalE2node-en-gNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalE2node-en-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_en_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_en_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalenGNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_en_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_en_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-gNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_en_gNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_en_gNB_ID),
+	offsetof(struct GlobalE2node_en_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_en_gNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_en_gNB_ID = {
+	"GlobalE2node-en-gNB-ID",
+	"GlobalE2node-en-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_en_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_en_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_en_gNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_en_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalE2node-gNB-ID.c b/e2sm/lib/GlobalE2node-gNB-ID.c
new file mode 100644
index 0000000..6be7447
--- /dev/null
+++ b/e2sm/lib/GlobalE2node-gNB-ID.c
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalE2node-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalgNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+	{ ATF_POINTER, 2, offsetof(struct GlobalE2node_gNB_ID, gNB_CU_UP_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_CU_UP_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-CU-UP-ID"
+		},
+	{ ATF_POINTER, 1, offsetof(struct GlobalE2node_gNB_ID, gNB_DU_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_DU_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-DU-ID"
+		},
+};
+static const int asn_MAP_GlobalE2node_gNB_ID_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* global-gNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gNB-CU-UP-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* gNB-DU-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_gNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_gNB_ID),
+	offsetof(struct GlobalE2node_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_gNB_ID_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_GlobalE2node_gNB_ID_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_gNB_ID = {
+	"GlobalE2node-gNB-ID",
+	"GlobalE2node-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_gNB_ID_1,
+	3,	/* Elements count */
+	&asn_SPC_GlobalE2node_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalE2node-ng-eNB-ID.c b/e2sm/lib/GlobalE2node-ng-eNB-ID.c
new file mode 100644
index 0000000..8ae9e02
--- /dev/null
+++ b/e2sm/lib/GlobalE2node-ng-eNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalE2node-ng-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_ng_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_ng_eNB_ID, global_ng_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalngeNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-ng-eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_ng_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-ng-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_ng_eNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_ng_eNB_ID),
+	offsetof(struct GlobalE2node_ng_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_ng_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ng_eNB_ID = {
+	"GlobalE2node-ng-eNB-ID",
+	"GlobalE2node-ng-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_ng_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_ng_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_ng_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_ng_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalENB-ID.c b/e2sm/lib/GlobalENB-ID.c
new file mode 100644
index 0000000..fccb2e0
--- /dev/null
+++ b/e2sm/lib/GlobalENB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalENB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalENB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalENB_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalENB_ID, eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalENB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalENB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalENB_ID_specs_1 = {
+	sizeof(struct GlobalENB_ID),
+	offsetof(struct GlobalENB_ID, _asn_ctx),
+	asn_MAP_GlobalENB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalENB_ID = {
+	"GlobalENB-ID",
+	"GlobalENB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalENB_ID_tags_1,
+	sizeof(asn_DEF_GlobalENB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalENB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalENB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalENB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalENB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalENB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalENB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalKPMnode-ID.c b/e2sm/lib/GlobalKPMnode-ID.c
new file mode 100644
index 0000000..db52419
--- /dev/null
+++ b/e2sm/lib/GlobalKPMnode-ID.c
@@ -0,0 +1,87 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#include "GlobalKPMnode-ID.h"
+
+static asn_oer_constraints_t asn_OER_type_GlobalKPMnode_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_GlobalKPMnode_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GlobalKPMnode_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_ID, choice.gNB),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalKPMnode_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_ID, choice.en_gNB),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalKPMnode_en_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"en-gNB"
+		},
+
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_ID, choice.ng_eNB),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalKPMnode_ng_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ng-eNB"
+		},
+
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_ID, choice.eNB),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalKPMnode_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eNB"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalKPMnode_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* en-gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ng-eNB */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* eNB */
+};
+asn_CHOICE_specifics_t asn_SPC_GlobalKPMnode_ID_specs_1 = {
+	sizeof(struct GlobalKPMnode_ID),
+	offsetof(struct GlobalKPMnode_ID, _asn_ctx),
+	offsetof(struct GlobalKPMnode_ID, present),
+	sizeof(((struct GlobalKPMnode_ID *)0)->present),
+	asn_MAP_GlobalKPMnode_ID_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	4	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_ID = {
+	"GlobalKPMnode-ID",
+	"GlobalKPMnode-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_GlobalKPMnode_ID_constr_1, &asn_PER_type_GlobalKPMnode_ID_constr_1, CHOICE_constraint },
+	asn_MBR_GlobalKPMnode_ID_1,
+	4,	/* Elements count */
+	&asn_SPC_GlobalKPMnode_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalKPMnode-eNB-ID.c b/e2sm/lib/GlobalKPMnode-eNB-ID.c
new file mode 100644
index 0000000..5d6e935
--- /dev/null
+++ b/e2sm/lib/GlobalKPMnode-eNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#include "GlobalKPMnode-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalKPMnode_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_eNB_ID, global_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalENB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalKPMnode_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalKPMnode_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_eNB_ID_specs_1 = {
+	sizeof(struct GlobalKPMnode_eNB_ID),
+	offsetof(struct GlobalKPMnode_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalKPMnode_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_eNB_ID = {
+	"GlobalKPMnode-eNB-ID",
+	"GlobalKPMnode-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalKPMnode_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalKPMnode_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalKPMnode_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalKPMnode_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalKPMnode_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalKPMnode_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalKPMnode-en-gNB-ID.c b/e2sm/lib/GlobalKPMnode-en-gNB-ID.c
new file mode 100644
index 0000000..4c4f222
--- /dev/null
+++ b/e2sm/lib/GlobalKPMnode-en-gNB-ID.c
@@ -0,0 +1,51 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#include "GlobalKPMnode-en-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalKPMnode_en_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_en_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalenGNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+};
+
+static const ber_tlv_tag_t asn_DEF_GlobalKPMnode_en_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalKPMnode_en_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-gNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_en_gNB_ID_specs_1 = {
+	sizeof(struct GlobalKPMnode_en_gNB_ID),
+	offsetof(struct GlobalKPMnode_en_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalKPMnode_en_gNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_en_gNB_ID = {
+	"GlobalKPMnode-en-gNB-ID",
+	"GlobalKPMnode-en-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalKPMnode_en_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalKPMnode_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_en_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalKPMnode_en_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalKPMnode_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_en_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalKPMnode_en_gNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalKPMnode_en_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalKPMnode-gNB-ID.c b/e2sm/lib/GlobalKPMnode-gNB-ID.c
new file mode 100644
index 0000000..19f2769
--- /dev/null
+++ b/e2sm/lib/GlobalKPMnode-gNB-ID.c
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#include "GlobalKPMnode-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalKPMnode_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalgNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+	{ ATF_POINTER, 2, offsetof(struct GlobalKPMnode_gNB_ID, gNB_CU_UP_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_CU_UP_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-CU-UP-ID"
+		},
+	{ ATF_POINTER, 1, offsetof(struct GlobalKPMnode_gNB_ID, gNB_DU_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_DU_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-DU-ID"
+		},
+};
+static const int asn_MAP_GlobalKPMnode_gNB_ID_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_GlobalKPMnode_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalKPMnode_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* global-gNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gNB-CU-UP-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* gNB-DU-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_gNB_ID_specs_1 = {
+	sizeof(struct GlobalKPMnode_gNB_ID),
+	offsetof(struct GlobalKPMnode_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalKPMnode_gNB_ID_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_GlobalKPMnode_gNB_ID_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_gNB_ID = {
+	"GlobalKPMnode-gNB-ID",
+	"GlobalKPMnode-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalKPMnode_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalKPMnode_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalKPMnode_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalKPMnode_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalKPMnode_gNB_ID_1,
+	3,	/* Elements count */
+	&asn_SPC_GlobalKPMnode_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalKPMnode-ng-eNB-ID.c b/e2sm/lib/GlobalKPMnode-ng-eNB-ID.c
new file mode 100644
index 0000000..6d04929
--- /dev/null
+++ b/e2sm/lib/GlobalKPMnode-ng-eNB-ID.c
@@ -0,0 +1,51 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-IEs"
+ * 	found in "E2SM-KPM-Prespec.asn"
+ * 	`asn1c -D ./e2sm-kpm -gen-PER`
+ */
+
+#include "GlobalKPMnode-ng-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalKPMnode_ng_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalKPMnode_ng_eNB_ID, global_ng_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalngeNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-ng-eNB-ID"
+		},
+};
+
+static const ber_tlv_tag_t asn_DEF_GlobalKPMnode_ng_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalKPMnode_ng_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-ng-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalKPMnode_ng_eNB_ID_specs_1 = {
+	sizeof(struct GlobalKPMnode_ng_eNB_ID),
+	offsetof(struct GlobalKPMnode_ng_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalKPMnode_ng_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalKPMnode_ng_eNB_ID = {
+	"GlobalKPMnode-ng-eNB-ID",
+	"GlobalKPMnode-ng-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalKPMnode_ng_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalKPMnode_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_ng_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalKPMnode_ng_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalKPMnode_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalKPMnode_ng_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalKPMnode_ng_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalKPMnode_ng_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalenGNB-ID.c b/e2sm/lib/GlobalenGNB-ID.c
new file mode 100644
index 0000000..1824a11
--- /dev/null
+++ b/e2sm/lib/GlobalenGNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalenGNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalenGNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalenGNB_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalenGNB_ID, gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENGNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalenGNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalenGNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* gNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalenGNB_ID_specs_1 = {
+	sizeof(struct GlobalenGNB_ID),
+	offsetof(struct GlobalenGNB_ID, _asn_ctx),
+	asn_MAP_GlobalenGNB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalenGNB_ID = {
+	"GlobalenGNB-ID",
+	"GlobalenGNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalenGNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalenGNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalenGNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalenGNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalenGNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalenGNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalenGNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalenGNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalgNB-ID.c b/e2sm/lib/GlobalgNB-ID.c
new file mode 100644
index 0000000..40d7462
--- /dev/null
+++ b/e2sm/lib/GlobalgNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalgNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalgNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalgNB_ID, plmn_id),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"plmn-id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalgNB_ID, gnb_id),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_GNB_ID_Choice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gnb-id"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalgNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalgNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-id */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* gnb-id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalgNB_ID_specs_1 = {
+	sizeof(struct GlobalgNB_ID),
+	offsetof(struct GlobalgNB_ID, _asn_ctx),
+	asn_MAP_GlobalgNB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalgNB_ID = {
+	"GlobalgNB-ID",
+	"GlobalgNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalgNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalgNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalgNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalgNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalgNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalgNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalgNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalgNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/GlobalngeNB-ID.c b/e2sm/lib/GlobalngeNB-ID.c
new file mode 100644
index 0000000..91873a1
--- /dev/null
+++ b/e2sm/lib/GlobalngeNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "GlobalngeNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalngeNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalngeNB_ID, plmn_id),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"plmn-id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalngeNB_ID, enb_id),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENB_ID_Choice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"enb-id"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalngeNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalngeNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-id */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* enb-id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalngeNB_ID_specs_1 = {
+	sizeof(struct GlobalngeNB_ID),
+	offsetof(struct GlobalngeNB_ID, _asn_ctx),
+	asn_MAP_GlobalngeNB_ID_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalngeNB_ID = {
+	"GlobalngeNB-ID",
+	"GlobalngeNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalngeNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalngeNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalngeNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalngeNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalngeNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalngeNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalngeNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalngeNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/INTEGER.c b/e2sm/lib/INTEGER.c
new file mode 100644
index 0000000..2a2f4d7
--- /dev/null
+++ b/e2sm/lib/INTEGER.c
@@ -0,0 +1,1735 @@
+/*-
+ * Copyright (c) 2003-2014 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <INTEGER.h>
+#include <asn_codecs_prim.h>	/* Encoder and decoder of a primitive type */
+#include <errno.h>
+
+/*
+ * INTEGER basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_INTEGER_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_operation_t asn_OP_INTEGER = {
+	INTEGER_free,
+	INTEGER_print,
+	INTEGER_compare,
+	ber_decode_primitive,
+	INTEGER_encode_der,
+	INTEGER_decode_xer,
+	INTEGER_encode_xer,
+#ifdef  ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	INTEGER_decode_oer,     /* OER decoder */
+	INTEGER_encode_oer,     /* Canonical OER encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	INTEGER_decode_uper,	/* Unaligned PER decoder */
+	INTEGER_encode_uper,	/* Unaligned PER encoder */
+	INTEGER_decode_aper,	/* Aligned PER decoder */
+	INTEGER_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	INTEGER_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_INTEGER = {
+	"INTEGER",
+	"INTEGER",
+	&asn_OP_INTEGER,
+	asn_DEF_INTEGER_tags,
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
+	asn_DEF_INTEGER_tags,	/* Same as above */
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+/*
+ * Encode INTEGER type using DER.
+ */
+asn_enc_rval_t
+INTEGER_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                   void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+    asn_enc_rval_t rval;
+    INTEGER_t effective_integer;
+
+	ASN_DEBUG("%s %s as INTEGER (tm=%d)",
+		cb?"Encoding":"Estimating", td->name, tag_mode);
+
+	/*
+	 * Canonicalize integer in the buffer.
+	 * (Remove too long sign extension, remove some first 0x00 bytes)
+	 */
+	if(st->buf) {
+		uint8_t *buf = st->buf;
+		uint8_t *end1 = buf + st->size - 1;
+		int shift;
+
+		/* Compute the number of superfluous leading bytes */
+		for(; buf < end1; buf++) {
+			/*
+			 * If the contents octets of an integer value encoding
+			 * consist of more than one octet, then the bits of the
+			 * first octet and bit 8 of the second octet:
+			 * a) shall not all be ones; and
+			 * b) shall not all be zero.
+			 */
+			switch(*buf) {
+			case 0x00: if((buf[1] & 0x80) == 0)
+					continue;
+				break;
+			case 0xff: if((buf[1] & 0x80))
+					continue;
+				break;
+			}
+			break;
+		}
+
+		/* Remove leading superfluous bytes from the integer */
+		shift = buf - st->buf;
+		if(shift) {
+            union {
+                const uint8_t *c_buf;
+                uint8_t *nc_buf;
+            } unconst;
+            unconst.c_buf = st->buf;
+            effective_integer.buf = unconst.nc_buf + shift;
+            effective_integer.size = st->size - shift;
+
+            st = &effective_integer;
+        }
+    }
+
+    rval = der_encode_primitive(td, st, tag_mode, tag, cb, app_key);
+    if(rval.structure_ptr == &effective_integer) {
+        rval.structure_ptr = sptr;
+    }
+    return rval;
+}
+
+static const asn_INTEGER_enum_map_t *INTEGER_map_enum2value(
+    const asn_INTEGER_specifics_t *specs, const char *lstart,
+    const char *lstop);
+
+/*
+ * INTEGER specific human-readable output.
+ */
+static ssize_t
+INTEGER__dump(const asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+	char scratch[32];
+	uint8_t *buf = st->buf;
+	uint8_t *buf_end = st->buf + st->size;
+	intmax_t value;
+	ssize_t wrote = 0;
+	char *p;
+	int ret;
+
+	if(specs && specs->field_unsigned)
+		ret = asn_INTEGER2umax(st, (uintmax_t *)&value);
+	else
+		ret = asn_INTEGER2imax(st, &value);
+
+	/* Simple case: the integer size is small */
+	if(ret == 0) {
+		const asn_INTEGER_enum_map_t *el;
+		el = (value >= 0 || !specs || !specs->field_unsigned)
+			? INTEGER_map_value2enum(specs, value) : 0;
+		if(el) {
+			if(plainOrXER == 0)
+				return asn__format_to_callback(cb, app_key,
+					"%" ASN_PRIdMAX " (%s)", value, el->enum_name);
+			else
+				return asn__format_to_callback(cb, app_key,
+					"<%s/>", el->enum_name);
+		} else if(plainOrXER && specs && specs->strict_enumeration) {
+			ASN_DEBUG("ASN.1 forbids dealing with "
+				"unknown value of ENUMERATED type");
+			errno = EPERM;
+			return -1;
+		} else {
+            return asn__format_to_callback(cb, app_key,
+                                           (specs && specs->field_unsigned)
+                                               ? "%" ASN_PRIuMAX
+                                               : "%" ASN_PRIdMAX,
+                                           value);
+        }
+	} else if(plainOrXER && specs && specs->strict_enumeration) {
+		/*
+		 * Here and earlier, we cannot encode the ENUMERATED values
+		 * if there is no corresponding identifier.
+		 */
+		ASN_DEBUG("ASN.1 forbids dealing with "
+			"unknown value of ENUMERATED type");
+		errno = EPERM;
+		return -1;
+	}
+
+	/* Output in the long xx:yy:zz... format */
+	/* TODO: replace with generic algorithm (Knuth TAOCP Vol 2, 4.3.1) */
+	for(p = scratch; buf < buf_end; buf++) {
+		const char * const h2c = "0123456789ABCDEF";
+		if((p - scratch) >= (ssize_t)(sizeof(scratch) - 4)) {
+			/* Flush buffer */
+			if(cb(scratch, p - scratch, app_key) < 0)
+				return -1;
+			wrote += p - scratch;
+			p = scratch;
+		}
+		*p++ = h2c[*buf >> 4];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x3a;	/* ":" */
+	}
+	if(p != scratch)
+		p--;	/* Remove the last ":" */
+
+	wrote += p - scratch;
+	return (cb(scratch, p - scratch, app_key) < 0) ? -1 : wrote;
+}
+
+/*
+ * INTEGER specific human-readable output.
+ */
+int
+INTEGER_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+              asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+	ssize_t ret;
+
+	(void)ilevel;
+
+	if(!st || !st->buf)
+		ret = cb("<absent>", 8, app_key);
+	else
+		ret = INTEGER__dump(td, st, cb, app_key, 0);
+
+	return (ret < 0) ? -1 : 0;
+}
+
+struct e2v_key {
+	const char *start;
+	const char *stop;
+	const asn_INTEGER_enum_map_t *vemap;
+	const unsigned int *evmap;
+};
+static int
+INTEGER__compar_enum2value(const void *kp, const void *am) {
+	const struct e2v_key *key = (const struct e2v_key *)kp;
+	const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
+	const char *ptr, *end, *name;
+
+	/* Remap the element (sort by different criterion) */
+	el = key->vemap + key->evmap[el - key->vemap];
+
+	/* Compare strings */
+	for(ptr = key->start, end = key->stop, name = el->enum_name;
+			ptr < end; ptr++, name++) {
+		if(*ptr != *name || !*name)
+			return *(const unsigned char *)ptr
+				- *(const unsigned char *)name;
+	}
+	return name[0] ? -1 : 0;
+}
+
+static const asn_INTEGER_enum_map_t *
+INTEGER_map_enum2value(const asn_INTEGER_specifics_t *specs, const char *lstart,
+                       const char *lstop) {
+    const asn_INTEGER_enum_map_t *el_found;
+	int count = specs ? specs->map_count : 0;
+	struct e2v_key key;
+	const char *lp;
+
+	if(!count) return NULL;
+
+	/* Guaranteed: assert(lstart < lstop); */
+	/* Figure out the tag name */
+	for(lstart++, lp = lstart; lp < lstop; lp++) {
+		switch(*lp) {
+		case 9: case 10: case 11: case 12: case 13: case 32: /* WSP */
+		case 0x2f: /* '/' */ case 0x3e: /* '>' */
+			break;
+		default:
+			continue;
+		}
+		break;
+	}
+	if(lp == lstop) return NULL;	/* No tag found */
+	lstop = lp;
+
+	key.start = lstart;
+	key.stop = lstop;
+	key.vemap = specs->value2enum;
+	key.evmap = specs->enum2value;
+	el_found = (asn_INTEGER_enum_map_t *)bsearch(&key,
+		specs->value2enum, count, sizeof(specs->value2enum[0]),
+		INTEGER__compar_enum2value);
+	if(el_found) {
+		/* Remap enum2value into value2enum */
+		el_found = key.vemap + key.evmap[el_found - key.vemap];
+	}
+	return el_found;
+}
+
+static int
+INTEGER__compar_value2enum(const void *kp, const void *am) {
+	long a = *(const long *)kp;
+	const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
+	long b = el->nat_value;
+	if(a < b) return -1;
+	else if(a == b) return 0;
+	else return 1;
+}
+
+const asn_INTEGER_enum_map_t *
+INTEGER_map_value2enum(const asn_INTEGER_specifics_t *specs, long value) {
+	int count = specs ? specs->map_count : 0;
+	if(!count) return 0;
+	return (asn_INTEGER_enum_map_t *)bsearch(&value, specs->value2enum,
+		count, sizeof(specs->value2enum[0]),
+		INTEGER__compar_value2enum);
+}
+
+static int
+INTEGER_st_prealloc(INTEGER_t *st, int min_size) {
+	void *p = MALLOC(min_size + 1);
+	if(p) {
+		void *b = st->buf;
+		st->size = 0;
+		st->buf = p;
+		FREEMEM(b);
+		return 0;
+	} else {
+		return -1;
+	}
+}
+
+/*
+ * Decode the chunk of XML text encoding INTEGER.
+ */
+static enum xer_pbd_rval
+INTEGER__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
+                         const void *chunk_buf, size_t chunk_size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    INTEGER_t *st = (INTEGER_t *)sptr;
+	intmax_t dec_value;
+	intmax_t hex_value = 0;
+	const char *lp;
+	const char *lstart = (const char *)chunk_buf;
+	const char *lstop = lstart + chunk_size;
+	enum {
+		ST_LEADSPACE,
+		ST_SKIPSPHEX,
+		ST_WAITDIGITS,
+		ST_DIGITS,
+		ST_DIGITS_TRAILSPACE,
+		ST_HEXDIGIT1,
+		ST_HEXDIGIT2,
+		ST_HEXDIGITS_TRAILSPACE,
+		ST_HEXCOLON,
+		ST_END_ENUM,
+		ST_UNEXPECTED
+	} state = ST_LEADSPACE;
+	const char *dec_value_start = 0; /* INVARIANT: always !0 in ST_DIGITS */
+	const char *dec_value_end = 0;
+
+	if(chunk_size)
+		ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x",
+			(long)chunk_size, *lstart, lstop[-1]);
+
+	if(INTEGER_st_prealloc(st, (chunk_size/3) + 1))
+		return XPBD_SYSTEM_FAILURE;
+
+	/*
+	 * We may have received a tag here. It will be processed inline.
+	 * Use strtoul()-like code and serialize the result.
+	 */
+	for(lp = lstart; lp < lstop; lp++) {
+		int lv = *lp;
+		switch(lv) {
+		case 0x09: case 0x0a: case 0x0d: case 0x20:
+			switch(state) {
+			case ST_LEADSPACE:
+			case ST_DIGITS_TRAILSPACE:
+			case ST_HEXDIGITS_TRAILSPACE:
+			case ST_SKIPSPHEX:
+				continue;
+			case ST_DIGITS:
+				dec_value_end = lp;
+				state = ST_DIGITS_TRAILSPACE;
+				continue;
+			case ST_HEXCOLON:
+				state = ST_HEXDIGITS_TRAILSPACE;
+				continue;
+			default:
+				break;
+			}
+			break;
+		case 0x2d:	/* '-' */
+			if(state == ST_LEADSPACE) {
+				dec_value = 0;
+				dec_value_start = lp;
+				state = ST_WAITDIGITS;
+				continue;
+			}
+			break;
+		case 0x2b:	/* '+' */
+			if(state == ST_LEADSPACE) {
+				dec_value = 0;
+				dec_value_start = lp;
+				state = ST_WAITDIGITS;
+				continue;
+			}
+			break;
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39:
+			switch(state) {
+			case ST_DIGITS: continue;
+			case ST_SKIPSPHEX:	/* Fall through */
+			case ST_HEXDIGIT1:
+				hex_value = (lv - 0x30) << 4;
+				state = ST_HEXDIGIT2;
+				continue;
+			case ST_HEXDIGIT2:
+				hex_value += (lv - 0x30);
+				state = ST_HEXCOLON;
+				st->buf[st->size++] = (uint8_t)hex_value;
+				continue;
+			case ST_HEXCOLON:
+				return XPBD_BROKEN_ENCODING;
+			case ST_LEADSPACE:
+				dec_value = 0;
+				dec_value_start = lp;
+				/* FALL THROUGH */
+			case ST_WAITDIGITS:
+				state = ST_DIGITS;
+				continue;
+			default:
+				break;
+			}
+			break;
+		case 0x3c:	/* '<', start of XML encoded enumeration */
+			if(state == ST_LEADSPACE) {
+				const asn_INTEGER_enum_map_t *el;
+				el = INTEGER_map_enum2value(
+					(const asn_INTEGER_specifics_t *)
+					td->specifics, lstart, lstop);
+				if(el) {
+					ASN_DEBUG("Found \"%s\" => %ld",
+						el->enum_name, el->nat_value);
+					dec_value = el->nat_value;
+					state = ST_END_ENUM;
+					lp = lstop - 1;
+					continue;
+				}
+				ASN_DEBUG("Unknown identifier for INTEGER");
+			}
+			return XPBD_BROKEN_ENCODING;
+		case 0x3a:	/* ':' */
+			if(state == ST_HEXCOLON) {
+				/* This colon is expected */
+				state = ST_HEXDIGIT1;
+				continue;
+			} else if(state == ST_DIGITS) {
+				/* The colon here means that we have
+				 * decoded the first two hexadecimal
+				 * places as a decimal value.
+				 * Switch decoding mode. */
+				ASN_DEBUG("INTEGER re-evaluate as hex form");
+				state = ST_SKIPSPHEX;
+				dec_value_start = 0;
+				lp = lstart - 1;
+				continue;
+			} else {
+				ASN_DEBUG("state %d at %ld", state, (long)(lp - lstart));
+				break;
+			}
+		/* [A-Fa-f] */
+		case 0x41:case 0x42:case 0x43:case 0x44:case 0x45:case 0x46:
+		case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:case 0x66:
+			switch(state) {
+			case ST_SKIPSPHEX:
+			case ST_LEADSPACE: /* Fall through */
+			case ST_HEXDIGIT1:
+				hex_value = lv - ((lv < 0x61) ? 0x41 : 0x61);
+				hex_value += 10;
+				hex_value <<= 4;
+				state = ST_HEXDIGIT2;
+				continue;
+			case ST_HEXDIGIT2:
+				hex_value += lv - ((lv < 0x61) ? 0x41 : 0x61);
+				hex_value += 10;
+				st->buf[st->size++] = (uint8_t)hex_value;
+				state = ST_HEXCOLON;
+				continue;
+			case ST_DIGITS:
+				ASN_DEBUG("INTEGER re-evaluate as hex form");
+				state = ST_SKIPSPHEX;
+				dec_value_start = 0;
+				lp = lstart - 1;
+				continue;
+			default:
+				break;
+			}
+			break;
+		}
+
+		/* Found extra non-numeric stuff */
+		ASN_DEBUG("INTEGER :: Found non-numeric 0x%2x at %ld",
+			lv, (long)(lp - lstart));
+		state = ST_UNEXPECTED;
+		break;
+	}
+
+	switch(state) {
+	case ST_END_ENUM:
+		/* Got a complete and valid enumeration encoded as a tag. */
+		break;
+	case ST_DIGITS:
+		dec_value_end = lstop;
+		/* FALL THROUGH */
+	case ST_DIGITS_TRAILSPACE:
+		/* The last symbol encountered was a digit. */
+        switch(asn_strtoimax_lim(dec_value_start, &dec_value_end, &dec_value)) {
+        case ASN_STRTOX_OK:
+            if(specs && specs->field_unsigned && (uintmax_t) dec_value <= ULONG_MAX) {
+                break;
+            } else if(dec_value >= LONG_MIN && dec_value <= LONG_MAX) {
+                break;
+            } else {
+                /*
+                 * We model INTEGER on long for XER,
+                 * to avoid rewriting all the tests at once.
+                 */
+                ASN_DEBUG("INTEGER exceeds long range");
+            }
+            /* Fall through */
+        case ASN_STRTOX_ERROR_RANGE:
+            ASN_DEBUG("INTEGER decode %s hit range limit", td->name);
+            return XPBD_DECODER_LIMIT;
+		case ASN_STRTOX_ERROR_INVAL:
+		case ASN_STRTOX_EXPECT_MORE:
+		case ASN_STRTOX_EXTRA_DATA:
+			return XPBD_BROKEN_ENCODING;
+		}
+		break;
+	case ST_HEXCOLON:
+	case ST_HEXDIGITS_TRAILSPACE:
+		st->buf[st->size] = 0;	/* Just in case termination */
+		return XPBD_BODY_CONSUMED;
+	case ST_HEXDIGIT1:
+	case ST_HEXDIGIT2:
+	case ST_SKIPSPHEX:
+		return XPBD_BROKEN_ENCODING;
+	case ST_LEADSPACE:
+		/* Content not found */
+		return XPBD_NOT_BODY_IGNORE;
+	case ST_WAITDIGITS:
+	case ST_UNEXPECTED:
+		ASN_DEBUG("INTEGER: No useful digits (state %d)", state);
+		return XPBD_BROKEN_ENCODING;	/* No digits */
+	}
+
+	/*
+	 * Convert the result of parsing of enumeration or a straight
+	 * decimal value into a BER representation.
+	 */
+	if(asn_imax2INTEGER(st, dec_value)) {
+                ASN_DEBUG("INTEGER decode %s conversion failed", td->name);
+		return XPBD_SYSTEM_FAILURE;
+        }
+
+	return XPBD_BODY_CONSUMED;
+}
+
+asn_dec_rval_t
+INTEGER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void **sptr,
+                   const char *opt_mname, const void *buf_ptr, size_t size) {
+    return xer_decode_primitive(opt_codec_ctx, td,
+		sptr, sizeof(INTEGER_t), opt_mname,
+		buf_ptr, size, INTEGER__xer_body_decode);
+}
+
+asn_enc_rval_t
+INTEGER_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int ilevel, enum xer_encoder_flags_e flags,
+                   asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+	asn_enc_rval_t er = {0,0,0};
+
+	(void)ilevel;
+	(void)flags;
+	
+	if(!st || !st->buf)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = INTEGER__dump(td, st, cb, app_key, 1);
+	if(er.encoded < 0) ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#ifndef	ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr,
+                    asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = { RC_OK, 0 };
+	INTEGER_t *st = (INTEGER_t *)*sptr;
+	const asn_per_constraint_t *ct;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(!st) {
+		st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	FREEMEM(st->buf);
+	st->buf = 0;
+	st->size = 0;
+	if(ct) {
+		if(ct->flags & APC_SEMI_CONSTRAINED) {
+			st->buf = (uint8_t *)CALLOC(1, 2);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = 1;
+		} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
+			size_t size = (ct->range_bits + 7) >> 3;
+			st->buf = (uint8_t *)MALLOC(1 + size + 1);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = size;
+		}
+	}
+
+	/* X.691-2008/11, #13.2.2, constrained whole number */
+	if(ct && ct->flags != APC_UNCONSTRAINED) {
+		/* #11.5.6 */
+		ASN_DEBUG("Integer with range %d bits", ct->range_bits);
+		if(ct->range_bits >= 0) {
+			if((size_t)ct->range_bits > 8 * sizeof(unsigned long))
+				ASN__DECODE_FAILED;
+
+			if(specs && specs->field_unsigned) {
+				unsigned long uvalue = 0;
+				if(uper_get_constrained_whole_number(pd,
+					&uvalue, ct->range_bits))
+					ASN__DECODE_STARVED;
+				ASN_DEBUG("Got value %lu + low %ld",
+					uvalue, ct->lower_bound);
+				uvalue += ct->lower_bound;
+				if(asn_ulong2INTEGER(st, uvalue))
+					ASN__DECODE_FAILED;
+			} else {
+				unsigned long uvalue = 0;
+				long svalue;
+				if(uper_get_constrained_whole_number(pd,
+					&uvalue, ct->range_bits))
+					ASN__DECODE_STARVED;
+				ASN_DEBUG("Got value %lu + low %ld",
+					uvalue, ct->lower_bound);
+                if(per_long_range_unrebase(uvalue, ct->lower_bound,
+                                           ct->upper_bound, &svalue)
+                   || asn_long2INTEGER(st, svalue)) {
+                    ASN__DECODE_FAILED;
+                }
+			}
+			return rval;
+		}
+	} else {
+		ASN_DEBUG("Decoding unconstrained integer %s", td->name);
+	}
+
+	/* X.691, #12.2.3, #12.2.4 */
+	do {
+		ssize_t len = 0;
+		void *p = NULL;
+		int ret = 0;
+
+		/* Get the PER length */
+		len = uper_get_length(pd, -1, 0, &repeat);
+		if(len < 0) ASN__DECODE_STARVED;
+
+		p = REALLOC(st->buf, st->size + len + 1);
+		if(!p) ASN__DECODE_FAILED;
+		st->buf = (uint8_t *)p;
+
+		ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
+		if(ret < 0) ASN__DECODE_STARVED;
+		st->size += len;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* JIC */
+
+	/* #12.2.3 */
+	if(ct && ct->lower_bound) {
+		/*
+		 * TODO: replace by in-place arithmetics.
+		 */
+		long value = 0;
+		if(asn_INTEGER2long(st, &value))
+			ASN__DECODE_FAILED;
+		if(asn_imax2INTEGER(st, value + ct->lower_bound))
+			ASN__DECODE_FAILED;
+	}
+
+	return rval;
+}
+
+asn_enc_rval_t
+INTEGER_encode_uper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, const void *sptr,
+                    asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs =
+        	(const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	const uint8_t *buf;
+	const uint8_t *end;
+	const asn_per_constraint_t *ct;
+	long value = 0;
+
+	if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	er.encoded = 0;
+
+	if(ct) {
+		int inext = 0;
+		if(specs && specs->field_unsigned) {
+			unsigned long uval;
+			if(asn_INTEGER2ulong(st, &uval))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(uval < (unsigned long)ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(uval < (unsigned long)ct->lower_bound
+				|| uval > (unsigned long)ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%" ASN_PRI_SIZE ") lb %lu ub %lu %s",
+				uval, st->buf[0], st->size,
+				ct->lower_bound, ct->upper_bound,
+				inext ? "ext" : "fix");
+			value = uval;
+		} else {
+			if(asn_INTEGER2long(st, &value))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(value < ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(value < ct->lower_bound
+				|| value > ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %ld (%02x/%" ASN_PRI_SIZE ") lb %ld ub %ld %s",
+				value, st->buf[0], st->size,
+				ct->lower_bound, ct->upper_bound,
+				inext ? "ext" : "fix");
+		}
+		if(ct->flags & APC_EXTENSIBLE) {
+			if(per_put_few_bits(po, inext, 1))
+				ASN__ENCODE_FAILED;
+			if(inext) ct = 0;
+		} else if(inext) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+
+	/* X.691-11/2008, #13.2.2, test if constrained whole number */
+	if(ct && ct->range_bits >= 0) {
+        unsigned long v;
+		/* #11.5.6 -> #11.3 */
+		ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
+			value, value - ct->lower_bound, ct->range_bits);
+	if(specs && specs->field_unsigned) {
+		if (  ((unsigned long)ct->lower_bound > (unsigned long)(ct->upper_bound)
+		   || ((unsigned long)value < (unsigned long)ct->lower_bound))
+		   || ((unsigned long)value > (unsigned long)ct->upper_bound)
+		) {
+			ASN_DEBUG("Value %lu to-be-encoded is outside the bounds [%lu, %lu]!",
+				value, ct->lower_bound, ct->upper_bound);
+			ASN__ENCODE_FAILED;
+		}
+ 		v = (unsigned long)value - (unsigned long)ct->lower_bound;
+ 	} else {
+ 		if(per_long_range_rebase(value, ct->lower_bound, ct->upper_bound, &v)) {
+ 			ASN__ENCODE_FAILED;
+ 		}
+	}
+        if(uper_put_constrained_whole_number_u(po, v, ct->range_bits))
+		ASN__ENCODE_FAILED;
+	ASN__ENCODED_OK(er);
+	}
+
+	if(ct && ct->lower_bound) {
+		ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
+		/* TODO: adjust lower bound */
+		ASN__ENCODE_FAILED;
+	}
+
+	for(buf = st->buf, end = st->buf + st->size; buf < end;) {
+        int need_eom = 0;
+        ssize_t mayEncode = uper_put_length(po, end - buf, &need_eom);
+        if(mayEncode < 0)
+			ASN__ENCODE_FAILED;
+		if(per_put_many_bits(po, buf, 8 * mayEncode))
+			ASN__ENCODE_FAILED;
+		buf += mayEncode;
+        if(need_eom && uper_put_length(po, 0, 0)) ASN__ENCODE_FAILED;
+    }
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	INTEGER_t *st = (INTEGER_t *)*sptr;
+	const asn_per_constraint_t *ct;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(!st) {
+		st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	FREEMEM(st->buf);
+	st->buf = 0;
+	st->size = 0;
+	if(ct) {
+		if(ct->flags & APC_SEMI_CONSTRAINED) {
+			st->buf = (uint8_t *)CALLOC(1, 2);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = 1;
+		} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
+			size_t size = (ct->range_bits + 7) >> 3;
+			st->buf = (uint8_t *)MALLOC(1 + size + 1);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = size;
+		}
+	}
+
+	/* X.691, #12.2.2 */
+	if(ct && ct->flags != APC_UNCONSTRAINED) {
+		/* #10.5.6 */
+		ASN_DEBUG("Integer with range %d bits", ct->range_bits);
+		if(ct->range_bits >= 0) {
+			if (ct->range_bits > 16) {
+				int max_range_bytes = (ct->range_bits >> 3) +
+				                      (((ct->range_bits % 8) > 0) ? 1 : 0);
+				int length = 0, i;
+				long value = 0;
+
+				for (i = 1; ; i++) {
+					int upper = 1 << i;
+					if (upper >= max_range_bytes)
+						break;
+				}
+				ASN_DEBUG("Can encode %d (%d bytes) in %d bits", ct->range_bits,
+				          max_range_bytes, i);
+
+				if ((length = per_get_few_bits(pd, i)) < 0)
+					ASN__DECODE_FAILED;
+
+				/* X.691 #12.2.6 length determinant + lb (1) */
+				length += 1;
+				ASN_DEBUG("Got length %d", length);
+				if (aper_get_align(pd) != 0)
+					ASN__DECODE_FAILED;
+				while (length--) {
+					int buf = per_get_few_bits(pd, 8);
+					if (buf < 0)
+						ASN__DECODE_FAILED;
+					value += (((long)buf) << (8 * length));
+				}
+
+				value += ct->lower_bound;
+				if((specs && specs->field_unsigned)
+				        ? asn_uint642INTEGER(st, (unsigned long)value)
+				        : asn_int642INTEGER(st, value))
+					ASN__DECODE_FAILED;
+				ASN_DEBUG("Got value %ld + low %ld",
+				          value, ct->lower_bound);
+			} else {
+				long value = 0;
+				if (ct->range_bits < 8) {
+					value = per_get_few_bits(pd, ct->range_bits);
+					if(value < 0) ASN__DECODE_STARVED;
+				} else if (ct->range_bits == 8) {
+					if (aper_get_align(pd) < 0)
+						ASN__DECODE_FAILED;
+					value = per_get_few_bits(pd, ct->range_bits);
+					if(value < 0) ASN__DECODE_STARVED;
+				} else {
+					/* Align */
+					if (aper_get_align(pd) < 0)
+						ASN__DECODE_FAILED;
+					value = per_get_few_bits(pd, 16);
+					if(value < 0) ASN__DECODE_STARVED;
+				}
+				value += ct->lower_bound;
+				if((specs && specs->field_unsigned)
+				        ? asn_ulong2INTEGER(st, value)
+				        : asn_long2INTEGER(st, value))
+					ASN__DECODE_FAILED;
+				ASN_DEBUG("Got value %ld + low %ld",
+				          value, ct->lower_bound);
+			}
+			return rval;
+		} else {
+			ASN__DECODE_FAILED;
+		}
+	} else {
+		ASN_DEBUG("Decoding unconstrained integer %s", td->name);
+	}
+
+	/* X.691, #12.2.3, #12.2.4 */
+	do {
+		ssize_t len;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		len = aper_get_length(pd, -1, -1, &repeat);
+		if(len < 0) ASN__DECODE_STARVED;
+
+		p = REALLOC(st->buf, st->size + len + 1);
+		if(!p) ASN__DECODE_FAILED;
+		st->buf = (uint8_t *)p;
+
+		ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
+		if(ret < 0) ASN__DECODE_STARVED;
+		st->size += len;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* JIC */
+
+	/* #12.2.3 */
+	if(ct && ct->lower_bound) {
+		/*
+		 * TODO: replace by in-place arithmetics.
+		 */
+		long value;
+		if(asn_INTEGER2long(st, &value))
+			ASN__DECODE_FAILED;
+		if(asn_long2INTEGER(st, value + ct->lower_bound))
+			ASN__DECODE_FAILED;
+	}
+
+	return rval;
+}
+
+asn_enc_rval_t
+INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints,
+                    const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	const uint8_t *buf;
+	const uint8_t *end;
+	const asn_per_constraint_t *ct;
+	long value = 0;
+
+	if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	er.encoded = 0;
+
+	if(ct) {
+		int inext = 0;
+		if(specs && specs->field_unsigned) {
+			unsigned long uval;
+			if(asn_INTEGER2ulong(st, &uval))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(uval < (unsigned long)ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(uval < (unsigned long)ct->lower_bound
+				        || uval > (unsigned long)ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+			          uval, st->buf[0], st->size,
+			          ct->lower_bound, ct->upper_bound,
+			          inext ? "ext" : "fix");
+			value = uval;
+		} else {
+			if(asn_INTEGER2long(st, &value)) ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(value < ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(value < ct->lower_bound
+				        || value > ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+			          value, st->buf[0], st->size,
+			          ct->lower_bound, ct->upper_bound,
+			          inext ? "ext" : "fix");
+		}
+		if(ct->flags & APC_EXTENSIBLE) {
+			if(per_put_few_bits(po, inext, 1))
+				ASN__ENCODE_FAILED;
+			if(inext) ct = 0;
+		} else if(inext) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+	/* X.691, #12.2.2 */
+	if(ct && ct->range_bits >= 0) {
+		unsigned long v;
+
+		/* #10.5.6 */
+		ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
+		          value, value - ct->lower_bound, ct->range_bits);
+
+		v = value - ct->lower_bound;
+
+		/* #12 <= 8 -> alignment ? */
+		if (ct->range_bits < 8) {
+			if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
+				ASN__ENCODE_FAILED;
+		} else if (ct->range_bits == 8) {
+			if(aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
+				ASN__ENCODE_FAILED;
+		} else if (ct->range_bits <= 16) {
+			/* Consume the bytes to align on octet */
+			if(aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			if(per_put_few_bits(po, 0x0000 | v,
+			                    16))
+				ASN__ENCODE_FAILED;
+		} else {
+			/* TODO: extend to >64 bits */
+			int64_t v64 = v;
+			int i, j;
+			int max_range_bytes = (ct->range_bits >> 3) +
+			                      (((ct->range_bits % 8) > 0) ? 1 : 0);
+
+			for (i = 1; ; i++) {
+				int upper = 1 << i;
+				if (upper >= max_range_bytes)
+					break;
+			}
+
+			for (j = sizeof(int64_t) -1; j != 0; j--) {
+				int64_t val;
+				val = v64 >> (j * 8);
+				if (val != 0)
+					break;
+			}
+
+			/* Putting length in the minimum number of bits ex: 5 = 3bits */
+			if (per_put_few_bits(po, j, i))
+				ASN__ENCODE_FAILED;
+
+			/* Consume the bits to align on octet */
+			if (aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			/* Put the value */
+			for (i = 0; i <= j; i++) {
+				if(per_put_few_bits(po, (v64 >> (8 * (j - i))) & 0xff, 8))
+					ASN__ENCODE_FAILED;
+			}
+		}
+		ASN__ENCODED_OK(er);
+	}
+
+	if(ct && ct->lower_bound) {
+		ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
+		/* TODO: adjust lower bound */
+		ASN__ENCODE_FAILED;
+	}
+
+	for(buf = st->buf, end = st->buf + st->size; buf < end;) {
+		ssize_t mayEncode = aper_put_length(po, -1, end - buf);
+		if(mayEncode < 0)
+			ASN__ENCODE_FAILED;
+		if(per_put_many_bits(po, buf, 8 * mayEncode))
+			ASN__ENCODE_FAILED;
+		buf += mayEncode;
+	}
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+
+static intmax_t
+asn__integer_convert(const uint8_t *b, const uint8_t *end) {
+    uintmax_t value;
+
+    /* Perform the sign initialization */
+    /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
+    if((*b >> 7)) {
+        value = (uintmax_t)(-1);
+    } else {
+        value = 0;
+    }
+
+    /* Conversion engine */
+    for(; b < end; b++) {
+        value = (value << 8) | *b;
+    }
+
+    return value;
+}
+
+int
+asn_INTEGER2imax(const INTEGER_t *iptr, intmax_t *lptr) {
+	uint8_t *b, *end;
+	size_t size;
+
+	/* Sanity checking */
+	if(!iptr || !iptr->buf || !lptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	/* Cache the begin/end of the buffer */
+	b = iptr->buf;	/* Start of the INTEGER buffer */
+	size = iptr->size;
+	end = b + size;	/* Where to stop */
+
+	if(size > sizeof(intmax_t)) {
+		uint8_t *end1 = end - 1;
+		/*
+		 * Slightly more advanced processing,
+		 * able to process INTEGERs with >sizeof(intmax_t) bytes
+		 * when the actual value is small, e.g. for intmax_t == int32_t
+		 * (0x0000000000abcdef INTEGER would yield a fine 0x00abcdef int32_t)
+		 */
+		/* Skip out the insignificant leading bytes */
+		for(; b < end1; b++) {
+			switch(*b) {
+				case 0x00: if((b[1] & 0x80) == 0) continue; break;
+				case 0xff: if((b[1] & 0x80) != 0) continue; break;
+			}
+			break;
+		}
+
+		size = end - b;
+		if(size > sizeof(intmax_t)) {
+			/* Still cannot fit the sizeof(intmax_t) */
+			errno = ERANGE;
+			return -1;
+		}
+	}
+
+	/* Shortcut processing of a corner case */
+	if(end == b) {
+		*lptr = 0;
+		return 0;
+	}
+
+	*lptr = asn__integer_convert(b, end);
+	return 0;
+}
+
+/* FIXME: negative INTEGER values are silently interpreted as large unsigned ones. */
+int
+asn_INTEGER2umax(const INTEGER_t *iptr, uintmax_t *lptr) {
+	uint8_t *b, *end;
+	uintmax_t value;
+	size_t size;
+
+	if(!iptr || !iptr->buf || !lptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	b = iptr->buf;
+	size = iptr->size;
+	end = b + size;
+
+	/* If all extra leading bytes are zeroes, ignore them */
+	for(; size > sizeof(value); b++, size--) {
+		if(*b) {
+			/* Value won't fit into uintmax_t */
+			errno = ERANGE;
+			return -1;
+		}
+	}
+
+	/* Conversion engine */
+	for(value = 0; b < end; b++)
+		value = (value << 8) | *b;
+
+	*lptr = value;
+	return 0;
+}
+
+int
+asn_umax2INTEGER(INTEGER_t *st, uintmax_t value) {
+    uint8_t *buf;
+    uint8_t *end;
+    uint8_t *b;
+    int shr;
+
+    if(value <= ((~(uintmax_t)0) >> 1)) {
+        return asn_imax2INTEGER(st, value);
+    }
+
+    buf = (uint8_t *)MALLOC(1 + sizeof(value));
+    if(!buf) return -1;
+
+    end = buf + (sizeof(value) + 1);
+    buf[0] = 0; /* INTEGERs are signed. 0-byte indicates positive. */
+    for(b = buf + 1, shr = (sizeof(value) - 1) * 8; b < end; shr -= 8, b++)
+        *b = (uint8_t)(value >> shr);
+
+    if(st->buf) FREEMEM(st->buf);
+    st->buf = buf;
+    st->size = 1 + sizeof(value);
+
+	return 0;
+}
+
+int
+asn_imax2INTEGER(INTEGER_t *st, intmax_t value) {
+	uint8_t *buf, *bp;
+	uint8_t *p;
+	uint8_t *pstart;
+	uint8_t *pend1;
+	int littleEndian = 1;	/* Run-time detection */
+	int add;
+
+	if(!st) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	buf = (uint8_t *)(long *)MALLOC(sizeof(value));
+	if(!buf) return -1;
+
+	if(*(char *)&littleEndian) {
+		pstart = (uint8_t *)&value + sizeof(value) - 1;
+		pend1 = (uint8_t *)&value;
+		add = -1;
+	} else {
+		pstart = (uint8_t *)&value;
+		pend1 = pstart + sizeof(value) - 1;
+		add = 1;
+	}
+
+	/*
+	 * If the contents octet consists of more than one octet,
+	 * then bits of the first octet and bit 8 of the second octet:
+	 * a) shall not all be ones; and
+	 * b) shall not all be zero.
+	 */
+	for(p = pstart; p != pend1; p += add) {
+		switch(*p) {
+		case 0x00: if((*(p+add) & 0x80) == 0)
+				continue;
+			break;
+		case 0xff: if((*(p+add) & 0x80))
+				continue;
+			break;
+		}
+		break;
+	}
+	/* Copy the integer body */
+	for(bp = buf, pend1 += add; p != pend1; p += add)
+		*bp++ = *p;
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = bp - buf;
+
+	return 0;
+}
+
+int
+asn_INTEGER2long(const INTEGER_t *iptr, long *l) {
+    intmax_t v;
+    if(asn_INTEGER2imax(iptr, &v) == 0) {
+        if(v < LONG_MIN || v > LONG_MAX) {
+            errno = ERANGE;
+            return -1;
+        }
+        *l = v;
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
+int
+asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *l) {
+    uintmax_t v;
+    if(asn_INTEGER2umax(iptr, &v) == 0) {
+        if(v > ULONG_MAX) {
+            errno = ERANGE;
+            return -1;
+        }
+        *l = v;
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
+int
+asn_long2INTEGER(INTEGER_t *st, long value) {
+    return asn_imax2INTEGER(st, value);
+}
+
+int
+asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
+    return asn_imax2INTEGER(st, value);
+}
+
+
+int
+asn_uint642INTEGER(INTEGER_t *st, uint64_t value) {
+	uint8_t *buf;
+	uint8_t *end;
+	uint8_t *b;
+	int shr;
+
+	if(value <= INT64_MAX)
+		return asn_int642INTEGER(st, value);
+
+	buf = (uint8_t *)MALLOC(1 + sizeof(value));
+	if(!buf) return -1;
+
+	end = buf + (sizeof(value) + 1);
+	buf[0] = 0;
+	for(b = buf + 1, shr = (sizeof(value)-1)*8; b < end; shr -= 8, b++)
+		*b = (uint8_t)(value >> shr);
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = 1 + sizeof(value);
+
+	return 0;
+}
+
+int
+asn_int642INTEGER(INTEGER_t *st, int64_t value) {
+	uint8_t *buf, *bp;
+	uint8_t *p;
+	uint8_t *pstart;
+	uint8_t *pend1;
+	int littleEndian = 1;	/* Run-time detection */
+	int add;
+
+	if(!st) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	buf = (uint8_t *)MALLOC(sizeof(value));
+	if(!buf) return -1;
+
+	if(*(char *)&littleEndian) {
+		pstart = (uint8_t *)&value + sizeof(value) - 1;
+		pend1 = (uint8_t *)&value;
+		add = -1;
+	} else {
+		pstart = (uint8_t *)&value;
+		pend1 = pstart + sizeof(value) - 1;
+		add = 1;
+	}
+
+	/*
+	 * If the contents octet consists of more than one octet,
+	 * then bits of the first octet and bit 8 of the second octet:
+	 * a) shall not all be ones; and
+	 * b) shall not all be zero.
+	 */
+	for(p = pstart; p != pend1; p += add) {
+		switch(*p) {
+		case 0x00: if((*(p+add) & 0x80) == 0)
+				continue;
+			break;
+		case 0xff: if((*(p+add) & 0x80))
+				continue;
+			break;
+		}
+		break;
+	}
+	/* Copy the integer body */
+	for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add)
+		*bp++ = *p;
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = bp - buf;
+
+	return 0;
+}
+
+/*
+ * Parse the number in the given string until the given *end position,
+ * returning the position after the last parsed character back using the
+ * same (*end) pointer.
+ * WARNING: This behavior is different from the standard strtol/strtoimax(3).
+ */
+enum asn_strtox_result_e
+asn_strtoimax_lim(const char *str, const char **end, intmax_t *intp) {
+	int sign = 1;
+	intmax_t value;
+
+#define ASN1_INTMAX_MAX ((~(uintmax_t)0) >> 1)
+    const intmax_t upper_boundary = ASN1_INTMAX_MAX / 10;
+	intmax_t last_digit_max = ASN1_INTMAX_MAX % 10;
+#undef  ASN1_INTMAX_MAX
+
+	if(str >= *end) return ASN_STRTOX_ERROR_INVAL;
+
+	switch(*str) {
+	case '-':
+		last_digit_max++;
+		sign = -1;
+		/* FALL THROUGH */
+	case '+':
+		str++;
+		if(str >= *end) {
+			*end = str;
+			return ASN_STRTOX_EXPECT_MORE;
+		}
+	}
+
+	for(value = 0; str < (*end); str++) {
+		switch(*str) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
+			int d = *str - '0';
+			if(value < upper_boundary) {
+				value = value * 10 + d;
+			} else if(value == upper_boundary) {
+				if(d <= last_digit_max) {
+					if(sign > 0) {
+						value = value * 10 + d;
+					} else {
+						sign = 1;
+						value = -value * 10 - d;
+					}
+				} else {
+					*end = str;
+					return ASN_STRTOX_ERROR_RANGE;
+				}
+			} else {
+				*end = str;
+				return ASN_STRTOX_ERROR_RANGE;
+			}
+		    }
+		    continue;
+		default:
+		    *end = str;
+		    *intp = sign * value;
+		    return ASN_STRTOX_EXTRA_DATA;
+		}
+	}
+
+	*end = str;
+	*intp = sign * value;
+	return ASN_STRTOX_OK;
+}
+
+/*
+ * Parse the number in the given string until the given *end position,
+ * returning the position after the last parsed character back using the
+ * same (*end) pointer.
+ * WARNING: This behavior is different from the standard strtoul/strtoumax(3).
+ */
+enum asn_strtox_result_e
+asn_strtoumax_lim(const char *str, const char **end, uintmax_t *uintp) {
+	uintmax_t value;
+
+#define ASN1_UINTMAX_MAX ((~(uintmax_t)0))
+    const uintmax_t upper_boundary = ASN1_UINTMAX_MAX / 10;
+    uintmax_t last_digit_max = ASN1_UINTMAX_MAX % 10;
+#undef ASN1_UINTMAX_MAX
+
+    if(str >= *end) return ASN_STRTOX_ERROR_INVAL;
+
+	switch(*str) {
+	case '-':
+        return ASN_STRTOX_ERROR_INVAL;
+	case '+':
+		str++;
+		if(str >= *end) {
+			*end = str;
+			return ASN_STRTOX_EXPECT_MORE;
+		}
+	}
+
+	for(value = 0; str < (*end); str++) {
+		switch(*str) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
+			unsigned int d = *str - '0';
+			if(value < upper_boundary) {
+				value = value * 10 + d;
+			} else if(value == upper_boundary) {
+				if(d <= last_digit_max) {
+                    value = value * 10 + d;
+                } else {
+					*end = str;
+					return ASN_STRTOX_ERROR_RANGE;
+				}
+			} else {
+				*end = str;
+				return ASN_STRTOX_ERROR_RANGE;
+			}
+		    }
+		    continue;
+		default:
+		    *end = str;
+		    *uintp = value;
+		    return ASN_STRTOX_EXTRA_DATA;
+		}
+	}
+
+	*end = str;
+	*uintp = value;
+	return ASN_STRTOX_OK;
+}
+
+enum asn_strtox_result_e
+asn_strtol_lim(const char *str, const char **end, long *lp) {
+    intmax_t value;
+    switch(asn_strtoimax_lim(str, end, &value)) {
+    case ASN_STRTOX_ERROR_RANGE:
+        return ASN_STRTOX_ERROR_RANGE;
+    case ASN_STRTOX_ERROR_INVAL:
+        return ASN_STRTOX_ERROR_INVAL;
+    case ASN_STRTOX_EXPECT_MORE:
+        return ASN_STRTOX_EXPECT_MORE;
+    case ASN_STRTOX_OK:
+        if(value >= LONG_MIN && value <= LONG_MAX) {
+            *lp = value;
+            return ASN_STRTOX_OK;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    case ASN_STRTOX_EXTRA_DATA:
+        if(value >= LONG_MIN && value <= LONG_MAX) {
+            *lp = value;
+            return ASN_STRTOX_EXTRA_DATA;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    }
+
+    assert(!"Unreachable");
+    return ASN_STRTOX_ERROR_INVAL;
+}
+
+enum asn_strtox_result_e
+asn_strtoul_lim(const char *str, const char **end, unsigned long *ulp) {
+    uintmax_t value;
+    switch(asn_strtoumax_lim(str, end, &value)) {
+    case ASN_STRTOX_ERROR_RANGE:
+        return ASN_STRTOX_ERROR_RANGE;
+    case ASN_STRTOX_ERROR_INVAL:
+        return ASN_STRTOX_ERROR_INVAL;
+    case ASN_STRTOX_EXPECT_MORE:
+        return ASN_STRTOX_EXPECT_MORE;
+    case ASN_STRTOX_OK:
+        if(value <= ULONG_MAX) {
+            *ulp = value;
+            return ASN_STRTOX_OK;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    case ASN_STRTOX_EXTRA_DATA:
+        if(value <= ULONG_MAX) {
+            *ulp = value;
+            return ASN_STRTOX_EXTRA_DATA;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    }
+
+    assert(!"Unreachable");
+    return ASN_STRTOX_ERROR_INVAL;
+}
+
+int
+INTEGER_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                     const void *bptr) {
+    const INTEGER_t *a = aptr;
+    const INTEGER_t *b = bptr;
+
+    (void)td;
+
+    if(a && b) {
+        if(a->size && b->size) {
+            int sign_a = (a->buf[0] & 0x80) ? -1 : 1;
+            int sign_b = (b->buf[0] & 0x80) ? -1 : 1;
+
+            if(sign_a < sign_b) return -1;
+            if(sign_a > sign_b) return 1;
+
+            /* The shortest integer wins, unless comparing negatives */
+            if(a->size < b->size) {
+                return -1 * sign_a;
+            } else if(a->size > b->size) {
+                return 1 * sign_b;
+            }
+
+            return sign_a * memcmp(a->buf, b->buf, a->size);
+        } else if(a->size) {
+            int sign = (a->buf[0] & 0x80) ? -1 : 1;
+            return (1) * sign;
+        } else if(b->size) {
+            int sign = (a->buf[0] & 0x80) ? -1 : 1;
+            return (-1) * sign;
+        } else {
+            return 0;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+
+}
+
+asn_random_fill_result_t
+INTEGER_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                    const asn_encoding_constraints_t *constraints,
+                    size_t max_length) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    INTEGER_t *st = *sptr;
+    const asn_INTEGER_enum_map_t *emap;
+    size_t emap_len;
+    intmax_t value;
+    int find_inside_map;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (INTEGER_t *)CALLOC(1, sizeof(*st));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    if(specs) {
+        emap = specs->value2enum;
+        emap_len = specs->map_count;
+        if(specs->strict_enumeration) {
+            find_inside_map = emap_len > 0;
+        } else {
+            find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
+        }
+    } else {
+        emap = 0;
+        emap_len = 0;
+        find_inside_map = 0;
+    }
+
+    if(find_inside_map) {
+        assert(emap_len > 0);
+        value = emap[asn_random_between(0, emap_len - 1)].nat_value;
+    } else {
+        const asn_per_constraints_t *ct;
+
+        static const long variants[] = {
+            -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
+            -16383, -257,   -256,   -255,   -254,   -129,   -128,   -127,
+            -126,   -1,     0,      1,      126,    127,    128,    129,
+            254,    255,    256,    257,    16383,  16384,  16385,  32767,
+            32768,  32769,  65534,  65535,  65536,  65537};
+        if(specs && specs->field_unsigned) {
+            assert(variants[18] == 0);
+            value = variants[asn_random_between(
+                18, sizeof(variants) / sizeof(variants[0]) - 1)];
+        } else {
+            value = variants[asn_random_between(
+                0, sizeof(variants) / sizeof(variants[0]) - 1)];
+        }
+
+        if(!constraints) constraints = &td->encoding_constraints;
+        ct = constraints ? constraints->per_constraints : 0;
+        if(ct && (ct->value.flags & APC_CONSTRAINED)) {
+            if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
+                value = asn_random_between(ct->value.lower_bound,
+                                           ct->value.upper_bound);
+            }
+        }
+    }
+
+    if(asn_imax2INTEGER(st, value)) {
+        if(st == *sptr) {
+            ASN_STRUCT_RESET(*td, st);
+        } else {
+            ASN_STRUCT_FREE(*td, st);
+        }
+        return result_failed;
+    } else {
+        *sptr = st;
+        result_ok.length = st->size;
+        return result_ok;
+    }
+}
diff --git a/e2sm/lib/INTEGER_oer.c b/e2sm/lib/INTEGER_oer.c
new file mode 100644
index 0000000..110689b
--- /dev/null
+++ b/e2sm/lib/INTEGER_oer.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <INTEGER.h>
+#include <errno.h>
+
+asn_dec_rval_t
+INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, void **sptr,
+                   const void *ptr, size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    INTEGER_t *st = (INTEGER_t *)*sptr;
+    struct asn_oer_constraint_number_s ct = {0, 0};
+    size_t req_bytes;
+
+    (void)opt_codec_ctx;
+    (void)specs;
+
+    if(!st) {
+        st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    FREEMEM(st->buf);
+    st->buf = 0;
+    st->size = 0;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints) ct = constraints->value;
+
+    if(ct.width) {
+        req_bytes = ct.width;
+    } else {
+        /* No lower bound and no upper bound, effectively */
+
+        ssize_t consumed = oer_fetch_length(ptr, size, &req_bytes);
+        if(consumed == 0) {
+            ASN__DECODE_STARVED;
+        } else if(consumed == -1) {
+            ASN__DECODE_FAILED;
+        }
+        rval.consumed += consumed;
+        ptr = (const char *)ptr + consumed;
+        size -= consumed;
+    }
+
+    if(req_bytes > size) {
+        ASN__DECODE_STARVED;
+    }
+
+    if(ct.positive) {
+        /* X.969 08/2015 10.2(a) */
+        unsigned msb;   /* Most significant bit */
+        size_t useful_size;
+
+        /* Check most significant bit */
+        msb = *(const uint8_t *)ptr >> 7; /* yields 0 or 1 */
+        useful_size = msb + req_bytes;
+        st->buf = (uint8_t *)MALLOC(useful_size + 1);
+        if(!st->buf) {
+            ASN__DECODE_FAILED;
+        }
+
+        /*
+         * Record a large unsigned in a way not to confuse it
+         * with signed value.
+         */
+        st->buf[0] = '\0';
+        memcpy(st->buf + msb, ptr, req_bytes);
+        st->buf[useful_size] = '\0';    /* Just in case, 0-terminate */
+        st->size = useful_size;
+
+        rval.consumed += req_bytes;
+        return rval;
+    } else {
+        /* X.969 08/2015 10.2(b) */
+        st->buf = (uint8_t *)MALLOC(req_bytes + 1);
+        if(!st->buf) {
+            ASN__DECODE_FAILED;
+        }
+
+        memcpy(st->buf, ptr, req_bytes);
+        st->buf[req_bytes] = '\0'; /* Just in case, 0-terminate */
+        st->size = req_bytes;
+
+        rval.consumed += req_bytes;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+INTEGER_encode_oer(const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, const void *sptr,
+                   asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = sptr;
+    asn_enc_rval_t er = {0,0,0};
+    struct asn_oer_constraint_number_s ct = {0, 0};
+    const uint8_t *buf;
+    const uint8_t *end;
+    size_t useful_bytes;
+    size_t req_bytes = 0;
+    int sign = 0;
+
+    if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints) ct = constraints->value;
+
+    er.encoded = 0;
+
+    buf = st->buf;
+    end = buf + st->size;
+
+    sign = (buf && buf < end) ? buf[0] & 0x80 : 0;
+
+    /* Ignore 9 leading zeroes or ones */
+    if(ct.positive) {
+        if(sign) {
+            /* The value given is a signed value. Can't proceed. */
+            ASN__ENCODE_FAILED;
+        }
+        /* Remove leading zeros. */
+        for(; buf + 1 < end; buf++) {
+            if(buf[0] != 0x0) break;
+        }
+    } else {
+        for(; buf + 1 < end; buf++) {
+            if(buf[0] == 0x0 && (buf[1] & 0x80) == 0) {
+                continue;
+            } else if(buf[0] == 0xff && (buf[1] & 0x80) != 0) {
+                continue;
+            }
+            break;
+        }
+    }
+
+    useful_bytes = end - buf;
+    if(ct.width) {
+        req_bytes = ct.width;
+    } else {
+        ssize_t r = oer_serialize_length(useful_bytes, cb, app_key);
+        if(r < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        er.encoded += r;
+        req_bytes = useful_bytes;
+    }
+
+    if(req_bytes < useful_bytes) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded += req_bytes;
+
+    for(; req_bytes > useful_bytes; req_bytes--) {
+        if(cb(sign?"\xff":"\0", 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+    if(cb(buf, useful_bytes, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/L3-RRC-Measurements.c b/e2sm/lib/L3-RRC-Measurements.c
new file mode 100644
index 0000000..df7009d
--- /dev/null
+++ b/e2sm/lib/L3-RRC-Measurements.c
@@ -0,0 +1,74 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "L3-RRC-Measurements.h"
+
+#include "ServingCellMeasurements.h"
+#include "MeasResultNeighCells.h"
+asn_TYPE_member_t asn_MBR_L3_RRC_Measurements_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct L3_RRC_Measurements, rrcEvent),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RRCEvent,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rrcEvent"
+		},
+	{ ATF_POINTER, 2, offsetof(struct L3_RRC_Measurements, servingCellMeasurements),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ServingCellMeasurements,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"servingCellMeasurements"
+		},
+	{ ATF_POINTER, 1, offsetof(struct L3_RRC_Measurements, measResultNeighCells),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_MeasResultNeighCells,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measResultNeighCells"
+		},
+};
+static const int asn_MAP_L3_RRC_Measurements_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_L3_RRC_Measurements_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_L3_RRC_Measurements_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* rrcEvent */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* servingCellMeasurements */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* measResultNeighCells */
+};
+asn_SEQUENCE_specifics_t asn_SPC_L3_RRC_Measurements_specs_1 = {
+	sizeof(struct L3_RRC_Measurements),
+	offsetof(struct L3_RRC_Measurements, _asn_ctx),
+	asn_MAP_L3_RRC_Measurements_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_L3_RRC_Measurements_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_L3_RRC_Measurements = {
+	"L3-RRC-Measurements",
+	"L3-RRC-Measurements",
+	&asn_OP_SEQUENCE,
+	asn_DEF_L3_RRC_Measurements_tags_1,
+	sizeof(asn_DEF_L3_RRC_Measurements_tags_1)
+		/sizeof(asn_DEF_L3_RRC_Measurements_tags_1[0]), /* 1 */
+	asn_DEF_L3_RRC_Measurements_tags_1,	/* Same as above */
+	sizeof(asn_DEF_L3_RRC_Measurements_tags_1)
+		/sizeof(asn_DEF_L3_RRC_Measurements_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_L3_RRC_Measurements_1,
+	3,	/* Elements count */
+	&asn_SPC_L3_RRC_Measurements_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasQuantityResults.c b/e2sm/lib/MeasQuantityResults.c
new file mode 100644
index 0000000..71a2de9
--- /dev/null
+++ b/e2sm/lib/MeasQuantityResults.c
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasQuantityResults.h"
+
+asn_TYPE_member_t asn_MBR_MeasQuantityResults_1[] = {
+	{ ATF_POINTER, 3, offsetof(struct MeasQuantityResults, rsrp),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RSRP_Range,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rsrp"
+		},
+	{ ATF_POINTER, 2, offsetof(struct MeasQuantityResults, rsrq),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RSRQ_Range,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rsrq"
+		},
+	{ ATF_POINTER, 1, offsetof(struct MeasQuantityResults, sinr),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_SINR_Range,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"sinr"
+		},
+};
+static const int asn_MAP_MeasQuantityResults_oms_1[] = { 0, 1, 2 };
+static const ber_tlv_tag_t asn_DEF_MeasQuantityResults_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasQuantityResults_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* rsrp */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* rsrq */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* sinr */
+};
+asn_SEQUENCE_specifics_t asn_SPC_MeasQuantityResults_specs_1 = {
+	sizeof(struct MeasQuantityResults),
+	offsetof(struct MeasQuantityResults, _asn_ctx),
+	asn_MAP_MeasQuantityResults_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_MeasQuantityResults_oms_1,	/* Optional members */
+	3, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasQuantityResults = {
+	"MeasQuantityResults",
+	"MeasQuantityResults",
+	&asn_OP_SEQUENCE,
+	asn_DEF_MeasQuantityResults_tags_1,
+	sizeof(asn_DEF_MeasQuantityResults_tags_1)
+		/sizeof(asn_DEF_MeasQuantityResults_tags_1[0]), /* 1 */
+	asn_DEF_MeasQuantityResults_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasQuantityResults_tags_1)
+		/sizeof(asn_DEF_MeasQuantityResults_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_MeasQuantityResults_1,
+	3,	/* Elements count */
+	&asn_SPC_MeasQuantityResults_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasQuantityResultsEUTRA.c b/e2sm/lib/MeasQuantityResultsEUTRA.c
new file mode 100644
index 0000000..8dfe36d
--- /dev/null
+++ b/e2sm/lib/MeasQuantityResultsEUTRA.c
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasQuantityResultsEUTRA.h"
+
+asn_TYPE_member_t asn_MBR_MeasQuantityResultsEUTRA_1[] = {
+	{ ATF_POINTER, 3, offsetof(struct MeasQuantityResultsEUTRA, rsrp),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RSRP_RangeEUTRA,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rsrp"
+		},
+	{ ATF_POINTER, 2, offsetof(struct MeasQuantityResultsEUTRA, rsrq),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RSRQ_RangeEUTRA,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rsrq"
+		},
+	{ ATF_POINTER, 1, offsetof(struct MeasQuantityResultsEUTRA, sinr),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_SINR_RangeEUTRA,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"sinr"
+		},
+};
+static const int asn_MAP_MeasQuantityResultsEUTRA_oms_1[] = { 0, 1, 2 };
+static const ber_tlv_tag_t asn_DEF_MeasQuantityResultsEUTRA_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasQuantityResultsEUTRA_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* rsrp */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* rsrq */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* sinr */
+};
+asn_SEQUENCE_specifics_t asn_SPC_MeasQuantityResultsEUTRA_specs_1 = {
+	sizeof(struct MeasQuantityResultsEUTRA),
+	offsetof(struct MeasQuantityResultsEUTRA, _asn_ctx),
+	asn_MAP_MeasQuantityResultsEUTRA_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_MeasQuantityResultsEUTRA_oms_1,	/* Optional members */
+	3, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasQuantityResultsEUTRA = {
+	"MeasQuantityResultsEUTRA",
+	"MeasQuantityResultsEUTRA",
+	&asn_OP_SEQUENCE,
+	asn_DEF_MeasQuantityResultsEUTRA_tags_1,
+	sizeof(asn_DEF_MeasQuantityResultsEUTRA_tags_1)
+		/sizeof(asn_DEF_MeasQuantityResultsEUTRA_tags_1[0]), /* 1 */
+	asn_DEF_MeasQuantityResultsEUTRA_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasQuantityResultsEUTRA_tags_1)
+		/sizeof(asn_DEF_MeasQuantityResultsEUTRA_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_MeasQuantityResultsEUTRA_1,
+	3,	/* Elements count */
+	&asn_SPC_MeasQuantityResultsEUTRA_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultEUTRA.c b/e2sm/lib/MeasResultEUTRA.c
new file mode 100644
index 0000000..b3713d9
--- /dev/null
+++ b/e2sm/lib/MeasResultEUTRA.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultEUTRA.h"
+
+asn_TYPE_member_t asn_MBR_MeasResultEUTRA_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultEUTRA, eutra_PhysCellId),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PhysCellId,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eutra-PhysCellId"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultEUTRA, measResult),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasQuantityResultsEUTRA,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measResult"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_MeasResultEUTRA_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasResultEUTRA_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* eutra-PhysCellId */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* measResult */
+};
+asn_SEQUENCE_specifics_t asn_SPC_MeasResultEUTRA_specs_1 = {
+	sizeof(struct MeasResultEUTRA),
+	offsetof(struct MeasResultEUTRA, _asn_ctx),
+	asn_MAP_MeasResultEUTRA_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultEUTRA = {
+	"MeasResultEUTRA",
+	"MeasResultEUTRA",
+	&asn_OP_SEQUENCE,
+	asn_DEF_MeasResultEUTRA_tags_1,
+	sizeof(asn_DEF_MeasResultEUTRA_tags_1)
+		/sizeof(asn_DEF_MeasResultEUTRA_tags_1[0]), /* 1 */
+	asn_DEF_MeasResultEUTRA_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasResultEUTRA_tags_1)
+		/sizeof(asn_DEF_MeasResultEUTRA_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_MeasResultEUTRA_1,
+	2,	/* Elements count */
+	&asn_SPC_MeasResultEUTRA_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultListEUTRA.c b/e2sm/lib/MeasResultListEUTRA.c
new file mode 100644
index 0000000..b7a963e
--- /dev/null
+++ b/e2sm/lib/MeasResultListEUTRA.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultListEUTRA.h"
+
+#include "MeasResultEUTRA.h"
+static asn_oer_constraints_t asn_OER_type_MeasResultListEUTRA_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..8)) */};
+asn_per_constraints_t asn_PER_type_MeasResultListEUTRA_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 3,  3,  1,  8 }	/* (SIZE(1..8)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_MeasResultListEUTRA_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_MeasResultEUTRA,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_MeasResultListEUTRA_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_MeasResultListEUTRA_specs_1 = {
+	sizeof(struct MeasResultListEUTRA),
+	offsetof(struct MeasResultListEUTRA, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultListEUTRA = {
+	"MeasResultListEUTRA",
+	"MeasResultListEUTRA",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_MeasResultListEUTRA_tags_1,
+	sizeof(asn_DEF_MeasResultListEUTRA_tags_1)
+		/sizeof(asn_DEF_MeasResultListEUTRA_tags_1[0]), /* 1 */
+	asn_DEF_MeasResultListEUTRA_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasResultListEUTRA_tags_1)
+		/sizeof(asn_DEF_MeasResultListEUTRA_tags_1[0]), /* 1 */
+	{ &asn_OER_type_MeasResultListEUTRA_constr_1, &asn_PER_type_MeasResultListEUTRA_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_MeasResultListEUTRA_1,
+	1,	/* Single element */
+	&asn_SPC_MeasResultListEUTRA_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultListNR.c b/e2sm/lib/MeasResultListNR.c
new file mode 100644
index 0000000..d5edda9
--- /dev/null
+++ b/e2sm/lib/MeasResultListNR.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultListNR.h"
+
+#include "MeasResultNR.h"
+static asn_oer_constraints_t asn_OER_type_MeasResultListNR_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..8)) */};
+asn_per_constraints_t asn_PER_type_MeasResultListNR_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 3,  3,  1,  8 }	/* (SIZE(1..8)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_MeasResultListNR_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_MeasResultNR,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_MeasResultListNR_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_MeasResultListNR_specs_1 = {
+	sizeof(struct MeasResultListNR),
+	offsetof(struct MeasResultListNR, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultListNR = {
+	"MeasResultListNR",
+	"MeasResultListNR",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_MeasResultListNR_tags_1,
+	sizeof(asn_DEF_MeasResultListNR_tags_1)
+		/sizeof(asn_DEF_MeasResultListNR_tags_1[0]), /* 1 */
+	asn_DEF_MeasResultListNR_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasResultListNR_tags_1)
+		/sizeof(asn_DEF_MeasResultListNR_tags_1[0]), /* 1 */
+	{ &asn_OER_type_MeasResultListNR_constr_1, &asn_PER_type_MeasResultListNR_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_MeasResultListNR_1,
+	1,	/* Single element */
+	&asn_SPC_MeasResultListNR_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultNR.c b/e2sm/lib/MeasResultNR.c
new file mode 100644
index 0000000..fa4dae8
--- /dev/null
+++ b/e2sm/lib/MeasResultNR.c
@@ -0,0 +1,230 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultNR.h"
+
+#include "MeasQuantityResults.h"
+#include "ResultsPerSSB-IndexList.h"
+#include "ResultsPerCSI-RS-IndexList.h"
+static asn_TYPE_member_t asn_MBR_cellResults_4[] = {
+	{ ATF_POINTER, 2, offsetof(struct MeasResultNR__measResult__cellResults, resultsSSB_Cell),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasQuantityResults,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"resultsSSB-Cell"
+		},
+	{ ATF_POINTER, 1, offsetof(struct MeasResultNR__measResult__cellResults, resultsCSI_RS_Cell),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasQuantityResults,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"resultsCSI-RS-Cell"
+		},
+};
+static const int asn_MAP_cellResults_oms_4[] = { 0, 1 };
+static const ber_tlv_tag_t asn_DEF_cellResults_tags_4[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_cellResults_tag2el_4[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* resultsSSB-Cell */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* resultsCSI-RS-Cell */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_cellResults_specs_4 = {
+	sizeof(struct MeasResultNR__measResult__cellResults),
+	offsetof(struct MeasResultNR__measResult__cellResults, _asn_ctx),
+	asn_MAP_cellResults_tag2el_4,
+	2,	/* Count of tags in the map */
+	asn_MAP_cellResults_oms_4,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	-1,	/* First extension addition */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_cellResults_4 = {
+	"cellResults",
+	"cellResults",
+	&asn_OP_SEQUENCE,
+	asn_DEF_cellResults_tags_4,
+	sizeof(asn_DEF_cellResults_tags_4)
+		/sizeof(asn_DEF_cellResults_tags_4[0]) - 1, /* 1 */
+	asn_DEF_cellResults_tags_4,	/* Same as above */
+	sizeof(asn_DEF_cellResults_tags_4)
+		/sizeof(asn_DEF_cellResults_tags_4[0]), /* 2 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_cellResults_4,
+	2,	/* Elements count */
+	&asn_SPC_cellResults_specs_4	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_rsIndexResults_7[] = {
+	{ ATF_POINTER, 2, offsetof(struct MeasResultNR__measResult__rsIndexResults, resultsSSB_Indexes),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ResultsPerSSB_IndexList,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"resultsSSB-Indexes"
+		},
+	{ ATF_POINTER, 1, offsetof(struct MeasResultNR__measResult__rsIndexResults, resultsCSI_RS_Indexes),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ResultsPerCSI_RS_IndexList,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"resultsCSI-RS-Indexes"
+		},
+};
+static const int asn_MAP_rsIndexResults_oms_7[] = { 0, 1 };
+static const ber_tlv_tag_t asn_DEF_rsIndexResults_tags_7[] = {
+	(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_rsIndexResults_tag2el_7[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* resultsSSB-Indexes */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* resultsCSI-RS-Indexes */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_rsIndexResults_specs_7 = {
+	sizeof(struct MeasResultNR__measResult__rsIndexResults),
+	offsetof(struct MeasResultNR__measResult__rsIndexResults, _asn_ctx),
+	asn_MAP_rsIndexResults_tag2el_7,
+	2,	/* Count of tags in the map */
+	asn_MAP_rsIndexResults_oms_7,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	-1,	/* First extension addition */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_rsIndexResults_7 = {
+	"rsIndexResults",
+	"rsIndexResults",
+	&asn_OP_SEQUENCE,
+	asn_DEF_rsIndexResults_tags_7,
+	sizeof(asn_DEF_rsIndexResults_tags_7)
+		/sizeof(asn_DEF_rsIndexResults_tags_7[0]) - 1, /* 1 */
+	asn_DEF_rsIndexResults_tags_7,	/* Same as above */
+	sizeof(asn_DEF_rsIndexResults_tags_7)
+		/sizeof(asn_DEF_rsIndexResults_tags_7[0]), /* 2 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_rsIndexResults_7,
+	2,	/* Elements count */
+	&asn_SPC_rsIndexResults_specs_7	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_measResult_3[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultNR__measResult, cellResults),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_cellResults_4,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cellResults"
+		},
+	{ ATF_POINTER, 1, offsetof(struct MeasResultNR__measResult, rsIndexResults),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		0,
+		&asn_DEF_rsIndexResults_7,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rsIndexResults"
+		},
+};
+static const int asn_MAP_measResult_oms_3[] = { 1 };
+static const ber_tlv_tag_t asn_DEF_measResult_tags_3[] = {
+	(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_measResult_tag2el_3[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cellResults */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* rsIndexResults */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_measResult_specs_3 = {
+	sizeof(struct MeasResultNR__measResult),
+	offsetof(struct MeasResultNR__measResult, _asn_ctx),
+	asn_MAP_measResult_tag2el_3,
+	2,	/* Count of tags in the map */
+	asn_MAP_measResult_oms_3,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	-1,	/* First extension addition */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_measResult_3 = {
+	"measResult",
+	"measResult",
+	&asn_OP_SEQUENCE,
+	asn_DEF_measResult_tags_3,
+	sizeof(asn_DEF_measResult_tags_3)
+		/sizeof(asn_DEF_measResult_tags_3[0]) - 1, /* 1 */
+	asn_DEF_measResult_tags_3,	/* Same as above */
+	sizeof(asn_DEF_measResult_tags_3)
+		/sizeof(asn_DEF_measResult_tags_3[0]), /* 2 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_measResult_3,
+	2,	/* Elements count */
+	&asn_SPC_measResult_specs_3	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_MeasResultNR_1[] = {
+	{ ATF_POINTER, 1, offsetof(struct MeasResultNR, physCellId),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PhysCellId,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"physCellId"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultNR, measResult),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		0,
+		&asn_DEF_measResult_3,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measResult"
+		},
+};
+static const int asn_MAP_MeasResultNR_oms_1[] = { 0 };
+static const ber_tlv_tag_t asn_DEF_MeasResultNR_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasResultNR_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* physCellId */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* measResult */
+};
+asn_SEQUENCE_specifics_t asn_SPC_MeasResultNR_specs_1 = {
+	sizeof(struct MeasResultNR),
+	offsetof(struct MeasResultNR, _asn_ctx),
+	asn_MAP_MeasResultNR_tag2el_1,
+	2,	/* Count of tags in the map */
+	asn_MAP_MeasResultNR_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultNR = {
+	"MeasResultNR",
+	"MeasResultNR",
+	&asn_OP_SEQUENCE,
+	asn_DEF_MeasResultNR_tags_1,
+	sizeof(asn_DEF_MeasResultNR_tags_1)
+		/sizeof(asn_DEF_MeasResultNR_tags_1[0]), /* 1 */
+	asn_DEF_MeasResultNR_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasResultNR_tags_1)
+		/sizeof(asn_DEF_MeasResultNR_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_MeasResultNR_1,
+	2,	/* Elements count */
+	&asn_SPC_MeasResultNR_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultNeighCells.c b/e2sm/lib/MeasResultNeighCells.c
new file mode 100644
index 0000000..3f87d70
--- /dev/null
+++ b/e2sm/lib/MeasResultNeighCells.c
@@ -0,0 +1,67 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultNeighCells.h"
+
+#include "MeasResultListNR.h"
+#include "MeasResultListEUTRA.h"
+static asn_oer_constraints_t asn_OER_type_MeasResultNeighCells_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_MeasResultNeighCells_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_MeasResultNeighCells_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct MeasResultNeighCells, choice.measResultListNR),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasResultListNR,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measResultListNR"
+		},
+	{ ATF_POINTER, 0, offsetof(struct MeasResultNeighCells, choice.measResultListEUTRA),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasResultListEUTRA,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measResultListEUTRA"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasResultNeighCells_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* measResultListNR */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* measResultListEUTRA */
+};
+asn_CHOICE_specifics_t asn_SPC_MeasResultNeighCells_specs_1 = {
+	sizeof(struct MeasResultNeighCells),
+	offsetof(struct MeasResultNeighCells, _asn_ctx),
+	offsetof(struct MeasResultNeighCells, present),
+	sizeof(((struct MeasResultNeighCells *)0)->present),
+	asn_MAP_MeasResultNeighCells_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0,
+	2	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultNeighCells = {
+	"MeasResultNeighCells",
+	"MeasResultNeighCells",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_MeasResultNeighCells_constr_1, &asn_PER_type_MeasResultNeighCells_constr_1, CHOICE_constraint },
+	asn_MBR_MeasResultNeighCells_1,
+	2,	/* Elements count */
+	&asn_SPC_MeasResultNeighCells_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultPCell.c b/e2sm/lib/MeasResultPCell.c
new file mode 100644
index 0000000..cbd74f8
--- /dev/null
+++ b/e2sm/lib/MeasResultPCell.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultPCell.h"
+
+asn_TYPE_member_t asn_MBR_MeasResultPCell_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultPCell, eutra_PhysCellId),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PhysCellId,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eutra-PhysCellId"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultPCell, rsrpResult),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RSRP_Range,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rsrpResult"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultPCell, rsrqResult),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RSRQ_Range,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"rsrqResult"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_MeasResultPCell_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasResultPCell_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* eutra-PhysCellId */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* rsrpResult */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* rsrqResult */
+};
+asn_SEQUENCE_specifics_t asn_SPC_MeasResultPCell_specs_1 = {
+	sizeof(struct MeasResultPCell),
+	offsetof(struct MeasResultPCell, _asn_ctx),
+	asn_MAP_MeasResultPCell_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultPCell = {
+	"MeasResultPCell",
+	"MeasResultPCell",
+	&asn_OP_SEQUENCE,
+	asn_DEF_MeasResultPCell_tags_1,
+	sizeof(asn_DEF_MeasResultPCell_tags_1)
+		/sizeof(asn_DEF_MeasResultPCell_tags_1[0]), /* 1 */
+	asn_DEF_MeasResultPCell_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasResultPCell_tags_1)
+		/sizeof(asn_DEF_MeasResultPCell_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_MeasResultPCell_1,
+	3,	/* Elements count */
+	&asn_SPC_MeasResultPCell_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultServMO.c b/e2sm/lib/MeasResultServMO.c
new file mode 100644
index 0000000..346f5fe
--- /dev/null
+++ b/e2sm/lib/MeasResultServMO.c
@@ -0,0 +1,73 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultServMO.h"
+
+#include "MeasResultNR.h"
+asn_TYPE_member_t asn_MBR_MeasResultServMO_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultServMO, servCellId),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ServCellIndex,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"servCellId"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasResultServMO, measResultServingCell),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasResultNR,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measResultServingCell"
+		},
+	{ ATF_POINTER, 1, offsetof(struct MeasResultServMO, measResultBestNeighCell),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasResultNR,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measResultBestNeighCell"
+		},
+};
+static const int asn_MAP_MeasResultServMO_oms_1[] = { 2 };
+static const ber_tlv_tag_t asn_DEF_MeasResultServMO_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasResultServMO_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* servCellId */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* measResultServingCell */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* measResultBestNeighCell */
+};
+asn_SEQUENCE_specifics_t asn_SPC_MeasResultServMO_specs_1 = {
+	sizeof(struct MeasResultServMO),
+	offsetof(struct MeasResultServMO, _asn_ctx),
+	asn_MAP_MeasResultServMO_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_MeasResultServMO_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultServMO = {
+	"MeasResultServMO",
+	"MeasResultServMO",
+	&asn_OP_SEQUENCE,
+	asn_DEF_MeasResultServMO_tags_1,
+	sizeof(asn_DEF_MeasResultServMO_tags_1)
+		/sizeof(asn_DEF_MeasResultServMO_tags_1[0]), /* 1 */
+	asn_DEF_MeasResultServMO_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasResultServMO_tags_1)
+		/sizeof(asn_DEF_MeasResultServMO_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_MeasResultServMO_1,
+	3,	/* Elements count */
+	&asn_SPC_MeasResultServMO_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasResultServMOList.c b/e2sm/lib/MeasResultServMOList.c
new file mode 100644
index 0000000..2798a7e
--- /dev/null
+++ b/e2sm/lib/MeasResultServMOList.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasResultServMOList.h"
+
+#include "MeasResultServMO.h"
+static asn_oer_constraints_t asn_OER_type_MeasResultServMOList_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..32)) */};
+asn_per_constraints_t asn_PER_type_MeasResultServMOList_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 5,  5,  1,  32 }	/* (SIZE(1..32)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_MeasResultServMOList_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_MeasResultServMO,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_MeasResultServMOList_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_MeasResultServMOList_specs_1 = {
+	sizeof(struct MeasResultServMOList),
+	offsetof(struct MeasResultServMOList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasResultServMOList = {
+	"MeasResultServMOList",
+	"MeasResultServMOList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_MeasResultServMOList_tags_1,
+	sizeof(asn_DEF_MeasResultServMOList_tags_1)
+		/sizeof(asn_DEF_MeasResultServMOList_tags_1[0]), /* 1 */
+	asn_DEF_MeasResultServMOList_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasResultServMOList_tags_1)
+		/sizeof(asn_DEF_MeasResultServMOList_tags_1[0]), /* 1 */
+	{ &asn_OER_type_MeasResultServMOList_constr_1, &asn_PER_type_MeasResultServMOList_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_MeasResultServMOList_1,
+	1,	/* Single element */
+	&asn_SPC_MeasResultServMOList_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasurementInfoItem.c b/e2sm/lib/MeasurementInfoItem.c
new file mode 100644
index 0000000..5edae52
--- /dev/null
+++ b/e2sm/lib/MeasurementInfoItem.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasurementInfoItem.h"
+
+asn_TYPE_member_t asn_MBR_MeasurementInfoItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasurementInfoItem, measType),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_MeasurementType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measType"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_MeasurementInfoItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasurementInfoItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* measType */
+};
+asn_SEQUENCE_specifics_t asn_SPC_MeasurementInfoItem_specs_1 = {
+	sizeof(struct MeasurementInfoItem),
+	offsetof(struct MeasurementInfoItem, _asn_ctx),
+	asn_MAP_MeasurementInfoItem_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasurementInfoItem = {
+	"MeasurementInfoItem",
+	"MeasurementInfoItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_MeasurementInfoItem_tags_1,
+	sizeof(asn_DEF_MeasurementInfoItem_tags_1)
+		/sizeof(asn_DEF_MeasurementInfoItem_tags_1[0]), /* 1 */
+	asn_DEF_MeasurementInfoItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasurementInfoItem_tags_1)
+		/sizeof(asn_DEF_MeasurementInfoItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_MeasurementInfoItem_1,
+	1,	/* Elements count */
+	&asn_SPC_MeasurementInfoItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasurementInfoList.c b/e2sm/lib/MeasurementInfoList.c
new file mode 100644
index 0000000..9e7aed9
--- /dev/null
+++ b/e2sm/lib/MeasurementInfoList.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasurementInfoList.h"
+
+#include "MeasurementInfoItem.h"
+static asn_oer_constraints_t asn_OER_type_MeasurementInfoList_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..65535)) */};
+asn_per_constraints_t asn_PER_type_MeasurementInfoList_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  1,  65535 }	/* (SIZE(1..65535)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_MeasurementInfoList_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_MeasurementInfoItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_MeasurementInfoList_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_MeasurementInfoList_specs_1 = {
+	sizeof(struct MeasurementInfoList),
+	offsetof(struct MeasurementInfoList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasurementInfoList = {
+	"MeasurementInfoList",
+	"MeasurementInfoList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_MeasurementInfoList_tags_1,
+	sizeof(asn_DEF_MeasurementInfoList_tags_1)
+		/sizeof(asn_DEF_MeasurementInfoList_tags_1[0]), /* 1 */
+	asn_DEF_MeasurementInfoList_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasurementInfoList_tags_1)
+		/sizeof(asn_DEF_MeasurementInfoList_tags_1[0]), /* 1 */
+	{ &asn_OER_type_MeasurementInfoList_constr_1, &asn_PER_type_MeasurementInfoList_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_MeasurementInfoList_1,
+	1,	/* Single element */
+	&asn_SPC_MeasurementInfoList_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasurementType.c b/e2sm/lib/MeasurementType.c
new file mode 100644
index 0000000..2d3e1f7
--- /dev/null
+++ b/e2sm/lib/MeasurementType.c
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasurementType.h"
+
+static asn_oer_constraints_t asn_OER_type_MeasurementType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_MeasurementType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_MeasurementType_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasurementType, choice.measName),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasurementTypeName,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measName"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasurementType, choice.measID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasurementTypeID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"measID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasurementType_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* measName */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* measID */
+};
+asn_CHOICE_specifics_t asn_SPC_MeasurementType_specs_1 = {
+	sizeof(struct MeasurementType),
+	offsetof(struct MeasurementType, _asn_ctx),
+	offsetof(struct MeasurementType, present),
+	sizeof(((struct MeasurementType *)0)->present),
+	asn_MAP_MeasurementType_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0,
+	2	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasurementType = {
+	"MeasurementType",
+	"MeasurementType",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_MeasurementType_constr_1, &asn_PER_type_MeasurementType_constr_1, CHOICE_constraint },
+	asn_MBR_MeasurementType_1,
+	2,	/* Elements count */
+	&asn_SPC_MeasurementType_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/MeasurementTypeID.c b/e2sm/lib/MeasurementTypeID.c
new file mode 100644
index 0000000..62a8a79
--- /dev/null
+++ b/e2sm/lib/MeasurementTypeID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasurementTypeID.h"
+
+int
+MeasurementTypeID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 1 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_MeasurementTypeID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_MeasurementTypeID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  16,  16,  1,  65535 }	/* (1..65535,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_MeasurementTypeID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_MeasurementTypeID = {
+	"MeasurementTypeID",
+	"MeasurementTypeID",
+	&asn_OP_NativeInteger,
+	asn_DEF_MeasurementTypeID_tags_1,
+	sizeof(asn_DEF_MeasurementTypeID_tags_1)
+		/sizeof(asn_DEF_MeasurementTypeID_tags_1[0]), /* 1 */
+	asn_DEF_MeasurementTypeID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasurementTypeID_tags_1)
+		/sizeof(asn_DEF_MeasurementTypeID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_MeasurementTypeID_constr_1, &asn_PER_type_MeasurementTypeID_constr_1, MeasurementTypeID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/MeasurementTypeName.c b/e2sm/lib/MeasurementTypeName.c
new file mode 100644
index 0000000..1b5fd5a
--- /dev/null
+++ b/e2sm/lib/MeasurementTypeName.c
@@ -0,0 +1,109 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasurementTypeName.h"
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_1[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+	const int *table = permitted_alphabet_table_1;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+int
+MeasurementTypeName_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_1(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_MeasurementTypeName_1_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+		return -1;
+	return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_MeasurementTypeName_1_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+		return -1;
+	return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using PrintableString,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_MeasurementTypeName_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+asn_per_constraints_t asn_PER_type_MeasurementTypeName_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_MeasurementTypeName_1_v2c,	/* Value to PER code map */
+	asn_PER_MAP_MeasurementTypeName_1_c2v	/* PER code to value map */
+};
+static const ber_tlv_tag_t asn_DEF_MeasurementTypeName_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_MeasurementTypeName = {
+	"MeasurementTypeName",
+	"MeasurementTypeName",
+	&asn_OP_PrintableString,
+	asn_DEF_MeasurementTypeName_tags_1,
+	sizeof(asn_DEF_MeasurementTypeName_tags_1)
+		/sizeof(asn_DEF_MeasurementTypeName_tags_1[0]), /* 1 */
+	asn_DEF_MeasurementTypeName_tags_1,	/* Same as above */
+	sizeof(asn_DEF_MeasurementTypeName_tags_1)
+		/sizeof(asn_DEF_MeasurementTypeName_tags_1[0]), /* 1 */
+	{ &asn_OER_type_MeasurementTypeName_constr_1, &asn_PER_type_MeasurementTypeName_constr_1, MeasurementTypeName_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/MeasurementValue.c b/e2sm/lib/MeasurementValue.c
new file mode 100644
index 0000000..ed03a0b
--- /dev/null
+++ b/e2sm/lib/MeasurementValue.c
@@ -0,0 +1,86 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "MeasurementValue.h"
+
+#include "L3-RRC-Measurements.h"
+static asn_oer_constraints_t asn_OER_type_MeasurementValue_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_MeasurementValue_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_MeasurementValue_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasurementValue, choice.valueInt),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"valueInt"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasurementValue, choice.valueReal),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeReal,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"valueReal"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct MeasurementValue, choice.noValue),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NULL,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"noValue"
+		},
+	{ ATF_POINTER, 0, offsetof(struct MeasurementValue, choice.valueRRC),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_L3_RRC_Measurements,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"valueRRC"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_MeasurementValue_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* valueInt */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* valueReal */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* noValue */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* valueRRC */
+};
+asn_CHOICE_specifics_t asn_SPC_MeasurementValue_specs_1 = {
+	sizeof(struct MeasurementValue),
+	offsetof(struct MeasurementValue, _asn_ctx),
+	offsetof(struct MeasurementValue, present),
+	sizeof(((struct MeasurementValue *)0)->present),
+	asn_MAP_MeasurementValue_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	4	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_MeasurementValue = {
+	"MeasurementValue",
+	"MeasurementValue",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_MeasurementValue_constr_1, &asn_PER_type_MeasurementValue_constr_1, CHOICE_constraint },
+	asn_MBR_MeasurementValue_1,
+	4,	/* Elements count */
+	&asn_SPC_MeasurementValue_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/NI-Type.c b/e2sm/lib/NI-Type.c
new file mode 100644
index 0000000..06ba425
--- /dev/null
+++ b/e2sm/lib/NI-Type.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "NI-Type.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_NI_Type_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_NI_Type_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_NI_Type_value2enum_1[] = {
+	{ 0,	4,	"x2-u" },
+	{ 1,	4,	"xn-u" },
+	{ 2,	4,	"f1-u" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_NI_Type_enum2value_1[] = {
+	2,	/* f1-u(2) */
+	0,	/* x2-u(0) */
+	1	/* xn-u(1) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_NI_Type_specs_1 = {
+	asn_MAP_NI_Type_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_NI_Type_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_NI_Type_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NI_Type = {
+	"NI-Type",
+	"NI-Type",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_NI_Type_tags_1,
+	sizeof(asn_DEF_NI_Type_tags_1)
+		/sizeof(asn_DEF_NI_Type_tags_1[0]), /* 1 */
+	asn_DEF_NI_Type_tags_1,	/* Same as above */
+	sizeof(asn_DEF_NI_Type_tags_1)
+		/sizeof(asn_DEF_NI_Type_tags_1[0]), /* 1 */
+	{ &asn_OER_type_NI_Type_constr_1, &asn_PER_type_NI_Type_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_NI_Type_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/NRCGI.c b/e2sm/lib/NRCGI.c
new file mode 100644
index 0000000..2eaae12
--- /dev/null
+++ b/e2sm/lib/NRCGI.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "NRCGI.h"
+
+asn_TYPE_member_t asn_MBR_NRCGI_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct NRCGI, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct NRCGI, nRCellIdentity),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NRCellIdentity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"nRCellIdentity"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_NRCGI_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_NRCGI_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* nRCellIdentity */
+};
+asn_SEQUENCE_specifics_t asn_SPC_NRCGI_specs_1 = {
+	sizeof(struct NRCGI),
+	offsetof(struct NRCGI, _asn_ctx),
+	asn_MAP_NRCGI_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_NRCGI = {
+	"NRCGI",
+	"NRCGI",
+	&asn_OP_SEQUENCE,
+	asn_DEF_NRCGI_tags_1,
+	sizeof(asn_DEF_NRCGI_tags_1)
+		/sizeof(asn_DEF_NRCGI_tags_1[0]), /* 1 */
+	asn_DEF_NRCGI_tags_1,	/* Same as above */
+	sizeof(asn_DEF_NRCGI_tags_1)
+		/sizeof(asn_DEF_NRCGI_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_NRCGI_1,
+	2,	/* Elements count */
+	&asn_SPC_NRCGI_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/NRCellIdentity.c b/e2sm/lib/NRCellIdentity.c
new file mode 100644
index 0000000..511d128
--- /dev/null
+++ b/e2sm/lib/NRCellIdentity.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "NRCellIdentity.h"
+
+int
+NRCellIdentity_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 36)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using BIT_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_NRCellIdentity_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	36	/* (SIZE(36..36)) */};
+asn_per_constraints_t asn_PER_type_NRCellIdentity_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  36,  36 }	/* (SIZE(36..36)) */,
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_NRCellIdentity_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NRCellIdentity = {
+	"NRCellIdentity",
+	"NRCellIdentity",
+	&asn_OP_BIT_STRING,
+	asn_DEF_NRCellIdentity_tags_1,
+	sizeof(asn_DEF_NRCellIdentity_tags_1)
+		/sizeof(asn_DEF_NRCellIdentity_tags_1[0]), /* 1 */
+	asn_DEF_NRCellIdentity_tags_1,	/* Same as above */
+	sizeof(asn_DEF_NRCellIdentity_tags_1)
+		/sizeof(asn_DEF_NRCellIdentity_tags_1[0]), /* 1 */
+	{ &asn_OER_type_NRCellIdentity_constr_1, &asn_PER_type_NRCellIdentity_constr_1, NRCellIdentity_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_BIT_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2sm/lib/NULL.c b/e2sm/lib/NULL.c
new file mode 100644
index 0000000..4a2914f
--- /dev/null
+++ b/e2sm/lib/NULL.c
@@ -0,0 +1,299 @@
+/*-
+ * Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+#include <NULL.h>
+#include <BOOLEAN.h>	/* Implemented in terms of BOOLEAN type */
+
+/*
+ * NULL basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
+};
+asn_TYPE_operation_t asn_OP_NULL = {
+	BOOLEAN_free,
+	NULL_print,
+	NULL_compare,
+	BOOLEAN_decode_ber,	/* Implemented in terms of BOOLEAN */
+	NULL_encode_der,	/* Special handling of DER encoding */
+	NULL_decode_xer,
+	NULL_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NULL_decode_oer,
+	NULL_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NULL_decode_uper,	/* Unaligned PER decoder */
+	NULL_encode_uper,	/* Unaligned PER encoder */
+	NULL_decode_aper,	/* Aligned PER decoder */
+	NULL_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NULL_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NULL = {
+	"NULL",
+	"NULL",
+	&asn_OP_NULL,
+	asn_DEF_NULL_tags,
+	sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
+	asn_DEF_NULL_tags,	/* Same as above */
+	sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+asn_enc_rval_t
+NULL_encode_der(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode,
+                ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_enc_rval_t erval = {0,0,0};
+
+	erval.encoded = der_write_tags(td, 0, tag_mode, 0, tag, cb, app_key);
+	if(erval.encoded == -1) {
+		erval.failed_type = td;
+		erval.structure_ptr = ptr;
+	}
+
+	ASN__ENCODED_OK(erval);
+}
+
+asn_enc_rval_t
+NULL_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                void *app_key) {
+	asn_enc_rval_t er = {0,0,0};
+
+	(void)td;
+	(void)sptr;
+	(void)ilevel;
+	(void)flags;
+	(void)cb;
+	(void)app_key;
+
+	/* XMLNullValue is empty */
+	er.encoded = 0;
+	ASN__ENCODED_OK(er);
+}
+
+
+static enum xer_pbd_rval
+NULL__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
+                      const void *chunk_buf, size_t chunk_size) {
+    (void)td;
+	(void)sptr;
+	(void)chunk_buf;    /* Going to be empty according to the rules below. */
+
+	/*
+	 * There must be no content in self-terminating <NULL/> tag.
+	 */
+	if(chunk_size)
+		return XPBD_BROKEN_ENCODING;
+	else
+		return XPBD_BODY_CONSUMED;
+}
+
+asn_dec_rval_t
+NULL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td, void **sptr,
+                const char *opt_mname, const void *buf_ptr, size_t size) {
+    return xer_decode_primitive(opt_codec_ctx, td,
+		sptr, sizeof(NULL_t), opt_mname, buf_ptr, size,
+		NULL__xer_body_decode);
+}
+
+int
+NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) {
+    (void)td;
+    (void)a;
+    (void)b;
+    return 0;
+}
+
+int
+NULL_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+           asn_app_consume_bytes_f *cb, void *app_key) {
+    (void)td;	/* Unused argument */
+	(void)ilevel;	/* Unused argument */
+
+	if(sptr) {
+		return (cb("<present>", 9, app_key) < 0) ? -1 : 0;
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+asn_dec_rval_t
+NULL_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td,
+                const asn_oer_constraints_t *constraints, void **sptr,
+                const void *ptr, size_t size) {
+    asn_dec_rval_t rv = {RC_OK, 0};
+    (void)opt_codec_ctx;
+    (void)td;
+    (void)constraints;
+    (void)ptr;
+    (void)size;
+
+    if(!*sptr) {
+        *sptr = MALLOC(sizeof(NULL_t));
+        if(*sptr) {
+            *(NULL_t *)*sptr = 0;
+        } else {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    return rv;
+}
+
+asn_enc_rval_t
+NULL_encode_oer(const asn_TYPE_descriptor_t *td,
+                const asn_oer_constraints_t *constraints, const void *sptr,
+                asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+
+    (void)td;
+    (void)sptr;
+    (void)constraints;
+    (void)cb;
+    (void)app_key;
+
+    er.encoded = 0; /* Encoding in 0 bytes. */
+
+    ASN__ENCODED_OK(er);
+}
+
+#endif /* ASN_DISABLE_OER_SUPPORT */
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+NULL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                 const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints, void **sptr,
+                 asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+
+	(void)opt_codec_ctx;
+	(void)td;
+	(void)constraints;
+	(void)pd;
+
+	if(!*sptr) {
+		*sptr = MALLOC(sizeof(NULL_t));
+		if(*sptr) {
+			*(NULL_t *)*sptr = 0;
+		} else {
+			ASN__DECODE_FAILED;
+		}
+	}
+
+	/*
+	 * NULL type does not have content octets.
+	 */
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+asn_enc_rval_t
+NULL_encode_uper(const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints, const void *sptr,
+                 asn_per_outp_t *po) {
+	asn_enc_rval_t er = {0,0,0};
+
+	(void)td;
+	(void)constraints;
+	(void)sptr;
+	(void)po;
+
+	er.encoded = 0;
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+NULL_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                 const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv = {RC_OK, 0};
+
+	(void)opt_codec_ctx;
+	(void)td;
+	(void)constraints;
+	(void)pd;
+
+	if(!*sptr) {
+		*sptr = MALLOC(sizeof(NULL_t));
+		if(*sptr) {
+			*(NULL_t *)*sptr = 0;
+		} else {
+			ASN__DECODE_FAILED;
+		}
+	}
+
+	/*
+	 * NULL type does not have content octets.
+	 */
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+
+asn_enc_rval_t
+NULL_encode_aper(const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints,
+                 const void *sptr, asn_per_outp_t *po) {
+	asn_enc_rval_t er = {0,0,0};
+
+	(void)td;
+	(void)constraints;
+	(void)sptr;
+	(void)po;
+
+	er.encoded = 0;
+	ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+asn_random_fill_result_t
+NULL_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                    const asn_encoding_constraints_t *constr,
+                    size_t max_length) {
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    NULL_t *st = *sptr;
+
+    (void)td;
+    (void)constr;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (NULL_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    return result_ok;
+}
+
diff --git a/e2sm/lib/NativeEnumerated.c b/e2sm/lib/NativeEnumerated.c
new file mode 100644
index 0000000..50ffb1d
--- /dev/null
+++ b/e2sm/lib/NativeEnumerated.c
@@ -0,0 +1,367 @@
+/*-
+ * Copyright (c) 2004, 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Read the NativeInteger.h for the explanation wrt. differences between
+ * INTEGER and NativeInteger.
+ * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
+ * implementation deals with the standard (machine-specific) representation
+ * of them instead of using the platform-independent buffer.
+ */
+#include <asn_internal.h>
+#include <NativeEnumerated.h>
+
+/*
+ * NativeEnumerated basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_operation_t asn_OP_NativeEnumerated = {
+	NativeInteger_free,
+	NativeInteger_print,
+	NativeInteger_compare,
+	NativeInteger_decode_ber,
+	NativeInteger_encode_der,
+	NativeInteger_decode_xer,
+	NativeEnumerated_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NativeEnumerated_decode_oer,
+	NativeEnumerated_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NativeEnumerated_decode_uper,
+	NativeEnumerated_encode_uper,
+	NativeEnumerated_decode_aper,
+	NativeEnumerated_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NativeEnumerated_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
+	"ENUMERATED",			/* The ASN.1 type is still ENUMERATED */
+	"ENUMERATED",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_NativeEnumerated_tags,
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
+	asn_DEF_NativeEnumerated_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+asn_enc_rval_t
+NativeEnumerated_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                            int ilevel, enum xer_encoder_flags_e flags,
+                            asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_enc_rval_t er = {0,0,0};
+    const long *native = (const long *)sptr;
+    const asn_INTEGER_enum_map_t *el;
+
+    (void)ilevel;
+    (void)flags;
+
+    if(!native) ASN__ENCODE_FAILED;
+
+    el = INTEGER_map_value2enum(specs, *native);
+    if(el) {
+        er.encoded =
+            asn__format_to_callback(cb, app_key, "<%s/>", el->enum_name);
+        if(er.encoded < 0) ASN__ENCODE_FAILED;
+        ASN__ENCODED_OK(er);
+    } else {
+        ASN_DEBUG(
+            "ASN.1 forbids dealing with "
+            "unknown value of ENUMERATED type");
+        ASN__ENCODE_FAILED;
+    }
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             void **sptr, asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs = td->specifics;
+    asn_dec_rval_t rval = { RC_OK, 0 };
+	long *native = (long *)*sptr;
+	const asn_per_constraint_t *ct = NULL;
+	long value;
+
+	(void)opt_codec_ctx;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__DECODE_FAILED;	/* Mandatory! */
+	if(!specs) ASN__DECODE_FAILED;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value >= (specs->extension
+			? specs->extension - 1 : specs->map_count))
+			ASN__DECODE_FAILED;
+	} else {
+		if(!specs->extension)
+			ASN__DECODE_FAILED;
+		/*
+		 * X.691, #10.6: normally small non-negative whole number;
+		 */
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->extension - 1;
+		if(value >= specs->map_count)
+			ASN__DECODE_FAILED;
+	}
+
+	*native = specs->value2enum[value].nat_value;
+	ASN_DEBUG("Decoded %s = %ld", td->name, *native);
+
+	return rval;
+}
+
+static int
+NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
+	const asn_INTEGER_enum_map_t *a = ap;
+	const asn_INTEGER_enum_map_t *b = bp;
+	if(a->nat_value == b->nat_value)
+		return 0;
+	if(a->nat_value < b->nat_value)
+		return -1;
+	return 1;
+}
+
+asn_enc_rval_t
+NativeEnumerated_encode_uper(const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native, value;
+	const asn_per_constraint_t *ct = NULL;
+	int inext = 0;
+	asn_INTEGER_enum_map_t key;
+	const asn_INTEGER_enum_map_t *kf;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	if(!specs) ASN__ENCODE_FAILED;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__ENCODE_FAILED;	/* Mandatory! */
+
+	ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
+
+	er.encoded = 0;
+
+	native = *(const long *)sptr;
+
+	key.nat_value = native;
+	kf = bsearch(&key, specs->value2enum, specs->map_count,
+		sizeof(key), NativeEnumerated__compar_value2enum);
+	if(!kf) {
+		ASN_DEBUG("No element corresponds to %ld", native);
+		ASN__ENCODE_FAILED;
+	}
+	value = kf - specs->value2enum;
+
+	if(ct && ct->range_bits >= 0) {
+		int cmpWith = specs->extension
+				? specs->extension - 1 : specs->map_count;
+		if(value >= cmpWith)
+			inext = 1;
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+		if(inext) ct = 0;
+	} else if(inext) {
+		ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		if(per_put_few_bits(po, value, ct->range_bits))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	if(!specs->extension)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * X.691, #10.6: normally small non-negative whole number;
+	 */
+	ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
+		value, specs->extension, inext,
+		value - (inext ? (specs->extension - 1) : 0));
+	if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             void **sptr, asn_per_data_t *pd) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	long *native = (long *)*sptr;
+	const asn_per_constraint_t *ct = NULL;
+	long value;
+
+	(void)opt_codec_ctx;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__DECODE_FAILED;	/* Mandatory! */
+	if(!specs) ASN__DECODE_FAILED;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	/* Deal with APER padding */
+	if(ct && ct->upper_bound >= 255) {
+		int padding = 0;
+		padding = (8 - (pd->moved % 8)) % 8;
+		ASN_DEBUG("For NativeEnumerated %s,offset= %lu Padding bits = %d", td->name, pd->moved, padding);
+		ASN_DEBUG("For NativeEnumerated %s, upper bound = %lu", td->name, ct->upper_bound);
+		if(padding > 0)
+			per_get_few_bits(pd, padding);
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value >= (specs->extension
+		             ? specs->extension - 1 : specs->map_count))
+			ASN__DECODE_FAILED;
+	} else {
+		if(!specs->extension)
+			ASN__DECODE_FAILED;
+		/*
+		 * X.691, #10.6: normally small non-negative whole number;
+		 */
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->extension - 1;
+		if(value >= specs->map_count)
+			ASN__DECODE_FAILED;
+	}
+
+	*native = specs->value2enum[value].nat_value;
+	ASN_DEBUG("Decoded %s = %ld", td->name, *native);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeEnumerated_encode_aper(const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native, value;
+	const asn_per_constraint_t *ct = NULL;
+	int inext = 0;
+	asn_INTEGER_enum_map_t key;
+	asn_INTEGER_enum_map_t *kf;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	if(!specs) ASN__ENCODE_FAILED;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__ENCODE_FAILED;        /* Mandatory! */
+
+	ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
+
+	er.encoded = 0;
+
+	native = *(const long *)sptr;
+	if(native < 0) ASN__ENCODE_FAILED;
+
+	key.nat_value = native;
+	kf = bsearch(&key, specs->value2enum, specs->map_count,
+	             sizeof(key), NativeEnumerated__compar_value2enum);
+	if(!kf) {
+		ASN_DEBUG("No element corresponds to %ld", native);
+		ASN__ENCODE_FAILED;
+	}
+	value = kf - specs->value2enum;
+
+	if(ct && ct->range_bits >= 0) {
+		int cmpWith = specs->extension
+		              ? specs->extension - 1 : specs->map_count;
+		if(value >= cmpWith)
+			inext = 1;
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+		if(inext) ct = 0;
+	} else if(inext) {
+		ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		if(per_put_few_bits(po, value, ct->range_bits))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	if(!specs->extension)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * X.691, #10.6: normally small non-negative whole number;
+	 */
+	ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
+	          value, specs->extension, inext,
+	          value - (inext ? (specs->extension - 1) : 0));
+	if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
diff --git a/e2sm/lib/NativeEnumerated_oer.c b/e2sm/lib/NativeEnumerated_oer.c
new file mode 100644
index 0000000..ee3c189
--- /dev/null
+++ b/e2sm/lib/NativeEnumerated_oer.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <NativeEnumerated.h>
+#include <errno.h>
+
+static long
+asn__nativeenumerated_convert(const uint8_t *b, const uint8_t *end) {
+    unsigned long value;
+
+    /* Perform the sign initialization */
+    /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
+    if((*b >> 7)) {
+        value = (unsigned long)(-1);
+    } else {
+        value = 0;
+    }
+
+    /* Conversion engine */
+    for(; b < end; b++) {
+        value = (value << 8) | *b;
+    }
+
+    return value;
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                            const asn_TYPE_descriptor_t *td,
+                            const asn_oer_constraints_t *constraints,
+                            void **nint_ptr, const void *ptr, size_t size) {
+    asn_dec_rval_t rval = {RC_OK, 0};
+    long *native = (long *)*nint_ptr;
+    const uint8_t *b = ptr;
+
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    if(size < 1) {
+        ASN__DECODE_STARVED;
+    }
+
+    if((*b & 0x80) == 0) {
+        /*
+         * X.696 (08/2015) #11.2 Short form for Enumerated.
+         */
+        if(!native) {
+            native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+            if(!native) ASN__DECODE_FAILED;
+        }
+
+        *native = *b;
+        rval.consumed = 1;
+    } else {
+        /*
+         * X.696 (08/2015) #11.4 Long form for Enumerated.
+         */
+        size_t length = *b & 0x7f;
+        const uint8_t *bend;
+        long value;
+
+        if(length < 1 || length > sizeof(*native)) {
+            ASN__DECODE_FAILED;
+        }
+        if((1 + length) > size) {
+            ASN__DECODE_STARVED;
+        }
+        b++;
+        bend = b + length;
+
+        value = asn__nativeenumerated_convert(b, bend);
+        if(value < 0) {
+            const asn_INTEGER_specifics_t *specs =
+                (const asn_INTEGER_specifics_t *)td->specifics;
+            if(specs && specs->field_unsigned) {
+                ASN__DECODE_FAILED;
+            }
+        }
+
+        if(!native) {
+            native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+            if(!native) ASN__DECODE_FAILED;
+        }
+
+        *native = value;
+
+        rval.consumed = (1 + length);
+    }
+
+    return rval;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+NativeEnumerated_encode_oer(const asn_TYPE_descriptor_t *td,
+                            const asn_oer_constraints_t *constraints,
+                            const void *sptr, asn_app_consume_bytes_f *cb,
+                            void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    long native;
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+
+    if(native >= 0 && native <= 127) {
+        /* #11.2 Short form */
+        uint8_t b = native;
+        er.encoded = 1;
+        if(cb(&b, er.encoded, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    } else {
+        /* #11.2 Long form */
+        uint8_t buf[1 + sizeof(native)];
+        uint8_t *b = &buf[sizeof(native)];  /* Last addressable */
+        long final_pattern = -1 * (native < 0);
+
+        for(;;) {
+            *b-- = native;
+            native >>= 8;
+            if(native == final_pattern) {
+                if(final_pattern) {
+                    if((b[1] & 0x80)) break;
+                } else {
+                    if(!(b[1] & 0x80)) break;
+                }
+            }
+        }
+        *b = 0x80 | (&buf[sizeof(native)] - b);
+        er.encoded = 1 + (&buf[sizeof(native)] - b);
+        if(cb(b, er.encoded, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/NativeInteger.c b/e2sm/lib/NativeInteger.c
new file mode 100644
index 0000000..316e872
--- /dev/null
+++ b/e2sm/lib/NativeInteger.c
@@ -0,0 +1,550 @@
+/*-
+ * Copyright (c) 2004, 2005, 2006 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Read the NativeInteger.h for the explanation wrt. differences between
+ * INTEGER and NativeInteger.
+ * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
+ * implementation deals with the standard (machine-specific) representation
+ * of them instead of using the platform-independent buffer.
+ */
+#include <asn_internal.h>
+#include <NativeInteger.h>
+
+/*
+ * NativeInteger basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_operation_t asn_OP_NativeInteger = {
+	NativeInteger_free,
+	NativeInteger_print,
+	NativeInteger_compare,
+	NativeInteger_decode_ber,
+	NativeInteger_encode_der,
+	NativeInteger_decode_xer,
+	NativeInteger_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NativeInteger_decode_oer,	/* OER decoder */
+	NativeInteger_encode_oer,	/* Canonical OER encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NativeInteger_decode_uper,	/* Unaligned PER decoder */
+	NativeInteger_encode_uper,	/* Unaligned PER encoder */
+	NativeInteger_decode_aper,	/* Aligned PER decoder */
+	NativeInteger_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NativeInteger_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
+	"INTEGER",			/* The ASN.1 type is still INTEGER */
+	"INTEGER",
+	&asn_OP_NativeInteger,
+	asn_DEF_NativeInteger_tags,
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
+	asn_DEF_NativeInteger_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+/*
+ * Decode INTEGER type.
+ */
+asn_dec_rval_t
+NativeInteger_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td, void **nint_ptr,
+                         const void *buf_ptr, size_t size, int tag_mode) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    long *native = (long *)*nint_ptr;
+	asn_dec_rval_t rval;
+	ber_tlv_len_t length;
+
+	/*
+	 * If the structure is not there, allocate it.
+	 */
+	if(native == NULL) {
+		native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+		if(native == NULL) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+			return rval;
+		}
+	}
+
+	ASN_DEBUG("Decoding %s as INTEGER (tm=%d)",
+		td->name, tag_mode);
+
+	/*
+	 * Check tags.
+	 */
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
+	if(rval.code != RC_OK)
+		return rval;
+
+	ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
+
+	/*
+	 * Make sure we have this length.
+	 */
+	buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+	size -= rval.consumed;
+	if(length > (ber_tlv_len_t)size) {
+		rval.code = RC_WMORE;
+		rval.consumed = 0;
+		return rval;
+	}
+
+	/*
+	 * ASN.1 encoded INTEGER: buf_ptr, length
+	 * Fill the native, at the same time checking for overflow.
+	 * If overflow occured, return with RC_FAIL.
+	 */
+	{
+		INTEGER_t tmp;
+		union {
+			const void *constbuf;
+			void *nonconstbuf;
+		} unconst_buf;
+		long l;
+
+		unconst_buf.constbuf = buf_ptr;
+		tmp.buf = (uint8_t *)unconst_buf.nonconstbuf;
+		tmp.size = length;
+
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */
+			: asn_INTEGER2long(&tmp, &l)) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+			return rval;
+		}
+
+		*native = l;
+	}
+
+	rval.code = RC_OK;
+	rval.consumed += length;
+
+	ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
+		(long)rval.consumed, (long)length, td->name, (long)*native);
+
+	return rval;
+}
+
+/*
+ * Encode the NativeInteger using the standard INTEGER type DER encoder.
+ */
+asn_enc_rval_t
+NativeInteger_encode_der(const asn_TYPE_descriptor_t *sd, const void *ptr,
+                         int tag_mode, ber_tlv_tag_t tag,
+                         asn_app_consume_bytes_f *cb, void *app_key) {
+	unsigned long native = *(const unsigned long *)ptr; /* Disable sign ext. */
+	asn_enc_rval_t erval = {0,0,0};
+	INTEGER_t tmp;
+
+#ifdef	WORDS_BIGENDIAN		/* Opportunistic optimization */
+
+	tmp.buf = (uint8_t *)&native;
+	tmp.size = sizeof(native);
+
+#else	/* Works even if WORDS_BIGENDIAN is not set where should've been */
+	uint8_t buf[sizeof(native)];
+	uint8_t *p;
+
+	/* Prepare a fake INTEGER */
+	for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8)
+		*p = (uint8_t)native;
+
+	tmp.buf = buf;
+	tmp.size = sizeof(buf);
+#endif	/* WORDS_BIGENDIAN */
+	
+	/* Encode fake INTEGER */
+	erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key);
+    if(erval.structure_ptr == &tmp) {
+        erval.structure_ptr = ptr;
+    }
+	return erval;
+}
+
+/*
+ * Decode the chunk of XML text encoding INTEGER.
+ */
+asn_dec_rval_t
+NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td, void **sptr,
+                         const char *opt_mname, const void *buf_ptr,
+                         size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval;
+	INTEGER_t st;
+	void *st_ptr = (void *)&st;
+	long *native = (long *)*sptr;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&st, 0, sizeof(st));
+	rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, 
+		opt_mname, buf_ptr, size);
+	if(rval.code == RC_OK) {
+		long l;
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */
+			: asn_INTEGER2long(&st, &l)) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+		} else {
+			*native = l;
+		}
+	} else {
+		/*
+		 * Cannot restart from the middle;
+		 * there is no place to save state in the native type.
+		 * Request a continuation from the very beginning.
+		 */
+		rval.consumed = 0;
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st);
+	return rval;
+}
+
+
+asn_enc_rval_t
+NativeInteger_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                         int ilevel, enum xer_encoder_flags_e flags,
+                         asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    char scratch[32];	/* Enough for 64-bit int */
+	asn_enc_rval_t er = {0,0,0};
+	const long *native = (const long *)sptr;
+
+	(void)ilevel;
+	(void)flags;
+
+	if(!native) ASN__ENCODE_FAILED;
+
+	er.encoded = snprintf(scratch, sizeof(scratch),
+			(specs && specs->field_unsigned)
+			? "%lu" : "%ld", *native);
+	if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch)
+		|| cb(scratch, er.encoded, app_key) < 0)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+NativeInteger_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr,
+                          asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval;
+	long *native = (long *)*sptr;
+	INTEGER_t tmpint;
+	void *tmpintptr = &tmpint;
+
+	(void)opt_codec_ctx;
+	ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name);
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&tmpint, 0, sizeof tmpint);
+	rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints,
+				   &tmpintptr, pd);
+	if(rval.code == RC_OK) {
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
+			: asn_INTEGER2long(&tmpint, native))
+			rval.code = RC_FAIL;
+		else
+			ASN_DEBUG("NativeInteger %s got value %ld",
+				td->name, *native);
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeInteger_encode_uper(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, asn_per_outp_t *po) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_enc_rval_t er = {0,0,0};
+	long native;
+	INTEGER_t tmpint;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+
+    ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native);
+
+	memset(&tmpint, 0, sizeof(tmpint));
+	if((specs&&specs->field_unsigned)
+		? asn_ulong2INTEGER(&tmpint, native)
+		: asn_long2INTEGER(&tmpint, native))
+		ASN__ENCODE_FAILED;
+	er = INTEGER_encode_uper(td, constraints, &tmpint, po);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+	return er;
+}
+
+asn_dec_rval_t
+NativeInteger_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval;
+	long *native = (long *)*sptr;
+	INTEGER_t tmpint;
+	void *tmpintptr = &tmpint;
+
+	(void)opt_codec_ctx;
+	ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name);
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&tmpint, 0, sizeof tmpint);
+	rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints,
+	                           &tmpintptr, pd);
+	if(rval.code == RC_OK) {
+		if((specs&&specs->field_unsigned)
+		        ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
+		        : asn_INTEGER2long(&tmpint, native))
+			rval.code = RC_FAIL;
+		else
+			ASN_DEBUG("NativeInteger %s got value %ld",
+			          td->name, *native);
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeInteger_encode_aper(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, asn_per_outp_t *po) {
+
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native;
+	INTEGER_t tmpint;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	native = *(const long *)sptr;
+
+	ASN_DEBUG("Encoding NativeInteger %s %ld (APER)", td->name, native);
+
+	memset(&tmpint, 0, sizeof(tmpint));
+	if((specs&&specs->field_unsigned)
+	        ? asn_ulong2INTEGER(&tmpint, (unsigned long)native)
+	        : asn_long2INTEGER(&tmpint, native))
+		ASN__ENCODE_FAILED;
+	er = INTEGER_encode_aper(td, constraints, &tmpint, po);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+	return er;
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+/*
+ * INTEGER specific human-readable output.
+ */
+int
+NativeInteger_print(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    const long *native = (const long *)sptr;
+    char scratch[32]; /* Enough for 64-bit int */
+    int ret;
+
+    (void)td;       /* Unused argument */
+    (void)ilevel;   /* Unused argument */
+
+    if(native) {
+        long value = *native;
+        ret = snprintf(scratch, sizeof(scratch),
+                       (specs && specs->field_unsigned) ? "%lu" : "%ld", value);
+        assert(ret > 0 && (size_t)ret < sizeof(scratch));
+        if(cb(scratch, ret, app_key) < 0) return -1;
+        if(specs && (value >= 0 || !specs->field_unsigned)) {
+            const asn_INTEGER_enum_map_t *el =
+                INTEGER_map_value2enum(specs, value);
+            if(el) {
+                if(cb(" (", 2, app_key) < 0) return -1;
+                if(cb(el->enum_name, el->enum_len, app_key) < 0) return -1;
+                if(cb(")", 1, app_key) < 0) return -1;
+            }
+        }
+        return 0;
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+NativeInteger_free(const asn_TYPE_descriptor_t *td, void *ptr,
+                   enum asn_struct_free_method method) {
+    if(!td || !ptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)",
+		td->name, method, ptr);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(ptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(ptr, 0, sizeof(long));
+        break;
+    }
+}
+
+int
+NativeInteger_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) {
+    (void)td;
+
+    if(aptr && bptr) {
+        const asn_INTEGER_specifics_t *specs =
+            (const asn_INTEGER_specifics_t *)td->specifics;
+        if(specs && specs->field_unsigned) {
+            const unsigned long *a = aptr;
+            const unsigned long *b = bptr;
+            if(*a < *b) {
+                return -1;
+            } else if(*a > *b) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            const long *a = aptr;
+            const long *b = bptr;
+            if(*a < *b) {
+                return -1;
+            } else if(*a > *b) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    } else if(!aptr) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+asn_random_fill_result_t
+NativeInteger_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                          const asn_encoding_constraints_t *constraints,
+                          size_t max_length) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    long *st = *sptr;
+    const asn_INTEGER_enum_map_t *emap;
+    size_t emap_len;
+    intmax_t value;
+    int find_inside_map;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (long *)CALLOC(1, sizeof(*st));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    if(specs) {
+        emap = specs->value2enum;
+        emap_len = specs->map_count;
+        if(specs->strict_enumeration) {
+            find_inside_map = emap_len > 0;
+        } else {
+            find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
+        }
+    } else {
+        emap = 0;
+        emap_len = 0;
+        find_inside_map = 0;
+    }
+
+    if(find_inside_map) {
+        assert(emap_len > 0);
+        value = emap[asn_random_between(0, emap_len - 1)].nat_value;
+    } else {
+        const asn_per_constraints_t *ct;
+
+        static const long variants[] = {
+            -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
+            -16383, -257,   -256,   -255,   -254,   -129,   -128,   -127,
+            -126,   -1,     0,      1,      126,    127,    128,    129,
+            254,    255,    256,    257,    16383,  16384,  16385,  32767,
+            32768,  32769,  65534,  65535,  65536,  65537};
+        if(specs && specs->field_unsigned) {
+            assert(variants[18] == 0);
+            value = variants[asn_random_between(
+                18, sizeof(variants) / sizeof(variants[0]) - 1)];
+        } else {
+            value = variants[asn_random_between(
+                0, sizeof(variants) / sizeof(variants[0]) - 1)];
+        }
+
+        if(!constraints) constraints = &td->encoding_constraints;
+        ct = constraints ? constraints->per_constraints : 0;
+        if(ct && (ct->value.flags & APC_CONSTRAINED)) {
+            if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
+                value = asn_random_between(ct->value.lower_bound,
+                                           ct->value.upper_bound);
+            }
+        }
+    }
+
+    *sptr = st;
+    *st = value;
+    return result_ok;
+}
diff --git a/e2sm/lib/NativeInteger_oer.c b/e2sm/lib/NativeInteger_oer.c
new file mode 100644
index 0000000..411413a
--- /dev/null
+++ b/e2sm/lib/NativeInteger_oer.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <NativeInteger.h>
+#include <errno.h>
+
+asn_dec_rval_t
+NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_oer_constraints_t *constraints,
+                         void **nint_ptr, const void *ptr, size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    long *native = (long *)*nint_ptr;
+    INTEGER_t tmpint;
+    INTEGER_t *tmpintptr = &tmpint;
+
+    memset(&tmpint, 0, sizeof(tmpint));
+
+    if(!native) {
+        native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+        if(!native) ASN__DECODE_FAILED;
+    }
+
+    /*
+     * OPTIMIZATION: Encode directly rather than passing through INTEGER.
+     * Saves a memory allocation.
+     */
+    rval = INTEGER_decode_oer(opt_codec_ctx, td, constraints,
+                              (void **)&tmpintptr, ptr, size);
+    if(rval.code != RC_OK) {
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        return rval;
+    }
+
+    if(specs && specs->field_unsigned) {
+        unsigned long ul;
+        int ok = asn_INTEGER2ulong(&tmpint, &ul) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
+            *native = ul;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
+        }
+    } else {
+        long l;
+        int ok = asn_INTEGER2long(&tmpint, &l) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
+            *native = l;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
+        }
+    }
+
+    return rval;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+NativeInteger_encode_oer(const asn_TYPE_descriptor_t *td,
+                         const asn_oer_constraints_t *constraints,
+                         const void *sptr, asn_app_consume_bytes_f *cb,
+                         void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    INTEGER_t tmpint;
+    long native;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+    memset(&tmpint, 0, sizeof(tmpint));
+
+    ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native);
+
+    if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native)
+                                        : asn_long2INTEGER(&tmpint, native)) {
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        ASN__ENCODE_FAILED;
+    } else {
+        asn_enc_rval_t er =
+            INTEGER_encode_oer(td, constraints, &tmpint, cb, app_key);
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        return er;
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/NativeReal.c b/e2sm/lib/NativeReal.c
new file mode 100644
index 0000000..160a471
--- /dev/null
+++ b/e2sm/lib/NativeReal.c
@@ -0,0 +1,781 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Read the NativeReal.h for the explanation wrt. differences between
+ * REAL and NativeReal.
+ * Basically, both are decoders and encoders of ASN.1 REAL type, but this
+ * implementation deals with the standard (machine-specific) representation
+ * of them instead of using the platform-independent buffer.
+ */
+#include <asn_internal.h>
+#include <NativeReal.h>
+#include <REAL.h>
+#include <OCTET_STRING.h>
+#include <math.h>
+#include <float.h>
+
+#if defined(__clang__)
+/*
+ * isnan() is defined using generic selections and won't compile in
+ * strict C89 mode because of too fancy system's standard library.
+ * However, prior to C11 the math had a perfectly working isnan()
+ * in the math library.
+ * Disable generic selection warning so we can test C89 mode with newer libc.
+ */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc11-extensions"
+static int asn_isnan(double d) {
+    return isnan(d);
+}
+#pragma clang diagnostic pop
+#else
+#define asn_isnan(v)    isnan(v)
+#endif  /* generic selections */
+
+/*
+ * NativeReal basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NativeReal_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
+};
+asn_TYPE_operation_t asn_OP_NativeReal = {
+	NativeReal_free,
+	NativeReal_print,
+	NativeReal_compare,
+	NativeReal_decode_ber,
+	NativeReal_encode_der,
+	NativeReal_decode_xer,
+	NativeReal_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NativeReal_decode_oer,
+	NativeReal_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NativeReal_decode_uper,
+	NativeReal_encode_uper,
+	NativeReal_decode_aper,
+	NativeReal_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NativeReal_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NativeReal = {
+	"REAL",			/* The ASN.1 type is still REAL */
+	"REAL",
+	&asn_OP_NativeReal,
+	asn_DEF_NativeReal_tags,
+	sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
+	asn_DEF_NativeReal_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+static size_t NativeReal__float_size(const asn_TYPE_descriptor_t *td);
+static double NativeReal__get_double(const asn_TYPE_descriptor_t *td,
+                                     const void *ptr);
+static ssize_t NativeReal__set(const asn_TYPE_descriptor_t *td, void **sptr,
+                               double d);
+
+/*
+ * Decode REAL type.
+ */
+asn_dec_rval_t
+NativeReal_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                      const asn_TYPE_descriptor_t *td, void **sptr,
+                      const void *buf_ptr, size_t size, int tag_mode) {
+    asn_dec_rval_t rval;
+    ber_tlv_len_t length;
+
+    ASN_DEBUG("Decoding %s as REAL (tm=%d)", td->name, tag_mode);
+
+    /*
+     * Check tags.
+     */
+    rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, tag_mode, 0,
+                          &length, 0);
+    if(rval.code != RC_OK) return rval;
+    assert(length >= 0);    /* Ensured by ber_check_tags */
+
+    ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
+
+    /*
+     * Make sure we have this length.
+     */
+    buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+    size -= rval.consumed;
+    if(length > (ber_tlv_len_t)size) {
+        rval.code = RC_WMORE;
+        rval.consumed = 0;
+        return rval;
+    }
+
+    /*
+     * ASN.1 encoded REAL: buf_ptr, length
+     * Fill the Dbl, at the same time checking for overflow.
+     * If overflow occured, return with RC_FAIL.
+     */
+    {
+        uint8_t scratch[24]; /* Longer than %.16f in decimal */
+        REAL_t tmp;
+        double d;
+        int ret;
+
+        if((size_t)length < sizeof(scratch)) {
+            tmp.buf = scratch;
+            tmp.size = length;
+        } else {
+            /* This rarely happens: impractically long value */
+            tmp.buf = CALLOC(1, length + 1);
+            tmp.size = length;
+            if(!tmp.buf) {
+                rval.code = RC_FAIL;
+                rval.consumed = 0;
+                return rval;
+            }
+        }
+
+        memcpy(tmp.buf, buf_ptr, length);
+        tmp.buf[length] = '\0';
+
+        ret = asn_REAL2double(&tmp, &d);
+        if(tmp.buf != scratch) FREEMEM(tmp.buf);
+        if(ret) {
+            rval.code = RC_FAIL;
+            rval.consumed = 0;
+            return rval;
+        }
+
+        if(NativeReal__set(td, sptr, d) < 0)
+            ASN__DECODE_FAILED;
+    }
+
+    rval.code = RC_OK;
+    rval.consumed += length;
+
+    ASN_DEBUG("Took %ld/%ld bytes to encode %s", (long)rval.consumed,
+              (long)length, td->name);
+
+    return rval;
+}
+
+/*
+ * Encode the NativeReal using the standard REAL type DER encoder.
+ */
+asn_enc_rval_t
+NativeReal_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      int tag_mode, ber_tlv_tag_t tag,
+                      asn_app_consume_bytes_f *cb, void *app_key) {
+    double d = NativeReal__get_double(td, sptr);
+    asn_enc_rval_t erval = {0,0,0};
+	REAL_t tmp;
+
+	/* Prepare a temporary clean structure */
+	memset(&tmp, 0, sizeof(tmp));
+
+    if(asn_double2REAL(&tmp, d))
+        ASN__ENCODE_FAILED;
+
+    /* Encode a fake REAL */
+    erval = der_encode_primitive(td, &tmp, tag_mode, tag, cb, app_key);
+    if(erval.encoded == -1) {
+		assert(erval.structure_ptr == &tmp);
+		erval.structure_ptr = sptr;
+	}
+
+	/* Free possibly allocated members of the temporary structure */
+    ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+
+    return erval;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+/*
+ * Decode REAL type using PER.
+ */
+asn_dec_rval_t
+NativeReal_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                       const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints, void **sptr,
+                       asn_per_data_t *pd) {
+    asn_dec_rval_t rval;
+    double d;
+	REAL_t tmp;
+	void *ptmp = &tmp;
+	int ret;
+
+	(void)constraints;
+
+	memset(&tmp, 0, sizeof(tmp));
+    rval = OCTET_STRING_decode_uper(opt_codec_ctx, &asn_DEF_REAL,
+                                    NULL, &ptmp, pd);
+    if(rval.code != RC_OK) {
+		ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+		return rval;
+	}
+
+	ret = asn_REAL2double(&tmp, &d);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+	if(ret) ASN__DECODE_FAILED;
+
+    if(NativeReal__set(td, sptr, d) < 0 )
+        ASN__DECODE_FAILED;
+
+	return rval;
+}
+
+/*
+ * Encode the NativeReal using the OCTET STRING PER encoder.
+ */
+asn_enc_rval_t
+NativeReal_encode_uper(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po) {
+    double d = NativeReal__get_double(td, sptr);
+	asn_enc_rval_t erval = {0,0,0};
+	REAL_t tmp;
+
+	(void)constraints;
+
+	/* Prepare a temporary clean structure */
+	memset(&tmp, 0, sizeof(tmp));
+
+	if(asn_double2REAL(&tmp, d))
+		ASN__ENCODE_FAILED;
+	
+	/* Encode a DER REAL */
+    erval = OCTET_STRING_encode_uper(&asn_DEF_REAL, NULL, &tmp, po);
+    if(erval.encoded == -1)
+		erval.structure_ptr = sptr;
+
+	/* Free possibly allocated members of the temporary structure */
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+
+	return erval;
+}
+
+
+asn_dec_rval_t
+NativeReal_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                       const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       void **dbl_ptr, asn_per_data_t *pd) {
+	double *Dbl = (double *)*dbl_ptr;
+	asn_dec_rval_t rval;
+	REAL_t tmp;
+	void *ptmp = &tmp;
+	int ret;
+
+	(void)constraints;
+
+	/*
+	 * If the structure is not there, allocate it.
+	 */
+	if(Dbl == NULL) {
+		*dbl_ptr = CALLOC(1, sizeof(*Dbl));
+		Dbl = (double *)*dbl_ptr;
+		if(Dbl == NULL)
+			ASN__DECODE_FAILED;
+	}
+
+	memset(&tmp, 0, sizeof(tmp));
+	rval = OCTET_STRING_decode_aper(opt_codec_ctx, td, NULL,
+			&ptmp, pd);
+	if(rval.code != RC_OK) {
+		ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+		return rval;
+	}
+
+	ret = asn_REAL2double(&tmp, Dbl);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+	if(ret) ASN__DECODE_FAILED;
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeReal_encode_aper(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po) {
+	double Dbl = *(const double *)sptr;
+	asn_enc_rval_t erval = {0,0,0};
+	REAL_t tmp;
+
+	(void)constraints;
+
+	/* Prepare a temporary clean structure */
+	memset(&tmp, 0, sizeof(tmp));
+
+	if(asn_double2REAL(&tmp, Dbl))
+		ASN__ENCODE_FAILED;
+
+	/* Encode a DER REAL */
+	erval = OCTET_STRING_encode_aper(td, NULL, &tmp, po);
+	if(erval.encoded == -1)
+		erval.structure_ptr = sptr;
+
+	/* Free possibly allocated members of the temporary structure */
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+
+	return erval;
+}
+
+#endif /* ASN_DISABLE_PER_SUPPORT */
+
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+/*
+ * Swap bytes from/to network, if local is little-endian.
+ * Unused endianness sections are likely removed at compile phase.
+ */
+static void
+NativeReal__network_swap(size_t float_size, const void *srcp, uint8_t *dst) {
+    const uint8_t *src = srcp;
+    double test = -0.0;
+    int float_big_endian = *(const char *)&test != 0;
+    /* In lieu of static_assert(sizeof(double) == 8) */
+    static const char sizeof_double_is_8_a[sizeof(double)-7] CC_NOTUSED;
+    static const char sizeof_double_is_8_b[9-sizeof(double)] CC_NOTUSED;
+    /* In lieu of static_assert(sizeof(sizeof) == 4) */
+    static const char sizeof_float_is_4_a[sizeof(float)-3] CC_NOTUSED;
+    static const char sizeof_float_is_4_b[5-sizeof(float)] CC_NOTUSED;
+
+    switch(float_size) {
+    case sizeof(double):
+        assert(sizeof(double) == 8);
+        if(float_big_endian) {
+            dst[0] = src[0];
+            dst[1] = src[1];
+            dst[2] = src[2];
+            dst[3] = src[3];
+            dst[4] = src[4];
+            dst[5] = src[5];
+            dst[6] = src[6];
+            dst[7] = src[7];
+        } else {
+            dst[0] = src[7];
+            dst[1] = src[6];
+            dst[2] = src[5];
+            dst[3] = src[4];
+            dst[4] = src[3];
+            dst[5] = src[2];
+            dst[6] = src[1];
+            dst[7] = src[0];
+        }
+        return;
+    case sizeof(float):
+        assert(sizeof(float) == 4);
+        if(float_big_endian) {
+            dst[0] = src[0];
+            dst[1] = src[1];
+            dst[2] = src[2];
+            dst[3] = src[3];
+        } else {
+            dst[0] = src[3];
+            dst[1] = src[2];
+            dst[2] = src[1];
+            dst[3] = src[0];
+        }
+        return;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+NativeReal_encode_oer(const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints,
+                      const void *sptr, asn_app_consume_bytes_f *cb,
+                      void *app_key) {
+    asn_enc_rval_t er = {0, 0, 0};
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints && constraints->value.width != 0) {
+        /* X.696 IEEE 754 binary32 and binary64 encoding */
+        uint8_t scratch[sizeof(double)];
+        const asn_NativeReal_specifics_t *specs =
+            (const asn_NativeReal_specifics_t *)td->specifics;
+        size_t wire_size = constraints->value.width;
+
+        if(specs ? (wire_size == specs->float_size)
+                 : (wire_size == sizeof(double))) {
+            /*
+             * Our representation matches the wire, modulo endianness.
+             * That was the whole point of compact encoding!
+             */
+        } else {
+            assert((wire_size == sizeof(double))
+                   || (specs && specs->float_size == wire_size));
+            ASN__ENCODE_FAILED;
+        }
+
+        /*
+         * The X.696 standard doesn't specify endianness, neither is IEEE 754.
+         * So we assume the network format is big endian.
+         */
+        NativeReal__network_swap(wire_size, sptr, scratch);
+        if(cb(scratch, wire_size, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        } else {
+            er.encoded = wire_size;
+            ASN__ENCODED_OK(er);
+        }
+    } else {
+        double d = NativeReal__get_double(td, sptr);
+        ssize_t len_len;
+        REAL_t tmp;
+
+        /* Prepare a temporary clean structure */
+        memset(&tmp, 0, sizeof(tmp));
+
+        if(asn_double2REAL(&tmp, d)) {
+            ASN__ENCODE_FAILED;
+        }
+
+        /* Encode a fake REAL */
+        len_len = oer_serialize_length(tmp.size, cb, app_key);
+        if(len_len < 0 || cb(tmp.buf, tmp.size, app_key) < 0) {
+            ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+            ASN__ENCODE_FAILED;
+        } else {
+            er.encoded = len_len + tmp.size;
+            ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
+            ASN__ENCODED_OK(er);
+        }
+    }
+}
+
+asn_dec_rval_t
+NativeReal_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                      const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints, void **sptr,
+                      const void *ptr, size_t size) {
+    asn_dec_rval_t ok = {RC_OK, 0};
+    double d;
+    ssize_t len_len;
+    size_t real_body_len;
+
+    (void)opt_codec_ctx;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints && constraints->value.width != 0) {
+        /* X.696 IEEE 754 binary32 and binary64 encoding */
+        uint8_t scratch[sizeof(double)];
+        size_t wire_size = constraints->value.width;
+
+        if(size < wire_size)
+            ASN__DECODE_STARVED;
+
+        /*
+         * The X.696 standard doesn't specify endianness, neither is IEEE 754.
+         * So we assume the network format is big endian.
+         */
+        NativeReal__network_swap(wire_size, ptr, scratch);
+
+
+        switch(wire_size) {
+            case sizeof(double):
+                {
+                    double tmp;
+                    memcpy(&tmp, scratch, sizeof(double));
+                    if(NativeReal__set(td, sptr, tmp) < 0)
+                        ASN__DECODE_FAILED;
+                }
+                break;
+            case sizeof(float):
+                {
+                    float tmp;
+                    memcpy(&tmp, scratch, sizeof(float));
+                    if(NativeReal__set(td, sptr, tmp) < 0)
+                        ASN__DECODE_FAILED;
+                }
+                break;
+        default:
+            ASN__DECODE_FAILED;
+        }
+
+        ok.consumed = wire_size;
+        return ok;
+    }
+
+    len_len = oer_fetch_length(ptr, size, &real_body_len);
+    if(len_len < 0) ASN__DECODE_FAILED;
+    if(len_len == 0) ASN__DECODE_STARVED;
+
+    ptr = (const char *)ptr + len_len;
+    size -= len_len;
+
+    if(real_body_len > size) ASN__DECODE_STARVED;
+
+    {
+        uint8_t scratch[24]; /* Longer than %.16f in decimal */
+        REAL_t tmp;
+        int ret;
+
+        if(real_body_len < sizeof(scratch)) {
+            tmp.buf = scratch;
+            tmp.size = real_body_len;
+        } else {
+            /* This rarely happens: impractically long value */
+            tmp.buf = CALLOC(1, real_body_len + 1);
+            tmp.size = real_body_len;
+            if(!tmp.buf) {
+                ASN__DECODE_FAILED;
+            }
+        }
+
+        memcpy(tmp.buf, ptr, real_body_len);
+        tmp.buf[real_body_len] = '\0';
+
+        ret = asn_REAL2double(&tmp, &d);
+        if(tmp.buf != scratch) FREEMEM(tmp.buf);
+        if(ret) {
+            ASN_DEBUG("REAL decoded in %" ASN_PRI_SIZE " bytes, but can't convert t double",
+                      real_body_len);
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    if(NativeReal__set(td, sptr, d) < 0)
+        ASN__DECODE_FAILED;
+
+    ok.consumed = len_len + real_body_len;
+    return ok;
+}
+
+#endif /* ASN_DISABLE_OER_SUPPORT */
+
+/*
+ * Decode the chunk of XML text encoding REAL.
+ */
+asn_dec_rval_t
+NativeReal_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                      const asn_TYPE_descriptor_t *td, void **sptr,
+                      const char *opt_mname, const void *buf_ptr, size_t size) {
+    asn_dec_rval_t rval;
+	REAL_t st = { 0, 0 };
+	REAL_t *stp = &st;
+
+	rval = REAL_decode_xer(opt_codec_ctx, td, (void **)&stp, opt_mname,
+		buf_ptr, size);
+	if(rval.code == RC_OK) {
+        double d;
+        if(asn_REAL2double(&st, &d) || NativeReal__set(td, sptr, d) < 0) {
+            rval.code = RC_FAIL;
+            rval.consumed = 0;
+        }
+	} else {
+        /* Convert all errors into RC_FAIL */
+        rval.consumed = 0;
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &st);
+	return rval;
+}
+
+asn_enc_rval_t
+NativeReal_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      int ilevel, enum xer_encoder_flags_e flags,
+                      asn_app_consume_bytes_f *cb, void *app_key) {
+	double d = NativeReal__get_double(td, sptr);
+	asn_enc_rval_t er = {0,0,0};
+
+	(void)ilevel;
+
+	er.encoded = REAL__dump(d, flags & XER_F_CANONICAL, cb, app_key);
+	if(er.encoded < 0) ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+/*
+ * REAL specific human-readable output.
+ */
+int
+NativeReal_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                 asn_app_consume_bytes_f *cb, void *app_key) {
+    (void)ilevel;	/* Unused argument */
+
+	if(sptr) {
+        double d = NativeReal__get_double(td, sptr);
+        return (REAL__dump(d, 0, cb, app_key) < 0) ? -1 : 0;
+    } else {
+        return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+    }
+}
+
+int
+NativeReal_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                   const void *bptr) {
+
+    if(aptr && bptr) {
+        double a = NativeReal__get_double(td, aptr);
+        double b = NativeReal__get_double(td, bptr);
+
+        /* NaN sorted above everything else */
+        if(asn_isnan(a)) {
+            if(asn_isnan(b)) {
+                return 0;
+            } else {
+                return -1;
+            }
+        } else if(asn_isnan(b)) {
+            return 1;
+        }
+        /* Value comparison. */
+        if(a < b) {
+            return -1;
+        } else if(a > b) {
+            return 1;
+        } else {
+            return 0;
+        }
+    } else if(!aptr) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+void
+NativeReal_free(const asn_TYPE_descriptor_t *td, void *ptr,
+                enum asn_struct_free_method method) {
+    if(!td || !ptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as REAL (%d, %p, Native)",
+		td->name, method, ptr);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(ptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET: {
+        const asn_NativeReal_specifics_t *specs;
+        size_t float_size;
+        specs = (const asn_NativeReal_specifics_t *)td->specifics;
+        float_size = specs ? specs->float_size : sizeof(double);
+        memset(ptr, 0, float_size);
+    } break;
+    }
+}
+
+asn_random_fill_result_t
+NativeReal_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                       const asn_encoding_constraints_t *constraints,
+                       size_t max_length) {
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 0};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+#ifndef INFINITY
+#define INFINITY (1.0/0.0)
+#endif
+#ifndef NAN
+#define NAN (0.0/0.0)
+#endif
+    static const double double_values[] = {
+        -M_E, M_E, -M_PI, M_PI, /* Better precision than with floats */
+        -1E+308, 1E+308,
+        /* 2^51 */
+        -2251799813685248.0, 2251799813685248.0,
+        /* 2^52 */
+        -4503599627370496.0, 4503599627370496.0,
+        /* 2^100 */
+        -1267650600228229401496703205376.0, 1267650600228229401496703205376.0,
+        -DBL_MIN, DBL_MIN,
+        -DBL_MAX, DBL_MAX,
+#ifdef  DBL_TRUE_MIN
+        -DBL_TRUE_MIN, DBL_TRUE_MIN
+#endif
+    };
+    static const float float_values[] = {
+        0, -0.0, -1, 1, -M_E, M_E, -3.14, 3.14, -M_PI, M_PI, -255, 255,
+        -FLT_MIN, FLT_MIN,
+        -FLT_MAX, FLT_MAX,
+#ifdef  FLT_TRUE_MIN
+        -FLT_TRUE_MIN, FLT_TRUE_MIN,
+#endif
+        INFINITY, -INFINITY, NAN
+    };
+    ssize_t float_set_size = NativeReal__float_size(td);
+    const size_t n_doubles = sizeof(double_values) / sizeof(double_values[0]);
+    const size_t n_floats = sizeof(float_values) / sizeof(float_values[0]);
+    double d;
+
+    (void)constraints;
+
+    if(max_length == 0) return result_skipped;
+
+    if(float_set_size == sizeof(double) && asn_random_between(0, 1) == 0) {
+        d = double_values[asn_random_between(0, n_doubles - 1)];
+    } else {
+        d = float_values[asn_random_between(0, n_floats - 1)];
+    }
+
+    if(NativeReal__set(td, sptr, d) < 0) {
+        return result_failed;
+    }
+
+    result_ok.length = float_set_size;
+    return result_ok;
+}
+
+
+/*
+ * Local helper functions.
+ */
+
+static size_t
+NativeReal__float_size(const asn_TYPE_descriptor_t *td) {
+    const asn_NativeReal_specifics_t *specs =
+        (const asn_NativeReal_specifics_t *)td->specifics;
+    return specs ? specs->float_size : sizeof(double);
+}
+
+static double
+NativeReal__get_double(const asn_TYPE_descriptor_t *td, const void *ptr) {
+    size_t float_size = NativeReal__float_size(td);
+    if(float_size == sizeof(float)) {
+        return *(const float *)ptr;
+    } else {
+        return *(const double *)ptr;
+    }
+}
+
+static ssize_t  /* Returns -1 or float size. */
+NativeReal__set(const asn_TYPE_descriptor_t *td, void **sptr, double d) {
+    size_t float_size = NativeReal__float_size(td);
+    void *native;
+
+    if(!(native = *sptr)) {
+        native = (*sptr = CALLOC(1, float_size));
+        if(!native) {
+            return -1;
+        }
+    }
+
+    if(float_size == sizeof(float)) {
+        if(asn_double2float(d, (float *)native)) {
+            return -1;
+        }
+    } else {
+        *(double *)native = d;
+    }
+
+    return float_size;
+}
+
diff --git a/e2sm/lib/OCTET_STRING.c b/e2sm/lib/OCTET_STRING.c
new file mode 100644
index 0000000..ae34c96
--- /dev/null
+++ b/e2sm/lib/OCTET_STRING.c
@@ -0,0 +1,2411 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OCTET_STRING.h>
+#include <BIT_STRING.h>	/* for .bits_unused member */
+#include <errno.h>
+
+/*
+ * OCTET STRING basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs = {
+	sizeof(OCTET_STRING_t),
+	offsetof(OCTET_STRING_t, _asn_ctx),
+	ASN_OSUBV_STR
+};
+
+asn_TYPE_operation_t asn_OP_OCTET_STRING = {
+	OCTET_STRING_free,
+	OCTET_STRING_print,	/* OCTET STRING generally means a non-ascii sequence */
+	OCTET_STRING_compare,
+	OCTET_STRING_decode_ber,
+	OCTET_STRING_encode_der,
+	OCTET_STRING_decode_xer_hex,
+	OCTET_STRING_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	OCTET_STRING_decode_oer,
+	OCTET_STRING_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	OCTET_STRING_decode_uper,	/* Unaligned PER decoder */
+	OCTET_STRING_encode_uper,	/* Unaligned PER encoder */
+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	OCTET_STRING_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = {
+	"OCTET STRING",		/* Canonical name */
+	"OCTET_STRING",		/* XML tag name */
+	&asn_OP_OCTET_STRING,
+	asn_DEF_OCTET_STRING_tags,
+	sizeof(asn_DEF_OCTET_STRING_tags)
+	  / sizeof(asn_DEF_OCTET_STRING_tags[0]),
+	asn_DEF_OCTET_STRING_tags,	/* Same as above */
+	sizeof(asn_DEF_OCTET_STRING_tags)
+	  / sizeof(asn_DEF_OCTET_STRING_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs
+};
+
+#undef	_CH_PHASE
+#undef	NEXT_PHASE
+#undef	PREV_PHASE
+#define	_CH_PHASE(ctx, inc) do {					\
+		if(ctx->phase == 0)					\
+			ctx->context = 0;				\
+		ctx->phase += inc;					\
+	} while(0)
+#define	NEXT_PHASE(ctx)	_CH_PHASE(ctx, +1)
+#define	PREV_PHASE(ctx)	_CH_PHASE(ctx, -1)
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {					\
+		size_t num = (num_bytes);				\
+		buf_ptr = ((const char *)buf_ptr) + num;		\
+		size -= num;						\
+		consumed_myself += num;					\
+	} while(0)
+
+#undef	RETURN
+#define	RETURN(_code)	do {						\
+		asn_dec_rval_t tmprval;					\
+		tmprval.code = _code;					\
+		tmprval.consumed = consumed_myself;			\
+		return tmprval;						\
+	} while(0)
+
+#undef	APPEND
+#define	APPEND(bufptr, bufsize)	do {					\
+		size_t _bs = (bufsize);		/* Append size */	\
+		size_t _ns = ctx->context;	/* Allocated now */	\
+		size_t _es = st->size + _bs;	/* Expected size */	\
+		/* int is really a typeof(st->size): */			\
+		if((int)_es < 0) RETURN(RC_FAIL);			\
+		if(_ns <= _es) {					\
+			void *ptr;					\
+			/* Be nice and round to the memory allocator */	\
+			do { _ns = _ns ? _ns << 1 : 16; }		\
+			    while(_ns <= _es);				\
+			/* int is really a typeof(st->size): */		\
+			if((int)_ns < 0) RETURN(RC_FAIL);		\
+			ptr = REALLOC(st->buf, _ns);			\
+			if(ptr) {					\
+				st->buf = (uint8_t *)ptr;		\
+				ctx->context = _ns;			\
+			} else {					\
+				RETURN(RC_FAIL);			\
+			}						\
+			ASN_DEBUG("Reallocating into %ld", (long)_ns);	\
+		}							\
+		memcpy(st->buf + st->size, bufptr, _bs);		\
+		/* Convenient nul-termination */			\
+		st->buf[_es] = '\0';					\
+		st->size = _es;						\
+	} while(0)
+
+/*
+ * The main reason why ASN.1 is still alive is that too much time and effort
+ * is necessary for learning it more or less adequately, thus creating a gut
+ * necessity to demonstrate that aquired skill everywhere afterwards.
+ * No, I am not going to explain what the following stuff is.
+ */
+struct _stack_el {
+    ber_tlv_len_t left;     /* What's left to read (or -1) */
+    ber_tlv_len_t got;      /* What was actually processed */
+    unsigned cont_level;    /* Depth of subcontainment */
+    int want_nulls;         /* Want null "end of content" octets? */
+    int bits_chopped;       /* Flag in BIT STRING mode */
+    ber_tlv_tag_t tag;      /* For debugging purposes */
+    struct _stack_el *prev;
+    struct _stack_el *next;
+};
+struct _stack {
+	struct _stack_el *tail;
+	struct _stack_el *cur_ptr;
+};
+
+static struct _stack_el *
+OS__add_stack_el(struct _stack *st) {
+	struct _stack_el *nel;
+
+	/*
+	 * Reuse the old stack frame or allocate a new one.
+	 */
+	if(st->cur_ptr && st->cur_ptr->next) {
+		nel = st->cur_ptr->next;
+		nel->bits_chopped = 0;
+		nel->got = 0;
+		/* Retain the nel->cont_level, it's correct. */
+	} else {
+		nel = (struct _stack_el *)CALLOC(1, sizeof(struct _stack_el));
+		if(nel == NULL)
+			return NULL;
+
+		if(st->tail) {
+			/* Increase a subcontainment depth */
+			nel->cont_level = st->tail->cont_level + 1;
+			st->tail->next = nel;
+		}
+		nel->prev = st->tail;
+		st->tail = nel;
+	}
+
+	st->cur_ptr = nel;
+
+	return nel;
+}
+
+static struct _stack *
+_new_stack(void) {
+	return (struct _stack *)CALLOC(1, sizeof(struct _stack));
+}
+
+/*
+ * Decode OCTET STRING type.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                        const asn_TYPE_descriptor_t *td, void **sptr,
+                        const void *buf_ptr, size_t size, int tag_mode) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	asn_dec_rval_t rval;
+	asn_struct_ctx_t *ctx;
+	ssize_t consumed_myself = 0;
+	struct _stack *stck;		/* Expectations stack structure */
+	struct _stack_el *sel = 0;	/* Stack element */
+	int tlv_constr;
+	enum asn_OS_Subvariant type_variant = specs->subvariant;
+
+	ASN_DEBUG("Decoding %s as %s (frame %ld)",
+		td->name,
+		(type_variant == ASN_OSUBV_STR) ?
+			"OCTET STRING" : "OS-SpecialCase",
+		(long)size);
+
+	/*
+	 * Create the string if does not exist.
+	 */
+	if(st == NULL) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(st == NULL) RETURN(RC_FAIL);
+	}
+
+	/* Restore parsing context */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * Check tags.
+		 */
+		rval = ber_check_tags(opt_codec_ctx, td, ctx,
+			buf_ptr, size, tag_mode, -1,
+			&ctx->left, &tlv_constr);
+		if(rval.code != RC_OK)
+			return rval;
+
+		if(tlv_constr) {
+			/*
+			 * Complex operation, requires stack of expectations.
+			 */
+			ctx->ptr = _new_stack();
+			if(!ctx->ptr) {
+				RETURN(RC_FAIL);
+			}
+		} else {
+			/*
+			 * Jump into stackless primitive decoding.
+			 */
+			_CH_PHASE(ctx, 3);
+			if(type_variant == ASN_OSUBV_ANY && tag_mode != 1)
+				APPEND(buf_ptr, rval.consumed);
+			ADVANCE(rval.consumed);
+			goto phase3;
+		}
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 1:
+	phase1:
+		/*
+		 * Fill the stack with expectations.
+		 */
+		stck = (struct _stack *)ctx->ptr;
+		sel = stck->cur_ptr;
+	  do {
+		ber_tlv_tag_t tlv_tag;
+		ber_tlv_len_t tlv_len;
+		ber_tlv_tag_t expected_tag;
+		ssize_t tl, ll, tlvl;
+				/* This one works even if (sel->left == -1) */
+		size_t Left = ((!sel||(size_t)sel->left >= size)
+					?size:(size_t)sel->left);
+
+
+		ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", (void *)sel,
+			(long)(sel?sel->left:0),
+			(long)(sel?sel->want_nulls:0),
+			(long)(sel?sel->got:0)
+		);
+		if(sel && sel->left <= 0 && sel->want_nulls == 0) {
+			if(sel->prev) {
+				struct _stack_el *prev = sel->prev;
+				if(prev->left != -1) {
+					if(prev->left < sel->got)
+						RETURN(RC_FAIL);
+					prev->left -= sel->got;
+				}
+				prev->got += sel->got;
+				sel = stck->cur_ptr = prev;
+				if(!sel) break;
+				tlv_constr = 1;
+				continue;
+			} else {
+				sel = stck->cur_ptr = 0;
+				break;	/* Nothing to wait */
+			}
+		}
+
+		tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag);
+		ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld",
+			(long)size, (long)Left, sel?"":"!",
+			(long)(sel?sel->left:0),
+			(long)(sel?sel->want_nulls:0),
+			(long)tl);
+		switch(tl) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		tlv_constr = BER_TLV_CONSTRUCTED(buf_ptr);
+
+		ll = ber_fetch_length(tlv_constr,
+				(const char *)buf_ptr + tl,Left - tl,&tlv_len);
+		ASN_DEBUG("Got tag=%s, tc=%d, left=%ld, tl=%ld, len=%ld, ll=%ld",
+			ber_tlv_tag_string(tlv_tag), tlv_constr,
+				(long)Left, (long)tl, (long)tlv_len, (long)ll);
+		switch(ll) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		if(sel && sel->want_nulls
+			&& ((const uint8_t *)buf_ptr)[0] == 0
+			&& ((const uint8_t *)buf_ptr)[1] == 0)
+		{
+
+			ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls);
+
+			if(type_variant == ASN_OSUBV_ANY
+			&& (tag_mode != 1 || sel->cont_level))
+				APPEND("\0\0", 2);
+
+			ADVANCE(2);
+			sel->got += 2;
+			if(sel->left != -1) {
+				sel->left -= 2;	/* assert(sel->left >= 2) */
+			}
+
+			sel->want_nulls--;
+			if(sel->want_nulls == 0) {
+				/* Move to the next expectation */
+				sel->left = 0;
+				tlv_constr = 1;
+			}
+
+			continue;
+		}
+
+		/*
+		 * Set up expected tags,
+		 * depending on ASN.1 type being decoded.
+		 */
+		switch(type_variant) {
+		case ASN_OSUBV_BIT:
+			/* X.690: 8.6.4.1, NOTE 2 */
+			/* Fall through */
+		case ASN_OSUBV_STR:
+		default:
+			if(sel) {
+				unsigned level = sel->cont_level;
+				if(level < td->all_tags_count) {
+					expected_tag = td->all_tags[level];
+					break;
+				} else if(td->all_tags_count) {
+					expected_tag = td->all_tags
+						[td->all_tags_count - 1];
+					break;
+				}
+				/* else, Fall through */
+			}
+			/* Fall through */
+		case ASN_OSUBV_ANY:
+			expected_tag = tlv_tag;
+			break;
+		}
+
+
+		if(tlv_tag != expected_tag) {
+			char buf[2][32];
+			ber_tlv_tag_snprint(tlv_tag,
+				buf[0], sizeof(buf[0]));
+			ber_tlv_tag_snprint(td->tags[td->tags_count-1],
+				buf[1], sizeof(buf[1]));
+			ASN_DEBUG("Tag does not match expectation: %s != %s",
+				buf[0], buf[1]);
+			RETURN(RC_FAIL);
+		}
+
+		tlvl = tl + ll;	/* Combined length of T and L encoding */
+		if((tlv_len + tlvl) < 0) {
+			/* tlv_len value is too big */
+			ASN_DEBUG("TLV encoding + length (%ld) is too big",
+				(long)tlv_len);
+			RETURN(RC_FAIL);
+		}
+
+		/*
+		 * Append a new expectation.
+		 */
+		sel = OS__add_stack_el(stck);
+		if(!sel) RETURN(RC_FAIL);
+
+		sel->tag = tlv_tag;
+
+		sel->want_nulls = (tlv_len==-1);
+		if(sel->prev && sel->prev->left != -1) {
+			/* Check that the parent frame is big enough */
+			if(sel->prev->left < tlvl + (tlv_len==-1?0:tlv_len))
+				RETURN(RC_FAIL);
+			if(tlv_len == -1)
+				sel->left = sel->prev->left - tlvl;
+			else
+				sel->left = tlv_len;
+		} else {
+			sel->left = tlv_len;
+		}
+		if(type_variant == ASN_OSUBV_ANY
+		&& (tag_mode != 1 || sel->cont_level))
+			APPEND(buf_ptr, tlvl);
+		sel->got += tlvl;
+		ADVANCE(tlvl);
+
+		ASN_DEBUG("+EXPECT2 got=%ld left=%ld, wn=%d, clvl=%u",
+			(long)sel->got, (long)sel->left,
+			sel->want_nulls, sel->cont_level);
+
+	  } while(tlv_constr);
+		if(sel == NULL) {
+			/* Finished operation, "phase out" */
+			ASN_DEBUG("Phase out");
+			_CH_PHASE(ctx, +3);
+			break;
+		}
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 2:
+		stck = (struct _stack *)ctx->ptr;
+		sel = stck->cur_ptr;
+		ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d",
+			(long)sel->left, (long)size, (long)sel->got,
+				sel->want_nulls);
+	    {
+		ber_tlv_len_t len;
+
+		assert(sel->left >= 0);
+
+		len = ((ber_tlv_len_t)size < sel->left)
+				? (ber_tlv_len_t)size : sel->left;
+		if(len > 0) {
+			if(type_variant == ASN_OSUBV_BIT
+			&& sel->bits_chopped == 0) {
+				/* Put the unused-bits-octet away */
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				APPEND(((const char *)buf_ptr+1), (len - 1));
+				sel->bits_chopped = 1;
+			} else {
+				APPEND(buf_ptr, len);
+			}
+			ADVANCE(len);
+			sel->left -= len;
+			sel->got += len;
+		}
+
+		if(sel->left) {
+			ASN_DEBUG("OS left %ld, size = %ld, wn=%d\n",
+				(long)sel->left, (long)size, sel->want_nulls);
+			RETURN(RC_WMORE);
+		}
+
+		PREV_PHASE(ctx);
+		goto phase1;
+	    }
+		break;
+	case 3:
+	phase3:
+		/*
+		 * Primitive form, no stack required.
+		 */
+		assert(ctx->left >= 0);
+
+		if(size < (size_t)ctx->left) {
+			if(!size) RETURN(RC_WMORE);
+			if(type_variant == ASN_OSUBV_BIT && !ctx->context) {
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				ctx->left--;
+				ADVANCE(1);
+			}
+			APPEND(buf_ptr, size);
+			assert(ctx->context > 0);
+			ctx->left -= size;
+			ADVANCE(size);
+			RETURN(RC_WMORE);
+		} else {
+			if(type_variant == ASN_OSUBV_BIT
+			&& !ctx->context && ctx->left) {
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				ctx->left--;
+				ADVANCE(1);
+			}
+			APPEND(buf_ptr, ctx->left);
+			ADVANCE(ctx->left);
+			ctx->left = 0;
+
+			NEXT_PHASE(ctx);
+		}
+		break;
+	}
+
+	if(sel) {
+		ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld",
+			(void *)sel->prev, sel->want_nulls,
+			(long)sel->left, (long)sel->got, (long)size);
+		if(sel->prev || sel->want_nulls > 1 || sel->left > 0) {
+			RETURN(RC_WMORE);
+		}
+	}
+
+	/*
+	 * BIT STRING-specific processing.
+	 */
+	if(type_variant == ASN_OSUBV_BIT) {
+        if(st->size) {
+			if(st->bits_unused < 0 || st->bits_unused > 7) {
+				RETURN(RC_FAIL);
+			}
+			/* Finalize BIT STRING: zero out unused bits. */
+			st->buf[st->size-1] &= 0xff << st->bits_unused;
+		} else {
+			if(st->bits_unused) {
+				RETURN(RC_FAIL);
+			}
+		}
+	}
+
+	ASN_DEBUG("Took %ld bytes to encode %s: [%s]:%ld",
+		(long)consumed_myself, td->name,
+		(type_variant == ASN_OSUBV_STR) ? (char *)st->buf : "<data>",
+		(long)st->size);
+
+
+	RETURN(RC_OK);
+}
+
+/*
+ * Encode OCTET STRING type using DER.
+ */
+asn_enc_rval_t
+OCTET_STRING_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int tag_mode, ber_tlv_tag_t tag,
+                        asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = { 0, 0, 0 };
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	enum asn_OS_Subvariant type_variant = specs->subvariant;
+	int fix_last_byte = 0;
+
+	ASN_DEBUG("%s %s as OCTET STRING",
+		cb?"Estimating":"Encoding", td->name);
+
+	/*
+	 * Write tags.
+	 */
+	if(type_variant != ASN_OSUBV_ANY || tag_mode == 1) {
+		er.encoded = der_write_tags(td,
+				(type_variant == ASN_OSUBV_BIT) + st->size,
+			tag_mode, type_variant == ASN_OSUBV_ANY, tag,
+			cb, app_key);
+		if(er.encoded == -1) {
+			er.failed_type = td;
+			er.structure_ptr = sptr;
+			return er;
+		}
+	} else {
+		/* Disallow: [<tag>] IMPLICIT ANY */
+		assert(type_variant != ASN_OSUBV_ANY || tag_mode != -1);
+		er.encoded = 0;
+	}
+
+	if(!cb) {
+		er.encoded += (type_variant == ASN_OSUBV_BIT) + st->size;
+		ASN__ENCODED_OK(er);
+	}
+
+	/*
+	 * Prepare to deal with the last octet of BIT STRING.
+	 */
+	if(type_variant == ASN_OSUBV_BIT) {
+		uint8_t b = st->bits_unused & 0x07;
+		if(b && st->size) fix_last_byte = 1;
+		ASN__CALLBACK(&b, 1);
+	}
+
+	/* Invoke callback for the main part of the buffer */
+	ASN__CALLBACK(st->buf, st->size - fix_last_byte);
+
+	/* The last octet should be stripped off the unused bits */
+	if(fix_last_byte) {
+		uint8_t b = st->buf[st->size-1] & (0xff << st->bits_unused);
+		ASN__CALLBACK(&b, 1);
+	}
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int ilevel, enum xer_encoder_flags_e flags,
+                        asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	char scratch[16 * 3 + 4];
+	char *p = scratch;
+	uint8_t *buf;
+	uint8_t *end;
+	size_t i;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	/*
+	 * Dump the contents of the buffer in hexadecimal.
+	 */
+	buf = st->buf;
+	end = buf + st->size;
+	if(flags & XER_F_CANONICAL) {
+		char *scend = scratch + (sizeof(scratch) - 2);
+		for(; buf < end; buf++) {
+			if(p >= scend) {
+				ASN__CALLBACK(scratch, p - scratch);
+				p = scratch;
+			}
+			*p++ = h2c[(*buf >> 4) & 0x0F];
+			*p++ = h2c[*buf & 0x0F];
+		}
+
+		ASN__CALLBACK(scratch, p-scratch);	/* Dump the rest */
+	} else {
+		for(i = 0; buf < end; buf++, i++) {
+			if(!(i % 16) && (i || st->size > 16)) {
+				ASN__CALLBACK(scratch, p-scratch);
+				p = scratch;
+				ASN__TEXT_INDENT(1, ilevel);
+			}
+			*p++ = h2c[(*buf >> 4) & 0x0F];
+			*p++ = h2c[*buf & 0x0F];
+			*p++ = 0x20;
+		}
+		if(p - scratch) {
+			p--;	/* Remove the tail space */
+			ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */
+			if(st->size > 16)
+				ASN__TEXT_INDENT(1, ilevel-1);
+		}
+	}
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+static const struct OCTET_STRING__xer_escape_table_s {
+	const char *string;
+	int size;
+} OCTET_STRING__xer_escape_table[] = {
+#define	OSXET(s)	{ s, sizeof(s) - 1 }
+	OSXET("\074\156\165\154\057\076"),	/* <nul/> */
+	OSXET("\074\163\157\150\057\076"),	/* <soh/> */
+	OSXET("\074\163\164\170\057\076"),	/* <stx/> */
+	OSXET("\074\145\164\170\057\076"),	/* <etx/> */
+	OSXET("\074\145\157\164\057\076"),	/* <eot/> */
+	OSXET("\074\145\156\161\057\076"),	/* <enq/> */
+	OSXET("\074\141\143\153\057\076"),	/* <ack/> */
+	OSXET("\074\142\145\154\057\076"),	/* <bel/> */
+	OSXET("\074\142\163\057\076"),		/* <bs/> */
+	OSXET("\011"),				/* \t */
+	OSXET("\012"),				/* \n */
+	OSXET("\074\166\164\057\076"),		/* <vt/> */
+	OSXET("\074\146\146\057\076"),		/* <ff/> */
+	OSXET("\015"),				/* \r */
+	OSXET("\074\163\157\057\076"),		/* <so/> */
+	OSXET("\074\163\151\057\076"),		/* <si/> */
+	OSXET("\074\144\154\145\057\076"),	/* <dle/> */
+	OSXET("\074\144\143\061\057\076"),	/* <de1/> */
+	OSXET("\074\144\143\062\057\076"),	/* <de2/> */
+	OSXET("\074\144\143\063\057\076"),	/* <de3/> */
+	OSXET("\074\144\143\064\057\076"),	/* <de4/> */
+	OSXET("\074\156\141\153\057\076"),	/* <nak/> */
+	OSXET("\074\163\171\156\057\076"),	/* <syn/> */
+	OSXET("\074\145\164\142\057\076"),	/* <etb/> */
+	OSXET("\074\143\141\156\057\076"),	/* <can/> */
+	OSXET("\074\145\155\057\076"),		/* <em/> */
+	OSXET("\074\163\165\142\057\076"),	/* <sub/> */
+	OSXET("\074\145\163\143\057\076"),	/* <esc/> */
+	OSXET("\074\151\163\064\057\076"),	/* <is4/> */
+	OSXET("\074\151\163\063\057\076"),	/* <is3/> */
+	OSXET("\074\151\163\062\057\076"),	/* <is2/> */
+	OSXET("\074\151\163\061\057\076"),	/* <is1/> */
+	{ 0, 0 },	/* " " */
+	{ 0, 0 },	/* ! */
+	{ 0, 0 },	/* \" */
+	{ 0, 0 },	/* # */
+	{ 0, 0 },	/* $ */
+	{ 0, 0 },	/* % */
+	OSXET("\046\141\155\160\073"),	/* &amp; */
+	{ 0, 0 },	/* ' */
+	{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* ()*+,-./ */
+	{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* 01234567 */
+	{0,0},{0,0},{0,0},{0,0},			 /* 89:; */
+	OSXET("\046\154\164\073"),	/* &lt; */
+	{ 0, 0 },	/* = */
+	OSXET("\046\147\164\073"),	/* &gt; */
+};
+
+static int
+OS__check_escaped_control_char(const void *buf, int size) {
+	size_t i;
+	/*
+	 * Inefficient algorithm which translates the escape sequences
+	 * defined above into characters. Returns -1 if not found.
+	 * TODO: replace by a faster algorithm (bsearch(), hash or
+	 * nested table lookups).
+	 */
+	for(i = 0; i < 32 /* Don't spend time on the bottom half */; i++) {
+		const struct OCTET_STRING__xer_escape_table_s *el;
+		el = &OCTET_STRING__xer_escape_table[i];
+		if(el->size == size && memcmp(buf, el->string, size) == 0)
+			return i;
+	}
+	return -1;
+}
+
+static int
+OCTET_STRING__handle_control_chars(void *struct_ptr, const void *chunk_buf, size_t chunk_size) {
+	/*
+	 * This might be one of the escape sequences
+	 * for control characters. Check it out.
+	 * #11.15.5
+	 */
+	int control_char = OS__check_escaped_control_char(chunk_buf,chunk_size);
+	if(control_char >= 0) {
+		OCTET_STRING_t *st = (OCTET_STRING_t *)struct_ptr;
+		void *p = REALLOC(st->buf, st->size + 2);
+		if(p) {
+			st->buf = (uint8_t *)p;
+			st->buf[st->size++] = control_char;
+			st->buf[st->size] = '\0';	/* nul-termination */
+			return 0;
+		}
+	}
+
+	return -1;	/* No, it's not */
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_xer_utf8(const asn_TYPE_descriptor_t *td, const void *sptr,
+                             int ilevel, enum xer_encoder_flags_e flags,
+                             asn_app_consume_bytes_f *cb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	uint8_t *buf, *end;
+	uint8_t *ss;	/* Sequence start */
+	ssize_t encoded_len = 0;
+
+	(void)ilevel;	/* Unused argument */
+	(void)flags;	/* Unused argument */
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	buf = st->buf;
+	end = buf + st->size;
+	for(ss = buf; buf < end; buf++) {
+		unsigned int ch = *buf;
+		int s_len;	/* Special encoding sequence length */
+
+		/*
+		 * Escape certain characters: X.680/11.15
+		 */
+		if(ch < sizeof(OCTET_STRING__xer_escape_table)
+			/sizeof(OCTET_STRING__xer_escape_table[0])
+		&& (s_len = OCTET_STRING__xer_escape_table[ch].size)) {
+			if(((buf - ss) && cb(ss, buf - ss, app_key) < 0)
+			|| cb(OCTET_STRING__xer_escape_table[ch].string, s_len,
+					app_key) < 0)
+				ASN__ENCODE_FAILED;
+			encoded_len += (buf - ss) + s_len;
+			ss = buf + 1;
+		}
+	}
+
+	encoded_len += (buf - ss);
+	if((buf - ss) && cb(ss, buf - ss, app_key) < 0)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = encoded_len;
+	ASN__ENCODED_OK(er);
+}
+
+/*
+ * Convert from hexadecimal format (cstring): "AB CD EF"
+ */
+static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) {
+	OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const char *chunk_stop = (const char *)chunk_buf;
+	const char *p = chunk_stop;
+	const char *pend = p + chunk_size;
+	unsigned int clv = 0;
+	int half = 0;	/* Half bit */
+	uint8_t *buf;
+
+	/* Reallocate buffer according to high cap estimation */
+	size_t new_size = st->size + (chunk_size + 1) / 2;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	/*
+	 * If something like " a b c " appears here, the " a b":3 will be
+	 * converted, and the rest skipped. That is, unless buf_size is greater
+	 * than chunk_size, then it'll be equivalent to "ABC0".
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		switch(ch) {
+		case 0x09: case 0x0a: case 0x0c: case 0x0d:
+		case 0x20:
+			/* Ignore whitespace */
+			continue;
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/
+			clv = (clv << 4) + (ch - 0x30);
+			break;
+		case 0x41: case 0x42: case 0x43:	/* ABC */
+		case 0x44: case 0x45: case 0x46:	/* DEF */
+			clv = (clv << 4) + (ch - 0x41 + 10);
+			break;
+		case 0x61: case 0x62: case 0x63:	/* abc */
+		case 0x64: case 0x65: case 0x66:	/* def */
+			clv = (clv << 4) + (ch - 0x61 + 10);
+			break;
+		default:
+			*buf = 0;	/* JIC */
+			return -1;
+		}
+		if(half++) {
+			half = 0;
+			*buf++ = clv;
+			chunk_stop = p + 1;
+		}
+	}
+
+	/*
+	 * Check partial decoding.
+	 */
+	if(half) {
+		if(have_more) {
+			/*
+			 * Partial specification is fine,
+			 * because no more more PXER_TEXT data is available.
+			 */
+			*buf++ = clv << 4;
+			chunk_stop = p;
+		}
+	} else {
+		chunk_stop = p;
+	}
+
+	st->size = buf - st->buf;	/* Adjust the buffer size */
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return (chunk_stop - (const char *)chunk_buf);	/* Converted size */
+}
+
+/*
+ * Convert from binary format: "00101011101"
+ */
+static ssize_t OCTET_STRING__convert_binary(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) {
+	BIT_STRING_t *st = (BIT_STRING_t *)sptr;
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+	int bits_unused = st->bits_unused & 0x7;
+	uint8_t *buf;
+
+	/* Reallocate buffer according to high cap estimation */
+	size_t new_size = st->size + (chunk_size + 7) / 8;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	(void)have_more;
+
+	if(bits_unused == 0)
+		bits_unused = 8;
+	else if(st->size)
+		buf--;
+
+	/*
+	 * Convert series of 0 and 1 into the octet string.
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		switch(ch) {
+		case 0x09: case 0x0a: case 0x0c: case 0x0d:
+		case 0x20:
+			/* Ignore whitespace */
+			break;
+		case 0x30:
+		case 0x31:
+			if(bits_unused-- <= 0) {
+				*++buf = 0;	/* Clean the cell */
+				bits_unused = 7;
+			}
+			*buf |= (ch&1) << bits_unused;
+			break;
+		default:
+			st->bits_unused = bits_unused;
+			return -1;
+		}
+	}
+
+	if(bits_unused == 8) {
+		st->size = buf - st->buf;
+		st->bits_unused = 0;
+	} else {
+		st->size = buf - st->buf + 1;
+		st->bits_unused = bits_unused;
+	}
+
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return chunk_size;	/* Converted in full */
+}
+
+/*
+ * Something like strtod(), but with stricter rules.
+ */
+static int
+OS__strtoent(int base, const char *buf, const char *end, int32_t *ret_value) {
+	const int32_t last_unicode_codepoint = 0x10ffff;
+	int32_t val = 0;
+	const char *p;
+
+	for(p = buf; p < end; p++) {
+		int ch = *p;
+
+		switch(ch) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/
+			val = val * base + (ch - 0x30);
+			break;
+		case 0x41: case 0x42: case 0x43:	/* ABC */
+		case 0x44: case 0x45: case 0x46:	/* DEF */
+			val = val * base + (ch - 0x41 + 10);
+			break;
+		case 0x61: case 0x62: case 0x63:	/* abc */
+		case 0x64: case 0x65: case 0x66:	/* def */
+			val = val * base + (ch - 0x61 + 10);
+			break;
+		case 0x3b:	/* ';' */
+			*ret_value = val;
+			return (p - buf) + 1;
+		default:
+			return -1;	/* Character set error */
+		}
+
+		/* Value exceeds the Unicode range. */
+		if(val > last_unicode_codepoint) {
+			return -1;
+		}
+	}
+
+	*ret_value = -1;
+	return (p - buf);
+}
+
+/*
+ * Convert from the plain UTF-8 format, expanding entity references: "2 &lt; 3"
+ */
+static ssize_t
+OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf,
+                              size_t chunk_size, int have_more) {
+    OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+	uint8_t *buf;
+
+	/* Reallocate buffer */
+	size_t new_size = st->size + chunk_size;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	/*
+	 * Convert series of 0 and 1 into the octet string.
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		int len;	/* Length of the rest of the chunk */
+
+		if(ch != 0x26 /* '&' */) {
+			*buf++ = ch;
+			continue;	/* That was easy... */
+		}
+
+		/*
+		 * Process entity reference.
+		 */
+		len = chunk_size - (p - (const char *)chunk_buf);
+		if(len == 1 /* "&" */) goto want_more;
+		if(p[1] == 0x23 /* '#' */) {
+			const char *pval;	/* Pointer to start of digits */
+			int32_t val = 0;	/* Entity reference value */
+			int base;
+
+			if(len == 2 /* "&#" */) goto want_more;
+			if(p[2] == 0x78 /* 'x' */)
+				pval = p + 3, base = 16;
+			else
+				pval = p + 2, base = 10;
+			len = OS__strtoent(base, pval, p + len, &val);
+			if(len == -1) {
+				/* Invalid charset. Just copy verbatim. */
+				*buf++ = ch;
+				continue;
+			}
+			if(!len || pval[len-1] != 0x3b) goto want_more;
+			assert(val > 0);
+			p += (pval - p) + len - 1; /* Advance past entref */
+
+			if(val < 0x80) {
+				*buf++ = (char)val;
+			} else if(val < 0x800) {
+				*buf++ = 0xc0 | ((val >> 6));
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x10000) {
+				*buf++ = 0xe0 | ((val >> 12));
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x200000) {
+				*buf++ = 0xf0 | ((val >> 18));
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x4000000) {
+				*buf++ = 0xf8 | ((val >> 24));
+				*buf++ = 0x80 | ((val >> 18) & 0x3f);
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else {
+				*buf++ = 0xfc | ((val >> 30) & 0x1);
+				*buf++ = 0x80 | ((val >> 24) & 0x3f);
+				*buf++ = 0x80 | ((val >> 18) & 0x3f);
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			}
+		} else {
+			/*
+			 * Ugly, limited parsing of &amp; &gt; &lt;
+			 */
+			char *sc = (char *)memchr(p, 0x3b, len > 5 ? 5 : len);
+			if(!sc) goto want_more;
+			if((sc - p) == 4
+				&& p[1] == 0x61	/* 'a' */
+				&& p[2] == 0x6d	/* 'm' */
+				&& p[3] == 0x70	/* 'p' */) {
+				*buf++ = 0x26;
+				p = sc;
+				continue;
+			}
+			if((sc - p) == 3) {
+				if(p[1] == 0x6c) {
+					*buf = 0x3c;	/* '<' */
+				} else if(p[1] == 0x67) {
+					*buf = 0x3e;	/* '>' */
+				} else {
+					/* Unsupported entity reference */
+					*buf++ = ch;
+					continue;
+				}
+				if(p[2] != 0x74) {
+					/* Unsupported entity reference */
+					*buf++ = ch;
+					continue;
+				}
+				buf++;
+				p = sc;
+				continue;
+			}
+			/* Unsupported entity reference */
+			*buf++ = ch;
+		}
+
+		continue;
+	want_more:
+		if(have_more) {
+			/*
+			 * We know that no more data (of the same type)
+			 * is coming. Copy the rest verbatim.
+			 */
+			*buf++ = ch;
+			continue;
+		}
+		chunk_size = (p - (const char *)chunk_buf);
+		/* Processing stalled: need more data */
+		break;
+	}
+
+	st->size = buf - st->buf;
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return chunk_size;	/* Converted in full */
+}
+
+/*
+ * Decode OCTET STRING from the XML element's body.
+ */
+static asn_dec_rval_t
+OCTET_STRING__decode_xer(
+    const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td,
+    void **sptr, const char *opt_mname, const void *buf_ptr, size_t size,
+    int (*opt_unexpected_tag_decoder)(void *struct_ptr, const void *chunk_buf,
+                                      size_t chunk_size),
+    ssize_t (*body_receiver)(void *struct_ptr, const void *chunk_buf,
+                             size_t chunk_size, int have_more)) {
+    OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+	asn_struct_ctx_t *ctx;		/* Per-structure parser context */
+	asn_dec_rval_t rval;		/* Return value from the decoder */
+	int st_allocated;
+
+	/*
+	 * Create the string if does not exist.
+	 */
+	if(!st) {
+		st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
+		*sptr = (void *)st;
+		if(!st) goto sta_failed;
+		st_allocated = 1;
+	} else {
+		st_allocated = 0;
+	}
+	if(!st->buf) {
+		/* This is separate from above section */
+		st->buf = (uint8_t *)CALLOC(1, 1);
+		if(!st->buf) {
+			if(st_allocated) {
+				*sptr = 0;
+				goto stb_failed;
+			} else {
+				goto sta_failed;
+			}
+		}
+	}
+
+	/* Restore parsing context */
+	ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset);
+
+	return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag,
+		buf_ptr, size, opt_unexpected_tag_decoder, body_receiver);
+
+stb_failed:
+	FREEMEM(st);
+sta_failed:
+	rval.code = RC_FAIL;
+	rval.consumed = 0;
+	return rval;
+}
+
+/*
+ * Decode OCTET STRING from the hexadecimal data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_hex(const asn_codec_ctx_t *opt_codec_ctx,
+                            const asn_TYPE_descriptor_t *td, void **sptr,
+                            const char *opt_mname, const void *buf_ptr,
+                            size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size, 0, OCTET_STRING__convert_hexadecimal);
+}
+
+/*
+ * Decode OCTET STRING from the binary (0/1) data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_binary(const asn_codec_ctx_t *opt_codec_ctx,
+                               const asn_TYPE_descriptor_t *td, void **sptr,
+                               const char *opt_mname, const void *buf_ptr,
+                               size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size, 0, OCTET_STRING__convert_binary);
+}
+
+/*
+ * Decode OCTET STRING from the string (ASCII/UTF-8) data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_utf8(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td, void **sptr,
+                             const char *opt_mname, const void *buf_ptr,
+                             size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size,
+		OCTET_STRING__handle_control_chars,
+		OCTET_STRING__convert_entrefs);
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+static int
+OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf,
+		size_t units, unsigned int bpc, unsigned int unit_bits,
+		long lb, long ub, const asn_per_constraints_t *pc) {
+	uint8_t *end = buf + units * bpc;
+
+	ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d",
+		(int)units, lb, ub, unit_bits);
+
+	/* X.691: 27.5.4 */
+	if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) {
+		/* Decode without translation */
+		lb = 0;
+	} else if(pc && pc->code2value) {
+		if(unit_bits > 16)
+			return 1;	/* FATAL: can't have constrained
+					 * UniversalString with more than
+					 * 16 million code points */
+		for(; buf < end; buf += bpc) {
+			int value;
+			int code = per_get_few_bits(po, unit_bits);
+			if(code < 0) return -1;	/* WMORE */
+			value = pc->code2value(code);
+			if(value < 0) {
+				ASN_DEBUG("Code %d (0x%02x) is"
+					" not in map (%ld..%ld)",
+					code, code, lb, ub);
+				return 1;	/* FATAL */
+			}
+			switch(bpc) {
+			case 1: *buf = value; break;
+			case 2: buf[0] = value >> 8; buf[1] = value; break;
+			case 4: buf[0] = value >> 24; buf[1] = value >> 16;
+				buf[2] = value >> 8; buf[3] = value; break;
+			}
+		}
+		return 0;
+	}
+
+	/* Shortcut the no-op copying to the aligned structure */
+	if(lb == 0 && (unit_bits == 8 * bpc)) {
+		return per_get_many_bits(po, buf, 0, unit_bits * units);
+	}
+
+	for(; buf < end; buf += bpc) {
+		int32_t code = per_get_few_bits(po, unit_bits);
+		int32_t ch = code + lb;
+		if(code < 0) return -1;	/* WMORE */
+		if(ch > ub) {
+			ASN_DEBUG("Code %d is out of range (%ld..%ld)",
+				ch, lb, ub);
+			return 1;	/* FATAL */
+		}
+		switch(bpc) {
+		case 1: *buf = ch; break;
+		case 2: buf[0] = ch >> 8; buf[1] = ch; break;
+		case 4: buf[0] = ch >> 24; buf[1] = ch >> 16;
+			buf[2] = ch >> 8; buf[3] = ch; break;
+		}
+	}
+
+	return 0;
+}
+
+static int
+OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
+		size_t units, unsigned int bpc, unsigned int unit_bits,
+		long lb, long ub, const asn_per_constraints_t *pc) {
+	const uint8_t *end = buf + units * bpc;
+
+	ASN_DEBUG("Squeezing %d characters into (%ld..%ld):%d (%d bpc)",
+		(int)units, lb, ub, unit_bits, bpc);
+
+	/* X.691: 27.5.4 */
+	if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) {
+		/* Encode as is */
+		lb = 0;
+	} else if(pc && pc->value2code) {
+		for(; buf < end; buf += bpc) {
+			int code;
+			uint32_t value;
+			switch(bpc) {
+			case 1: value = *(const uint8_t *)buf; break;
+			case 2: value = (buf[0] << 8) | buf[1]; break;
+			case 4: value = (buf[0] << 24) | (buf[1] << 16)
+					| (buf[2] << 8) | buf[3]; break;
+			default: return -1;
+			}
+			code = pc->value2code(value);
+			if(code < 0) {
+				ASN_DEBUG("Character %d (0x%02x) is"
+					" not in map (%ld..%ld)",
+					*buf, *buf, lb, ub);
+				return -1;
+			}
+			if(per_put_few_bits(po, code, unit_bits))
+				return -1;
+		}
+	}
+
+	/* Shortcut the no-op copying to the aligned structure */
+	if(lb == 0 && (unit_bits == 8 * bpc)) {
+		return per_put_many_bits(po, buf, unit_bits * units);
+	}
+
+    for(ub -= lb; buf < end; buf += bpc) {
+        int ch;
+        uint32_t value;
+        switch(bpc) {
+        case 1:
+            value = *(const uint8_t *)buf;
+            break;
+        case 2:
+            value = (buf[0] << 8) | buf[1];
+            break;
+        case 4:
+            value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+            break;
+        default:
+            return -1;
+        }
+        ch = value - lb;
+        if(ch < 0 || ch > ub) {
+            ASN_DEBUG("Character %d (0x%02x) is out of range (%ld..%ld)", *buf,
+                      value, lb, ub + lb);
+            return -1;
+        }
+        if(per_put_few_bits(po, ch, unit_bits)) return -1;
+    }
+
+    return 0;
+}
+
+static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = {
+	{ APC_CONSTRAINED, 8, 8, 0, 255 },
+	{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 },
+	0, 0
+};
+
+asn_dec_rval_t
+OCTET_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints, void **sptr,
+                         asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+    const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+	enum {
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+
+	switch(specs->subvariant) {
+	default:
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_BIT:
+		ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
+		RETURN(RC_FAIL);
+		break;
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_CHAR;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		break;
+	}
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_OCTET_STRING_constraints.size;
+			unit_bits = canonical_unit_bits;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+		if(bpc) {
+			st->size = csiz->upper_bound * bpc;
+		} else {
+			st->size = (csiz->upper_bound + 7) >> 3;
+		}
+		st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+		if(bpc) {
+			ASN_DEBUG("Encoding OCTET STRING size %ld",
+				csiz->upper_bound);
+			ret = OCTET_STRING_per_get_characters(pd, st->buf,
+				csiz->upper_bound, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ASN_DEBUG("Encoding BIT STRING size %ld",
+				csiz->upper_bound);
+			ret = per_get_many_bits(pd, st->buf, 0,
+					    unit_bits * csiz->upper_bound);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += unit_bits * csiz->upper_bound;
+		st->buf[st->size] = 0;
+		RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
+		                          &repeat);
+		if(raw_len < 0) RETURN(RC_WMORE);
+		if(raw_len == 0 && st->buf) break;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+        len_bytes = raw_len * bpc;
+		p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+        ret = OCTET_STRING_per_get_characters(pd, &st->buf[st->size], raw_len,
+                                              bpc, unit_bits, cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret > 0) RETURN(RC_FAIL);
+		if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         const void *sptr, asn_per_outp_t *po) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+				: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;		/* Lies not within extension root */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+	size_t size_in_units;
+	const uint8_t *buf;
+	int ret;
+	enum {
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+	switch(specs->subvariant) {
+	default:
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_BIT:
+		ASN__ENCODE_FAILED;
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_CHAR;
+		size_in_units = st->size;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		size_in_units = st->size >> 1;
+		if(st->size & 1) {
+			ASN_DEBUG("%s string size is not modulo 2", td->name);
+			ASN__ENCODE_FAILED;
+		}
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		size_in_units = st->size >> 2;
+		if(st->size & 3) {
+			ASN_DEBUG("%s string size is not modulo 4", td->name);
+			ASN__ENCODE_FAILED;
+		}
+		break;
+	}
+
+	ASN_DEBUG("Encoding %s into %" ASN_PRI_SIZE " units of %d bits"
+		" (%ld..%ld, effective %d)%s",
+		td->name, size_in_units, unit_bits,
+		csiz->lower_bound, csiz->upper_bound,
+		csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+	/* Figure out whether size lies within PER visible constraint */
+
+    if(csiz->effective_bits >= 0) {
+        if((ssize_t)size_in_units < csiz->lower_bound
+           || (ssize_t)size_in_units > csiz->upper_bound) {
+            if(ct_extensible) {
+                csiz = &asn_DEF_OCTET_STRING_constraints.size;
+                unit_bits = canonical_unit_bits;
+                inext = 1;
+            } else {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    } else {
+        inext = 0;
+    }
+
+    if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+    if(csiz->effective_bits >= 0 && !inext) {
+        ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes (%ld), length in %d bits", st->size,
+                  size_in_units - csiz->lower_bound, csiz->effective_bits);
+        ret = per_put_few_bits(po, size_in_units - csiz->lower_bound,
+                               csiz->effective_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        ret = OCTET_STRING_per_put_characters(po, st->buf, size_in_units, bpc,
+                                              unit_bits, cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret) ASN__ENCODE_FAILED;
+        ASN__ENCODED_OK(er);
+    }
+
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
+
+    buf = st->buf;
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " in units", size_in_units);
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size_in_units, &need_eom);
+        if(may_save < 0) ASN__ENCODE_FAILED;
+
+        ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "%s", may_save, size_in_units,
+                  need_eom ? ",+EOM" : "");
+
+        ret = OCTET_STRING_per_put_characters(po, buf, may_save, bpc, unit_bits,
+                                              cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += may_save * bpc;
+        size_in_units -= may_save;
+        assert(!(may_save & 0x07) || !size_in_units);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size_in_units);
+
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         void **sptr, asn_per_data_t *pd) {
+
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+				: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+	enum {
+		OS__BPC_BIT	= 0,
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+
+	switch(specs->subvariant) {
+	default:
+/* 	case ASN_OSUBV_ANY:
+		ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
+		RETURN(RC_FAIL);
+*/
+	case ASN_OSUBV_BIT:
+		canonical_unit_bits = unit_bits = 1;
+		bpc = OS__BPC_BIT;
+		break;
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+/* 		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+*/
+		bpc = OS__BPC_CHAR;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		break;
+	}
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_OCTET_STRING_constraints.size;
+			cval = &asn_DEF_OCTET_STRING_constraints.value;
+			unit_bits = canonical_unit_bits;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+		if(bpc) {
+			st->size = csiz->upper_bound * bpc;
+		} else {
+			st->size = (csiz->upper_bound + 7) >> 3;
+		}
+		st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+		if (st->size > 2) { /* X.691 #16 NOTE 1 */
+			if (aper_get_align(pd) < 0)
+				RETURN(RC_FAIL);
+		}
+		if(bpc) {
+			ASN_DEBUG("Decoding OCTET STRING size %ld",
+				csiz->upper_bound);
+			ret = OCTET_STRING_per_get_characters(pd, st->buf,
+				csiz->upper_bound, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ASN_DEBUG("Decoding BIT STRING size %ld",
+				csiz->upper_bound);
+			ret = per_get_many_bits(pd, st->buf, 0,
+					    unit_bits * csiz->upper_bound);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += unit_bits * csiz->upper_bound;
+		st->buf[st->size] = 0;
+		if(bpc == 0) {
+			int ubs = (csiz->upper_bound & 0x7);
+			st->bits_unused = ubs ? 8 - ubs : 0;
+		}
+		RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		ssize_t len_bits;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		if (csiz->upper_bound - csiz->lower_bound == 0)
+			/* Indefinite length case */
+			raw_len = aper_get_length(pd, -1, csiz->effective_bits, &repeat);
+		else
+			raw_len = aper_get_length(pd, csiz->upper_bound - csiz->lower_bound + 1, csiz->effective_bits, &repeat);
+		repeat = 0;
+		if(raw_len < 0) RETURN(RC_WMORE);
+		raw_len += csiz->lower_bound;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+
+		if (raw_len > 2) { /* X.691 #16 NOTE 1 */
+			if (aper_get_align(pd) < 0)
+				RETURN(RC_FAIL);
+		}
+
+		if(bpc) {
+			len_bytes = raw_len * bpc;
+			len_bits = len_bytes * unit_bits;
+		} else {
+			len_bits = raw_len;
+			len_bytes = (len_bits + 7) >> 3;
+			if(len_bits & 0x7)
+				st->bits_unused = 8 - (len_bits & 0x7);
+			/* len_bits be multiple of 16K if repeat is set */
+		}
+		p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+		if(bpc) {
+			ret = OCTET_STRING_per_get_characters(pd,
+				&st->buf[st->size], raw_len, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ret = per_get_many_bits(pd, &st->buf[st->size],
+				0, len_bits);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         const void *sptr, asn_per_outp_t *po) {
+
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+	: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;          /* Lies not within extension root */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+	unsigned int sizeinunits;
+	const uint8_t *buf;
+	int ret;
+	enum {
+		OS__BPC_BIT     = 0,
+		OS__BPC_CHAR    = 1,
+		OS__BPC_U16     = 2,
+		OS__BPC_U32     = 4
+	} bpc;  /* Bytes per character */
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+	switch(specs->subvariant) {
+		default:
+			/*         case ASN_OSUBV_ANY:
+			                 ASN__ENCODE_FAILED;
+			*/
+		case ASN_OSUBV_BIT:
+			canonical_unit_bits = unit_bits = 1;
+			bpc = OS__BPC_BIT;
+			sizeinunits = st->size * 8 - (st->bits_unused & 0x07);
+			ASN_DEBUG("BIT STRING of %d bytes",
+								sizeinunits);
+		break;
+        case ASN_OSUBV_ANY:
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+/* 		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = 8;
+*/
+		bpc = OS__BPC_CHAR;
+		sizeinunits = st->size;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		sizeinunits = st->size / 2;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		sizeinunits = st->size / 4;
+		break;
+	}
+
+	ASN_DEBUG("Encoding %s into %d units of %d bits"
+		" (%ld..%ld, effective %d)%s",
+		td->name, sizeinunits, unit_bits,
+		csiz->lower_bound, csiz->upper_bound,
+		csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+	/* Figure out wheter size lies within PER visible constraint */
+
+	if(csiz->effective_bits >= 0) {
+		if((int)sizeinunits < csiz->lower_bound
+		|| (int)sizeinunits > csiz->upper_bound) {
+			if(ct_extensible) {
+				cval = &asn_DEF_OCTET_STRING_constraints.value;
+				csiz = &asn_DEF_OCTET_STRING_constraints.size;
+				unit_bits = canonical_unit_bits;
+				inext = 1;
+			} else
+				ASN__ENCODE_FAILED;
+		}
+	} else {
+		inext = 0;
+	}
+
+
+	if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits >= 0) {
+		ASN_DEBUG("Encoding %lu bytes (%ld), length in %d bits",
+				st->size, sizeinunits - csiz->lower_bound,
+				csiz->effective_bits);
+		if (csiz->effective_bits > 0) {
+		        ret = aper_put_length(po, csiz->upper_bound - csiz->lower_bound + 1, sizeinunits - csiz->lower_bound);
+		        if(ret) ASN__ENCODE_FAILED;
+		}
+		/* EB MOD
+                   AFAIU if lb != ub it is aligned whatever the number of bits */
+		if ((st->size > 2) || (csiz->lower_bound != csiz->upper_bound)) { /* X.691 #16.11 */
+			if (aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+		}
+		if(bpc) {
+			ret = OCTET_STRING_per_put_characters(po, st->buf,
+				sizeinunits, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+		} else {
+			ret = per_put_many_bits(po, st->buf,
+				sizeinunits * unit_bits);
+		}
+		if(ret) ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	ASN_DEBUG("Encoding %lu bytes", st->size);
+
+	if(sizeinunits == 0) {
+		if(aper_put_length(po, -1, 0))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	buf = st->buf;
+	while(sizeinunits) {
+		ssize_t maySave = aper_put_length(po, -1, sizeinunits);
+
+		if(maySave < 0) ASN__ENCODE_FAILED;
+
+		ASN_DEBUG("Encoding %ld of %ld",
+			(long)maySave, (long)sizeinunits);
+
+		if(bpc) {
+			ret = OCTET_STRING_per_put_characters(po, buf,
+				maySave, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+		} else {
+			ret = per_put_many_bits(po, buf, maySave * unit_bits);
+		}
+		if(ret) ASN__ENCODE_FAILED;
+
+		if(bpc)
+			buf += maySave * bpc;
+		else
+			buf += maySave >> 3;
+		sizeinunits -= maySave;
+		assert(!(maySave & 0x07) || !sizeinunits);
+	}
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+OCTET_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	char scratch[16 * 3 + 4];
+	char *p = scratch;
+	uint8_t *buf;
+	uint8_t *end;
+	size_t i;
+
+	(void)td;	/* Unused argument */
+
+	if(!st || (!st->buf && st->size))
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/*
+	 * Dump the contents of the buffer in hexadecimal.
+	 */
+	buf = st->buf;
+	end = buf + st->size;
+	for(i = 0; buf < end; buf++, i++) {
+		if(!(i % 16) && (i || st->size > 16)) {
+			if(cb(scratch, p - scratch, app_key) < 0)
+				return -1;
+			_i_INDENT(1);
+			p = scratch;
+		}
+		*p++ = h2c[(*buf >> 4) & 0x0F];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x20;
+	}
+
+	if(p > scratch) {
+		p--;	/* Remove the tail space */
+		if(cb(scratch, p - scratch, app_key) < 0)
+			return -1;
+	}
+
+	return 0;
+}
+
+int
+OCTET_STRING_print_utf8(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int ilevel, asn_app_consume_bytes_f *cb,
+                        void *app_key) {
+    const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+
+	(void)td;	/* Unused argument */
+	(void)ilevel;	/* Unused argument */
+
+	if(st && (st->buf || !st->size)) {
+		return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0;
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
+                  enum asn_struct_free_method method) {
+	OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const asn_OCTET_STRING_specifics_t *specs;
+	asn_struct_ctx_t *ctx;
+	struct _stack *stck;
+
+	if(!td || !st)
+		return;
+
+	specs = td->specifics
+		    ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		    : &asn_SPC_OCTET_STRING_specs;
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	ASN_DEBUG("Freeing %s as OCTET STRING", td->name);
+
+	if(st->buf) {
+		FREEMEM(st->buf);
+		st->buf = 0;
+	}
+
+	/*
+	 * Remove decode-time stack.
+	 */
+	stck = (struct _stack *)ctx->ptr;
+	if(stck) {
+		while(stck->tail) {
+			struct _stack_el *sel = stck->tail;
+			stck->tail = sel->prev;
+			FREEMEM(sel);
+		}
+		FREEMEM(stck);
+	}
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(sptr, 0,
+               td->specifics
+                   ? ((const asn_OCTET_STRING_specifics_t *)(td->specifics))
+                         ->struct_size
+                   : sizeof(OCTET_STRING_t));
+        break;
+    }
+}
+
+/*
+ * Conversion routines.
+ */
+int
+OCTET_STRING_fromBuf(OCTET_STRING_t *st, const char *str, int len) {
+	void *buf;
+
+	if(st == 0 || (str == 0 && len)) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	/*
+	 * Clear the OCTET STRING.
+	 */
+	if(str == NULL) {
+		FREEMEM(st->buf);
+		st->buf = 0;
+		st->size = 0;
+		return 0;
+	}
+
+	/* Determine the original string size, if not explicitly given */
+	if(len < 0)
+		len = strlen(str);
+
+	/* Allocate and fill the memory */
+	buf = MALLOC(len + 1);
+	if(buf == NULL)
+		return -1;
+
+	memcpy(buf, str, len);
+	((uint8_t *)buf)[len] = '\0';	/* Couldn't use memcpy(len+1)! */
+	FREEMEM(st->buf);
+	st->buf = (uint8_t *)buf;
+	st->size = len;
+
+	return 0;
+}
+
+OCTET_STRING_t *
+OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td, const char *str,
+                         int len) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    OCTET_STRING_t *st;
+
+	st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
+	if(st && str && OCTET_STRING_fromBuf(st, str, len)) {
+		FREEMEM(st);
+		st = NULL;
+	}
+
+	return st;
+}
+
+/*
+ * Lexicographically compare the common prefix of both strings,
+ * and if it is the same return -1 for the smallest string.
+ */
+int
+OCTET_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                     const void *bptr) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics;
+    const OCTET_STRING_t *a = aptr;
+    const OCTET_STRING_t *b = bptr;
+
+    assert(!specs || specs->subvariant != ASN_OSUBV_BIT);
+
+    if(a && b) {
+        size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
+        int ret = memcmp(a->buf, b->buf, common_prefix_size);
+        if(ret == 0) {
+            /* Figure out which string with equal prefixes is longer. */
+            if(a->size < b->size) {
+                return -1;
+            } else if(a->size > b->size) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            return ret < 0 ? -1 : 1;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+
+}
+
+/*
+ * Biased function for randomizing character values around their limits.
+ */
+static uint32_t
+OCTET_STRING__random_char(unsigned long lb, unsigned long ub) {
+    assert(lb <= ub);
+    switch(asn_random_between(0, 16)) {
+    case 0:
+        if(lb < ub) return lb + 1;
+        /* Fall through */
+    case 1:
+        return lb;
+    case 2:
+        if(lb < ub) return ub - 1;
+        /* Fall through */
+    case 3:
+        return ub;
+    default:
+        return asn_random_between(lb, ub);
+    }
+}
+
+
+size_t
+OCTET_STRING_random_length_constrained(
+    const asn_TYPE_descriptor_t *td,
+    const asn_encoding_constraints_t *constraints, size_t max_length) {
+    const unsigned lengths[] = {0,     1,     2,     3,     4,     8,
+                                126,   127,   128,   16383, 16384, 16385,
+                                65534, 65535, 65536, 65537};
+    size_t rnd_len;
+
+    /* Figure out how far we should go */
+    rnd_len = lengths[asn_random_between(
+        0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_CONSTRAINED) {
+            long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
+                                             ? pc->upper_bound
+                                             : (ssize_t)max_length;
+            if(max_length <= (size_t)pc->lower_bound) {
+                return pc->lower_bound;
+            }
+            if(pc->flags & APC_EXTENSIBLE) {
+                switch(asn_random_between(0, 5)) {
+                case 0:
+                    if(pc->lower_bound > 0) {
+                        rnd_len = pc->lower_bound - 1;
+                        break;
+                    }
+                    /* Fall through */
+                case 1:
+                    rnd_len = pc->upper_bound + 1;
+                    break;
+                case 2:
+                    /* Keep rnd_len from the table */
+                    if(rnd_len <= max_length) {
+                        break;
+                    }
+                    /* Fall through */
+                default:
+                    rnd_len = asn_random_between(pc->lower_bound,
+                                                 suggested_upper_bound);
+                }
+            } else {
+                rnd_len =
+                    asn_random_between(pc->lower_bound, suggested_upper_bound);
+            }
+        } else {
+            rnd_len = asn_random_between(0, max_length);
+        }
+    } else if(rnd_len > max_length) {
+        rnd_len = asn_random_between(0, max_length);
+    }
+
+    return rnd_len;
+}
+
+asn_random_fill_result_t
+OCTET_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                         const asn_encoding_constraints_t *constraints,
+                         size_t max_length) {
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    unsigned int unit_bytes = 1;
+    unsigned long clb = 0;  /* Lower bound on char */
+    unsigned long cub = 255;  /* Higher bound on char value */
+    uint8_t *buf;
+    uint8_t *bend;
+    uint8_t *b;
+    size_t rnd_len;
+    OCTET_STRING_t *st;
+
+    if(max_length == 0 && !*sptr) return result_skipped;
+
+    switch(specs->subvariant) {
+    default:
+    case ASN_OSUBV_ANY:
+        return result_failed;
+    case ASN_OSUBV_BIT:
+        /* Handled by BIT_STRING itself. */
+        return result_failed;
+    case ASN_OSUBV_STR:
+        unit_bytes = 1;
+        clb = 0;
+        cub = 255;
+        break;
+    case ASN_OSUBV_U16:
+        unit_bytes = 2;
+        clb = 0;
+        cub = 65535;
+        break;
+    case ASN_OSUBV_U32:
+        unit_bytes = 4;
+        clb = 0;
+        cub = 0x10FFFF;
+        break;
+    }
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->value;
+        if(pc->flags & APC_SEMI_CONSTRAINED) {
+            clb = pc->lower_bound;
+        } else if(pc->flags & APC_CONSTRAINED) {
+            clb = pc->lower_bound;
+            cub = pc->upper_bound;
+        }
+    }
+
+    rnd_len =
+        OCTET_STRING_random_length_constrained(td, constraints, max_length);
+
+    buf = CALLOC(unit_bytes, rnd_len + 1);
+    if(!buf) return result_failed;
+
+    bend = &buf[unit_bytes * rnd_len];
+
+    switch(unit_bytes) {
+    case 1:
+        for(b = buf; b < bend; b += unit_bytes) {
+            *(uint8_t *)b = OCTET_STRING__random_char(clb, cub);
+        }
+        *(uint8_t *)b = 0;
+        break;
+    case 2:
+        for(b = buf; b < bend; b += unit_bytes) {
+            uint32_t code = OCTET_STRING__random_char(clb, cub);
+            b[0] = code >> 8;
+            b[1] = code;
+        }
+        *(uint16_t *)b = 0;
+        break;
+    case 4:
+        for(b = buf; b < bend; b += unit_bytes) {
+            uint32_t code = OCTET_STRING__random_char(clb, cub);
+            b[0] = code >> 24;
+            b[1] = code >> 16;
+            b[2] = code >> 8;
+            b[3] = code;
+        }
+        *(uint32_t *)b = 0;
+        break;
+    }
+
+    if(*sptr) {
+        st = *sptr;
+        FREEMEM(st->buf);
+    } else {
+        st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) {
+            FREEMEM(buf);
+            return result_failed;
+        }
+    }
+
+    st->buf = buf;
+    st->size = unit_bytes * rnd_len;
+
+    result_ok.length = st->size;
+    return result_ok;
+}
diff --git a/e2sm/lib/OCTET_STRING_oer.c b/e2sm/lib/OCTET_STRING_oer.c
new file mode 100644
index 0000000..c16faea
--- /dev/null
+++ b/e2sm/lib/OCTET_STRING_oer.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <OCTET_STRING.h>
+#include <errno.h>
+
+asn_dec_rval_t
+OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                        const asn_TYPE_descriptor_t *td,
+                        const asn_oer_constraints_t *constraints, void **sptr,
+                        const void *ptr, size_t size) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+
+    size_t unit_bytes;
+    switch(specs->subvariant) {
+    default:
+    case ASN_OSUBV_BIT:
+        ASN_DEBUG("Invalid use of OCTET STRING to decode BIT STRING");
+        ASN__DECODE_FAILED;
+    case ASN_OSUBV_ANY:
+        /* Fall through */
+    case ASN_OSUBV_STR:
+        unit_bytes = 1;
+        break;
+    case ASN_OSUBV_U16:
+        unit_bytes = 2;
+        break;
+    case ASN_OSUBV_U32:
+        unit_bytes = 4;
+        break;
+    }
+
+    (void)opt_codec_ctx;
+
+    if(!st) {
+        st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        expected_length = unit_bytes * ct_size;
+    } else {
+        /*
+         * X.696 (08/2015) #27.2
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
+        if(len_len > 0) {
+            rval.consumed = len_len;
+            ptr = (const char *)ptr + len_len;
+            size -= len_len;
+        } else if(len_len == 0) {
+            ASN__DECODE_STARVED;
+        } else if(len_len < 0) {
+            ASN__DECODE_FAILED;
+        }
+
+        if(expected_length % unit_bytes != 0) {
+            ASN_DEBUG(
+                "Data size %" ASN_PRI_SIZE " bytes is not consistent with multiplier %" ASN_PRI_SIZE "",
+                expected_length, unit_bytes);
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+OCTET_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
+                        const asn_oer_constraints_t *constraints,
+                        const void *sptr, asn_app_consume_bytes_f *cb,
+                        void *app_key) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_enc_rval_t er = {0, 0, 0};
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("Encoding %s %" ASN_PRI_SIZE " as OCTET STRING", td ? td->name : "", st->size);
+
+    if(ct_size >= 0) {
+        /*
+         * Check that available data matches the constraint
+         */
+        size_t unit_bytes;
+        switch(specs->subvariant) {
+        default:
+        case ASN_OSUBV_BIT:
+            ASN_DEBUG("Invalid use of OCTET STRING to encode BIT STRING");
+            ASN__ENCODE_FAILED;
+        case ASN_OSUBV_ANY:
+            /* Fall through */
+        case ASN_OSUBV_STR:
+            unit_bytes = 1;
+            break;
+        case ASN_OSUBV_U16:
+            unit_bytes = 2;
+            break;
+        case ASN_OSUBV_U32:
+            unit_bytes = 4;
+            break;
+        }
+
+        if(st->size != unit_bytes * (size_t)ct_size) {
+            ASN_DEBUG(
+                "Trying to encode %s (%" ASN_PRI_SIZE " bytes) which doesn't fit SIZE "
+                "constraint (%" ASN_PRI_SIZE ")",
+                td->name, st->size, ct_size);
+            ASN__ENCODE_FAILED;
+        }
+    } else {
+        /*
+         * X.696 (08/2015) #27.2
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t ret = oer_serialize_length(st->size, cb, app_key);
+        if(ret < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        er.encoded += ret;
+    }
+
+    er.encoded += st->size;
+    if(cb(st->buf, st->size, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/OCUCP-PF-Container.c b/e2sm/lib/OCUCP-PF-Container.c
new file mode 100644
index 0000000..8788478
--- /dev/null
+++ b/e2sm/lib/OCUCP-PF-Container.c
@@ -0,0 +1,128 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "OCUCP-PF-Container.h"
+
+static int
+memb_numberOfActive_UEs_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 1 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_numberOfActive_UEs_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_numberOfActive_UEs_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  16,  16,  1,  65535 }	/* (1..65535,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_cu_CP_Resource_Status_2[] = {
+	{ ATF_POINTER, 1, offsetof(struct OCUCP_PF_Container__cu_CP_Resource_Status, numberOfActive_UEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_numberOfActive_UEs_constr_3, &asn_PER_memb_numberOfActive_UEs_constr_3,  memb_numberOfActive_UEs_constraint_2 },
+		0, 0, /* No default value */
+		"numberOfActive-UEs"
+		},
+};
+static const int asn_MAP_cu_CP_Resource_Status_oms_2[] = { 0 };
+static const ber_tlv_tag_t asn_DEF_cu_CP_Resource_Status_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_cu_CP_Resource_Status_tag2el_2[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* numberOfActive-UEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_cu_CP_Resource_Status_specs_2 = {
+	sizeof(struct OCUCP_PF_Container__cu_CP_Resource_Status),
+	offsetof(struct OCUCP_PF_Container__cu_CP_Resource_Status, _asn_ctx),
+	asn_MAP_cu_CP_Resource_Status_tag2el_2,
+	1,	/* Count of tags in the map */
+	asn_MAP_cu_CP_Resource_Status_oms_2,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	-1,	/* First extension addition */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_cu_CP_Resource_Status_2 = {
+	"cu-CP-Resource-Status",
+	"cu-CP-Resource-Status",
+	&asn_OP_SEQUENCE,
+	asn_DEF_cu_CP_Resource_Status_tags_2,
+	sizeof(asn_DEF_cu_CP_Resource_Status_tags_2)
+		/sizeof(asn_DEF_cu_CP_Resource_Status_tags_2[0]) - 1, /* 1 */
+	asn_DEF_cu_CP_Resource_Status_tags_2,	/* Same as above */
+	sizeof(asn_DEF_cu_CP_Resource_Status_tags_2)
+		/sizeof(asn_DEF_cu_CP_Resource_Status_tags_2[0]), /* 2 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_cu_CP_Resource_Status_2,
+	1,	/* Elements count */
+	&asn_SPC_cu_CP_Resource_Status_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_OCUCP_PF_Container_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct OCUCP_PF_Container, cu_CP_Resource_Status),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_cu_CP_Resource_Status_2,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cu-CP-Resource-Status"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_OCUCP_PF_Container_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_OCUCP_PF_Container_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* cu-CP-Resource-Status */
+};
+asn_SEQUENCE_specifics_t asn_SPC_OCUCP_PF_Container_specs_1 = {
+	sizeof(struct OCUCP_PF_Container),
+	offsetof(struct OCUCP_PF_Container, _asn_ctx),
+	asn_MAP_OCUCP_PF_Container_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_OCUCP_PF_Container = {
+	"OCUCP-PF-Container",
+	"OCUCP-PF-Container",
+	&asn_OP_SEQUENCE,
+	asn_DEF_OCUCP_PF_Container_tags_1,
+	sizeof(asn_DEF_OCUCP_PF_Container_tags_1)
+		/sizeof(asn_DEF_OCUCP_PF_Container_tags_1[0]), /* 1 */
+	asn_DEF_OCUCP_PF_Container_tags_1,	/* Same as above */
+	sizeof(asn_DEF_OCUCP_PF_Container_tags_1)
+		/sizeof(asn_DEF_OCUCP_PF_Container_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_OCUCP_PF_Container_1,
+	1,	/* Elements count */
+	&asn_SPC_OCUCP_PF_Container_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/OCUUP-PF-Container.c b/e2sm/lib/OCUUP-PF-Container.c
new file mode 100644
index 0000000..8ccc575
--- /dev/null
+++ b/e2sm/lib/OCUUP-PF-Container.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "OCUUP-PF-Container.h"
+
+#include "PF-ContainerListItem.h"
+static int
+memb_pf_ContainerList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 3)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_pf_ContainerList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..3)) */};
+static asn_per_constraints_t asn_PER_type_pf_ContainerList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 2,  2,  1,  3 }	/* (SIZE(1..3)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_pf_ContainerList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..3)) */};
+static asn_per_constraints_t asn_PER_memb_pf_ContainerList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 2,  2,  1,  3 }	/* (SIZE(1..3)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_pf_ContainerList_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PF_ContainerListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_pf_ContainerList_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_pf_ContainerList_specs_2 = {
+	sizeof(struct OCUUP_PF_Container__pf_ContainerList),
+	offsetof(struct OCUUP_PF_Container__pf_ContainerList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_pf_ContainerList_2 = {
+	"pf-ContainerList",
+	"pf-ContainerList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_pf_ContainerList_tags_2,
+	sizeof(asn_DEF_pf_ContainerList_tags_2)
+		/sizeof(asn_DEF_pf_ContainerList_tags_2[0]) - 1, /* 1 */
+	asn_DEF_pf_ContainerList_tags_2,	/* Same as above */
+	sizeof(asn_DEF_pf_ContainerList_tags_2)
+		/sizeof(asn_DEF_pf_ContainerList_tags_2[0]), /* 2 */
+	{ &asn_OER_type_pf_ContainerList_constr_2, &asn_PER_type_pf_ContainerList_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_pf_ContainerList_2,
+	1,	/* Single element */
+	&asn_SPC_pf_ContainerList_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_OCUUP_PF_Container_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct OCUUP_PF_Container, pf_ContainerList),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_pf_ContainerList_2,
+		0,
+		{ &asn_OER_memb_pf_ContainerList_constr_2, &asn_PER_memb_pf_ContainerList_constr_2,  memb_pf_ContainerList_constraint_1 },
+		0, 0, /* No default value */
+		"pf-ContainerList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_OCUUP_PF_Container_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_OCUUP_PF_Container_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* pf-ContainerList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_OCUUP_PF_Container_specs_1 = {
+	sizeof(struct OCUUP_PF_Container),
+	offsetof(struct OCUUP_PF_Container, _asn_ctx),
+	asn_MAP_OCUUP_PF_Container_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_OCUUP_PF_Container = {
+	"OCUUP-PF-Container",
+	"OCUUP-PF-Container",
+	&asn_OP_SEQUENCE,
+	asn_DEF_OCUUP_PF_Container_tags_1,
+	sizeof(asn_DEF_OCUUP_PF_Container_tags_1)
+		/sizeof(asn_DEF_OCUUP_PF_Container_tags_1[0]), /* 1 */
+	asn_DEF_OCUUP_PF_Container_tags_1,	/* Same as above */
+	sizeof(asn_DEF_OCUUP_PF_Container_tags_1)
+		/sizeof(asn_DEF_OCUUP_PF_Container_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_OCUUP_PF_Container_1,
+	1,	/* Elements count */
+	&asn_SPC_OCUUP_PF_Container_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ODU-PF-Container.c b/e2sm/lib/ODU-PF-Container.c
new file mode 100644
index 0000000..4aeaa6c
--- /dev/null
+++ b/e2sm/lib/ODU-PF-Container.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ODU-PF-Container.h"
+
+#include "CellResourceReportListItem.h"
+static int
+memb_cellResourceReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 512)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..512)) */};
+static asn_per_constraints_t asn_PER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  1,  512 }	/* (SIZE(1..512)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..512)) */};
+static asn_per_constraints_t asn_PER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  1,  512 }	/* (SIZE(1..512)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_cellResourceReportList_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CellResourceReportListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_cellResourceReportList_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_cellResourceReportList_specs_2 = {
+	sizeof(struct ODU_PF_Container__cellResourceReportList),
+	offsetof(struct ODU_PF_Container__cellResourceReportList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_cellResourceReportList_2 = {
+	"cellResourceReportList",
+	"cellResourceReportList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_cellResourceReportList_tags_2,
+	sizeof(asn_DEF_cellResourceReportList_tags_2)
+		/sizeof(asn_DEF_cellResourceReportList_tags_2[0]) - 1, /* 1 */
+	asn_DEF_cellResourceReportList_tags_2,	/* Same as above */
+	sizeof(asn_DEF_cellResourceReportList_tags_2)
+		/sizeof(asn_DEF_cellResourceReportList_tags_2[0]), /* 2 */
+	{ &asn_OER_type_cellResourceReportList_constr_2, &asn_PER_type_cellResourceReportList_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_cellResourceReportList_2,
+	1,	/* Single element */
+	&asn_SPC_cellResourceReportList_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ODU_PF_Container_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ODU_PF_Container, cellResourceReportList),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_cellResourceReportList_2,
+		0,
+		{ &asn_OER_memb_cellResourceReportList_constr_2, &asn_PER_memb_cellResourceReportList_constr_2,  memb_cellResourceReportList_constraint_1 },
+		0, 0, /* No default value */
+		"cellResourceReportList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ODU_PF_Container_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ODU_PF_Container_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* cellResourceReportList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ODU_PF_Container_specs_1 = {
+	sizeof(struct ODU_PF_Container),
+	offsetof(struct ODU_PF_Container, _asn_ctx),
+	asn_MAP_ODU_PF_Container_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ODU_PF_Container = {
+	"ODU-PF-Container",
+	"ODU-PF-Container",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ODU_PF_Container_tags_1,
+	sizeof(asn_DEF_ODU_PF_Container_tags_1)
+		/sizeof(asn_DEF_ODU_PF_Container_tags_1[0]), /* 1 */
+	asn_DEF_ODU_PF_Container_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ODU_PF_Container_tags_1)
+		/sizeof(asn_DEF_ODU_PF_Container_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ODU_PF_Container_1,
+	1,	/* Elements count */
+	&asn_SPC_ODU_PF_Container_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/OPEN_TYPE.c b/e2sm/lib/OPEN_TYPE.c
new file mode 100644
index 0000000..a54e99c
--- /dev/null
+++ b/e2sm/lib/OPEN_TYPE.c
@@ -0,0 +1,509 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <per_opentype.h>
+#include <errno.h>
+
+asn_TYPE_operation_t asn_OP_OPEN_TYPE = {
+	OPEN_TYPE_free,
+	OPEN_TYPE_print,
+	OPEN_TYPE_compare,
+	OPEN_TYPE_decode_ber,
+	OPEN_TYPE_encode_der,
+	OPEN_TYPE_decode_xer,
+	OPEN_TYPE_encode_xer,
+#ifdef ASN_DISABLE_OER_SUPPORT
+ 	0, 0,	/* No OER support, use "-gen-OER" to enable */
+#else
+	OPEN_TYPE_decode_oer,
+	OPEN_TYPE_encode_oer,
+#endif
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0, 0, 0, 0,
+#else
+	OPEN_TYPE_decode_uper,
+	OPEN_TYPE_encode_uper,
+	OPEN_TYPE_decode_aper,
+	OPEN_TYPE_encode_aper,
+#endif
+	0,  /* Random fill is not supported for open type */
+	0	/* Use generic outmost tag fetcher */
+};
+
+#undef  ADVANCE
+#define ADVANCE(num_bytes)               \
+    do {                                 \
+        size_t num = num_bytes;          \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+asn_dec_rval_t
+OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    size_t consumed_myself = 0;
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    ASN_DEBUG("presence %d\n", selected.presence_index);
+
+    rv = selected.type_descriptor->op->ber_decoder(
+        opt_codec_ctx, selected.type_descriptor, &inner_value, ptr, size,
+        elm->tag_mode);
+    ADVANCE(rv.consumed);
+    rv.consumed = 0;
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            rv.code = RC_OK;
+            rv.consumed = consumed_myself;
+            return rv;
+        } else {
+            /* Oh, now a full-blown failure failure */
+        }
+        /* Fall through */
+    case RC_FAIL:
+        rv.consumed = consumed_myself;
+        /* Fall through */
+    case RC_WMORE:
+        break;
+    }
+
+    if(*memb_ptr2) {
+        if(elm->flags & ATF_POINTER) {
+            ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+            *memb_ptr2 = NULL;
+        } else {
+            ASN_STRUCT_RESET(*selected.type_descriptor,
+                                          inner_value);
+        }
+    }
+    return rv;
+}
+
+asn_dec_rval_t
+OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    size_t consumed_myself = 0;
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    int xer_context = 0;
+    ssize_t ch_size;
+    pxer_chunk_type_e ch_type;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    /*
+     * Confirm wrapper.
+     */
+    for(;;) {
+        ch_size = xer_next_token(&xer_context, ptr, size, &ch_type);
+        if(ch_size < 0) {
+            ASN__DECODE_FAILED;
+        } else {
+            switch(ch_type) {
+            case PXER_WMORE:
+                ASN__DECODE_STARVED;
+            case PXER_COMMENT:
+            case PXER_TEXT:
+                ADVANCE(ch_size);
+                continue;
+            case PXER_TAG:
+                break;
+            }
+            break;
+        }
+    }
+
+    /*
+     * Wrapper value confirmed.
+     */
+    switch(xer_check_tag(ptr, ch_size, elm->name)) {
+    case XCT_OPENING:
+        ADVANCE(ch_size);
+        break;
+    case XCT_BROKEN:
+    default:
+        ASN__DECODE_FAILED;
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = selected.type_descriptor->op->xer_decoder(
+        opt_codec_ctx, selected.type_descriptor, &inner_value, NULL, ptr, size);
+    ADVANCE(rv.consumed);
+    rv.consumed = 0;
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_FAIL:
+        /* Point to a best position where failure occurred */
+        rv.consumed = consumed_myself;
+        /* Fall through */
+    case RC_WMORE:
+        /* Wrt. rv.consumed==0:
+         * In case a genuine RC_WMORE, the whole Open Type decoding
+         * will have to be restarted.
+         */
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+        return rv;
+    }
+
+    /*
+     * Finalize wrapper.
+     */
+    for(;;) {
+        ch_size = xer_next_token(&xer_context, ptr, size, &ch_type);
+        if(ch_size < 0) {
+            ASN__DECODE_FAILED;
+        } else {
+            switch(ch_type) {
+            case PXER_WMORE:
+                ASN__DECODE_STARVED;
+            case PXER_COMMENT:
+            case PXER_TEXT:
+                ADVANCE(ch_size);
+                continue;
+            case PXER_TAG:
+                break;
+            }
+            break;
+        }
+    }
+
+    /*
+     * Wrapper value confirmed.
+     */
+    switch(xer_check_tag(ptr, ch_size, elm->name)) {
+    case XCT_CLOSING:
+        ADVANCE(ch_size);
+        break;
+    case XCT_BROKEN:
+    default:
+        ASN__DECODE_FAILED;
+    }
+
+    rv.consumed += consumed_myself;
+
+    return rv;
+}
+
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void *sptr,
+                   const asn_TYPE_member_t *elm, asn_per_data_t *pd) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = uper_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                            &inner_value, pd);
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_WMORE:
+    case RC_FAIL:
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+    }
+    return rv;
+}
+
+asn_enc_rval_t
+OPEN_TYPE_encode_uper(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, asn_per_outp_t *po) {
+    const void *memb_ptr;   /* Pointer to the member */
+    asn_TYPE_member_t *elm; /* CHOICE's element */
+    asn_enc_rval_t er = {0,0,0};
+    unsigned present;
+
+    (void)constraints;
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN__ENCODE_FAILED;
+    } else {
+        present--;
+    }
+
+    ASN_DEBUG("Encoding %s OPEN TYPE element %d", td->name, present);
+
+    elm = &td->elements[present];
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+    } else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(uper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded = 0;
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+OPEN_TYPE_aper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void *sptr,
+                   const asn_TYPE_member_t *elm, asn_per_data_t *pd) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = aper_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                            &inner_value, pd);
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_WMORE:
+    case RC_FAIL:
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+    }
+    return rv;
+}
+
+asn_enc_rval_t
+OPEN_TYPE_encode_aper(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, asn_per_outp_t *po) {
+    const void *memb_ptr;   /* Pointer to the member */
+    asn_TYPE_member_t *elm; /* CHOICE's element */
+    asn_enc_rval_t er = {0,0,0};
+    unsigned present;
+
+    (void)constraints;
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN__ENCODE_FAILED;
+    } else {
+        present--;
+    }
+
+    ASN_DEBUG("Encoding %s OPEN TYPE element %d", td->name, present);
+
+    elm = &td->elements[present];
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+    } else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(aper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded = 0;
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
diff --git a/e2sm/lib/OPEN_TYPE_oer.c b/e2sm/lib/OPEN_TYPE_oer.c
new file mode 100644
index 0000000..dd2f5c6
--- /dev/null
+++ b/e2sm/lib/OPEN_TYPE_oer.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <errno.h>
+
+asn_dec_rval_t
+OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+    size_t ot_ret;
+
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    ot_ret = oer_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                               &inner_value, ptr, size);
+    switch(ot_ret) {
+    default:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            rv.code = RC_OK;
+            rv.consumed = ot_ret;
+            return rv;
+        } else {
+            /* Oh, now a full-blown failure failure */
+        }
+        /* Fall through */
+    case -1:
+        rv.code = RC_FAIL;
+        rv.consumed = ot_ret;
+        break;
+    case 0:
+        rv.code = RC_WMORE;
+        rv.consumed = 0;
+        break;
+    }
+
+    if(*memb_ptr2) {
+        const asn_CHOICE_specifics_t *specs =
+            selected.type_descriptor->specifics;
+        if(elm->flags & ATF_POINTER) {
+            ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+            *memb_ptr2 = NULL;
+        } else {
+            ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor,
+                                          inner_value);
+            memset(*memb_ptr2, 0, specs->struct_size);
+        }
+    }
+    return rv;
+}
diff --git a/e2sm/lib/PF-Container.c b/e2sm/lib/PF-Container.c
new file mode 100644
index 0000000..c4034f8
--- /dev/null
+++ b/e2sm/lib/PF-Container.c
@@ -0,0 +1,78 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PF-Container.h"
+
+#include "ODU-PF-Container.h"
+#include "OCUCP-PF-Container.h"
+#include "OCUUP-PF-Container.h"
+static asn_oer_constraints_t asn_OER_type_PF_Container_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_PF_Container_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_PF_Container_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct PF_Container, choice.oDU),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ODU_PF_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"oDU"
+		},
+	{ ATF_POINTER, 0, offsetof(struct PF_Container, choice.oCU_CP),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_OCUCP_PF_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"oCU-CP"
+		},
+	{ ATF_POINTER, 0, offsetof(struct PF_Container, choice.oCU_UP),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_OCUUP_PF_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"oCU-UP"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_PF_Container_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* oDU */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* oCU-CP */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* oCU-UP */
+};
+asn_CHOICE_specifics_t asn_SPC_PF_Container_specs_1 = {
+	sizeof(struct PF_Container),
+	offsetof(struct PF_Container, _asn_ctx),
+	offsetof(struct PF_Container, present),
+	sizeof(((struct PF_Container *)0)->present),
+	asn_MAP_PF_Container_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_PF_Container = {
+	"PF-Container",
+	"PF-Container",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_PF_Container_constr_1, &asn_PER_type_PF_Container_constr_1, CHOICE_constraint },
+	asn_MBR_PF_Container_1,
+	3,	/* Elements count */
+	&asn_SPC_PF_Container_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PF-ContainerListItem.c b/e2sm/lib/PF-ContainerListItem.c
new file mode 100644
index 0000000..112175c
--- /dev/null
+++ b/e2sm/lib/PF-ContainerListItem.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PF-ContainerListItem.h"
+
+asn_TYPE_member_t asn_MBR_PF_ContainerListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct PF_ContainerListItem, interface_type),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NI_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"interface-type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct PF_ContainerListItem, o_CU_UP_PM_Container),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CUUPMeasurement_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"o-CU-UP-PM-Container"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_PF_ContainerListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PF_ContainerListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* interface-type */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* o-CU-UP-PM-Container */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PF_ContainerListItem_specs_1 = {
+	sizeof(struct PF_ContainerListItem),
+	offsetof(struct PF_ContainerListItem, _asn_ctx),
+	asn_MAP_PF_ContainerListItem_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_PF_ContainerListItem = {
+	"PF-ContainerListItem",
+	"PF-ContainerListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_PF_ContainerListItem_tags_1,
+	sizeof(asn_DEF_PF_ContainerListItem_tags_1)
+		/sizeof(asn_DEF_PF_ContainerListItem_tags_1[0]), /* 1 */
+	asn_DEF_PF_ContainerListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PF_ContainerListItem_tags_1)
+		/sizeof(asn_DEF_PF_ContainerListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_PF_ContainerListItem_1,
+	2,	/* Elements count */
+	&asn_SPC_PF_ContainerListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PLMN-Identity.c b/e2sm/lib/PLMN-Identity.c
new file mode 100644
index 0000000..023b1f7
--- /dev/null
+++ b/e2sm/lib/PLMN-Identity.c
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PLMN-Identity.h"
+
+int
+PLMN_Identity_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size == 3)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_PLMN_Identity_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	3	/* (SIZE(3..3)) */};
+asn_per_constraints_t asn_PER_type_PLMN_Identity_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  3,  3 }	/* (SIZE(3..3)) */,
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_PLMN_Identity_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PLMN_Identity = {
+	"PLMN-Identity",
+	"PLMN-Identity",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_PLMN_Identity_tags_1,
+	sizeof(asn_DEF_PLMN_Identity_tags_1)
+		/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
+	asn_DEF_PLMN_Identity_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PLMN_Identity_tags_1)
+		/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
+	{ &asn_OER_type_PLMN_Identity_constr_1, &asn_PER_type_PLMN_Identity_constr_1, PLMN_Identity_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PM-Containers-Item.c b/e2sm/lib/PM-Containers-Item.c
new file mode 100644
index 0000000..2116f5a
--- /dev/null
+++ b/e2sm/lib/PM-Containers-Item.c
@@ -0,0 +1,63 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PM-Containers-Item.h"
+
+#include "PF-Container.h"
+asn_TYPE_member_t asn_MBR_PM_Containers_Item_1[] = {
+	{ ATF_POINTER, 2, offsetof(struct PM_Containers_Item, performanceContainer),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_PF_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"performanceContainer"
+		},
+	{ ATF_POINTER, 1, offsetof(struct PM_Containers_Item, theRANContainer),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RAN_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"theRANContainer"
+		},
+};
+static const int asn_MAP_PM_Containers_Item_oms_1[] = { 0, 1 };
+static const ber_tlv_tag_t asn_DEF_PM_Containers_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PM_Containers_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* performanceContainer */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* theRANContainer */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PM_Containers_Item_specs_1 = {
+	sizeof(struct PM_Containers_Item),
+	offsetof(struct PM_Containers_Item, _asn_ctx),
+	asn_MAP_PM_Containers_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	asn_MAP_PM_Containers_Item_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_PM_Containers_Item = {
+	"PM-Containers-Item",
+	"PM-Containers-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_PM_Containers_Item_tags_1,
+	sizeof(asn_DEF_PM_Containers_Item_tags_1)
+		/sizeof(asn_DEF_PM_Containers_Item_tags_1[0]), /* 1 */
+	asn_DEF_PM_Containers_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PM_Containers_Item_tags_1)
+		/sizeof(asn_DEF_PM_Containers_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_PM_Containers_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_PM_Containers_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PM-Info-Item.c b/e2sm/lib/PM-Info-Item.c
new file mode 100644
index 0000000..e469eb6
--- /dev/null
+++ b/e2sm/lib/PM-Info-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PM-Info-Item.h"
+
+asn_TYPE_member_t asn_MBR_PM_Info_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct PM_Info_Item, pmType),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_MeasurementType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pmType"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct PM_Info_Item, pmVal),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_MeasurementValue,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pmVal"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_PM_Info_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PM_Info_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pmType */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* pmVal */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PM_Info_Item_specs_1 = {
+	sizeof(struct PM_Info_Item),
+	offsetof(struct PM_Info_Item, _asn_ctx),
+	asn_MAP_PM_Info_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_PM_Info_Item = {
+	"PM-Info-Item",
+	"PM-Info-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_PM_Info_Item_tags_1,
+	sizeof(asn_DEF_PM_Info_Item_tags_1)
+		/sizeof(asn_DEF_PM_Info_Item_tags_1[0]), /* 1 */
+	asn_DEF_PM_Info_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PM_Info_Item_tags_1)
+		/sizeof(asn_DEF_PM_Info_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_PM_Info_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_PM_Info_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PerQCIReportListItem.c b/e2sm/lib/PerQCIReportListItem.c
new file mode 100644
index 0000000..45935bd
--- /dev/null
+++ b/e2sm/lib/PerQCIReportListItem.c
@@ -0,0 +1,138 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PerQCIReportListItem.h"
+
+static int
+memb_dl_PRBUsage_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 100)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_ul_PRBUsage_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 100)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_dl_PRBUsage_constr_3 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..100) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_dl_PRBUsage_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  100 }	/* (0..100) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ul_PRBUsage_constr_4 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..100) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_ul_PRBUsage_constr_4 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  100 }	/* (0..100) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_PerQCIReportListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct PerQCIReportListItem, qci),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_QCI,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"qci"
+		},
+	{ ATF_POINTER, 2, offsetof(struct PerQCIReportListItem, dl_PRBUsage),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_dl_PRBUsage_constr_3, &asn_PER_memb_dl_PRBUsage_constr_3,  memb_dl_PRBUsage_constraint_1 },
+		0, 0, /* No default value */
+		"dl-PRBUsage"
+		},
+	{ ATF_POINTER, 1, offsetof(struct PerQCIReportListItem, ul_PRBUsage),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_ul_PRBUsage_constr_4, &asn_PER_memb_ul_PRBUsage_constr_4,  memb_ul_PRBUsage_constraint_1 },
+		0, 0, /* No default value */
+		"ul-PRBUsage"
+		},
+};
+static const int asn_MAP_PerQCIReportListItem_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_PerQCIReportListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PerQCIReportListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* qci */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* dl-PRBUsage */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ul-PRBUsage */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PerQCIReportListItem_specs_1 = {
+	sizeof(struct PerQCIReportListItem),
+	offsetof(struct PerQCIReportListItem, _asn_ctx),
+	asn_MAP_PerQCIReportListItem_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_PerQCIReportListItem_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_PerQCIReportListItem = {
+	"PerQCIReportListItem",
+	"PerQCIReportListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_PerQCIReportListItem_tags_1,
+	sizeof(asn_DEF_PerQCIReportListItem_tags_1)
+		/sizeof(asn_DEF_PerQCIReportListItem_tags_1[0]), /* 1 */
+	asn_DEF_PerQCIReportListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PerQCIReportListItem_tags_1)
+		/sizeof(asn_DEF_PerQCIReportListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_PerQCIReportListItem_1,
+	3,	/* Elements count */
+	&asn_SPC_PerQCIReportListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PerQCIReportListItemFormat.c b/e2sm/lib/PerQCIReportListItemFormat.c
new file mode 100644
index 0000000..86f8bb4
--- /dev/null
+++ b/e2sm/lib/PerQCIReportListItemFormat.c
@@ -0,0 +1,150 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PerQCIReportListItemFormat.h"
+
+static int
+memb_pDCPBytesDL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 10000000000)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_pDCPBytesUL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 10000000000)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_pDCPBytesDL_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_pDCPBytesDL_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  34, -1,  0,  10000000000 }	/* (0..10000000000,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_pDCPBytesUL_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_pDCPBytesUL_constr_4 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  34, -1,  0,  10000000000 }	/* (0..10000000000,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_PerQCIReportListItemFormat_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct PerQCIReportListItemFormat, drbqci),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_QCI,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"drbqci"
+		},
+	{ ATF_POINTER, 2, offsetof(struct PerQCIReportListItemFormat, pDCPBytesDL),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_INTEGER,
+		0,
+		{ &asn_OER_memb_pDCPBytesDL_constr_3, &asn_PER_memb_pDCPBytesDL_constr_3,  memb_pDCPBytesDL_constraint_1 },
+		0, 0, /* No default value */
+		"pDCPBytesDL"
+		},
+	{ ATF_POINTER, 1, offsetof(struct PerQCIReportListItemFormat, pDCPBytesUL),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_INTEGER,
+		0,
+		{ &asn_OER_memb_pDCPBytesUL_constr_4, &asn_PER_memb_pDCPBytesUL_constr_4,  memb_pDCPBytesUL_constraint_1 },
+		0, 0, /* No default value */
+		"pDCPBytesUL"
+		},
+};
+static const int asn_MAP_PerQCIReportListItemFormat_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_PerQCIReportListItemFormat_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PerQCIReportListItemFormat_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* drbqci */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* pDCPBytesDL */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* pDCPBytesUL */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PerQCIReportListItemFormat_specs_1 = {
+	sizeof(struct PerQCIReportListItemFormat),
+	offsetof(struct PerQCIReportListItemFormat, _asn_ctx),
+	asn_MAP_PerQCIReportListItemFormat_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_PerQCIReportListItemFormat_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_PerQCIReportListItemFormat = {
+	"PerQCIReportListItemFormat",
+	"PerQCIReportListItemFormat",
+	&asn_OP_SEQUENCE,
+	asn_DEF_PerQCIReportListItemFormat_tags_1,
+	sizeof(asn_DEF_PerQCIReportListItemFormat_tags_1)
+		/sizeof(asn_DEF_PerQCIReportListItemFormat_tags_1[0]), /* 1 */
+	asn_DEF_PerQCIReportListItemFormat_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PerQCIReportListItemFormat_tags_1)
+		/sizeof(asn_DEF_PerQCIReportListItemFormat_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_PerQCIReportListItemFormat_1,
+	3,	/* Elements count */
+	&asn_SPC_PerQCIReportListItemFormat_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PerUE-PM-Item.c b/e2sm/lib/PerUE-PM-Item.c
new file mode 100644
index 0000000..9ecc2df
--- /dev/null
+++ b/e2sm/lib/PerUE-PM-Item.c
@@ -0,0 +1,142 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PerUE-PM-Item.h"
+
+#include "PM-Info-Item.h"
+static int
+memb_list_of_PM_Information_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 2147483647)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_list_of_PM_Information_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..2147483647)) */};
+static asn_per_constraints_t asn_PER_type_list_of_PM_Information_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 31, -1,  1,  2147483647 }	/* (SIZE(1..2147483647)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_list_of_PM_Information_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..2147483647)) */};
+static asn_per_constraints_t asn_PER_memb_list_of_PM_Information_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 31, -1,  1,  2147483647 }	/* (SIZE(1..2147483647)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_list_of_PM_Information_3[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_PM_Info_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_list_of_PM_Information_tags_3[] = {
+	(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_list_of_PM_Information_specs_3 = {
+	sizeof(struct PerUE_PM_Item__list_of_PM_Information),
+	offsetof(struct PerUE_PM_Item__list_of_PM_Information, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_list_of_PM_Information_3 = {
+	"list-of-PM-Information",
+	"list-of-PM-Information",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_list_of_PM_Information_tags_3,
+	sizeof(asn_DEF_list_of_PM_Information_tags_3)
+		/sizeof(asn_DEF_list_of_PM_Information_tags_3[0]) - 1, /* 1 */
+	asn_DEF_list_of_PM_Information_tags_3,	/* Same as above */
+	sizeof(asn_DEF_list_of_PM_Information_tags_3)
+		/sizeof(asn_DEF_list_of_PM_Information_tags_3[0]), /* 2 */
+	{ &asn_OER_type_list_of_PM_Information_constr_3, &asn_PER_type_list_of_PM_Information_constr_3, SEQUENCE_OF_constraint },
+	asn_MBR_list_of_PM_Information_3,
+	1,	/* Single element */
+	&asn_SPC_list_of_PM_Information_specs_3	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_PerUE_PM_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct PerUE_PM_Item, ueId),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_UE_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ueId"
+		},
+	{ ATF_POINTER, 1, offsetof(struct PerUE_PM_Item, list_of_PM_Information),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		0,
+		&asn_DEF_list_of_PM_Information_3,
+		0,
+		{ &asn_OER_memb_list_of_PM_Information_constr_3, &asn_PER_memb_list_of_PM_Information_constr_3,  memb_list_of_PM_Information_constraint_1 },
+		0, 0, /* No default value */
+		"list-of-PM-Information"
+		},
+};
+static const int asn_MAP_PerUE_PM_Item_oms_1[] = { 1 };
+static const ber_tlv_tag_t asn_DEF_PerUE_PM_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PerUE_PM_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ueId */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* list-of-PM-Information */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PerUE_PM_Item_specs_1 = {
+	sizeof(struct PerUE_PM_Item),
+	offsetof(struct PerUE_PM_Item, _asn_ctx),
+	asn_MAP_PerUE_PM_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	asn_MAP_PerUE_PM_Item_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_PerUE_PM_Item = {
+	"PerUE-PM-Item",
+	"PerUE-PM-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_PerUE_PM_Item_tags_1,
+	sizeof(asn_DEF_PerUE_PM_Item_tags_1)
+		/sizeof(asn_DEF_PerUE_PM_Item_tags_1[0]), /* 1 */
+	asn_DEF_PerUE_PM_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PerUE_PM_Item_tags_1)
+		/sizeof(asn_DEF_PerUE_PM_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_PerUE_PM_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_PerUE_PM_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PhysCellId.c b/e2sm/lib/PhysCellId.c
new file mode 100644
index 0000000..bb61e1d
--- /dev/null
+++ b/e2sm/lib/PhysCellId.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PhysCellId.h"
+
+int
+PhysCellId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 1007)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_PhysCellId_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..1007) */,
+	-1};
+asn_per_constraints_t asn_PER_type_PhysCellId_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 10,  10,  0,  1007 }	/* (0..1007) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_PhysCellId_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PhysCellId = {
+	"PhysCellId",
+	"PhysCellId",
+	&asn_OP_NativeInteger,
+	asn_DEF_PhysCellId_tags_1,
+	sizeof(asn_DEF_PhysCellId_tags_1)
+		/sizeof(asn_DEF_PhysCellId_tags_1[0]), /* 1 */
+	asn_DEF_PhysCellId_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PhysCellId_tags_1)
+		/sizeof(asn_DEF_PhysCellId_tags_1[0]), /* 1 */
+	{ &asn_OER_type_PhysCellId_constr_1, &asn_PER_type_PhysCellId_constr_1, PhysCellId_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/PlmnID-Item.c b/e2sm/lib/PlmnID-Item.c
new file mode 100644
index 0000000..5aad6cb
--- /dev/null
+++ b/e2sm/lib/PlmnID-Item.c
@@ -0,0 +1,74 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "PlmnID-Item.h"
+
+#include "FGC-CUUP-PM-Format.h"
+#include "EPC-CUUP-PM-Format.h"
+asn_TYPE_member_t asn_MBR_PlmnID_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct PlmnID_Item, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_POINTER, 2, offsetof(struct PlmnID_Item, cu_UP_PM_5GC),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_FGC_CUUP_PM_Format,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cu-UP-PM-5GC"
+		},
+	{ ATF_POINTER, 1, offsetof(struct PlmnID_Item, cu_UP_PM_EPC),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_EPC_CUUP_PM_Format,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cu-UP-PM-EPC"
+		},
+};
+static const int asn_MAP_PlmnID_Item_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_PlmnID_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_PlmnID_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* cu-UP-PM-5GC */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* cu-UP-PM-EPC */
+};
+asn_SEQUENCE_specifics_t asn_SPC_PlmnID_Item_specs_1 = {
+	sizeof(struct PlmnID_Item),
+	offsetof(struct PlmnID_Item, _asn_ctx),
+	asn_MAP_PlmnID_Item_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_PlmnID_Item_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_PlmnID_Item = {
+	"PlmnID-Item",
+	"PlmnID-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_PlmnID_Item_tags_1,
+	sizeof(asn_DEF_PlmnID_Item_tags_1)
+		/sizeof(asn_DEF_PlmnID_Item_tags_1[0]), /* 1 */
+	asn_DEF_PlmnID_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PlmnID_Item_tags_1)
+		/sizeof(asn_DEF_PlmnID_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_PlmnID_Item_1,
+	3,	/* Elements count */
+	&asn_SPC_PlmnID_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/Presence.c b/e2sm/lib/Presence.c
new file mode 100644
index 0000000..b2e8cda
--- /dev/null
+++ b/e2sm/lib/Presence.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "Presence.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_Presence_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_Presence_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_Presence_value2enum_1[] = {
+	{ 0,	8,	"optional" },
+	{ 1,	11,	"conditional" },
+	{ 2,	9,	"mandatory" }
+};
+static const unsigned int asn_MAP_Presence_enum2value_1[] = {
+	1,	/* conditional(1) */
+	2,	/* mandatory(2) */
+	0	/* optional(0) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_Presence_specs_1 = {
+	asn_MAP_Presence_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_Presence_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	0,	/* Enumeration is not extensible */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_Presence_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Presence = {
+	"Presence",
+	"Presence",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_Presence_tags_1,
+	sizeof(asn_DEF_Presence_tags_1)
+		/sizeof(asn_DEF_Presence_tags_1[0]), /* 1 */
+	asn_DEF_Presence_tags_1,	/* Same as above */
+	sizeof(asn_DEF_Presence_tags_1)
+		/sizeof(asn_DEF_Presence_tags_1[0]), /* 1 */
+	{ &asn_OER_type_Presence_constr_1, &asn_PER_type_Presence_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_Presence_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/PrintableString.c b/e2sm/lib/PrintableString.c
new file mode 100644
index 0000000..8fc3939
--- /dev/null
+++ b/e2sm/lib/PrintableString.c
@@ -0,0 +1,130 @@
+/*-
+ * Copyright (c) 2003, 2004, 2006 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <PrintableString.h>
+
+/*
+ * ASN.1:1984 (X.409)
+ */
+static const int _PrintableString_alphabet[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int _PrintableString_code2value[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122};
+
+/*
+ * PrintableString basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_PrintableString_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2)),	/* [UNIVERSAL 19] IMPLICIT ...*/
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
+};
+static int asn_DEF_PrintableString_v2c(unsigned int value) {
+	return _PrintableString_alphabet[value > 255 ? 0 : value] - 1;
+}
+static int asn_DEF_PrintableString_c2v(unsigned int code) {
+	if(code < 74)
+		return _PrintableString_code2value[code];
+	return -1;
+}
+static asn_per_constraints_t asn_DEF_PrintableString_per_constraints = {
+	{ APC_CONSTRAINED, 4, 4, 0x20, 0x39 },	/* Value */
+	{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 },	/* Size */
+	asn_DEF_PrintableString_v2c,
+	asn_DEF_PrintableString_c2v
+};
+asn_TYPE_operation_t asn_OP_PrintableString = {
+	OCTET_STRING_free,
+	OCTET_STRING_print_utf8,	/* ASCII subset */
+	OCTET_STRING_compare,
+	OCTET_STRING_decode_ber,      /* Implemented in terms of OCTET STRING */
+	OCTET_STRING_encode_der,
+	OCTET_STRING_decode_xer_utf8,
+	OCTET_STRING_encode_xer_utf8,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	OCTET_STRING_decode_oer,
+	OCTET_STRING_encode_oer,
+#endif	/* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	OCTET_STRING_decode_uper,
+	OCTET_STRING_encode_uper,
+	OCTET_STRING_decode_aper,
+	OCTET_STRING_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	OCTET_STRING_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_PrintableString = {
+	"PrintableString",
+	"PrintableString",
+	&asn_OP_PrintableString,
+	asn_DEF_PrintableString_tags,
+	sizeof(asn_DEF_PrintableString_tags)
+	  / sizeof(asn_DEF_PrintableString_tags[0]) - 1,
+	asn_DEF_PrintableString_tags,
+	sizeof(asn_DEF_PrintableString_tags)
+	  / sizeof(asn_DEF_PrintableString_tags[0]),
+	{ 0, &asn_DEF_PrintableString_per_constraints, PrintableString_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+
+int
+PrintableString_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                           asn_app_constraint_failed_f *ctfailcb,
+                           void *app_key) {
+    const PrintableString_t *st = (const PrintableString_t *)sptr;
+
+	if(st && st->buf) {
+		uint8_t *buf = st->buf;
+		uint8_t *end = buf + st->size;
+
+		/*
+		 * Check the alphabet of the PrintableString.
+		 * ASN.1:1984 (X.409)
+		 */
+		for(; buf < end; buf++) {
+			if(!_PrintableString_alphabet[*buf]) {
+				ASN__CTFAIL(app_key, td, sptr,
+					"%s: value byte %ld (%d) "
+					"not in PrintableString alphabet "
+					"(%s:%d)",
+					td->name,
+					(long)((buf - st->buf) + 1),
+					*buf,
+					__FILE__, __LINE__);
+				return -1;
+			}
+		}
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	return 0;
+}
diff --git a/e2sm/lib/ProcedureCode.c b/e2sm/lib/ProcedureCode.c
new file mode 100644
index 0000000..a3ef61a
--- /dev/null
+++ b/e2sm/lib/ProcedureCode.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ProcedureCode.h"
+
+int
+ProcedureCode_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_ProcedureCode_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+static asn_per_constraints_t asn_PER_type_ProcedureCode_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_ProcedureCode_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProcedureCode = {
+	"ProcedureCode",
+	"ProcedureCode",
+	&asn_OP_NativeInteger,
+	asn_DEF_ProcedureCode_tags_1,
+	sizeof(asn_DEF_ProcedureCode_tags_1)
+		/sizeof(asn_DEF_ProcedureCode_tags_1[0]), /* 1 */
+	asn_DEF_ProcedureCode_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProcedureCode_tags_1)
+		/sizeof(asn_DEF_ProcedureCode_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProcedureCode_constr_1, &asn_PER_type_ProcedureCode_constr_1, ProcedureCode_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/ProtocolIE-ID.c b/e2sm/lib/ProtocolIE-ID.c
new file mode 100644
index 0000000..fd10d9c
--- /dev/null
+++ b/e2sm/lib/ProtocolIE-ID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ProtocolIE-ID.h"
+
+int
+ProtocolIE_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_ID_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+asn_per_constraints_t asn_PER_type_ProtocolIE_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_ID = {
+	"ProtocolIE-ID",
+	"ProtocolIE-ID",
+	&asn_OP_NativeInteger,
+	asn_DEF_ProtocolIE_ID_tags_1,
+	sizeof(asn_DEF_ProtocolIE_ID_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_ID_tags_1[0]), /* 1 */
+	asn_DEF_ProtocolIE_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_ID_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_ID_constr_1, &asn_PER_type_ProtocolIE_ID_constr_1, ProtocolIE_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/QCI.c b/e2sm/lib/QCI.c
new file mode 100644
index 0000000..61627ee
--- /dev/null
+++ b/e2sm/lib/QCI.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "QCI.h"
+
+int
+QCI_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_QCI_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_QCI_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  0,  255 }	/* (0..255,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_QCI_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_QCI = {
+	"QCI",
+	"QCI",
+	&asn_OP_NativeInteger,
+	asn_DEF_QCI_tags_1,
+	sizeof(asn_DEF_QCI_tags_1)
+		/sizeof(asn_DEF_QCI_tags_1[0]), /* 1 */
+	asn_DEF_QCI_tags_1,	/* Same as above */
+	sizeof(asn_DEF_QCI_tags_1)
+		/sizeof(asn_DEF_QCI_tags_1[0]), /* 1 */
+	{ &asn_OER_type_QCI_constr_1, &asn_PER_type_QCI_constr_1, QCI_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RAN-Container.c b/e2sm/lib/RAN-Container.c
new file mode 100644
index 0000000..00ae3b9
--- /dev/null
+++ b/e2sm/lib/RAN-Container.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RAN-Container.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RAN_Container_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RAN_Container = {
+	"RAN-Container",
+	"RAN-Container",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RAN_Container_tags_1,
+	sizeof(asn_DEF_RAN_Container_tags_1)
+		/sizeof(asn_DEF_RAN_Container_tags_1[0]), /* 1 */
+	asn_DEF_RAN_Container_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RAN_Container_tags_1)
+		/sizeof(asn_DEF_RAN_Container_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RAN-ControlParameter-Item.c b/e2sm/lib/RAN-ControlParameter-Item.c
new file mode 100644
index 0000000..4ae973e
--- /dev/null
+++ b/e2sm/lib/RAN-ControlParameter-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RAN-ControlParameter-Item.h"
+
+asn_TYPE_member_t asn_MBR_RAN_ControlParameter_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RAN_ControlParameter_Item, ranParameter_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANParameter_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameter-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RAN_ControlParameter_Item, ranParameter_Name),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANParameter_Name,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameter-Name"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RAN_ControlParameter_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RAN_ControlParameter_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranParameter-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ranParameter-Name */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RAN_ControlParameter_Item_specs_1 = {
+	sizeof(struct RAN_ControlParameter_Item),
+	offsetof(struct RAN_ControlParameter_Item, _asn_ctx),
+	asn_MAP_RAN_ControlParameter_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RAN_ControlParameter_Item = {
+	"RAN-ControlParameter-Item",
+	"RAN-ControlParameter-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RAN_ControlParameter_Item_tags_1,
+	sizeof(asn_DEF_RAN_ControlParameter_Item_tags_1)
+		/sizeof(asn_DEF_RAN_ControlParameter_Item_tags_1[0]), /* 1 */
+	asn_DEF_RAN_ControlParameter_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RAN_ControlParameter_Item_tags_1)
+		/sizeof(asn_DEF_RAN_ControlParameter_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RAN_ControlParameter_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RAN_ControlParameter_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANParameter-ELEMENT.c b/e2sm/lib/RANParameter-ELEMENT.c
new file mode 100644
index 0000000..63edc16
--- /dev/null
+++ b/e2sm/lib/RANParameter-ELEMENT.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-ELEMENT.h"
+
+asn_TYPE_member_t asn_MBR_RANParameter_ELEMENT_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_ELEMENT, keyFlag),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BOOLEAN,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"keyFlag"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_ELEMENT, ranParameter_Value),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_RANParameter_Value,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameter-Value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANParameter_ELEMENT_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANParameter_ELEMENT_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* keyFlag */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ranParameter-Value */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANParameter_ELEMENT_specs_1 = {
+	sizeof(struct RANParameter_ELEMENT),
+	offsetof(struct RANParameter_ELEMENT, _asn_ctx),
+	asn_MAP_RANParameter_ELEMENT_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_ELEMENT = {
+	"RANParameter-ELEMENT",
+	"RANParameter-ELEMENT",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANParameter_ELEMENT_tags_1,
+	sizeof(asn_DEF_RANParameter_ELEMENT_tags_1)
+		/sizeof(asn_DEF_RANParameter_ELEMENT_tags_1[0]), /* 1 */
+	asn_DEF_RANParameter_ELEMENT_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANParameter_ELEMENT_tags_1)
+		/sizeof(asn_DEF_RANParameter_ELEMENT_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANParameter_ELEMENT_1,
+	2,	/* Elements count */
+	&asn_SPC_RANParameter_ELEMENT_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANParameter-ID.c b/e2sm/lib/RANParameter-ID.c
new file mode 100644
index 0000000..4965d59
--- /dev/null
+++ b/e2sm/lib/RANParameter-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-ID.h"
+
+int
+RANParameter_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	/* Constraint check succeeded */
+	return 0;
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RANParameter_ID_constr_1 CC_NOTUSED = {
+	{ 4, 1 }	/* (0..4294967295) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RANParameter_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 32, -1,  0,  4294967295 }	/* (0..4294967295) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+const asn_INTEGER_specifics_t asn_SPC_RANParameter_ID_specs_1 = {
+	0,	0,	0,	0,	0,
+	0,	/* Native long size */
+	1	/* Unsigned representation */
+};
+static const ber_tlv_tag_t asn_DEF_RANParameter_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_ID = {
+	"RANParameter-ID",
+	"RANParameter-ID",
+	&asn_OP_NativeInteger,
+	asn_DEF_RANParameter_ID_tags_1,
+	sizeof(asn_DEF_RANParameter_ID_tags_1)
+		/sizeof(asn_DEF_RANParameter_ID_tags_1[0]), /* 1 */
+	asn_DEF_RANParameter_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANParameter_ID_tags_1)
+		/sizeof(asn_DEF_RANParameter_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANParameter_ID_constr_1, &asn_PER_type_RANParameter_ID_constr_1, RANParameter_ID_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_RANParameter_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANParameter-Item.c b/e2sm/lib/RANParameter-Item.c
new file mode 100644
index 0000000..0da6978
--- /dev/null
+++ b/e2sm/lib/RANParameter-Item.c
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-Item.h"
+
+#include "RANParameter-ValueType.h"
+asn_TYPE_member_t asn_MBR_RANParameter_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_Item, ranParameterItem_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANParameter_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameterItem-ID"
+		},
+	{ ATF_POINTER, 0, offsetof(struct RANParameter_Item, ranParameterItem_valueType),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_RANParameter_ValueType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameterItem-valueType"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANParameter_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANParameter_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranParameterItem-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ranParameterItem-valueType */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANParameter_Item_specs_1 = {
+	sizeof(struct RANParameter_Item),
+	offsetof(struct RANParameter_Item, _asn_ctx),
+	asn_MAP_RANParameter_Item_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_Item = {
+	"RANParameter-Item",
+	"RANParameter-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANParameter_Item_tags_1,
+	sizeof(asn_DEF_RANParameter_Item_tags_1)
+		/sizeof(asn_DEF_RANParameter_Item_tags_1[0]), /* 1 */
+	asn_DEF_RANParameter_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANParameter_Item_tags_1)
+		/sizeof(asn_DEF_RANParameter_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANParameter_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RANParameter_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANParameter-LIST.c b/e2sm/lib/RANParameter-LIST.c
new file mode 100644
index 0000000..501db25
--- /dev/null
+++ b/e2sm/lib/RANParameter-LIST.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-LIST.h"
+
+#include "RANParameter-STRUCTURE.h"
+static int
+memb_list_of_ranParameter_Structures_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 4294967295)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_list_of_ranParameter_Structures_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_type_list_of_ranParameter_Structures_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_list_of_ranParameter_Structures_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_memb_list_of_ranParameter_Structures_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_list_of_ranParameter_Structures_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANParameter_STRUCTURE,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_list_of_ranParameter_Structures_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_list_of_ranParameter_Structures_specs_2 = {
+	sizeof(struct RANParameter_LIST__list_of_ranParameter_Structures),
+	offsetof(struct RANParameter_LIST__list_of_ranParameter_Structures, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_list_of_ranParameter_Structures_2 = {
+	"list-of-ranParameter-Structures",
+	"list-of-ranParameter-Structures",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_list_of_ranParameter_Structures_tags_2,
+	sizeof(asn_DEF_list_of_ranParameter_Structures_tags_2)
+		/sizeof(asn_DEF_list_of_ranParameter_Structures_tags_2[0]) - 1, /* 1 */
+	asn_DEF_list_of_ranParameter_Structures_tags_2,	/* Same as above */
+	sizeof(asn_DEF_list_of_ranParameter_Structures_tags_2)
+		/sizeof(asn_DEF_list_of_ranParameter_Structures_tags_2[0]), /* 2 */
+	{ &asn_OER_type_list_of_ranParameter_Structures_constr_2, &asn_PER_type_list_of_ranParameter_Structures_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_list_of_ranParameter_Structures_2,
+	1,	/* Single element */
+	&asn_SPC_list_of_ranParameter_Structures_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANParameter_LIST_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_LIST, list_of_ranParameter_Structures),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_list_of_ranParameter_Structures_2,
+		0,
+		{ &asn_OER_memb_list_of_ranParameter_Structures_constr_2, &asn_PER_memb_list_of_ranParameter_Structures_constr_2,  memb_list_of_ranParameter_Structures_constraint_1 },
+		0, 0, /* No default value */
+		"list-of-ranParameter-Structures"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANParameter_LIST_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANParameter_LIST_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* list-of-ranParameter-Structures */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANParameter_LIST_specs_1 = {
+	sizeof(struct RANParameter_LIST),
+	offsetof(struct RANParameter_LIST, _asn_ctx),
+	asn_MAP_RANParameter_LIST_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_LIST = {
+	"RANParameter-LIST",
+	"RANParameter-LIST",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANParameter_LIST_tags_1,
+	sizeof(asn_DEF_RANParameter_LIST_tags_1)
+		/sizeof(asn_DEF_RANParameter_LIST_tags_1[0]), /* 1 */
+	asn_DEF_RANParameter_LIST_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANParameter_LIST_tags_1)
+		/sizeof(asn_DEF_RANParameter_LIST_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANParameter_LIST_1,
+	1,	/* Elements count */
+	&asn_SPC_RANParameter_LIST_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANParameter-Name.c b/e2sm/lib/RANParameter-Name.c
new file mode 100644
index 0000000..fdd2f4c
--- /dev/null
+++ b/e2sm/lib/RANParameter-Name.c
@@ -0,0 +1,109 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-Name.h"
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_1[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+	const int *table = permitted_alphabet_table_1;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+int
+RANParameter_Name_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_1(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_RANParameter_Name_1_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+		return -1;
+	return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_RANParameter_Name_1_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+		return -1;
+	return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using PrintableString,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RANParameter_Name_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+asn_per_constraints_t asn_PER_type_RANParameter_Name_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_RANParameter_Name_1_v2c,	/* Value to PER code map */
+	asn_PER_MAP_RANParameter_Name_1_c2v	/* PER code to value map */
+};
+static const ber_tlv_tag_t asn_DEF_RANParameter_Name_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_Name = {
+	"RANParameter-Name",
+	"RANParameter-Name",
+	&asn_OP_PrintableString,
+	asn_DEF_RANParameter_Name_tags_1,
+	sizeof(asn_DEF_RANParameter_Name_tags_1)
+		/sizeof(asn_DEF_RANParameter_Name_tags_1[0]), /* 1 */
+	asn_DEF_RANParameter_Name_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANParameter_Name_tags_1)
+		/sizeof(asn_DEF_RANParameter_Name_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANParameter_Name_constr_1, &asn_PER_type_RANParameter_Name_constr_1, RANParameter_Name_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RANParameter-STRUCTURE.c b/e2sm/lib/RANParameter-STRUCTURE.c
new file mode 100644
index 0000000..89aa285
--- /dev/null
+++ b/e2sm/lib/RANParameter-STRUCTURE.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-STRUCTURE.h"
+
+#include "RANParameter-Item.h"
+static int
+memb_sequence_of_ranParameters_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 4294967295)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_sequence_of_ranParameters_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_type_sequence_of_ranParameters_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_sequence_of_ranParameters_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_memb_sequence_of_ranParameters_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_sequence_of_ranParameters_2[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANParameter_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_sequence_of_ranParameters_tags_2[] = {
+	(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_sequence_of_ranParameters_specs_2 = {
+	sizeof(struct RANParameter_STRUCTURE__sequence_of_ranParameters),
+	offsetof(struct RANParameter_STRUCTURE__sequence_of_ranParameters, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_sequence_of_ranParameters_2 = {
+	"sequence-of-ranParameters",
+	"sequence-of-ranParameters",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_sequence_of_ranParameters_tags_2,
+	sizeof(asn_DEF_sequence_of_ranParameters_tags_2)
+		/sizeof(asn_DEF_sequence_of_ranParameters_tags_2[0]) - 1, /* 1 */
+	asn_DEF_sequence_of_ranParameters_tags_2,	/* Same as above */
+	sizeof(asn_DEF_sequence_of_ranParameters_tags_2)
+		/sizeof(asn_DEF_sequence_of_ranParameters_tags_2[0]), /* 2 */
+	{ &asn_OER_type_sequence_of_ranParameters_constr_2, &asn_PER_type_sequence_of_ranParameters_constr_2, SEQUENCE_OF_constraint },
+	asn_MBR_sequence_of_ranParameters_2,
+	1,	/* Single element */
+	&asn_SPC_sequence_of_ranParameters_specs_2	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANParameter_STRUCTURE_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_STRUCTURE, sequence_of_ranParameters),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		0,
+		&asn_DEF_sequence_of_ranParameters_2,
+		0,
+		{ &asn_OER_memb_sequence_of_ranParameters_constr_2, &asn_PER_memb_sequence_of_ranParameters_constr_2,  memb_sequence_of_ranParameters_constraint_1 },
+		0, 0, /* No default value */
+		"sequence-of-ranParameters"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANParameter_STRUCTURE_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANParameter_STRUCTURE_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* sequence-of-ranParameters */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANParameter_STRUCTURE_specs_1 = {
+	sizeof(struct RANParameter_STRUCTURE),
+	offsetof(struct RANParameter_STRUCTURE, _asn_ctx),
+	asn_MAP_RANParameter_STRUCTURE_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_STRUCTURE = {
+	"RANParameter-STRUCTURE",
+	"RANParameter-STRUCTURE",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANParameter_STRUCTURE_tags_1,
+	sizeof(asn_DEF_RANParameter_STRUCTURE_tags_1)
+		/sizeof(asn_DEF_RANParameter_STRUCTURE_tags_1[0]), /* 1 */
+	asn_DEF_RANParameter_STRUCTURE_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANParameter_STRUCTURE_tags_1)
+		/sizeof(asn_DEF_RANParameter_STRUCTURE_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANParameter_STRUCTURE_1,
+	1,	/* Elements count */
+	&asn_SPC_RANParameter_STRUCTURE_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANParameter-Value.c b/e2sm/lib/RANParameter-Value.c
new file mode 100644
index 0000000..91f2bc9
--- /dev/null
+++ b/e2sm/lib/RANParameter-Value.c
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-Value.h"
+
+static asn_oer_constraints_t asn_OER_type_RANParameter_Value_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RANParameter_Value_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANParameter_Value_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_Value, choice.valueInt),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"valueInt"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_Value, choice.valueOctS),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_OCTET_STRING,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"valueOctS"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANParameter_Value_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* valueInt */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* valueOctS */
+};
+asn_CHOICE_specifics_t asn_SPC_RANParameter_Value_specs_1 = {
+	sizeof(struct RANParameter_Value),
+	offsetof(struct RANParameter_Value, _asn_ctx),
+	offsetof(struct RANParameter_Value, present),
+	sizeof(((struct RANParameter_Value *)0)->present),
+	asn_MAP_RANParameter_Value_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0,
+	2	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_Value = {
+	"RANParameter-Value",
+	"RANParameter-Value",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_RANParameter_Value_constr_1, &asn_PER_type_RANParameter_Value_constr_1, CHOICE_constraint },
+	asn_MBR_RANParameter_Value_1,
+	2,	/* Elements count */
+	&asn_SPC_RANParameter_Value_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANParameter-ValueType.c b/e2sm/lib/RANParameter-ValueType.c
new file mode 100644
index 0000000..ebbf953
--- /dev/null
+++ b/e2sm/lib/RANParameter-ValueType.c
@@ -0,0 +1,78 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANParameter-ValueType.h"
+
+#include "RANParameter-ELEMENT.h"
+#include "RANParameter-STRUCTURE.h"
+#include "RANParameter-LIST.h"
+static asn_oer_constraints_t asn_OER_type_RANParameter_ValueType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RANParameter_ValueType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANParameter_ValueType_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct RANParameter_ValueType, choice.ranParameter_Element),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANParameter_ELEMENT,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameter-Element"
+		},
+	{ ATF_POINTER, 0, offsetof(struct RANParameter_ValueType, choice.ranParameter_Structure),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANParameter_STRUCTURE,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameter-Structure"
+		},
+	{ ATF_POINTER, 0, offsetof(struct RANParameter_ValueType, choice.ranParameter_List),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANParameter_LIST,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranParameter-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANParameter_ValueType_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranParameter-Element */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ranParameter-Structure */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ranParameter-List */
+};
+asn_CHOICE_specifics_t asn_SPC_RANParameter_ValueType_specs_1 = {
+	sizeof(struct RANParameter_ValueType),
+	offsetof(struct RANParameter_ValueType, _asn_ctx),
+	offsetof(struct RANParameter_ValueType, present),
+	sizeof(((struct RANParameter_ValueType *)0)->present),
+	asn_MAP_RANParameter_ValueType_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0,
+	3	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_RANParameter_ValueType = {
+	"RANParameter-ValueType",
+	"RANParameter-ValueType",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_RANParameter_ValueType_constr_1, &asn_PER_type_RANParameter_ValueType_constr_1, CHOICE_constraint },
+	asn_MBR_RANParameter_ValueType_1,
+	3,	/* Elements count */
+	&asn_SPC_RANParameter_ValueType_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RANcallProcess-ID-string.c b/e2sm/lib/RANcallProcess-ID-string.c
new file mode 100644
index 0000000..69092be
--- /dev/null
+++ b/e2sm/lib/RANcallProcess-ID-string.c
@@ -0,0 +1,109 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANcallProcess-ID-string.h"
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_1[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+	const int *table = permitted_alphabet_table_1;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+int
+RANcallProcess_ID_string_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_1(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_RANcallProcess_ID_string_1_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+		return -1;
+	return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_RANcallProcess_ID_string_1_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+		return -1;
+	return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using PrintableString,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RANcallProcess_ID_string_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+static asn_per_constraints_t asn_PER_type_RANcallProcess_ID_string_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_RANcallProcess_ID_string_1_v2c,	/* Value to PER code map */
+	asn_PER_MAP_RANcallProcess_ID_string_1_c2v	/* PER code to value map */
+};
+static const ber_tlv_tag_t asn_DEF_RANcallProcess_ID_string_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANcallProcess_ID_string = {
+	"RANcallProcess-ID-string",
+	"RANcallProcess-ID-string",
+	&asn_OP_PrintableString,
+	asn_DEF_RANcallProcess_ID_string_tags_1,
+	sizeof(asn_DEF_RANcallProcess_ID_string_tags_1)
+		/sizeof(asn_DEF_RANcallProcess_ID_string_tags_1[0]), /* 1 */
+	asn_DEF_RANcallProcess_ID_string_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANcallProcess_ID_string_tags_1)
+		/sizeof(asn_DEF_RANcallProcess_ID_string_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANcallProcess_ID_string_constr_1, &asn_PER_type_RANcallProcess_ID_string_constr_1, RANcallProcess_ID_string_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RANfunction-Name.c b/e2sm/lib/RANfunction-Name.c
new file mode 100644
index 0000000..a56189d
--- /dev/null
+++ b/e2sm/lib/RANfunction-Name.c
@@ -0,0 +1,316 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RANfunction-Name.h"
+
+static const int permitted_alphabet_table_2[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_2[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_2(const void *sptr) {
+	const int *table = permitted_alphabet_table_2;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+static const int permitted_alphabet_table_3[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_3[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_3(const void *sptr) {
+	const int *table = permitted_alphabet_table_3;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+static const int permitted_alphabet_table_4[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_4[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_4(const void *sptr) {
+	const int *table = permitted_alphabet_table_4;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+static int
+memb_ranFunction_ShortName_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_2(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_ranFunction_ShortName_2_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_2)/sizeof(permitted_alphabet_table_2[0]))
+		return -1;
+	return permitted_alphabet_table_2[value] - 1;
+}
+static int asn_PER_MAP_ranFunction_ShortName_2_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_2)/sizeof(permitted_alphabet_code2value_2[0]))
+		return -1;
+	return permitted_alphabet_code2value_2[code];
+}
+static int
+memb_ranFunction_E2SM_OID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_3(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_ranFunction_E2SM_OID_3_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_3)/sizeof(permitted_alphabet_table_3[0]))
+		return -1;
+	return permitted_alphabet_table_3[value] - 1;
+}
+static int asn_PER_MAP_ranFunction_E2SM_OID_3_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_3)/sizeof(permitted_alphabet_code2value_3[0]))
+		return -1;
+	return permitted_alphabet_code2value_3[code];
+}
+static int
+memb_ranFunction_Description_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_4(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_ranFunction_Description_4_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_4)/sizeof(permitted_alphabet_table_4[0]))
+		return -1;
+	return permitted_alphabet_table_4[value] - 1;
+}
+static int asn_PER_MAP_ranFunction_Description_4_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_4)/sizeof(permitted_alphabet_code2value_4[0]))
+		return -1;
+	return permitted_alphabet_code2value_4[code];
+}
+static asn_oer_constraints_t asn_OER_memb_ranFunction_ShortName_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+static asn_per_constraints_t asn_PER_memb_ranFunction_ShortName_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_ranFunction_ShortName_2_v2c,	/* Value to PER code map */
+	asn_PER_MAP_ranFunction_ShortName_2_c2v	/* PER code to value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ranFunction_E2SM_OID_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+static asn_per_constraints_t asn_PER_memb_ranFunction_E2SM_OID_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_ranFunction_E2SM_OID_3_v2c,	/* Value to PER code map */
+	asn_PER_MAP_ranFunction_E2SM_OID_3_c2v	/* PER code to value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ranFunction_Description_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+static asn_per_constraints_t asn_PER_memb_ranFunction_Description_constr_4 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_ranFunction_Description_4_v2c,	/* Value to PER code map */
+	asn_PER_MAP_ranFunction_Description_4_c2v	/* PER code to value map */
+};
+asn_TYPE_member_t asn_MBR_RANfunction_Name_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Name, ranFunction_ShortName),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PrintableString,
+		0,
+		{ &asn_OER_memb_ranFunction_ShortName_constr_2, &asn_PER_memb_ranFunction_ShortName_constr_2,  memb_ranFunction_ShortName_constraint_1 },
+		0, 0, /* No default value */
+		"ranFunction-ShortName"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Name, ranFunction_E2SM_OID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PrintableString,
+		0,
+		{ &asn_OER_memb_ranFunction_E2SM_OID_constr_3, &asn_PER_memb_ranFunction_E2SM_OID_constr_3,  memb_ranFunction_E2SM_OID_constraint_1 },
+		0, 0, /* No default value */
+		"ranFunction-E2SM-OID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Name, ranFunction_Description),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PrintableString,
+		0,
+		{ &asn_OER_memb_ranFunction_Description_constr_4, &asn_PER_memb_ranFunction_Description_constr_4,  memb_ranFunction_Description_constraint_1 },
+		0, 0, /* No default value */
+		"ranFunction-Description"
+		},
+	{ ATF_POINTER, 1, offsetof(struct RANfunction_Name, ranFunction_Instance),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunction-Instance"
+		},
+};
+static const int asn_MAP_RANfunction_Name_oms_1[] = { 3 };
+static const ber_tlv_tag_t asn_DEF_RANfunction_Name_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunction_Name_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunction-ShortName */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ranFunction-E2SM-OID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ranFunction-Description */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* ranFunction-Instance */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunction_Name_specs_1 = {
+	sizeof(struct RANfunction_Name),
+	offsetof(struct RANfunction_Name, _asn_ctx),
+	asn_MAP_RANfunction_Name_tag2el_1,
+	4,	/* Count of tags in the map */
+	asn_MAP_RANfunction_Name_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	4,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunction_Name = {
+	"RANfunction-Name",
+	"RANfunction-Name",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunction_Name_tags_1,
+	sizeof(asn_DEF_RANfunction_Name_tags_1)
+		/sizeof(asn_DEF_RANfunction_Name_tags_1[0]), /* 1 */
+	asn_DEF_RANfunction_Name_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunction_Name_tags_1)
+		/sizeof(asn_DEF_RANfunction_Name_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunction_Name_1,
+	4,	/* Elements count */
+	&asn_SPC_RANfunction_Name_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/REAL.c b/e2sm/lib/REAL.c
new file mode 100644
index 0000000..e3daf37
--- /dev/null
+++ b/e2sm/lib/REAL.c
@@ -0,0 +1,1028 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#define	_ISOC99_SOURCE		/* For ilogb() and quiet NAN */
+#ifndef _BSD_SOURCE
+#define	_BSD_SOURCE		/* To reintroduce finite(3) */
+#endif
+#include <asn_internal.h>
+#if	defined(__alpha)
+#include <sys/resource.h>	/* For INFINITY */
+#endif
+#include <stdlib.h>	/* for strtod(3) */
+#include <math.h>
+#include <float.h>
+#include <errno.h>
+#include <REAL.h>
+#include <OCTET_STRING.h>
+
+#undef	INT_MAX
+#define	INT_MAX	((int)(((unsigned int)-1) >> 1))
+
+#if	!(defined(NAN) || defined(INFINITY))
+static volatile double real_zero CC_NOTUSED = 0.0;
+#endif
+#ifndef	NAN
+#define	NAN	(0.0/0.0)
+#endif
+#ifndef	INFINITY
+#define	INFINITY	(1.0/0.0)
+#endif
+
+#if defined(__clang__)
+/*
+ * isnan() is defined using generic selections and won't compile in
+ * strict C89 mode because of too fancy system's standard library.
+ * However, prior to C11 the math had a perfectly working isnan()
+ * in the math library.
+ * Disable generic selection warning so we can test C89 mode with newer libc.
+ */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc11-extensions"
+static int asn_isnan(double d) {
+    return isnan(d);
+}
+static int asn_isfinite(double d) {
+#ifdef isfinite
+    return isfinite(d);  /* ISO C99 */
+#else
+    return finite(d);    /* Deprecated on Mac OS X 10.9 */
+#endif
+}
+#pragma clang diagnostic pop
+#else   /* !clang */
+#define asn_isnan(v)    isnan(v)
+#ifdef isfinite
+#define asn_isfinite(d)   isfinite(d)  /* ISO C99 */
+#else
+#define asn_isfinite(d)   finite(d)    /* Deprecated on Mac OS X 10.9 */
+#endif
+#endif  /* clang */
+
+/*
+ * REAL basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_REAL_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
+};
+asn_TYPE_operation_t asn_OP_REAL = {
+	ASN__PRIMITIVE_TYPE_free,
+	REAL_print,
+	REAL_compare,
+	ber_decode_primitive,
+	der_encode_primitive,
+	REAL_decode_xer,
+	REAL_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	REAL_decode_oer,
+	REAL_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	REAL_decode_uper,
+	REAL_encode_uper,
+	REAL_decode_aper,
+	REAL_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	REAL_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_REAL = {
+	"REAL",
+	"REAL",
+	&asn_OP_REAL,
+	asn_DEF_REAL_tags,
+	sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
+	asn_DEF_REAL_tags, /* Same as above */
+	sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0,
+	0,	/* No members */
+	0	/* No specifics */
+};
+
+typedef enum specialRealValue {
+	SRV__NOT_A_NUMBER,
+	SRV__MINUS_INFINITY,
+	SRV__PLUS_INFINITY
+} specialRealValue_e;
+static struct specialRealValue_s {
+	char *string;
+	size_t length;
+	long dv;
+} specialRealValue[] = {
+#define	SRV_SET(foo, val)	{ foo, sizeof(foo) - 1, val }
+	SRV_SET("<NOT-A-NUMBER/>", 0),
+	SRV_SET("<MINUS-INFINITY/>", -1),
+	SRV_SET("<PLUS-INFINITY/>", 1),
+#undef	SRV_SET
+};
+
+ssize_t
+REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key) {
+	char local_buf[64];
+	char *buf = local_buf;
+	ssize_t buflen = sizeof(local_buf);
+	const char *fmt = canonical ? "%.17E" /* Precise */ : "%.15f" /* Pleasant*/;
+	ssize_t ret;
+
+	/*
+	 * Check whether it is a special value.
+	 */
+	/* fpclassify(3) is not portable yet */
+	if(asn_isnan(d)) {
+		buf = specialRealValue[SRV__NOT_A_NUMBER].string;
+		buflen = specialRealValue[SRV__NOT_A_NUMBER].length;
+		return (cb(buf, buflen, app_key) < 0) ? -1 : buflen;
+	} else if(!asn_isfinite(d)) {
+		if(copysign(1.0, d) < 0.0) {
+			buf = specialRealValue[SRV__MINUS_INFINITY].string;
+			buflen = specialRealValue[SRV__MINUS_INFINITY].length;
+		} else {
+			buf = specialRealValue[SRV__PLUS_INFINITY].string;
+			buflen = specialRealValue[SRV__PLUS_INFINITY].length;
+		}
+		return (cb(buf, buflen, app_key) < 0) ? -1 : buflen;
+	} else if(ilogb(d) <= -INT_MAX) {
+		if(copysign(1.0, d) < 0.0) {
+			buf = "-0";
+			buflen = 2;
+		} else {
+			buf = "0";
+			buflen = 1;
+		}
+		return (cb(buf, buflen, app_key) < 0) ? -1 : buflen;
+	}
+
+	/*
+	 * Use the libc's double printing, hopefully they got it right.
+	 */
+	do {
+		ret = snprintf(buf, buflen, fmt, d);
+		if(ret < 0) {
+			/* There are some old broken APIs. */
+			buflen <<= 1;
+			if(buflen > 4096) {
+				/* Should be plenty. */
+				if(buf != local_buf) FREEMEM(buf);
+				return -1;
+			}
+		} else if(ret >= buflen) {
+			buflen = ret + 1;
+		} else {
+			buflen = ret;
+			break;
+		}
+		if(buf != local_buf) FREEMEM(buf);
+		buf = (char *)MALLOC(buflen);
+		if(!buf) return -1;
+	} while(1);
+
+	if(canonical) {
+		/*
+		 * Transform the "[-]d.dddE+-dd" output into "[-]d.dddE[-]d"
+		 * Check that snprintf() constructed the output correctly.
+		 */
+		char *dot;
+		char *end = buf + buflen;
+		char *last_zero;
+		char *first_zero_in_run;
+        char *s;
+
+        enum {
+            LZSTATE_NOTHING,
+            LZSTATE_ZEROES
+        } lz_state = LZSTATE_NOTHING;
+
+		dot = (buf[0] == 0x2d /* '-' */) ? (buf + 2) : (buf + 1);
+		if(*dot >= 0x30) {
+			if(buf != local_buf) FREEMEM(buf);
+			errno = EINVAL;
+			return -1;	/* Not a dot, really */
+		}
+		*dot = 0x2e;		/* Replace possible comma */
+
+        for(first_zero_in_run = last_zero = s = dot + 2; s < end; s++) {
+            switch(*s) {
+            case 0x45: /* 'E' */
+                if(lz_state == LZSTATE_ZEROES) last_zero = first_zero_in_run;
+                break;
+            case 0x30: /* '0' */
+                if(lz_state == LZSTATE_NOTHING) first_zero_in_run = s;
+                lz_state = LZSTATE_ZEROES;
+                continue;
+            default:
+                lz_state = LZSTATE_NOTHING;
+                continue;
+            }
+            break;
+        }
+
+		if(s == end) {
+			if(buf != local_buf) FREEMEM(buf);
+			errno = EINVAL;
+			return -1;		/* No promised E */
+		}
+
+        assert(*s == 0x45);
+        {
+            char *E = s;
+            char *expptr = ++E;
+            char *s = expptr;
+            int sign;
+
+            if(*expptr == 0x2b /* '+' */) {
+                /* Skip the "+" */
+                buflen -= 1;
+                sign = 0;
+            } else {
+                sign = 1;
+                s++;
+            }
+            expptr++;
+            if(expptr > end) {
+                if(buf != local_buf) FREEMEM(buf);
+                errno = EINVAL;
+                return -1;
+            }
+            if(*expptr == 0x30) {
+                buflen--;
+                expptr++;
+            }
+            if(lz_state == LZSTATE_ZEROES) {
+                *last_zero = 0x45;	/* E */
+                buflen -= s - (last_zero + 1);
+                s = last_zero + 1;
+                if(sign) {
+                    *s++ = 0x2d /* '-' */;
+                    buflen++;
+                }
+            }
+            for(; expptr <= end; s++, expptr++)
+                *s = *expptr;
+        }
+	} else {
+		/*
+		 * Remove trailing zeros.
+		 */
+		char *end = buf + buflen;
+		char *last_zero = end;
+		int stoplooking = 0;
+		char *z;
+		for(z = end - 1; z > buf; z--) {
+			switch(*z) {
+			case 0x30:
+				if(!stoplooking)
+					last_zero = z;
+				continue;
+			case 0x31: case 0x32: case 0x33: case 0x34:
+			case 0x35: case 0x36: case 0x37: case 0x38: case 0x39:
+				stoplooking = 1;
+				continue;
+			default:	/* Catch dot and other separators */
+				/*
+				 * Replace possible comma (which may even
+				 * be not a comma at all: locale-defined).
+				 */
+				*z = 0x2e;
+				if(last_zero == z + 1) {	/* leave x.0 */
+					last_zero++;
+				}
+				buflen = last_zero - buf;
+				*last_zero = '\0';
+				break;
+			}
+			break;
+		}
+	}
+
+	ret = cb(buf, buflen, app_key);
+	if(buf != local_buf) FREEMEM(buf);
+	return (ret < 0) ? -1 : buflen;
+}
+
+int
+REAL_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+           asn_app_consume_bytes_f *cb, void *app_key) {
+    const REAL_t *st = (const REAL_t *)sptr;
+	ssize_t ret;
+	double d;
+
+	(void)td;	/* Unused argument */
+	(void)ilevel;	/* Unused argument */
+
+	if(!st || !st->buf)
+		ret = cb("<absent>", 8, app_key);
+	else if(asn_REAL2double(st, &d))
+		ret = cb("<error>", 7, app_key);
+	else
+		ret = REAL__dump(d, 0, cb, app_key);
+
+	return (ret < 0) ? -1 : 0;
+}
+
+int
+REAL_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+             const void *bptr) {
+    const REAL_t *a = aptr;
+    const REAL_t *b = bptr;
+
+    (void)td;
+
+    if(a && b) {
+        double adbl, bdbl;
+        int ra, rb;
+        ra = asn_REAL2double(a, &adbl);
+        rb = asn_REAL2double(b, &bdbl);
+        if(ra == 0 && rb == 0) {
+            if(asn_isnan(adbl)) {
+                if(asn_isnan(bdbl)) {
+                    return 0;
+                } else {
+                    return -1;
+                }
+            } else if(asn_isnan(bdbl)) {
+                return 1;
+            }
+            /* Value comparison. */
+            if(adbl < bdbl) {
+                return -1;
+            } else if(adbl > bdbl) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else if(ra) {
+            return -1;
+        } else {
+            return 1;
+        }
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+asn_enc_rval_t
+REAL_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                void *app_key) {
+	const REAL_t *st = (const REAL_t *)sptr;
+	asn_enc_rval_t er = {0,0,0};
+	double d;
+
+	(void)ilevel;
+
+	if(!st || !st->buf || asn_REAL2double(st, &d))
+		ASN__ENCODE_FAILED;
+
+	er.encoded = REAL__dump(d, flags & XER_F_CANONICAL, cb, app_key);
+	if(er.encoded < 0) ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+
+/*
+ * Decode the chunk of XML text encoding REAL.
+ */
+static enum xer_pbd_rval
+REAL__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
+                      const void *chunk_buf, size_t chunk_size) {
+    REAL_t *st = (REAL_t *)sptr;
+	double value;
+	const char *xerdata = (const char *)chunk_buf;
+	char *endptr = 0;
+	char *b;
+
+	(void)td;
+
+	if(!chunk_size) return XPBD_BROKEN_ENCODING;
+
+	/*
+	 * Decode an XMLSpecialRealValue: <MINUS-INFINITY>, etc.
+	 */
+	if(xerdata[0] == 0x3c /* '<' */) {
+		size_t i;
+		for(i = 0; i < sizeof(specialRealValue)
+				/ sizeof(specialRealValue[0]); i++) {
+			struct specialRealValue_s *srv = &specialRealValue[i];
+			double dv;
+
+			if(srv->length != chunk_size
+			|| memcmp(srv->string, chunk_buf, chunk_size))
+				continue;
+
+			/*
+			 * It could've been done using
+			 * (double)srv->dv / real_zero,
+			 * but it summons fp exception on some platforms.
+			 */
+			switch(srv->dv) {
+			case -1: dv = - INFINITY; break;
+			case 0: dv = NAN;	break;
+			case 1: dv = INFINITY;	break;
+			default: return XPBD_SYSTEM_FAILURE;
+			}
+
+			if(asn_double2REAL(st, dv))
+				return XPBD_SYSTEM_FAILURE;
+
+			return XPBD_BODY_CONSUMED;
+		}
+		ASN_DEBUG("Unknown XMLSpecialRealValue");
+		return XPBD_BROKEN_ENCODING;
+	}
+
+	/*
+	 * Copy chunk into the nul-terminated string, and run strtod.
+	 */
+	b = (char *)MALLOC(chunk_size + 1);
+	if(!b) return XPBD_SYSTEM_FAILURE;
+	memcpy(b, chunk_buf, chunk_size);
+	b[chunk_size] = 0;	/* nul-terminate */
+
+	value = strtod(b, &endptr);
+	FREEMEM(b);
+	if(endptr == b) return XPBD_BROKEN_ENCODING;
+
+	if(asn_double2REAL(st, value))
+		return XPBD_SYSTEM_FAILURE;
+
+	return XPBD_BODY_CONSUMED;
+}
+
+asn_dec_rval_t
+REAL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td, void **sptr,
+                const char *opt_mname, const void *buf_ptr, size_t size) {
+    return xer_decode_primitive(opt_codec_ctx, td,
+		sptr, sizeof(REAL_t), opt_mname,
+		buf_ptr, size, REAL__xer_body_decode);
+}
+
+int
+asn_REAL2double(const REAL_t *st, double *dbl_value) {
+	unsigned int octv;
+
+	if(!st || !st->buf) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(st->size == 0) {
+		*dbl_value = 0;
+		return 0;
+	}
+
+	octv = st->buf[0];	/* unsigned byte */
+
+	switch(octv & 0xC0) {
+	case 0x40:	/* X.690: 8.5.6 a) => 8.5.9 */
+		/* "SpecialRealValue" */
+
+		/* Be liberal in what you accept...
+		 * http://en.wikipedia.org/wiki/Robustness_principle
+		if(st->size != 1) ...
+		*/
+
+		switch(st->buf[0]) {
+		case 0x40:	/* 01000000: PLUS-INFINITY */
+			*dbl_value = INFINITY;
+			return 0;
+		case 0x41:	/* 01000001: MINUS-INFINITY */
+			*dbl_value = - INFINITY;
+			return 0;
+		case 0x42:	/* 01000010: NOT-A-NUMBER */
+			*dbl_value = NAN;
+			return 0;
+		case 0x43:	/* 01000011: minus zero */
+			*dbl_value = -0.0;
+			return 0;
+		}
+
+		errno = EINVAL;
+		return -1;
+	case 0x00: {	/* X.690: 8.5.7 */
+		/*
+		 * Decimal. NR{1,2,3} format from ISO 6093.
+		 * NR1: [ ]*[+-]?[0-9]+
+		 * NR2: [ ]*[+-]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)
+		 * NR3: [ ]*[+-]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)[Ee][+-]?[0-9]+
+		 */
+		double d;
+		char *source = 0;
+		char *endptr;
+		int used_malloc = 0;
+
+		if(octv == 0 || (octv & 0x3C)) {
+			/* Remaining values of bits 6 to 1 are Reserved. */
+			errno = EINVAL;
+			return -1;
+		}
+
+		/* 1. By contract, an input buffer should be '\0'-terminated.
+		 * OCTET STRING decoder ensures that, as is asn_double2REAL().
+		 * 2. ISO 6093 specifies COMMA as a possible decimal separator.
+		 * However, strtod() can't always deal with COMMA.
+		 * So her we fix both by reallocating, copying and fixing.
+		 */
+		if(st->buf[st->size] != '\0' || memchr(st->buf, ',', st->size)) {
+			const uint8_t *p, *end;
+			char *b;
+
+            b = source = (char *)MALLOC(st->size + 1);
+            if(!source) return -1;
+            used_malloc = 1;
+
+			/* Copy without the first byte and with 0-termination */
+			for(p = st->buf + 1, end = st->buf + st->size;
+					p < end; b++, p++)
+				*b = (*p == ',') ? '.' : *p;
+			*b = '\0';
+		} else {
+			source = (char *)&st->buf[1];
+		}
+
+		endptr = source;
+		d = strtod(source, &endptr);
+		if(*endptr != '\0') {
+			/* Format is not consistent with ISO 6093 */
+			if(used_malloc) FREEMEM(source);
+			errno = EINVAL;
+			return -1;
+		}
+		if(used_malloc) FREEMEM(source);
+		if(asn_isfinite(d)) {
+			*dbl_value = d;
+			return 0;
+		} else {
+			errno = ERANGE;
+			return -1;
+		}
+	  }
+	}
+
+	/*
+	 * Binary representation.
+	 */
+    {
+	double m;
+	int32_t expval;		/* exponent value */
+	unsigned int elen;	/* exponent value length, in octets */
+	int scaleF;
+	int baseF;
+	uint8_t *ptr;
+	uint8_t *end;
+	int sign;
+
+	switch((octv & 0x30) >> 4) {
+	case 0x00: baseF = 1; break;	/* base 2 */
+	case 0x01: baseF = 3; break;	/* base 8 */
+	case 0x02: baseF = 4; break;	/* base 16 */
+	default:
+		/* Reserved field, can't parse now. */
+		errno = EINVAL;
+		return -1;
+	}
+
+	sign = (octv & 0x40);	/* bit 7 */
+	scaleF = (octv & 0x0C) >> 2;	/* bits 4 to 3 */
+
+	if(st->size <= 1 + (octv & 0x03)) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	elen = (octv & 0x03);	/* bits 2 to 1; 8.5.6.4 */
+	if(elen == 0x03) {	/* bits 2 to 1 = 11; 8.5.6.4, case d) */
+		elen = st->buf[1];	/* unsigned binary number */
+		if(elen == 0 || st->size <= (2 + elen)) {
+			errno = EINVAL;
+			return -1;
+		}
+		/* FIXME: verify constraints of case d) */
+		ptr = &st->buf[2];
+	} else {
+		ptr = &st->buf[1];
+	}
+
+	/* Fetch the multibyte exponent */
+	expval = (int)(*(int8_t *)ptr);
+	if(elen >= sizeof(expval)-1) {
+		errno = ERANGE;
+		return -1;
+	}
+	end = ptr + elen + 1;
+	for(ptr++; ptr < end; ptr++)
+		expval = (expval * 256) + *ptr;
+
+	m = 0.0;	/* Initial mantissa value */
+
+	/* Okay, the exponent is here. Now, what about mantissa? */
+	end = st->buf + st->size;
+	for(; ptr < end; ptr++)
+		m = ldexp(m, 8) + *ptr;
+
+	if(0)
+	ASN_DEBUG("m=%.10f, scF=%d, bF=%d, expval=%d, ldexp()=%f, ldexp()=%f\n",
+		m, scaleF, baseF, expval,
+		ldexp(m, expval * baseF + scaleF),
+		ldexp(m, scaleF) * pow(pow(2, baseF), expval)
+	);
+
+	/*
+	 * (S * N * 2^F) * B^E
+	 * Essentially:
+	m = ldexp(m, scaleF) * pow(pow(2, baseF), expval);
+	 */
+	m = ldexp(m, expval * baseF + scaleF);
+	if(asn_isfinite(m)) {
+		*dbl_value = sign ? -m : m;
+	} else {
+		errno = ERANGE;
+		return -1;
+	}
+
+    } /* if(binary_format) */
+
+	return 0;
+}
+
+/*
+ * Assume IEEE 754 floating point: standard 64 bit double.
+ * [1 bit sign]  [11 bits exponent]  [52 bits mantissa]
+ */
+int
+asn_double2REAL(REAL_t *st, double dbl_value) {
+    double test = -0.0;
+    int float_big_endian = *(const char *)&test != 0;
+	uint8_t buf[16];	/* More than enough for 8-byte dbl_value */
+	uint8_t dscr[sizeof(dbl_value)];	/* double value scratch pad */
+	/* Assertion guards: won't even compile, if unexpected double size */
+	char assertion_buffer1[9 - sizeof(dbl_value)] CC_NOTUSED;
+	char assertion_buffer2[sizeof(dbl_value) - 7] CC_NOTUSED;
+	uint8_t *ptr = buf;
+	uint8_t *mstop;		/* Last byte of mantissa */
+	unsigned int mval;	/* Value of the last byte of mantissa */
+	unsigned int bmsign;	/* binary mask with sign */
+	unsigned int buflen;
+	unsigned int accum;
+	int expval;
+
+	if(!st) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	/*
+	 * ilogb(+-0) returns -INT_MAX or INT_MIN (platform-dependent)
+	 * ilogb(+-inf) returns INT_MAX, logb(+-inf) returns +inf
+	 * ilogb(NaN) returns INT_MIN or INT_MAX (platform-dependent)
+	 */
+	expval = ilogb(dbl_value);
+	if(expval <= -INT_MAX	/* Also catches +-0 and maybe isnan() */
+	|| expval == INT_MAX	/* catches isfin() and maybe isnan() */
+	) {
+		if(!st->buf || st->size < 2) {
+			ptr = (uint8_t *)MALLOC(2);
+			if(!ptr) return -1;
+			if(st->buf) FREEMEM(st->buf);
+			st->buf = ptr;
+		}
+		/* fpclassify(3) is not portable yet */
+		if(asn_isnan(dbl_value)) {
+			st->buf[0] = 0x42;	/* NaN */
+			st->buf[1] = 0;
+			st->size = 1;
+		} else if(!asn_isfinite(dbl_value)) {
+			if(copysign(1.0, dbl_value) < 0.0) {
+				st->buf[0] = 0x41;	/* MINUS-INFINITY */
+			} else {
+				st->buf[0] = 0x40;	/* PLUS-INFINITY */
+			}
+			st->buf[1] = 0;
+			st->size = 1;
+		} else {
+			if(copysign(1.0, dbl_value) >= 0.0) {
+				/* no content octets: positive zero */
+				st->buf[0] = 0;	/* JIC */
+				st->size = 0;
+			} else {
+				/* Negative zero. #8.5.3, 8.5.9 */
+				st->buf[0] = 0x43;
+				st->buf[1] = 0;
+				st->size = 1;
+			}
+		}
+		return 0;
+	}
+
+	if(float_big_endian) {
+		uint8_t *s = ((uint8_t *)&dbl_value) + 1;
+		uint8_t *end = ((uint8_t *)&dbl_value) + sizeof(double);
+		uint8_t *d;
+
+		bmsign = 0x80 | ((s[-1] >> 1) & 0x40);	/* binary mask & - */
+		for(mstop = d = dscr; s < end; d++, s++) {
+			*d = *s;
+			if(*d) mstop = d;
+		}
+    } else {
+		uint8_t *s = ((uint8_t *)&dbl_value) + sizeof(dbl_value) - 2;
+		uint8_t *start = ((uint8_t *)&dbl_value);
+		uint8_t *d;
+
+		bmsign = 0x80 | ((s[1] >> 1) & 0x40);	/* binary mask & - */
+		for(mstop = d = dscr; s >= start; d++, s--) {
+			*d = *s;
+			if(*d) mstop = d;
+		}
+    }
+
+	/* Remove parts of the exponent, leave mantissa and explicit 1. */
+	dscr[0] = 0x10 | (dscr[0] & 0x0f);
+
+	/* Adjust exponent in a very unobvious way */
+	expval -= 8 * ((mstop - dscr) + 1) - 4;
+
+	/* This loop ensures DER conformance by forcing mantissa odd: 11.3.1 */
+	mval = *mstop;
+	if(mval && !(mval & 1)) {
+		int shift_count = 1;
+		int ishift;
+		uint8_t *mptr;
+
+		/*
+		 * Figure out what needs to be done to make mantissa odd.
+		 */
+		if(!(mval & 0x0f))	/* Speed-up a little */
+			shift_count = 4;
+		while(((mval >> shift_count) & 1) == 0)
+			shift_count++;
+
+		ishift = 8 - shift_count;
+		accum = 0;
+
+		/* Go over the buffer, shifting it shift_count bits right. */
+		for(mptr = dscr; mptr <= mstop; mptr++) {
+			mval = *mptr;
+			*mptr = accum | (mval >> shift_count);
+			accum = mval << ishift;
+		}
+
+		/* Adjust exponent appropriately. */
+		expval += shift_count;
+	}
+
+	if(expval < 0) {
+		if((expval >> 7) == -1) {
+			*ptr++ = bmsign | 0x00;
+			*ptr++ = expval;
+		} else if((expval >> 15) == -1) {
+			*ptr++ = bmsign | 0x01;
+			*ptr++ = expval >> 8;
+			*ptr++ = expval;
+		} else {
+			*ptr++ = bmsign | 0x02;
+			*ptr++ = expval >> 16;
+			*ptr++ = expval >> 8;
+			*ptr++ = expval;
+		}
+	} else if(expval <= 0x7f) {
+		*ptr++ = bmsign | 0x00;
+		*ptr++ = expval;
+	} else if(expval <= 0x7fff) {
+		*ptr++ = bmsign | 0x01;
+		*ptr++ = expval >> 8;
+		*ptr++ = expval;
+	} else {
+		assert(expval <= 0x7fffff);
+		*ptr++ = bmsign | 0x02;
+		*ptr++ = expval >> 16;
+		*ptr++ = expval >> 8;
+		*ptr++ = expval;
+	}
+
+	buflen = (mstop - dscr) + 1;
+	memcpy(ptr, dscr, buflen);
+	ptr += buflen;
+	buflen = ptr - buf;
+
+	ptr = (uint8_t *)MALLOC(buflen + 1);
+	if(!ptr) return -1;
+
+	memcpy(ptr, buf, buflen);
+	buf[buflen] = 0;	/* JIC */
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = ptr;
+	st->size = buflen;
+
+	return 0;
+}
+
+int CC_ATTR_NO_SANITIZE("float-cast-overflow")
+asn_double2float(double d, float *outcome) {
+    float f = d;
+
+    *outcome = f;
+
+    if(asn_isfinite(d) == asn_isfinite(f)) {
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+/*
+ * Encode as Canonical OER
+ */
+asn_enc_rval_t
+REAL_encode_oer(const asn_TYPE_descriptor_t *td,
+                const asn_oer_constraints_t *constraints, const void *sptr,
+                asn_app_consume_bytes_f *cb, void *app_key) {
+    const REAL_t *st = sptr;
+    asn_enc_rval_t er = {0,0,0};
+    ssize_t len_len;
+
+    if(!st || !st->buf || !td)
+        ASN__ENCODE_FAILED;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints && constraints->value.width != 0) {
+        /* If we're constrained to a narrow float/double representation, we
+         * shouldn't have ended up using REAL. Expecting NativeReal. */
+        ASN__ENCODE_FAILED;
+    }
+
+    /* Encode a fake REAL */
+    len_len = oer_serialize_length(st->size, cb, app_key);
+    if(len_len < 0 || cb(st->buf, st->size, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        er.encoded = len_len + st->size;
+        ASN__ENCODED_OK(er);
+    }
+}
+
+asn_dec_rval_t
+REAL_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td,
+                const asn_oer_constraints_t *constraints, void **sptr,
+                const void *ptr, size_t size) {
+    asn_dec_rval_t ok = {RC_OK, 0};
+    REAL_t *st;
+    uint8_t *buf;
+    ssize_t len_len;
+    size_t real_body_len;
+
+    (void)opt_codec_ctx;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints && constraints->value.width != 0) {
+        /* If we're constrained to a narrow float/double representation, we
+         * shouldn't have ended up using REAL. Expecting NativeReal. */
+        ASN__DECODE_FAILED;
+    }
+
+    len_len = oer_fetch_length(ptr, size, &real_body_len);
+    if(len_len < 0) ASN__DECODE_FAILED;
+    if(len_len == 0) ASN__DECODE_STARVED;
+
+    ptr = (const char *)ptr + len_len;
+    size -= len_len;
+
+    if(real_body_len > size) ASN__DECODE_STARVED;
+
+    buf = CALLOC(1, real_body_len + 1);
+    if(!buf) ASN__DECODE_FAILED;
+
+    if(!(st = *sptr)) {
+        st = (*sptr = CALLOC(1, sizeof(REAL_t)));
+        if(!st) {
+            FREEMEM(buf);
+            ASN__DECODE_FAILED;
+        }
+    } else {
+        FREEMEM(st->buf);
+    }
+
+    memcpy(buf, ptr, real_body_len);
+    buf[real_body_len] = '\0';
+
+    st->buf = buf;
+    st->size = real_body_len;
+
+    ok.consumed = len_len + real_body_len;
+    return ok;
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+REAL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                 const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints, void **sptr,
+                 asn_per_data_t *pd) {
+    (void)constraints;	/* No PER visible constraints */
+	return OCTET_STRING_decode_uper(opt_codec_ctx, td, 0, sptr, pd);
+}
+
+asn_enc_rval_t
+REAL_encode_uper(const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints, const void *sptr,
+                 asn_per_outp_t *po) {
+    (void)constraints;	/* No PER visible constraints */
+	return OCTET_STRING_encode_uper(td, 0, sptr, po);
+}
+
+asn_dec_rval_t
+REAL_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                 const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints,
+                 void **sptr, asn_per_data_t *pd) {
+	(void)constraints;	/* No PER visible constraints */
+	return OCTET_STRING_decode_aper(opt_codec_ctx, td, 0, sptr, pd);
+}
+
+asn_enc_rval_t
+REAL_encode_aper(const asn_TYPE_descriptor_t *td,
+                 const asn_per_constraints_t *constraints,
+                 const void *sptr, asn_per_outp_t *po) {
+	(void)constraints;	/* No PER visible constraints */
+	return OCTET_STRING_encode_aper(td, 0, sptr, po);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+asn_random_fill_result_t
+REAL_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                       const asn_encoding_constraints_t *constraints,
+                       size_t max_length) {
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    static const double values[] = {
+        0, -0.0, -1, 1, -M_E, M_E, -3.14, 3.14, -M_PI, M_PI, -255, 255,
+        /* 2^51 */
+        -2251799813685248.0, 2251799813685248.0,
+        /* 2^52 */
+        -4503599627370496.0, 4503599627370496.0,
+        /* 2^100 */
+        -1267650600228229401496703205376.0, 1267650600228229401496703205376.0,
+        -FLT_MIN, FLT_MIN,
+        -FLT_MAX, FLT_MAX,
+        -DBL_MIN, DBL_MIN,
+        -DBL_MAX, DBL_MAX,
+#ifdef  FLT_TRUE_MIN
+        -FLT_TRUE_MIN, FLT_TRUE_MIN,
+#endif
+#ifdef  DBL_TRUE_MIN
+        -DBL_TRUE_MIN, DBL_TRUE_MIN,
+#endif
+        INFINITY, -INFINITY, NAN};
+    REAL_t *st;
+    double d;
+
+    (void)constraints;
+
+    if(max_length == 0) return result_skipped;
+
+    d = values[asn_random_between(0, sizeof(values) / sizeof(values[0]) - 1)];
+
+    if(*sptr) {
+        st = *sptr;
+    } else {
+        st = (REAL_t*)(*sptr = CALLOC(1, sizeof(REAL_t)));
+        if(!st) {
+            return result_failed;
+        }
+    }
+
+    if(asn_double2REAL(st, d)) {
+        if(st == *sptr) {
+            ASN_STRUCT_RESET(*td, st);
+        } else {
+            ASN_STRUCT_FREE(*td, st);
+        }
+        return result_failed;
+    }
+
+    result_ok.length = st->size;
+    return result_ok;
+}
+
diff --git a/e2sm/lib/RIC-ControlAction-ID.c b/e2sm/lib/RIC-ControlAction-ID.c
new file mode 100644
index 0000000..b0a0178
--- /dev/null
+++ b/e2sm/lib/RIC-ControlAction-ID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-ControlAction-ID.h"
+
+int
+RIC_ControlAction_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RIC_ControlAction_ID_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RIC_ControlAction_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RIC_ControlAction_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_ControlAction_ID = {
+	"RIC-ControlAction-ID",
+	"RIC-ControlAction-ID",
+	&asn_OP_NativeInteger,
+	asn_DEF_RIC_ControlAction_ID_tags_1,
+	sizeof(asn_DEF_RIC_ControlAction_ID_tags_1)
+		/sizeof(asn_DEF_RIC_ControlAction_ID_tags_1[0]), /* 1 */
+	asn_DEF_RIC_ControlAction_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_ControlAction_ID_tags_1)
+		/sizeof(asn_DEF_RIC_ControlAction_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RIC_ControlAction_ID_constr_1, &asn_PER_type_RIC_ControlAction_ID_constr_1, RIC_ControlAction_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RIC-ControlAction-Item.c b/e2sm/lib/RIC-ControlAction-Item.c
new file mode 100644
index 0000000..cc89d2d
--- /dev/null
+++ b/e2sm/lib/RIC-ControlAction-Item.c
@@ -0,0 +1,152 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-ControlAction-Item.h"
+
+#include "RAN-ControlParameter-Item.h"
+static int
+memb_ran_ControlParameters_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 4294967295)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_ran_ControlParameters_List_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_type_ran_ControlParameters_List_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ran_ControlParameters_List_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..4294967295)) */};
+static asn_per_constraints_t asn_PER_memb_ran_ControlParameters_List_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 32, -1,  1,  4294967295 }	/* (SIZE(1..4294967295)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_ran_ControlParameters_List_4[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RAN_ControlParameter_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ran_ControlParameters_List_tags_4[] = {
+	(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_ran_ControlParameters_List_specs_4 = {
+	sizeof(struct RIC_ControlAction_Item__ran_ControlParameters_List),
+	offsetof(struct RIC_ControlAction_Item__ran_ControlParameters_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ran_ControlParameters_List_4 = {
+	"ran-ControlParameters-List",
+	"ran-ControlParameters-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ran_ControlParameters_List_tags_4,
+	sizeof(asn_DEF_ran_ControlParameters_List_tags_4)
+		/sizeof(asn_DEF_ran_ControlParameters_List_tags_4[0]) - 1, /* 1 */
+	asn_DEF_ran_ControlParameters_List_tags_4,	/* Same as above */
+	sizeof(asn_DEF_ran_ControlParameters_List_tags_4)
+		/sizeof(asn_DEF_ran_ControlParameters_List_tags_4[0]), /* 2 */
+	{ &asn_OER_type_ran_ControlParameters_List_constr_4, &asn_PER_type_ran_ControlParameters_List_constr_4, SEQUENCE_OF_constraint },
+	asn_MBR_ran_ControlParameters_List_4,
+	1,	/* Single element */
+	&asn_SPC_ran_ControlParameters_List_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RIC_ControlAction_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ControlAction_Item, ric_ControlAction_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_ControlAction_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlAction-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ControlAction_Item, ric_ControlAction_Name),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_ControlAction_Name,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlAction-Name"
+		},
+	{ ATF_POINTER, 1, offsetof(struct RIC_ControlAction_Item, ran_ControlParameters_List),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		0,
+		&asn_DEF_ran_ControlParameters_List_4,
+		0,
+		{ &asn_OER_memb_ran_ControlParameters_List_constr_4, &asn_PER_memb_ran_ControlParameters_List_constr_4,  memb_ran_ControlParameters_List_constraint_1 },
+		0, 0, /* No default value */
+		"ran-ControlParameters-List"
+		},
+};
+static const int asn_MAP_RIC_ControlAction_Item_oms_1[] = { 2 };
+static const ber_tlv_tag_t asn_DEF_RIC_ControlAction_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RIC_ControlAction_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ric-ControlAction-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ric-ControlAction-Name */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ran-ControlParameters-List */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RIC_ControlAction_Item_specs_1 = {
+	sizeof(struct RIC_ControlAction_Item),
+	offsetof(struct RIC_ControlAction_Item, _asn_ctx),
+	asn_MAP_RIC_ControlAction_Item_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_RIC_ControlAction_Item_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_ControlAction_Item = {
+	"RIC-ControlAction-Item",
+	"RIC-ControlAction-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RIC_ControlAction_Item_tags_1,
+	sizeof(asn_DEF_RIC_ControlAction_Item_tags_1)
+		/sizeof(asn_DEF_RIC_ControlAction_Item_tags_1[0]), /* 1 */
+	asn_DEF_RIC_ControlAction_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_ControlAction_Item_tags_1)
+		/sizeof(asn_DEF_RIC_ControlAction_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RIC_ControlAction_Item_1,
+	3,	/* Elements count */
+	&asn_SPC_RIC_ControlAction_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RIC-ControlAction-Name.c b/e2sm/lib/RIC-ControlAction-Name.c
new file mode 100644
index 0000000..346ea42
--- /dev/null
+++ b/e2sm/lib/RIC-ControlAction-Name.c
@@ -0,0 +1,109 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-ControlAction-Name.h"
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_1[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+	const int *table = permitted_alphabet_table_1;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+int
+RIC_ControlAction_Name_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_1(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_RIC_ControlAction_Name_1_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+		return -1;
+	return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_RIC_ControlAction_Name_1_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+		return -1;
+	return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using PrintableString,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RIC_ControlAction_Name_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+asn_per_constraints_t asn_PER_type_RIC_ControlAction_Name_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_RIC_ControlAction_Name_1_v2c,	/* Value to PER code map */
+	asn_PER_MAP_RIC_ControlAction_Name_1_c2v	/* PER code to value map */
+};
+static const ber_tlv_tag_t asn_DEF_RIC_ControlAction_Name_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_ControlAction_Name = {
+	"RIC-ControlAction-Name",
+	"RIC-ControlAction-Name",
+	&asn_OP_PrintableString,
+	asn_DEF_RIC_ControlAction_Name_tags_1,
+	sizeof(asn_DEF_RIC_ControlAction_Name_tags_1)
+		/sizeof(asn_DEF_RIC_ControlAction_Name_tags_1[0]), /* 1 */
+	asn_DEF_RIC_ControlAction_Name_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_ControlAction_Name_tags_1)
+		/sizeof(asn_DEF_RIC_ControlAction_Name_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RIC_ControlAction_Name_constr_1, &asn_PER_type_RIC_ControlAction_Name_constr_1, RIC_ControlAction_Name_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RIC-ControlStyle-Item.c b/e2sm/lib/RIC-ControlStyle-Item.c
new file mode 100644
index 0000000..9aae0c9
--- /dev/null
+++ b/e2sm/lib/RIC-ControlStyle-Item.c
@@ -0,0 +1,172 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-ControlStyle-Item.h"
+
+#include "RIC-ControlAction-Item.h"
+static int
+memb_ric_ControlAction_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 65535)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_ric_ControlAction_List_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..65535)) */};
+static asn_per_constraints_t asn_PER_type_ric_ControlAction_List_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  1,  65535 }	/* (SIZE(1..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ric_ControlAction_List_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..65535)) */};
+static asn_per_constraints_t asn_PER_memb_ric_ControlAction_List_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  1,  65535 }	/* (SIZE(1..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_ric_ControlAction_List_4[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RIC_ControlAction_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ric_ControlAction_List_tags_4[] = {
+	(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_ric_ControlAction_List_specs_4 = {
+	sizeof(struct RIC_ControlStyle_Item__ric_ControlAction_List),
+	offsetof(struct RIC_ControlStyle_Item__ric_ControlAction_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_ric_ControlAction_List_4 = {
+	"ric-ControlAction-List",
+	"ric-ControlAction-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ric_ControlAction_List_tags_4,
+	sizeof(asn_DEF_ric_ControlAction_List_tags_4)
+		/sizeof(asn_DEF_ric_ControlAction_List_tags_4[0]) - 1, /* 1 */
+	asn_DEF_ric_ControlAction_List_tags_4,	/* Same as above */
+	sizeof(asn_DEF_ric_ControlAction_List_tags_4)
+		/sizeof(asn_DEF_ric_ControlAction_List_tags_4[0]), /* 2 */
+	{ &asn_OER_type_ric_ControlAction_List_constr_4, &asn_PER_type_ric_ControlAction_List_constr_4, SEQUENCE_OF_constraint },
+	asn_MBR_ric_ControlAction_List_4,
+	1,	/* Single element */
+	&asn_SPC_ric_ControlAction_List_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RIC_ControlStyle_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ControlStyle_Item, ric_ControlStyle_Type),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlStyle-Type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ControlStyle_Item, ric_ControlStyle_Name),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Name,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlStyle-Name"
+		},
+	{ ATF_POINTER, 1, offsetof(struct RIC_ControlStyle_Item, ric_ControlAction_List),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		0,
+		&asn_DEF_ric_ControlAction_List_4,
+		0,
+		{ &asn_OER_memb_ric_ControlAction_List_constr_4, &asn_PER_memb_ric_ControlAction_List_constr_4,  memb_ric_ControlAction_List_constraint_1 },
+		0, 0, /* No default value */
+		"ric-ControlAction-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ControlStyle_Item, ric_ControlHeaderFormat_Type),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Format_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlHeaderFormat-Type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ControlStyle_Item, ric_ControlMessageFormat_Type),
+		(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Format_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ControlMessageFormat-Type"
+		},
+};
+static const int asn_MAP_RIC_ControlStyle_Item_oms_1[] = { 2 };
+static const ber_tlv_tag_t asn_DEF_RIC_ControlStyle_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RIC_ControlStyle_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ric-ControlStyle-Type */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ric-ControlStyle-Name */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ric-ControlAction-List */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ric-ControlHeaderFormat-Type */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* ric-ControlMessageFormat-Type */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RIC_ControlStyle_Item_specs_1 = {
+	sizeof(struct RIC_ControlStyle_Item),
+	offsetof(struct RIC_ControlStyle_Item, _asn_ctx),
+	asn_MAP_RIC_ControlStyle_Item_tag2el_1,
+	5,	/* Count of tags in the map */
+	asn_MAP_RIC_ControlStyle_Item_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	5,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_ControlStyle_Item = {
+	"RIC-ControlStyle-Item",
+	"RIC-ControlStyle-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RIC_ControlStyle_Item_tags_1,
+	sizeof(asn_DEF_RIC_ControlStyle_Item_tags_1)
+		/sizeof(asn_DEF_RIC_ControlStyle_Item_tags_1[0]), /* 1 */
+	asn_DEF_RIC_ControlStyle_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_ControlStyle_Item_tags_1)
+		/sizeof(asn_DEF_RIC_ControlStyle_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RIC_ControlStyle_Item_1,
+	5,	/* Elements count */
+	&asn_SPC_RIC_ControlStyle_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RIC-EventTriggerStyle-Item.c b/e2sm/lib/RIC-EventTriggerStyle-Item.c
new file mode 100644
index 0000000..029f300
--- /dev/null
+++ b/e2sm/lib/RIC-EventTriggerStyle-Item.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-EventTriggerStyle-Item.h"
+
+asn_TYPE_member_t asn_MBR_RIC_EventTriggerStyle_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_EventTriggerStyle_Item, ric_EventTriggerStyle_Type),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-EventTriggerStyle-Type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_EventTriggerStyle_Item, ric_EventTriggerStyle_Name),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Name,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-EventTriggerStyle-Name"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_EventTriggerStyle_Item, ric_EventTriggerFormat_Type),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Format_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-EventTriggerFormat-Type"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RIC_EventTriggerStyle_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RIC_EventTriggerStyle_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ric-EventTriggerStyle-Type */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ric-EventTriggerStyle-Name */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ric-EventTriggerFormat-Type */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RIC_EventTriggerStyle_Item_specs_1 = {
+	sizeof(struct RIC_EventTriggerStyle_Item),
+	offsetof(struct RIC_EventTriggerStyle_Item, _asn_ctx),
+	asn_MAP_RIC_EventTriggerStyle_Item_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_EventTriggerStyle_Item = {
+	"RIC-EventTriggerStyle-Item",
+	"RIC-EventTriggerStyle-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RIC_EventTriggerStyle_Item_tags_1,
+	sizeof(asn_DEF_RIC_EventTriggerStyle_Item_tags_1)
+		/sizeof(asn_DEF_RIC_EventTriggerStyle_Item_tags_1[0]), /* 1 */
+	asn_DEF_RIC_EventTriggerStyle_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_EventTriggerStyle_Item_tags_1)
+		/sizeof(asn_DEF_RIC_EventTriggerStyle_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RIC_EventTriggerStyle_Item_1,
+	3,	/* Elements count */
+	&asn_SPC_RIC_EventTriggerStyle_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RIC-Format-Type.c b/e2sm/lib/RIC-Format-Type.c
new file mode 100644
index 0000000..8242722
--- /dev/null
+++ b/e2sm/lib/RIC-Format-Type.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-Format-Type.h"
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RIC_Format_Type_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_Format_Type = {
+	"RIC-Format-Type",
+	"RIC-Format-Type",
+	&asn_OP_NativeInteger,
+	asn_DEF_RIC_Format_Type_tags_1,
+	sizeof(asn_DEF_RIC_Format_Type_tags_1)
+		/sizeof(asn_DEF_RIC_Format_Type_tags_1[0]), /* 1 */
+	asn_DEF_RIC_Format_Type_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_Format_Type_tags_1)
+		/sizeof(asn_DEF_RIC_Format_Type_tags_1[0]), /* 1 */
+	{ 0, 0, NativeInteger_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RIC-ReportStyle-Item.c b/e2sm/lib/RIC-ReportStyle-Item.c
new file mode 100644
index 0000000..9efe8c3
--- /dev/null
+++ b/e2sm/lib/RIC-ReportStyle-Item.c
@@ -0,0 +1,80 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-ReportStyle-Item.h"
+
+asn_TYPE_member_t asn_MBR_RIC_ReportStyle_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ReportStyle_Item, ric_ReportStyle_Type),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ReportStyle-Type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ReportStyle_Item, ric_ReportStyle_Name),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Style_Name,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ReportStyle-Name"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ReportStyle_Item, ric_ReportIndicationHeaderFormat_Type),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Format_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ReportIndicationHeaderFormat-Type"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RIC_ReportStyle_Item, ric_ReportIndicationMessageFormat_Type),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RIC_Format_Type,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ric-ReportIndicationMessageFormat-Type"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RIC_ReportStyle_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RIC_ReportStyle_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ric-ReportStyle-Type */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ric-ReportStyle-Name */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ric-ReportIndicationHeaderFormat-Type */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* ric-ReportIndicationMessageFormat-Type */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RIC_ReportStyle_Item_specs_1 = {
+	sizeof(struct RIC_ReportStyle_Item),
+	offsetof(struct RIC_ReportStyle_Item, _asn_ctx),
+	asn_MAP_RIC_ReportStyle_Item_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	4,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_ReportStyle_Item = {
+	"RIC-ReportStyle-Item",
+	"RIC-ReportStyle-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RIC_ReportStyle_Item_tags_1,
+	sizeof(asn_DEF_RIC_ReportStyle_Item_tags_1)
+		/sizeof(asn_DEF_RIC_ReportStyle_Item_tags_1[0]), /* 1 */
+	asn_DEF_RIC_ReportStyle_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_ReportStyle_Item_tags_1)
+		/sizeof(asn_DEF_RIC_ReportStyle_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RIC_ReportStyle_Item_1,
+	4,	/* Elements count */
+	&asn_SPC_RIC_ReportStyle_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RIC-Style-Name.c b/e2sm/lib/RIC-Style-Name.c
new file mode 100644
index 0000000..7cc5fcc
--- /dev/null
+++ b/e2sm/lib/RIC-Style-Name.c
@@ -0,0 +1,109 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-Style-Name.h"
+
+static const int permitted_alphabet_table_1[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*                  */
+ 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,	/* .      '() +,-./ */
+10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,	/* 0123456789:  = ? */
+ 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,	/*  ABCDEFGHIJKLMNO */
+38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,	/* PQRSTUVWXYZ      */
+ 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,	/*  abcdefghijklmno */
+64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,	/* pqrstuvwxyz      */
+};
+static const int permitted_alphabet_code2value_1[74] = {
+32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
+55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
+75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
+113,114,115,116,117,118,119,120,121,122,};
+
+
+static int check_permitted_alphabet_1(const void *sptr) {
+	const int *table = permitted_alphabet_table_1;
+	/* The underlying type is PrintableString */
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	const uint8_t *ch = st->buf;
+	const uint8_t *end = ch + st->size;
+	
+	for(; ch < end; ch++) {
+		uint8_t cv = *ch;
+		if(!table[cv]) return -1;
+	}
+	return 0;
+}
+
+int
+RIC_Style_Name_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const PrintableString_t *st = (const PrintableString_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size >= 1 && size <= 150)
+		 && !check_permitted_alphabet_1(st)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int asn_PER_MAP_RIC_Style_Name_1_v2c(unsigned int value) {
+	if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
+		return -1;
+	return permitted_alphabet_table_1[value] - 1;
+}
+static int asn_PER_MAP_RIC_Style_Name_1_c2v(unsigned int code) {
+	if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
+		return -1;
+	return permitted_alphabet_code2value_1[code];
+}
+/*
+ * This type is implemented using PrintableString,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RIC_Style_Name_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..MAX)) */};
+asn_per_constraints_t asn_PER_type_RIC_Style_Name_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  32,  122 }	/* (32..122) */,
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }	/* (SIZE(1..150,...)) */,
+	asn_PER_MAP_RIC_Style_Name_1_v2c,	/* Value to PER code map */
+	asn_PER_MAP_RIC_Style_Name_1_c2v	/* PER code to value map */
+};
+static const ber_tlv_tag_t asn_DEF_RIC_Style_Name_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_Style_Name = {
+	"RIC-Style-Name",
+	"RIC-Style-Name",
+	&asn_OP_PrintableString,
+	asn_DEF_RIC_Style_Name_tags_1,
+	sizeof(asn_DEF_RIC_Style_Name_tags_1)
+		/sizeof(asn_DEF_RIC_Style_Name_tags_1[0]), /* 1 */
+	asn_DEF_RIC_Style_Name_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_Style_Name_tags_1)
+		/sizeof(asn_DEF_RIC_Style_Name_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RIC_Style_Name_constr_1, &asn_PER_type_RIC_Style_Name_constr_1, RIC_Style_Name_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RIC-Style-Type.c b/e2sm/lib/RIC-Style-Type.c
new file mode 100644
index 0000000..14475b8
--- /dev/null
+++ b/e2sm/lib/RIC-Style-Type.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RIC-Style-Type.h"
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RIC_Style_Type_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RIC_Style_Type = {
+	"RIC-Style-Type",
+	"RIC-Style-Type",
+	&asn_OP_NativeInteger,
+	asn_DEF_RIC_Style_Type_tags_1,
+	sizeof(asn_DEF_RIC_Style_Type_tags_1)
+		/sizeof(asn_DEF_RIC_Style_Type_tags_1[0]), /* 1 */
+	asn_DEF_RIC_Style_Type_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RIC_Style_Type_tags_1)
+		/sizeof(asn_DEF_RIC_Style_Type_tags_1[0]), /* 1 */
+	{ 0, 0, NativeInteger_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RRCEvent.c b/e2sm/lib/RRCEvent.c
new file mode 100644
index 0000000..8113c36
--- /dev/null
+++ b/e2sm/lib/RRCEvent.c
@@ -0,0 +1,62 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RRCEvent.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RRCEvent_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RRCEvent_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RRCEvent_value2enum_1[] = {
+	{ 0,	2,	"b1" },
+	{ 1,	2,	"a3" },
+	{ 2,	2,	"a5" },
+	{ 3,	8,	"periodic" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RRCEvent_enum2value_1[] = {
+	1,	/* a3(1) */
+	2,	/* a5(2) */
+	0,	/* b1(0) */
+	3	/* periodic(3) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RRCEvent_specs_1 = {
+	asn_MAP_RRCEvent_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RRCEvent_enum2value_1,	/* N => "tag"; sorted by N */
+	4,	/* Number of elements in the maps */
+	5,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RRCEvent_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RRCEvent = {
+	"RRCEvent",
+	"RRCEvent",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RRCEvent_tags_1,
+	sizeof(asn_DEF_RRCEvent_tags_1)
+		/sizeof(asn_DEF_RRCEvent_tags_1[0]), /* 1 */
+	asn_DEF_RRCEvent_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RRCEvent_tags_1)
+		/sizeof(asn_DEF_RRCEvent_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RRCEvent_constr_1, &asn_PER_type_RRCEvent_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RRCEvent_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/RSRP-Range.c b/e2sm/lib/RSRP-Range.c
new file mode 100644
index 0000000..31f13c4
--- /dev/null
+++ b/e2sm/lib/RSRP-Range.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RSRP-Range.h"
+
+int
+RSRP_Range_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 127)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RSRP_Range_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..127) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RSRP_Range_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  127 }	/* (0..127) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RSRP_Range_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RSRP_Range = {
+	"RSRP-Range",
+	"RSRP-Range",
+	&asn_OP_NativeInteger,
+	asn_DEF_RSRP_Range_tags_1,
+	sizeof(asn_DEF_RSRP_Range_tags_1)
+		/sizeof(asn_DEF_RSRP_Range_tags_1[0]), /* 1 */
+	asn_DEF_RSRP_Range_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RSRP_Range_tags_1)
+		/sizeof(asn_DEF_RSRP_Range_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RSRP_Range_constr_1, &asn_PER_type_RSRP_Range_constr_1, RSRP_Range_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RSRP-RangeEUTRA.c b/e2sm/lib/RSRP-RangeEUTRA.c
new file mode 100644
index 0000000..5c646f7
--- /dev/null
+++ b/e2sm/lib/RSRP-RangeEUTRA.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RSRP-RangeEUTRA.h"
+
+int
+RSRP_RangeEUTRA_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 97)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RSRP_RangeEUTRA_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..97) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RSRP_RangeEUTRA_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  97 }	/* (0..97) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RSRP_RangeEUTRA_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RSRP_RangeEUTRA = {
+	"RSRP-RangeEUTRA",
+	"RSRP-RangeEUTRA",
+	&asn_OP_NativeInteger,
+	asn_DEF_RSRP_RangeEUTRA_tags_1,
+	sizeof(asn_DEF_RSRP_RangeEUTRA_tags_1)
+		/sizeof(asn_DEF_RSRP_RangeEUTRA_tags_1[0]), /* 1 */
+	asn_DEF_RSRP_RangeEUTRA_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RSRP_RangeEUTRA_tags_1)
+		/sizeof(asn_DEF_RSRP_RangeEUTRA_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RSRP_RangeEUTRA_constr_1, &asn_PER_type_RSRP_RangeEUTRA_constr_1, RSRP_RangeEUTRA_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RSRQ-Range.c b/e2sm/lib/RSRQ-Range.c
new file mode 100644
index 0000000..0782d80
--- /dev/null
+++ b/e2sm/lib/RSRQ-Range.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RSRQ-Range.h"
+
+int
+RSRQ_Range_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 127)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RSRQ_Range_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..127) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RSRQ_Range_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  127 }	/* (0..127) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RSRQ_Range_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RSRQ_Range = {
+	"RSRQ-Range",
+	"RSRQ-Range",
+	&asn_OP_NativeInteger,
+	asn_DEF_RSRQ_Range_tags_1,
+	sizeof(asn_DEF_RSRQ_Range_tags_1)
+		/sizeof(asn_DEF_RSRQ_Range_tags_1[0]), /* 1 */
+	asn_DEF_RSRQ_Range_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RSRQ_Range_tags_1)
+		/sizeof(asn_DEF_RSRQ_Range_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RSRQ_Range_constr_1, &asn_PER_type_RSRQ_Range_constr_1, RSRQ_Range_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RSRQ-RangeEUTRA.c b/e2sm/lib/RSRQ-RangeEUTRA.c
new file mode 100644
index 0000000..1de3c4e
--- /dev/null
+++ b/e2sm/lib/RSRQ-RangeEUTRA.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RSRQ-RangeEUTRA.h"
+
+int
+RSRQ_RangeEUTRA_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 34)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RSRQ_RangeEUTRA_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..34) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RSRQ_RangeEUTRA_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 6,  6,  0,  34 }	/* (0..34) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RSRQ_RangeEUTRA_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RSRQ_RangeEUTRA = {
+	"RSRQ-RangeEUTRA",
+	"RSRQ-RangeEUTRA",
+	&asn_OP_NativeInteger,
+	asn_DEF_RSRQ_RangeEUTRA_tags_1,
+	sizeof(asn_DEF_RSRQ_RangeEUTRA_tags_1)
+		/sizeof(asn_DEF_RSRQ_RangeEUTRA_tags_1[0]), /* 1 */
+	asn_DEF_RSRQ_RangeEUTRA_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RSRQ_RangeEUTRA_tags_1)
+		/sizeof(asn_DEF_RSRQ_RangeEUTRA_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RSRQ_RangeEUTRA_constr_1, &asn_PER_type_RSRQ_RangeEUTRA_constr_1, RSRQ_RangeEUTRA_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/RT-Period-IE.c b/e2sm/lib/RT-Period-IE.c
new file mode 100644
index 0000000..7edf20d
--- /dev/null
+++ b/e2sm/lib/RT-Period-IE.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "RT-Period-IE.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RT_Period_IE_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RT_Period_IE_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  5,  5,  0,  19 }	/* (0..19,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RT_Period_IE_value2enum_1[] = {
+	{ 0,	4,	"ms10" },
+	{ 1,	4,	"ms20" },
+	{ 2,	4,	"ms32" },
+	{ 3,	4,	"ms40" },
+	{ 4,	4,	"ms60" },
+	{ 5,	4,	"ms64" },
+	{ 6,	4,	"ms70" },
+	{ 7,	4,	"ms80" },
+	{ 8,	5,	"ms128" },
+	{ 9,	5,	"ms160" },
+	{ 10,	5,	"ms256" },
+	{ 11,	5,	"ms320" },
+	{ 12,	5,	"ms512" },
+	{ 13,	5,	"ms640" },
+	{ 14,	6,	"ms1024" },
+	{ 15,	6,	"ms1280" },
+	{ 16,	6,	"ms2048" },
+	{ 17,	6,	"ms2560" },
+	{ 18,	6,	"ms5120" },
+	{ 19,	7,	"ms10240" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RT_Period_IE_enum2value_1[] = {
+	0,	/* ms10(0) */
+	14,	/* ms1024(14) */
+	19,	/* ms10240(19) */
+	8,	/* ms128(8) */
+	15,	/* ms1280(15) */
+	9,	/* ms160(9) */
+	1,	/* ms20(1) */
+	16,	/* ms2048(16) */
+	10,	/* ms256(10) */
+	17,	/* ms2560(17) */
+	2,	/* ms32(2) */
+	11,	/* ms320(11) */
+	3,	/* ms40(3) */
+	12,	/* ms512(12) */
+	18,	/* ms5120(18) */
+	4,	/* ms60(4) */
+	5,	/* ms64(5) */
+	13,	/* ms640(13) */
+	6,	/* ms70(6) */
+	7	/* ms80(7) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RT_Period_IE_specs_1 = {
+	asn_MAP_RT_Period_IE_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RT_Period_IE_enum2value_1,	/* N => "tag"; sorted by N */
+	20,	/* Number of elements in the maps */
+	21,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RT_Period_IE_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RT_Period_IE = {
+	"RT-Period-IE",
+	"RT-Period-IE",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RT_Period_IE_tags_1,
+	sizeof(asn_DEF_RT_Period_IE_tags_1)
+		/sizeof(asn_DEF_RT_Period_IE_tags_1[0]), /* 1 */
+	asn_DEF_RT_Period_IE_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RT_Period_IE_tags_1)
+		/sizeof(asn_DEF_RT_Period_IE_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RT_Period_IE_constr_1, &asn_PER_type_RT_Period_IE_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RT_Period_IE_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ResultsPerCSI-RS-Index.c b/e2sm/lib/ResultsPerCSI-RS-Index.c
new file mode 100644
index 0000000..36abbd9
--- /dev/null
+++ b/e2sm/lib/ResultsPerCSI-RS-Index.c
@@ -0,0 +1,63 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ResultsPerCSI-RS-Index.h"
+
+#include "MeasQuantityResults.h"
+asn_TYPE_member_t asn_MBR_ResultsPerCSI_RS_Index_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResultsPerCSI_RS_Index, csi_RS_Index),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CSI_RS_Index,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"csi-RS-Index"
+		},
+	{ ATF_POINTER, 1, offsetof(struct ResultsPerCSI_RS_Index, csi_RS_Results),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasQuantityResults,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"csi-RS-Results"
+		},
+};
+static const int asn_MAP_ResultsPerCSI_RS_Index_oms_1[] = { 1 };
+static const ber_tlv_tag_t asn_DEF_ResultsPerCSI_RS_Index_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResultsPerCSI_RS_Index_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* csi-RS-Index */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* csi-RS-Results */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ResultsPerCSI_RS_Index_specs_1 = {
+	sizeof(struct ResultsPerCSI_RS_Index),
+	offsetof(struct ResultsPerCSI_RS_Index, _asn_ctx),
+	asn_MAP_ResultsPerCSI_RS_Index_tag2el_1,
+	2,	/* Count of tags in the map */
+	asn_MAP_ResultsPerCSI_RS_Index_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResultsPerCSI_RS_Index = {
+	"ResultsPerCSI-RS-Index",
+	"ResultsPerCSI-RS-Index",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResultsPerCSI_RS_Index_tags_1,
+	sizeof(asn_DEF_ResultsPerCSI_RS_Index_tags_1)
+		/sizeof(asn_DEF_ResultsPerCSI_RS_Index_tags_1[0]), /* 1 */
+	asn_DEF_ResultsPerCSI_RS_Index_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResultsPerCSI_RS_Index_tags_1)
+		/sizeof(asn_DEF_ResultsPerCSI_RS_Index_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResultsPerCSI_RS_Index_1,
+	2,	/* Elements count */
+	&asn_SPC_ResultsPerCSI_RS_Index_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ResultsPerCSI-RS-IndexList.c b/e2sm/lib/ResultsPerCSI-RS-IndexList.c
new file mode 100644
index 0000000..d98d4d1
--- /dev/null
+++ b/e2sm/lib/ResultsPerCSI-RS-IndexList.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ResultsPerCSI-RS-IndexList.h"
+
+#include "ResultsPerCSI-RS-Index.h"
+static asn_oer_constraints_t asn_OER_type_ResultsPerCSI_RS_IndexList_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..64)) */};
+asn_per_constraints_t asn_PER_type_ResultsPerCSI_RS_IndexList_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  64 }	/* (SIZE(1..64)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ResultsPerCSI_RS_IndexList_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResultsPerCSI_RS_Index,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResultsPerCSI_RS_IndexList_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ResultsPerCSI_RS_IndexList_specs_1 = {
+	sizeof(struct ResultsPerCSI_RS_IndexList),
+	offsetof(struct ResultsPerCSI_RS_IndexList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ResultsPerCSI_RS_IndexList = {
+	"ResultsPerCSI-RS-IndexList",
+	"ResultsPerCSI-RS-IndexList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ResultsPerCSI_RS_IndexList_tags_1,
+	sizeof(asn_DEF_ResultsPerCSI_RS_IndexList_tags_1)
+		/sizeof(asn_DEF_ResultsPerCSI_RS_IndexList_tags_1[0]), /* 1 */
+	asn_DEF_ResultsPerCSI_RS_IndexList_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResultsPerCSI_RS_IndexList_tags_1)
+		/sizeof(asn_DEF_ResultsPerCSI_RS_IndexList_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ResultsPerCSI_RS_IndexList_constr_1, &asn_PER_type_ResultsPerCSI_RS_IndexList_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_ResultsPerCSI_RS_IndexList_1,
+	1,	/* Single element */
+	&asn_SPC_ResultsPerCSI_RS_IndexList_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ResultsPerSSB-Index.c b/e2sm/lib/ResultsPerSSB-Index.c
new file mode 100644
index 0000000..5aca175
--- /dev/null
+++ b/e2sm/lib/ResultsPerSSB-Index.c
@@ -0,0 +1,63 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ResultsPerSSB-Index.h"
+
+#include "MeasQuantityResults.h"
+asn_TYPE_member_t asn_MBR_ResultsPerSSB_Index_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResultsPerSSB_Index, ssb_Index),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_SSB_Index,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ssb-Index"
+		},
+	{ ATF_POINTER, 1, offsetof(struct ResultsPerSSB_Index, ssb_Results),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasQuantityResults,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ssb-Results"
+		},
+};
+static const int asn_MAP_ResultsPerSSB_Index_oms_1[] = { 1 };
+static const ber_tlv_tag_t asn_DEF_ResultsPerSSB_Index_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResultsPerSSB_Index_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ssb-Index */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ssb-Results */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ResultsPerSSB_Index_specs_1 = {
+	sizeof(struct ResultsPerSSB_Index),
+	offsetof(struct ResultsPerSSB_Index, _asn_ctx),
+	asn_MAP_ResultsPerSSB_Index_tag2el_1,
+	2,	/* Count of tags in the map */
+	asn_MAP_ResultsPerSSB_Index_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResultsPerSSB_Index = {
+	"ResultsPerSSB-Index",
+	"ResultsPerSSB-Index",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResultsPerSSB_Index_tags_1,
+	sizeof(asn_DEF_ResultsPerSSB_Index_tags_1)
+		/sizeof(asn_DEF_ResultsPerSSB_Index_tags_1[0]), /* 1 */
+	asn_DEF_ResultsPerSSB_Index_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResultsPerSSB_Index_tags_1)
+		/sizeof(asn_DEF_ResultsPerSSB_Index_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResultsPerSSB_Index_1,
+	2,	/* Elements count */
+	&asn_SPC_ResultsPerSSB_Index_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ResultsPerSSB-IndexList.c b/e2sm/lib/ResultsPerSSB-IndexList.c
new file mode 100644
index 0000000..2d7e1ab
--- /dev/null
+++ b/e2sm/lib/ResultsPerSSB-IndexList.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ResultsPerSSB-IndexList.h"
+
+#include "ResultsPerSSB-Index.h"
+static asn_oer_constraints_t asn_OER_type_ResultsPerSSB_IndexList_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..64)) */};
+asn_per_constraints_t asn_PER_type_ResultsPerSSB_IndexList_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  64 }	/* (SIZE(1..64)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ResultsPerSSB_IndexList_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResultsPerSSB_Index,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResultsPerSSB_IndexList_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ResultsPerSSB_IndexList_specs_1 = {
+	sizeof(struct ResultsPerSSB_IndexList),
+	offsetof(struct ResultsPerSSB_IndexList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ResultsPerSSB_IndexList = {
+	"ResultsPerSSB-IndexList",
+	"ResultsPerSSB-IndexList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ResultsPerSSB_IndexList_tags_1,
+	sizeof(asn_DEF_ResultsPerSSB_IndexList_tags_1)
+		/sizeof(asn_DEF_ResultsPerSSB_IndexList_tags_1[0]), /* 1 */
+	asn_DEF_ResultsPerSSB_IndexList_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResultsPerSSB_IndexList_tags_1)
+		/sizeof(asn_DEF_ResultsPerSSB_IndexList_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ResultsPerSSB_IndexList_constr_1, &asn_PER_type_ResultsPerSSB_IndexList_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_ResultsPerSSB_IndexList_1,
+	1,	/* Single element */
+	&asn_SPC_ResultsPerSSB_IndexList_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/S-NSSAI.c b/e2sm/lib/S-NSSAI.c
new file mode 100644
index 0000000..29b31b2
--- /dev/null
+++ b/e2sm/lib/S-NSSAI.c
@@ -0,0 +1,130 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "S-NSSAI.h"
+
+static int
+memb_sST_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size == 1)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_sD_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size == 3)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_sST_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	1	/* (SIZE(1..1)) */};
+static asn_per_constraints_t asn_PER_memb_sST_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  1,  1 }	/* (SIZE(1..1)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_sD_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	3	/* (SIZE(3..3)) */};
+static asn_per_constraints_t asn_PER_memb_sD_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  3,  3 }	/* (SIZE(3..3)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_S_NSSAI_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct S_NSSAI, sST),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_OCTET_STRING,
+		0,
+		{ &asn_OER_memb_sST_constr_2, &asn_PER_memb_sST_constr_2,  memb_sST_constraint_1 },
+		0, 0, /* No default value */
+		"sST"
+		},
+	{ ATF_POINTER, 1, offsetof(struct S_NSSAI, sD),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_OCTET_STRING,
+		0,
+		{ &asn_OER_memb_sD_constr_3, &asn_PER_memb_sD_constr_3,  memb_sD_constraint_1 },
+		0, 0, /* No default value */
+		"sD"
+		},
+};
+static const int asn_MAP_S_NSSAI_oms_1[] = { 1 };
+static const ber_tlv_tag_t asn_DEF_S_NSSAI_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_S_NSSAI_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sST */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sD */
+};
+asn_SEQUENCE_specifics_t asn_SPC_S_NSSAI_specs_1 = {
+	sizeof(struct S_NSSAI),
+	offsetof(struct S_NSSAI, _asn_ctx),
+	asn_MAP_S_NSSAI_tag2el_1,
+	2,	/* Count of tags in the map */
+	asn_MAP_S_NSSAI_oms_1,	/* Optional members */
+	1, 0,	/* Root/Additions */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_S_NSSAI = {
+	"S-NSSAI",
+	"S-NSSAI",
+	&asn_OP_SEQUENCE,
+	asn_DEF_S_NSSAI_tags_1,
+	sizeof(asn_DEF_S_NSSAI_tags_1)
+		/sizeof(asn_DEF_S_NSSAI_tags_1[0]), /* 1 */
+	asn_DEF_S_NSSAI_tags_1,	/* Same as above */
+	sizeof(asn_DEF_S_NSSAI_tags_1)
+		/sizeof(asn_DEF_S_NSSAI_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_S_NSSAI_1,
+	2,	/* Elements count */
+	&asn_SPC_S_NSSAI_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/SINR-Range.c b/e2sm/lib/SINR-Range.c
new file mode 100644
index 0000000..5c1f4ba
--- /dev/null
+++ b/e2sm/lib/SINR-Range.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "SINR-Range.h"
+
+int
+SINR_Range_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 127)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_SINR_Range_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..127) */,
+	-1};
+asn_per_constraints_t asn_PER_type_SINR_Range_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  127 }	/* (0..127) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_SINR_Range_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SINR_Range = {
+	"SINR-Range",
+	"SINR-Range",
+	&asn_OP_NativeInteger,
+	asn_DEF_SINR_Range_tags_1,
+	sizeof(asn_DEF_SINR_Range_tags_1)
+		/sizeof(asn_DEF_SINR_Range_tags_1[0]), /* 1 */
+	asn_DEF_SINR_Range_tags_1,	/* Same as above */
+	sizeof(asn_DEF_SINR_Range_tags_1)
+		/sizeof(asn_DEF_SINR_Range_tags_1[0]), /* 1 */
+	{ &asn_OER_type_SINR_Range_constr_1, &asn_PER_type_SINR_Range_constr_1, SINR_Range_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/SINR-RangeEUTRA.c b/e2sm/lib/SINR-RangeEUTRA.c
new file mode 100644
index 0000000..fdee3e7
--- /dev/null
+++ b/e2sm/lib/SINR-RangeEUTRA.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "SINR-RangeEUTRA.h"
+
+int
+SINR_RangeEUTRA_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 127)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_SINR_RangeEUTRA_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..127) */,
+	-1};
+asn_per_constraints_t asn_PER_type_SINR_RangeEUTRA_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 7,  7,  0,  127 }	/* (0..127) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_SINR_RangeEUTRA_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SINR_RangeEUTRA = {
+	"SINR-RangeEUTRA",
+	"SINR-RangeEUTRA",
+	&asn_OP_NativeInteger,
+	asn_DEF_SINR_RangeEUTRA_tags_1,
+	sizeof(asn_DEF_SINR_RangeEUTRA_tags_1)
+		/sizeof(asn_DEF_SINR_RangeEUTRA_tags_1[0]), /* 1 */
+	asn_DEF_SINR_RangeEUTRA_tags_1,	/* Same as above */
+	sizeof(asn_DEF_SINR_RangeEUTRA_tags_1)
+		/sizeof(asn_DEF_SINR_RangeEUTRA_tags_1[0]), /* 1 */
+	{ &asn_OER_type_SINR_RangeEUTRA_constr_1, &asn_PER_type_SINR_RangeEUTRA_constr_1, SINR_RangeEUTRA_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/SSB-Index.c b/e2sm/lib/SSB-Index.c
new file mode 100644
index 0000000..3f9975e
--- /dev/null
+++ b/e2sm/lib/SSB-Index.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "SSB-Index.h"
+
+int
+SSB_Index_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 63)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_SSB_Index_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..63) */,
+	-1};
+asn_per_constraints_t asn_PER_type_SSB_Index_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 6,  6,  0,  63 }	/* (0..63) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_SSB_Index_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SSB_Index = {
+	"SSB-Index",
+	"SSB-Index",
+	&asn_OP_NativeInteger,
+	asn_DEF_SSB_Index_tags_1,
+	sizeof(asn_DEF_SSB_Index_tags_1)
+		/sizeof(asn_DEF_SSB_Index_tags_1[0]), /* 1 */
+	asn_DEF_SSB_Index_tags_1,	/* Same as above */
+	sizeof(asn_DEF_SSB_Index_tags_1)
+		/sizeof(asn_DEF_SSB_Index_tags_1[0]), /* 1 */
+	{ &asn_OER_type_SSB_Index_constr_1, &asn_PER_type_SSB_Index_constr_1, SSB_Index_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/ServCellIndex.c b/e2sm/lib/ServCellIndex.c
new file mode 100644
index 0000000..a7dec96
--- /dev/null
+++ b/e2sm/lib/ServCellIndex.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ServCellIndex.h"
+
+int
+ServCellIndex_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 31)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_ServCellIndex_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..31) */,
+	-1};
+asn_per_constraints_t asn_PER_type_ServCellIndex_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 5,  5,  0,  31 }	/* (0..31) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_ServCellIndex_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ServCellIndex = {
+	"ServCellIndex",
+	"ServCellIndex",
+	&asn_OP_NativeInteger,
+	asn_DEF_ServCellIndex_tags_1,
+	sizeof(asn_DEF_ServCellIndex_tags_1)
+		/sizeof(asn_DEF_ServCellIndex_tags_1[0]), /* 1 */
+	asn_DEF_ServCellIndex_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ServCellIndex_tags_1)
+		/sizeof(asn_DEF_ServCellIndex_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ServCellIndex_constr_1, &asn_PER_type_ServCellIndex_constr_1, ServCellIndex_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2sm/lib/ServedPlmnPerCellListItem.c b/e2sm/lib/ServedPlmnPerCellListItem.c
new file mode 100644
index 0000000..4f10db7
--- /dev/null
+++ b/e2sm/lib/ServedPlmnPerCellListItem.c
@@ -0,0 +1,74 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ServedPlmnPerCellListItem.h"
+
+#include "FGC-DU-PM-Container.h"
+#include "EPC-DU-PM-Container.h"
+asn_TYPE_member_t asn_MBR_ServedPlmnPerCellListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ServedPlmnPerCellListItem, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_POINTER, 2, offsetof(struct ServedPlmnPerCellListItem, du_PM_5GC),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_FGC_DU_PM_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"du-PM-5GC"
+		},
+	{ ATF_POINTER, 1, offsetof(struct ServedPlmnPerCellListItem, du_PM_EPC),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_EPC_DU_PM_Container,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"du-PM-EPC"
+		},
+};
+static const int asn_MAP_ServedPlmnPerCellListItem_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_ServedPlmnPerCellListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ServedPlmnPerCellListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* du-PM-5GC */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* du-PM-EPC */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ServedPlmnPerCellListItem_specs_1 = {
+	sizeof(struct ServedPlmnPerCellListItem),
+	offsetof(struct ServedPlmnPerCellListItem, _asn_ctx),
+	asn_MAP_ServedPlmnPerCellListItem_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_ServedPlmnPerCellListItem_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ServedPlmnPerCellListItem = {
+	"ServedPlmnPerCellListItem",
+	"ServedPlmnPerCellListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ServedPlmnPerCellListItem_tags_1,
+	sizeof(asn_DEF_ServedPlmnPerCellListItem_tags_1)
+		/sizeof(asn_DEF_ServedPlmnPerCellListItem_tags_1[0]), /* 1 */
+	asn_DEF_ServedPlmnPerCellListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ServedPlmnPerCellListItem_tags_1)
+		/sizeof(asn_DEF_ServedPlmnPerCellListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ServedPlmnPerCellListItem_1,
+	3,	/* Elements count */
+	&asn_SPC_ServedPlmnPerCellListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/ServingCellMeasurements.c b/e2sm/lib/ServingCellMeasurements.c
new file mode 100644
index 0000000..8ff6d3b
--- /dev/null
+++ b/e2sm/lib/ServingCellMeasurements.c
@@ -0,0 +1,67 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "ServingCellMeasurements.h"
+
+#include "MeasResultServMOList.h"
+#include "MeasResultPCell.h"
+static asn_oer_constraints_t asn_OER_type_ServingCellMeasurements_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ServingCellMeasurements_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ServingCellMeasurements_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct ServingCellMeasurements, choice.nr_measResultServingMOList),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasResultServMOList,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"nr-measResultServingMOList"
+		},
+	{ ATF_POINTER, 0, offsetof(struct ServingCellMeasurements, choice.eutra_measResultPCell),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_MeasResultPCell,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eutra-measResultPCell"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ServingCellMeasurements_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nr-measResultServingMOList */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* eutra-measResultPCell */
+};
+asn_CHOICE_specifics_t asn_SPC_ServingCellMeasurements_specs_1 = {
+	sizeof(struct ServingCellMeasurements),
+	offsetof(struct ServingCellMeasurements, _asn_ctx),
+	offsetof(struct ServingCellMeasurements, present),
+	sizeof(((struct ServingCellMeasurements *)0)->present),
+	asn_MAP_ServingCellMeasurements_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0,
+	2	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ServingCellMeasurements = {
+	"ServingCellMeasurements",
+	"ServingCellMeasurements",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ServingCellMeasurements_constr_1, &asn_PER_type_ServingCellMeasurements_constr_1, CHOICE_constraint },
+	asn_MBR_ServingCellMeasurements_1,
+	2,	/* Elements count */
+	&asn_SPC_ServingCellMeasurements_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/SlicePerPlmnPerCellListItem.c b/e2sm/lib/SlicePerPlmnPerCellListItem.c
new file mode 100644
index 0000000..021489f
--- /dev/null
+++ b/e2sm/lib/SlicePerPlmnPerCellListItem.c
@@ -0,0 +1,140 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "SlicePerPlmnPerCellListItem.h"
+
+#include "FQIPERSlicesPerPlmnPerCellListItem.h"
+static int
+memb_fQIPERSlicesPerPlmnPerCellList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 64)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_fQIPERSlicesPerPlmnPerCellList_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..64)) */};
+static asn_per_constraints_t asn_PER_type_fQIPERSlicesPerPlmnPerCellList_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  64 }	/* (SIZE(1..64)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_fQIPERSlicesPerPlmnPerCellList_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..64)) */};
+static asn_per_constraints_t asn_PER_memb_fQIPERSlicesPerPlmnPerCellList_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  64 }	/* (SIZE(1..64)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_fQIPERSlicesPerPlmnPerCellList_3[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_FQIPERSlicesPerPlmnPerCellListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_fQIPERSlicesPerPlmnPerCellList_tags_3[] = {
+	(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_fQIPERSlicesPerPlmnPerCellList_specs_3 = {
+	sizeof(struct SlicePerPlmnPerCellListItem__fQIPERSlicesPerPlmnPerCellList),
+	offsetof(struct SlicePerPlmnPerCellListItem__fQIPERSlicesPerPlmnPerCellList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_fQIPERSlicesPerPlmnPerCellList_3 = {
+	"fQIPERSlicesPerPlmnPerCellList",
+	"fQIPERSlicesPerPlmnPerCellList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_fQIPERSlicesPerPlmnPerCellList_tags_3,
+	sizeof(asn_DEF_fQIPERSlicesPerPlmnPerCellList_tags_3)
+		/sizeof(asn_DEF_fQIPERSlicesPerPlmnPerCellList_tags_3[0]) - 1, /* 1 */
+	asn_DEF_fQIPERSlicesPerPlmnPerCellList_tags_3,	/* Same as above */
+	sizeof(asn_DEF_fQIPERSlicesPerPlmnPerCellList_tags_3)
+		/sizeof(asn_DEF_fQIPERSlicesPerPlmnPerCellList_tags_3[0]), /* 2 */
+	{ &asn_OER_type_fQIPERSlicesPerPlmnPerCellList_constr_3, &asn_PER_type_fQIPERSlicesPerPlmnPerCellList_constr_3, SEQUENCE_OF_constraint },
+	asn_MBR_fQIPERSlicesPerPlmnPerCellList_3,
+	1,	/* Single element */
+	&asn_SPC_fQIPERSlicesPerPlmnPerCellList_specs_3	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SlicePerPlmnPerCellListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct SlicePerPlmnPerCellListItem, sliceID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_S_NSSAI,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"sliceID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SlicePerPlmnPerCellListItem, fQIPERSlicesPerPlmnPerCellList),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		0,
+		&asn_DEF_fQIPERSlicesPerPlmnPerCellList_3,
+		0,
+		{ &asn_OER_memb_fQIPERSlicesPerPlmnPerCellList_constr_3, &asn_PER_memb_fQIPERSlicesPerPlmnPerCellList_constr_3,  memb_fQIPERSlicesPerPlmnPerCellList_constraint_1 },
+		0, 0, /* No default value */
+		"fQIPERSlicesPerPlmnPerCellList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_SlicePerPlmnPerCellListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SlicePerPlmnPerCellListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sliceID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* fQIPERSlicesPerPlmnPerCellList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SlicePerPlmnPerCellListItem_specs_1 = {
+	sizeof(struct SlicePerPlmnPerCellListItem),
+	offsetof(struct SlicePerPlmnPerCellListItem, _asn_ctx),
+	asn_MAP_SlicePerPlmnPerCellListItem_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_SlicePerPlmnPerCellListItem = {
+	"SlicePerPlmnPerCellListItem",
+	"SlicePerPlmnPerCellListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_SlicePerPlmnPerCellListItem_tags_1,
+	sizeof(asn_DEF_SlicePerPlmnPerCellListItem_tags_1)
+		/sizeof(asn_DEF_SlicePerPlmnPerCellListItem_tags_1[0]), /* 1 */
+	asn_DEF_SlicePerPlmnPerCellListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_SlicePerPlmnPerCellListItem_tags_1)
+		/sizeof(asn_DEF_SlicePerPlmnPerCellListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_SlicePerPlmnPerCellListItem_1,
+	2,	/* Elements count */
+	&asn_SPC_SlicePerPlmnPerCellListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/SliceToReportListItem.c b/e2sm/lib/SliceToReportListItem.c
new file mode 100644
index 0000000..b466fc3
--- /dev/null
+++ b/e2sm/lib/SliceToReportListItem.c
@@ -0,0 +1,140 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "SliceToReportListItem.h"
+
+#include "FQIPERSlicesPerPlmnListItem.h"
+static int
+memb_fQIPERSlicesPerPlmnList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	/* Determine the number of elements */
+	size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
+	
+	if((size >= 1 && size <= 64)) {
+		/* Perform validation of the inner elements */
+		return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_type_fQIPERSlicesPerPlmnList_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..64)) */};
+static asn_per_constraints_t asn_PER_type_fQIPERSlicesPerPlmnList_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  64 }	/* (SIZE(1..64)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_fQIPERSlicesPerPlmnList_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..64)) */};
+static asn_per_constraints_t asn_PER_memb_fQIPERSlicesPerPlmnList_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 6,  6,  1,  64 }	/* (SIZE(1..64)) */,
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_fQIPERSlicesPerPlmnList_3[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_FQIPERSlicesPerPlmnListItem,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_fQIPERSlicesPerPlmnList_tags_3[] = {
+	(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_fQIPERSlicesPerPlmnList_specs_3 = {
+	sizeof(struct SliceToReportListItem__fQIPERSlicesPerPlmnList),
+	offsetof(struct SliceToReportListItem__fQIPERSlicesPerPlmnList, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_fQIPERSlicesPerPlmnList_3 = {
+	"fQIPERSlicesPerPlmnList",
+	"fQIPERSlicesPerPlmnList",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_fQIPERSlicesPerPlmnList_tags_3,
+	sizeof(asn_DEF_fQIPERSlicesPerPlmnList_tags_3)
+		/sizeof(asn_DEF_fQIPERSlicesPerPlmnList_tags_3[0]) - 1, /* 1 */
+	asn_DEF_fQIPERSlicesPerPlmnList_tags_3,	/* Same as above */
+	sizeof(asn_DEF_fQIPERSlicesPerPlmnList_tags_3)
+		/sizeof(asn_DEF_fQIPERSlicesPerPlmnList_tags_3[0]), /* 2 */
+	{ &asn_OER_type_fQIPERSlicesPerPlmnList_constr_3, &asn_PER_type_fQIPERSlicesPerPlmnList_constr_3, SEQUENCE_OF_constraint },
+	asn_MBR_fQIPERSlicesPerPlmnList_3,
+	1,	/* Single element */
+	&asn_SPC_fQIPERSlicesPerPlmnList_specs_3	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SliceToReportListItem_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct SliceToReportListItem, sliceID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_S_NSSAI,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"sliceID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SliceToReportListItem, fQIPERSlicesPerPlmnList),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		0,
+		&asn_DEF_fQIPERSlicesPerPlmnList_3,
+		0,
+		{ &asn_OER_memb_fQIPERSlicesPerPlmnList_constr_3, &asn_PER_memb_fQIPERSlicesPerPlmnList_constr_3,  memb_fQIPERSlicesPerPlmnList_constraint_1 },
+		0, 0, /* No default value */
+		"fQIPERSlicesPerPlmnList"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_SliceToReportListItem_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SliceToReportListItem_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sliceID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* fQIPERSlicesPerPlmnList */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SliceToReportListItem_specs_1 = {
+	sizeof(struct SliceToReportListItem),
+	offsetof(struct SliceToReportListItem, _asn_ctx),
+	asn_MAP_SliceToReportListItem_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	2,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_SliceToReportListItem = {
+	"SliceToReportListItem",
+	"SliceToReportListItem",
+	&asn_OP_SEQUENCE,
+	asn_DEF_SliceToReportListItem_tags_1,
+	sizeof(asn_DEF_SliceToReportListItem_tags_1)
+		/sizeof(asn_DEF_SliceToReportListItem_tags_1[0]), /* 1 */
+	asn_DEF_SliceToReportListItem_tags_1,	/* Same as above */
+	sizeof(asn_DEF_SliceToReportListItem_tags_1)
+		/sizeof(asn_DEF_SliceToReportListItem_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_SliceToReportListItem_1,
+	2,	/* Elements count */
+	&asn_SPC_SliceToReportListItem_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/TimeStamp.c b/e2sm/lib/TimeStamp.c
new file mode 100644
index 0000000..6d6fd9c
--- /dev/null
+++ b/e2sm/lib/TimeStamp.c
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "TimeStamp.h"
+
+int
+TimeStamp_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size == 8)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_TimeStamp_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	8	/* (SIZE(8..8)) */};
+asn_per_constraints_t asn_PER_type_TimeStamp_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  8,  8 }	/* (SIZE(8..8)) */,
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_TimeStamp_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TimeStamp = {
+	"TimeStamp",
+	"TimeStamp",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_TimeStamp_tags_1,
+	sizeof(asn_DEF_TimeStamp_tags_1)
+		/sizeof(asn_DEF_TimeStamp_tags_1[0]), /* 1 */
+	asn_DEF_TimeStamp_tags_1,	/* Same as above */
+	sizeof(asn_DEF_TimeStamp_tags_1)
+		/sizeof(asn_DEF_TimeStamp_tags_1[0]), /* 1 */
+	{ &asn_OER_type_TimeStamp_constr_1, &asn_PER_type_TimeStamp_constr_1, TimeStamp_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2sm/lib/Trigger-ConditionIE-Item.c b/e2sm/lib/Trigger-ConditionIE-Item.c
new file mode 100644
index 0000000..dd0e6f4
--- /dev/null
+++ b/e2sm/lib/Trigger-ConditionIE-Item.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "Trigger-ConditionIE-Item.h"
+
+asn_TYPE_member_t asn_MBR_Trigger_ConditionIE_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct Trigger_ConditionIE_Item, report_Period_IE),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RT_Period_IE,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"report-Period-IE"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_Trigger_ConditionIE_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Trigger_ConditionIE_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* report-Period-IE */
+};
+asn_SEQUENCE_specifics_t asn_SPC_Trigger_ConditionIE_Item_specs_1 = {
+	sizeof(struct Trigger_ConditionIE_Item),
+	offsetof(struct Trigger_ConditionIE_Item, _asn_ctx),
+	asn_MAP_Trigger_ConditionIE_Item_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_Trigger_ConditionIE_Item = {
+	"Trigger-ConditionIE-Item",
+	"Trigger-ConditionIE-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_Trigger_ConditionIE_Item_tags_1,
+	sizeof(asn_DEF_Trigger_ConditionIE_Item_tags_1)
+		/sizeof(asn_DEF_Trigger_ConditionIE_Item_tags_1[0]), /* 1 */
+	asn_DEF_Trigger_ConditionIE_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_Trigger_ConditionIE_Item_tags_1)
+		/sizeof(asn_DEF_Trigger_ConditionIE_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_Trigger_ConditionIE_Item_1,
+	1,	/* Elements count */
+	&asn_SPC_Trigger_ConditionIE_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/TriggeringMessage.c b/e2sm/lib/TriggeringMessage.c
new file mode 100644
index 0000000..4af15f3
--- /dev/null
+++ b/e2sm/lib/TriggeringMessage.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "TriggeringMessage.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_TriggeringMessage_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_TriggeringMessage_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_TriggeringMessage_value2enum_1[] = {
+	{ 0,	18,	"initiating-message" },
+	{ 1,	18,	"successful-outcome" },
+	{ 2,	21,	"unsuccessfull-outcome" }
+};
+static const unsigned int asn_MAP_TriggeringMessage_enum2value_1[] = {
+	0,	/* initiating-message(0) */
+	1,	/* successful-outcome(1) */
+	2	/* unsuccessfull-outcome(2) */
+};
+static const asn_INTEGER_specifics_t asn_SPC_TriggeringMessage_specs_1 = {
+	asn_MAP_TriggeringMessage_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_TriggeringMessage_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	0,	/* Enumeration is not extensible */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_TriggeringMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TriggeringMessage = {
+	"TriggeringMessage",
+	"TriggeringMessage",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_TriggeringMessage_tags_1,
+	sizeof(asn_DEF_TriggeringMessage_tags_1)
+		/sizeof(asn_DEF_TriggeringMessage_tags_1[0]), /* 1 */
+	asn_DEF_TriggeringMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_TriggeringMessage_tags_1)
+		/sizeof(asn_DEF_TriggeringMessage_tags_1[0]), /* 1 */
+	{ &asn_OER_type_TriggeringMessage_constr_1, &asn_PER_type_TriggeringMessage_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_TriggeringMessage_specs_1	/* Additional specs */
+};
+
diff --git a/e2sm/lib/UE-Identity.c b/e2sm/lib/UE-Identity.c
new file mode 100644
index 0000000..f0c1410
--- /dev/null
+++ b/e2sm/lib/UE-Identity.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2SM-KPM-RC"
+ * 	found in "e2sm-kpm-rc.asn"
+ * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
+ */
+
+#include "UE-Identity.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_UE_Identity_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_UE_Identity = {
+	"UE-Identity",
+	"UE-Identity",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_UE_Identity_tags_1,
+	sizeof(asn_DEF_UE_Identity_tags_1)
+		/sizeof(asn_DEF_UE_Identity_tags_1[0]), /* 1 */
+	asn_DEF_UE_Identity_tags_1,	/* Same as above */
+	sizeof(asn_DEF_UE_Identity_tags_1)
+		/sizeof(asn_DEF_UE_Identity_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2sm/lib/asn_SEQUENCE_OF.c b/e2sm/lib/asn_SEQUENCE_OF.c
new file mode 100644
index 0000000..ec952fc
--- /dev/null
+++ b/e2sm/lib/asn_SEQUENCE_OF.c
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_SEQUENCE_OF.h>
+
+typedef A_SEQUENCE_OF(void) asn_sequence;
+
+void
+asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) {
+	asn_sequence *as = (asn_sequence *)asn_sequence_of_x;
+
+	if(as) {
+		void *ptr;
+		int n;
+
+		if(number < 0 || number >= as->count)
+			return;	/* Nothing to delete */
+
+		if(_do_free && as->free) {
+			ptr = as->array[number];
+		} else {
+			ptr = 0;
+		}
+
+		/*
+		 * Shift all elements to the left to hide the gap.
+		 */
+		--as->count;
+		for(n = number; n < as->count; n++)
+			as->array[n] = as->array[n+1];
+
+		/*
+		 * Invoke the third-party function only when the state
+		 * of the parent structure is consistent.
+		 */
+		if(ptr) as->free(ptr);
+	}
+}
+
diff --git a/e2sm/lib/asn_SET_OF.c b/e2sm/lib/asn_SET_OF.c
new file mode 100644
index 0000000..944f2cb
--- /dev/null
+++ b/e2sm/lib/asn_SET_OF.c
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_SET_OF.h>
+#include <errno.h>
+
+/*
+ * Add another element into the set.
+ */
+int
+asn_set_add(void *asn_set_of_x, void *ptr) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as == 0 || ptr == 0) {
+		errno = EINVAL;		/* Invalid arguments */
+		return -1;
+	}
+
+	/*
+	 * Make sure there's enough space to insert an element.
+	 */
+	if(as->count == as->size) {
+		int _newsize = as->size ? (as->size << 1) : 4;
+		void *_new_arr;
+		_new_arr = REALLOC(as->array, _newsize * sizeof(as->array[0]));
+		if(_new_arr) {
+			as->array = (void **)_new_arr;
+			as->size = _newsize;
+		} else {
+			/* ENOMEM */
+			return -1;
+		}
+	}
+
+	as->array[as->count++] = ptr;
+
+	return 0;
+}
+
+void
+asn_set_del(void *asn_set_of_x, int number, int _do_free) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as) {
+		void *ptr;
+		if(number < 0 || number >= as->count)
+			return;
+
+		if(_do_free && as->free) {
+			ptr = as->array[number];
+		} else {
+			ptr = 0;
+		}
+
+		as->array[number] = as->array[--as->count];
+
+		/*
+		 * Invoke the third-party function only when the state
+		 * of the parent structure is consistent.
+		 */
+		if(ptr) as->free(ptr);
+	}
+}
+
+/*
+ * Free the contents of the set, do not free the set itself.
+ */
+void
+asn_set_empty(void *asn_set_of_x) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as) {
+		if(as->array) {
+			if(as->free) {
+				while(as->count--)
+					as->free(as->array[as->count]);
+			}
+			FREEMEM(as->array);
+			as->array = 0;
+		}
+		as->count = 0;
+		as->size = 0;
+	}
+
+}
+
diff --git a/e2sm/lib/asn_application.c b/e2sm/lib/asn_application.c
new file mode 100644
index 0000000..2bff460
--- /dev/null
+++ b/e2sm/lib/asn_application.c
@@ -0,0 +1,481 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_application.h>
+#include <errno.h>
+
+static asn_enc_rval_t asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
+                                          enum asn_transfer_syntax syntax,
+                                          const asn_TYPE_descriptor_t *td,
+                                          const void *sptr,
+                                          asn_app_consume_bytes_f *callback,
+                                          void *callback_key);
+
+
+struct callback_count_bytes_key {
+    asn_app_consume_bytes_f *callback;
+    void *callback_key;
+    size_t computed_size;
+};
+
+/*
+ * Encoder which just counts bytes that come through it.
+ */
+static int
+callback_count_bytes_cb(const void *data, size_t size, void *keyp) {
+    struct callback_count_bytes_key *key = keyp;
+    int ret;
+
+    ret = key->callback(data, size, key->callback_key);
+    if(ret >= 0) {
+        key->computed_size += size;
+    }
+
+    return ret;
+}
+
+struct overrun_encoder_key {
+    void *buffer;
+    size_t buffer_size;
+    size_t computed_size;
+};
+
+struct dynamic_encoder_key {
+    void *buffer;
+    size_t buffer_size;
+    size_t computed_size;
+};
+
+struct callback_failure_catch_key {
+    asn_app_consume_bytes_f *callback;
+    void *callback_key;
+    int callback_failed;
+};
+
+/*
+ * Encoder which doesn't stop counting bytes
+ * even if it reaches the end of the buffer.
+ */
+static int
+overrun_encoder_cb(const void *data, size_t size, void *keyp) {
+    struct overrun_encoder_key *key = keyp;
+
+    if(key->computed_size + size > key->buffer_size) {
+        /*
+         * Avoid accident on the next call:
+         * stop adding bytes to the buffer.
+         */
+        key->buffer_size = 0;
+    } else {
+        memcpy((char *)key->buffer + key->computed_size, data, size);
+    }
+    key->computed_size += size;
+
+    return 0;
+}
+
+/*
+ * Encoder which dynamically allocates output, and continues
+ * to count even if allocation failed.
+ */
+static int
+dynamic_encoder_cb(const void *data, size_t size, void *keyp) {
+    struct dynamic_encoder_key *key = keyp;
+
+    if(key->buffer) {
+        if(key->computed_size + size >= key->buffer_size) {
+            void *p;
+            size_t new_size = key->buffer_size;
+
+            do {
+                new_size *= 2;
+            } while(new_size <= key->computed_size + size);
+
+            p = REALLOC(key->buffer, new_size);
+            if(p) {
+                key->buffer = p;
+                key->buffer_size = new_size;
+            } else {
+                FREEMEM(key->buffer);
+                key->buffer = 0;
+                key->buffer_size = 0;
+                key->computed_size += size;
+                return 0;
+            }
+        }
+        memcpy((char *)key->buffer + key->computed_size, data, size);
+    }
+
+    key->computed_size += size;
+
+    return 0;
+}
+
+/*
+ * Encoder which help convert the application level encoder failure into EIO.
+ */
+static int
+callback_failure_catch_cb(const void *data, size_t size, void *keyp) {
+    struct callback_failure_catch_key *key = keyp;
+    int ret;
+
+    ret = key->callback(data, size, key->callback_key);
+    if(ret < 0) {
+        key->callback_failed = 1;
+    }
+
+    return ret;
+}
+
+asn_enc_rval_t
+asn_encode(const asn_codec_ctx_t *opt_codec_ctx,
+           enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
+           const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) {
+    struct callback_failure_catch_key cb_key;
+    asn_enc_rval_t er = {0,0,0};
+
+    if(!callback) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    cb_key.callback = callback;
+    cb_key.callback_key = callback_key;
+    cb_key.callback_failed = 0;
+
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                             callback_failure_catch_cb, &cb_key);
+    if(cb_key.callback_failed) {
+        assert(er.encoded == -1);
+        assert(errno == EBADF);
+        errno = EIO;
+    }
+
+    return er;
+}
+
+asn_enc_rval_t
+asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx,
+                     enum asn_transfer_syntax syntax,
+                     const asn_TYPE_descriptor_t *td, const void *sptr,
+                     void *buffer, size_t buffer_size) {
+    struct overrun_encoder_key buf_key;
+    asn_enc_rval_t er = {0,0,0};
+
+    if(buffer_size > 0 && !buffer) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    buf_key.buffer = buffer;
+    buf_key.buffer_size = buffer_size;
+    buf_key.computed_size = 0;
+
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                             overrun_encoder_cb, &buf_key);
+
+    if(er.encoded >= 0 && (size_t)er.encoded != buf_key.computed_size) {
+        ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
+                  " yet produced %" ASN_PRI_SIZE " bytes",
+                  er.encoded, buf_key.computed_size);
+        assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size);
+    }
+
+    return er;
+}
+
+asn_encode_to_new_buffer_result_t
+asn_encode_to_new_buffer(const asn_codec_ctx_t *opt_codec_ctx,
+                         enum asn_transfer_syntax syntax,
+                         const asn_TYPE_descriptor_t *td, const void *sptr) {
+    struct dynamic_encoder_key buf_key;
+    asn_encode_to_new_buffer_result_t res;
+
+    buf_key.buffer_size = 16;
+    buf_key.buffer = MALLOC(buf_key.buffer_size);
+    buf_key.computed_size = 0;
+
+    res.result = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                                     dynamic_encoder_cb, &buf_key);
+
+    if(res.result.encoded >= 0
+       && (size_t)res.result.encoded != buf_key.computed_size) {
+        ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
+                  " yet produced %" ASN_PRI_SIZE " bytes",
+                  res.result.encoded, buf_key.computed_size);
+        assert(res.result.encoded < 0
+               || (size_t)res.result.encoded == buf_key.computed_size);
+    }
+
+    res.buffer = buf_key.buffer;
+
+    /* 0-terminate just in case. */
+    if(res.buffer) {
+        assert(buf_key.computed_size < buf_key.buffer_size);
+        ((char *)res.buffer)[buf_key.computed_size] = '\0';
+    }
+
+    return res;
+}
+
+static asn_enc_rval_t
+asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
+                    enum asn_transfer_syntax syntax,
+                    const asn_TYPE_descriptor_t *td, const void *sptr,
+                    asn_app_consume_bytes_f *callback, void *callback_key) {
+    asn_enc_rval_t er = {0,0,0};
+    enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL;
+
+    (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */
+
+    if(!td || !sptr) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    switch(syntax) {
+    case ATS_NONSTANDARD_PLAINTEXT:
+        if(td->op->print_struct) {
+            struct callback_count_bytes_key cb_key;
+            cb_key.callback = callback;
+            cb_key.callback_key = callback_key;
+            cb_key.computed_size = 0;
+            if(td->op->print_struct(td, sptr, 1, callback_count_bytes_cb,
+                                    &cb_key)
+                   < 0
+               || callback_count_bytes_cb("\n", 1, &cb_key) < 0) {
+                errno = EBADF; /* Structure has incorrect form. */
+                er.encoded = -1;
+                er.failed_type = td;
+                er.structure_ptr = sptr;
+            } else {
+                er.encoded = cb_key.computed_size;
+                er.failed_type = 0;
+                er.structure_ptr = 0;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+
+    case ATS_RANDOM:
+        errno = ENOENT; /* Randomization doesn't make sense on output. */
+        ASN__ENCODE_FAILED;
+
+    case ATS_BER:
+        /* BER is a superset of DER. */
+        /* Fall through. */
+    case ATS_DER:
+        if(td->op->der_encoder) {
+            er = der_encode(td, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->der_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* DER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+    case ATS_CER:
+        errno = ENOENT; /* Transfer syntax is not defined for any type. */
+        ASN__ENCODE_FAILED;
+
+#ifdef  ASN_DISABLE_OER_SUPPORT
+    case ATS_BASIC_OER:
+    case ATS_CANONICAL_OER:
+        errno = ENOENT; /* PER is not defined. */
+        ASN__ENCODE_FAILED;
+        break;
+#else /* ASN_DISABLE_OER_SUPPORT */
+    case ATS_BASIC_OER:
+        /* CANONICAL-OER is a superset of BASIC-OER. */
+        /* Fall through. */
+    case ATS_CANONICAL_OER:
+        if(td->op->oer_encoder) {
+            er = oer_encode(td, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->oer_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* OER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+#endif /* ASN_DISABLE_OER_SUPPORT */
+
+#ifdef  ASN_DISABLE_PER_SUPPORT
+    case ATS_UNALIGNED_BASIC_PER:
+    case ATS_UNALIGNED_CANONICAL_PER:
+    case ATS_ALIGNED_BASIC_PER:
+    case ATS_ALIGNED_CANONICAL_PER:
+        errno = ENOENT; /* PER is not defined. */
+        ASN__ENCODE_FAILED;
+        break;
+#else /* ASN_DISABLE_PER_SUPPORT */
+    case ATS_UNALIGNED_BASIC_PER:
+        /* CANONICAL-UPER is a superset of BASIC-UPER. */
+        /* Fall through. */
+    case ATS_UNALIGNED_CANONICAL_PER:
+        if(td->op->uper_encoder) {
+            er = uper_encode(td, 0, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->uper_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* UPER is not defined for this type. */
+                }
+            } else {
+                ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+                if(er.encoded == 0) {
+                    /* Enforce "Complete Encoding" of X.691 #11.1 */
+                    if(callback("\0", 1, callback_key) < 0) {
+                        errno = EBADF;
+                        ASN__ENCODE_FAILED;
+                    }
+                    er.encoded = 8; /* Exactly 8 zero bits is added. */
+                }
+                /* Convert bits into bytes */
+                er.encoded = (er.encoded + 7) >> 3;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+    case ATS_ALIGNED_BASIC_PER:
+        /* CANONICAL-APER is a superset of BASIC-APER. */
+        /* Fall through. */
+    case ATS_ALIGNED_CANONICAL_PER:
+        if(td->op->aper_encoder) {
+            er = aper_encode(td, 0, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->aper_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* APER is not defined for this type. */
+                }
+            } else {
+                ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+                if(er.encoded == 0) {
+                    /* Enforce "Complete Encoding" of X.691 #11.1 */
+                    if(callback("\0", 1, callback_key) < 0) {
+                        errno = EBADF;
+                        ASN__ENCODE_FAILED;
+                    }
+                    er.encoded = 8; /* Exactly 8 zero bits is added. */
+                }
+                /* Convert bits into bytes */
+                er.encoded = (er.encoded + 7) >> 3;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+    case ATS_BASIC_XER:
+        /* CANONICAL-XER is a superset of BASIC-XER. */
+        xer_flags &= ~XER_F_CANONICAL;
+        xer_flags |= XER_F_BASIC;
+        /* Fall through. */
+    case ATS_CANONICAL_XER:
+        if(td->op->xer_encoder) {
+            er = xer_encode(td, sptr, xer_flags, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->xer_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* XER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+
+    default:
+        errno = ENOENT;
+        ASN__ENCODE_FAILED;
+    }
+
+    return er;
+}
+
+asn_dec_rval_t
+asn_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
+           void **sptr, const void *buffer, size_t size) {
+    if(!td || !td->op || !sptr || (size && !buffer)) {
+        ASN__DECODE_FAILED;
+    }
+
+    switch(syntax) {
+    case ATS_CER:
+    case ATS_NONSTANDARD_PLAINTEXT:
+    default:
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+
+    case ATS_RANDOM:
+        if(!td->op->random_fill) {
+            ASN__DECODE_FAILED;
+        } else {
+            if(asn_random_fill(td, sptr, 16000) == 0) {
+                asn_dec_rval_t ret = {RC_OK, 0};
+                return ret;
+            } else {
+                ASN__DECODE_FAILED;
+            }
+        }
+        break;
+
+    case ATS_DER:
+    case ATS_BER:
+        return ber_decode(opt_codec_ctx, td, sptr, buffer, size);
+
+    case ATS_BASIC_OER:
+    case ATS_CANONICAL_OER:
+#ifdef  ASN_DISABLE_OER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return oer_decode(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_UNALIGNED_BASIC_PER:
+    case ATS_UNALIGNED_CANONICAL_PER:
+#ifdef  ASN_DISABLE_PER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_ALIGNED_BASIC_PER:
+    case ATS_ALIGNED_CANONICAL_PER:
+#ifdef  ASN_DISABLE_PER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return aper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_BASIC_XER:
+    case ATS_CANONICAL_XER:
+        return xer_decode(opt_codec_ctx, td, sptr, buffer, size);
+    }
+}
+
diff --git a/e2sm/lib/asn_bit_data.c b/e2sm/lib/asn_bit_data.c
new file mode 100644
index 0000000..fe4b89b
--- /dev/null
+++ b/e2sm/lib/asn_bit_data.c
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+#include <asn_bit_data.h>
+
+/*
+ * Create a contiguous non-refillable bit data structure.
+ * Can be freed by FREEMEM().
+ */
+asn_bit_data_t *
+asn_bit_data_new_contiguous(const void *data, size_t size_bits) {
+    size_t size_bytes = (size_bits + 7) / 8;
+    asn_bit_data_t *pd;
+    uint8_t *bytes;
+
+    /* Get the extensions map */
+    pd = CALLOC(1, sizeof(*pd) + size_bytes + 1);
+    if(!pd) {
+        return NULL;
+    }
+    bytes = (void *)(((char *)pd) + sizeof(*pd));
+    memcpy(bytes, data, size_bytes);
+    bytes[size_bytes] = 0;
+    pd->buffer = bytes;
+    pd->nboff = 0;
+    pd->nbits = size_bits;
+
+    return pd;
+}
+
+
+char *
+asn_bit_data_string(asn_bit_data_t *pd) {
+	static char buf[2][32];
+	static int n;
+	n = (n+1) % 2;
+    snprintf(buf[n], sizeof(buf[n]),
+             "{m=%" ASN_PRI_SIZE " span %" ASN_PRI_SIZE "[%" ASN_PRI_SIZE
+             "..%" ASN_PRI_SIZE "] (%" ASN_PRI_SIZE ")}",
+             pd->moved, ((uintptr_t)(pd->buffer) & 0xf), pd->nboff, pd->nbits,
+             pd->nbits - pd->nboff);
+    return buf[n];
+}
+
+void
+asn_get_undo(asn_bit_data_t *pd, int nbits) {
+	if((ssize_t)pd->nboff < nbits) {
+		assert((ssize_t)pd->nboff < nbits);
+	} else {
+		pd->nboff -= nbits;
+		pd->moved -= nbits;
+	}
+}
+
+/*
+ * Extract a small number of bits (<= 31) from the specified PER data pointer.
+ */
+int32_t
+asn_get_few_bits(asn_bit_data_t *pd, int nbits) {
+	size_t off;	/* Next after last bit offset */
+	ssize_t nleft;	/* Number of bits left in this stream */
+	uint32_t accum;
+	const uint8_t *buf;
+
+	if(nbits < 0)
+		return -1;
+
+	nleft = pd->nbits - pd->nboff;
+	if(nbits > nleft) {
+		int32_t tailv, vhead;
+		if(!pd->refill || nbits > 31) return -1;
+		/* Accumulate unused bytes before refill */
+		ASN_DEBUG("Obtain the rest %d bits (want %d)",
+			(int)nleft, (int)nbits);
+		tailv = asn_get_few_bits(pd, nleft);
+		if(tailv < 0) return -1;
+		/* Refill (replace pd contents with new data) */
+		if(pd->refill(pd))
+			return -1;
+		nbits -= nleft;
+		vhead = asn_get_few_bits(pd, nbits);
+		/* Combine the rest of previous pd with the head of new one */
+		tailv = (tailv << nbits) | vhead;  /* Could == -1 */
+		return tailv;
+	}
+
+	/*
+	 * Normalize position indicator.
+	 */
+	if(pd->nboff >= 8) {
+		pd->buffer += (pd->nboff >> 3);
+		pd->nbits  -= (pd->nboff & ~0x07);
+		pd->nboff  &= 0x07;
+	}
+	pd->moved += nbits;
+	pd->nboff += nbits;
+	off = pd->nboff;
+	buf = pd->buffer;
+
+	/*
+	 * Extract specified number of bits.
+	 */
+	if(off <= 8)
+		accum = nbits ? (buf[0]) >> (8 - off) : 0;
+	else if(off <= 16)
+		accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
+	else if(off <= 24)
+		accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
+	else if(off <= 31)
+		accum = (((uint32_t)buf[0] << 24) + (buf[1] << 16)
+			+ (buf[2] << 8) + (buf[3])) >> (32 - off);
+	else if(nbits <= 31) {
+		asn_bit_data_t tpd = *pd;
+		/* Here are we with our 31-bits limit plus 1..7 bits offset. */
+		asn_get_undo(&tpd, nbits);
+		/* The number of available bits in the stream allow
+		 * for the following operations to take place without
+		 * invoking the ->refill() function */
+		accum  = asn_get_few_bits(&tpd, nbits - 24) << 24;
+		accum |= asn_get_few_bits(&tpd, 24);
+	} else {
+		asn_get_undo(pd, nbits);
+		return -1;
+	}
+
+	accum &= (((uint32_t)1 << nbits) - 1);
+
+	ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
+		(int)nbits, (int)nleft,
+		(int)pd->moved,
+		(((long)pd->buffer) & 0xf),
+		(int)pd->nboff, (int)pd->nbits,
+		((pd->buffer != NULL)?pd->buffer[0]:0),
+		(int)(pd->nbits - pd->nboff),
+		(int)accum);
+
+	return accum;
+}
+
+/*
+ * Extract a large number of bits from the specified PER data pointer.
+ */
+int
+asn_get_many_bits(asn_bit_data_t *pd, uint8_t *dst, int alright, int nbits) {
+	int32_t value;
+
+	if(alright && (nbits & 7)) {
+		/* Perform right alignment of a first few bits */
+		value = asn_get_few_bits(pd, nbits & 0x07);
+		if(value < 0) return -1;
+		*dst++ = value;	/* value is already right-aligned */
+		nbits &= ~7;
+	}
+
+	while(nbits) {
+		if(nbits >= 24) {
+			value = asn_get_few_bits(pd, 24);
+			if(value < 0) return -1;
+			*(dst++) = value >> 16;
+			*(dst++) = value >> 8;
+			*(dst++) = value;
+			nbits -= 24;
+		} else {
+			value = asn_get_few_bits(pd, nbits);
+			if(value < 0) return -1;
+			if(nbits & 7) {	/* implies left alignment */
+				value <<= 8 - (nbits & 7),
+				nbits += 8 - (nbits & 7);
+				if(nbits > 24)
+					*dst++ = value >> 24;
+			}
+			if(nbits > 16)
+				*dst++ = value >> 16;
+			if(nbits > 8)
+				*dst++ = value >> 8;
+			*dst++ = value;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+/*
+ * Put a small number of bits (<= 31).
+ */
+int
+asn_put_few_bits(asn_bit_outp_t *po, uint32_t bits, int obits) {
+	size_t off;	/* Next after last bit offset */
+	size_t omsk;	/* Existing last byte meaningful bits mask */
+	uint8_t *buf;
+
+	if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
+
+	ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
+			obits, (int)bits, (void *)po->buffer, (int)po->nboff);
+
+	/*
+	 * Normalize position indicator.
+	 */
+	if(po->nboff >= 8) {
+		po->buffer += (po->nboff >> 3);
+		po->nbits  -= (po->nboff & ~0x07);
+		po->nboff  &= 0x07;
+	}
+
+	/*
+	 * Flush whole-bytes output, if necessary.
+	 */
+	if(po->nboff + obits > po->nbits) {
+		size_t complete_bytes;
+		if(!po->buffer) po->buffer = po->tmpspace;
+		complete_bytes = (po->buffer - po->tmpspace);
+		ASN_DEBUG("[PER output %ld complete + %ld]",
+			(long)complete_bytes, (long)po->flushed_bytes);
+		if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0)
+			return -1;
+		if(po->nboff)
+			po->tmpspace[0] = po->buffer[0];
+		po->buffer = po->tmpspace;
+		po->nbits = 8 * sizeof(po->tmpspace);
+		po->flushed_bytes += complete_bytes;
+	}
+
+	/*
+	 * Now, due to sizeof(tmpspace), we are guaranteed large enough space.
+	 */
+	buf = po->buffer;
+	omsk = ~((1 << (8 - po->nboff)) - 1);
+	off = (po->nboff + obits);
+
+	/* Clear data of debris before meaningful bits */
+	bits &= (((uint32_t)1 << obits) - 1);
+
+	ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
+		(int)bits, (int)bits,
+		(int)po->nboff, (int)off,
+		buf[0], (int)(omsk&0xff),
+		(int)(buf[0] & omsk));
+
+	if(off <= 8)	/* Completely within 1 byte */
+		po->nboff = off,
+		bits <<= (8 - off),
+		buf[0] = (buf[0] & omsk) | bits;
+	else if(off <= 16)
+		po->nboff = off,
+		bits <<= (16 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 8),
+		buf[1] = bits;
+	else if(off <= 24)
+		po->nboff = off,
+		bits <<= (24 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 16),
+		buf[1] = bits >> 8,
+		buf[2] = bits;
+	else if(off <= 31)
+		po->nboff = off,
+		bits <<= (32 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 24),
+		buf[1] = bits >> 16,
+		buf[2] = bits >> 8,
+		buf[3] = bits;
+	else {
+		if(asn_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
+		if(asn_put_few_bits(po, bits, obits - 24)) return -1;
+	}
+
+	ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
+		(int)bits, (int)bits, buf[0],
+		(long)(po->buffer - po->tmpspace));
+
+	return 0;
+}
+
+
+/*
+ * Output a large number of bits.
+ */
+int
+asn_put_many_bits(asn_bit_outp_t *po, const uint8_t *src, int nbits) {
+
+	while(nbits) {
+		uint32_t value;
+
+		if(nbits >= 24) {
+			value = (src[0] << 16) | (src[1] << 8) | src[2];
+			src += 3;
+			nbits -= 24;
+			if(asn_put_few_bits(po, value, 24))
+				return -1;
+		} else {
+			value = src[0];
+			if(nbits > 8)
+				value = (value << 8) | src[1];
+			if(nbits > 16)
+				value = (value << 8) | src[2];
+			if(nbits & 0x07)
+				value >>= (8 - (nbits & 0x07));
+			if(asn_put_few_bits(po, value, nbits))
+				return -1;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+
+int
+asn_put_aligned_flush(asn_bit_outp_t *po) {
+    uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07)));
+    size_t complete_bytes =
+        (po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3);
+
+    if(unused_bits) {
+        po->buffer[po->nboff >> 3] &= ~0u << unused_bits;
+    }
+
+    if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0) {
+        return -1;
+    } else {
+        po->buffer = po->tmpspace;
+        po->nboff = 0;
+        po->nbits = 8 * sizeof(po->tmpspace);
+        po->flushed_bytes += complete_bytes;
+        return 0;
+    }
+}
+
diff --git a/e2sm/lib/asn_codecs_prim.c b/e2sm/lib/asn_codecs_prim.c
new file mode 100644
index 0000000..fc24247
--- /dev/null
+++ b/e2sm/lib/asn_codecs_prim.c
@@ -0,0 +1,317 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+#include <errno.h>
+
+/*
+ * Decode an always-primitive type.
+ */
+asn_dec_rval_t
+ber_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buf_ptr, size_t size, int tag_mode) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
+	asn_dec_rval_t rval;
+	ber_tlv_len_t length = 0; /* =0 to avoid [incorrect] warning. */
+
+	/*
+	 * If the structure is not there, allocate it.
+	 */
+	if(st == NULL) {
+		st = (ASN__PRIMITIVE_TYPE_t *)CALLOC(1, sizeof(*st));
+		if(st == NULL) ASN__DECODE_FAILED;
+		*sptr = (void *)st;
+	}
+
+	ASN_DEBUG("Decoding %s as plain primitive (tm=%d)",
+		td->name, tag_mode);
+
+	/*
+	 * Check tags and extract value length.
+	 */
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
+	if(rval.code != RC_OK)
+		return rval;
+
+	ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
+
+	/*
+	 * Make sure we have this length.
+	 */
+	buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+	size -= rval.consumed;
+	if(length > (ber_tlv_len_t)size) {
+		rval.code = RC_WMORE;
+		rval.consumed = 0;
+		return rval;
+	}
+
+	st->size = (int)length;
+	/* The following better be optimized away. */
+	if(sizeof(st->size) != sizeof(length)
+			&& (ber_tlv_len_t)st->size != length) {
+		st->size = 0;
+		ASN__DECODE_FAILED;
+	}
+
+	st->buf = (uint8_t *)MALLOC(length + 1);
+	if(!st->buf) {
+		st->size = 0;
+		ASN__DECODE_FAILED;
+	}
+
+	memcpy(st->buf, buf_ptr, length);
+	st->buf[length] = '\0';		/* Just in case */
+
+	rval.code = RC_OK;
+	rval.consumed += length;
+
+	ASN_DEBUG("Took %ld/%ld bytes to encode %s",
+		(long)rval.consumed,
+		(long)length, td->name);
+
+	return rval;
+}
+
+/*
+ * Encode an always-primitive type using DER.
+ */
+asn_enc_rval_t
+der_encode_primitive(const asn_TYPE_descriptor_t *td, const void *sptr,
+                     int tag_mode, ber_tlv_tag_t tag,
+                     asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_enc_rval_t erval = {0,0,0};
+	const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr;
+
+	ASN_DEBUG("%s %s as a primitive type (tm=%d)",
+		cb?"Encoding":"Estimating", td->name, tag_mode);
+
+	erval.encoded = der_write_tags(td, st->size, tag_mode, 0, tag,
+		cb, app_key);
+	ASN_DEBUG("%s wrote tags %d", td->name, (int)erval.encoded);
+	if(erval.encoded == -1) {
+		erval.failed_type = td;
+		erval.structure_ptr = sptr;
+		return erval;
+	}
+
+	if(cb && st->buf) {
+		if(cb(st->buf, st->size, app_key) < 0) {
+			erval.encoded = -1;
+			erval.failed_type = td;
+			erval.structure_ptr = sptr;
+			return erval;
+		}
+	} else {
+		assert(st->buf || st->size == 0);
+	}
+
+	erval.encoded += st->size;
+	ASN__ENCODED_OK(erval);
+}
+
+void
+ASN__PRIMITIVE_TYPE_free(const asn_TYPE_descriptor_t *td, void *sptr,
+                         enum asn_struct_free_method method) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr;
+
+	if(!td || !sptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as a primitive type", td->name);
+
+	if(st->buf)
+		FREEMEM(st->buf);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(sptr, 0, sizeof(ASN__PRIMITIVE_TYPE_t));
+        break;
+    }
+}
+
+
+/*
+ * Local internal type passed around as an argument.
+ */
+struct xdp_arg_s {
+    const asn_TYPE_descriptor_t *type_descriptor;
+    void *struct_key;
+	xer_primitive_body_decoder_f *prim_body_decoder;
+	int decoded_something;
+	int want_more;
+};
+
+/*
+ * Since some kinds of primitive values can be encoded using value-specific
+ * tags (<MINUS-INFINITY>, <enum-element>, etc), the primitive decoder must
+ * be supplied with such tags to parse them as needed.
+ */
+static int
+xer_decode__unexpected_tag(void *key, const void *chunk_buf, size_t chunk_size) {
+	struct xdp_arg_s *arg = (struct xdp_arg_s *)key;
+	enum xer_pbd_rval bret;
+
+	/*
+	 * The chunk_buf is guaranteed to start at '<'.
+	 */
+	assert(chunk_size && ((const char *)chunk_buf)[0] == 0x3c);
+
+	/*
+	 * Decoding was performed once already. Prohibit doing it again.
+	 */
+	if(arg->decoded_something)
+		return -1;
+
+	bret = arg->prim_body_decoder(arg->type_descriptor,
+		arg->struct_key, chunk_buf, chunk_size);
+	switch(bret) {
+	case XPBD_SYSTEM_FAILURE:
+	case XPBD_DECODER_LIMIT:
+	case XPBD_BROKEN_ENCODING:
+		break;
+	case XPBD_BODY_CONSUMED:
+		/* Tag decoded successfully */
+		arg->decoded_something = 1;
+		/* Fall through */
+	case XPBD_NOT_BODY_IGNORE:	/* Safe to proceed further */
+		return 0;
+	}
+
+	return -1;
+}
+
+static ssize_t
+xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, int have_more) {
+	struct xdp_arg_s *arg = (struct xdp_arg_s *)key;
+	enum xer_pbd_rval bret;
+	size_t lead_wsp_size;
+
+	if(arg->decoded_something) {
+		if(xer_whitespace_span(chunk_buf, chunk_size) == chunk_size) {
+			/*
+			 * Example:
+			 * "<INTEGER>123<!--/--> </INTEGER>"
+			 *                      ^- chunk_buf position.
+			 */
+			return chunk_size;
+		}
+		/*
+		 * Decoding was done once already. Prohibit doing it again.
+		 */
+		return -1;
+	}
+
+	if(!have_more) {
+		/*
+		 * If we've received something like "1", we can't really
+		 * tell whether it is really `1` or `123`, until we know
+		 * that there is no more data coming.
+		 * The have_more argument will be set to 1 once something
+		 * like this is available to the caller of this callback:
+		 * "1<tag_start..."
+		 */
+		arg->want_more = 1;
+		return -1;
+	}
+
+	lead_wsp_size = xer_whitespace_span(chunk_buf, chunk_size);
+	chunk_buf = (const char *)chunk_buf + lead_wsp_size;
+	chunk_size -= lead_wsp_size;
+
+	bret = arg->prim_body_decoder(arg->type_descriptor,
+		arg->struct_key, chunk_buf, chunk_size);
+	switch(bret) {
+	case XPBD_SYSTEM_FAILURE:
+	case XPBD_DECODER_LIMIT:
+	case XPBD_BROKEN_ENCODING:
+		break;
+	case XPBD_BODY_CONSUMED:
+		/* Tag decoded successfully */
+		arg->decoded_something = 1;
+		/* Fall through */
+	case XPBD_NOT_BODY_IGNORE:	/* Safe to proceed further */
+		return lead_wsp_size + chunk_size;
+	}
+
+	return -1;
+}
+
+
+asn_dec_rval_t
+xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     size_t struct_size, const char *opt_mname,
+                     const void *buf_ptr, size_t size,
+                     xer_primitive_body_decoder_f *prim_body_decoder) {
+    const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+	asn_struct_ctx_t s_ctx;
+	struct xdp_arg_s s_arg;
+	asn_dec_rval_t rc;
+
+	/*
+	 * Create the structure if does not exist.
+	 */
+	if(!*sptr) {
+		*sptr = CALLOC(1, struct_size);
+		if(!*sptr) ASN__DECODE_FAILED;
+	}
+
+	memset(&s_ctx, 0, sizeof(s_ctx));
+	s_arg.type_descriptor = td;
+	s_arg.struct_key = *sptr;
+	s_arg.prim_body_decoder = prim_body_decoder;
+	s_arg.decoded_something = 0;
+	s_arg.want_more = 0;
+
+	rc = xer_decode_general(opt_codec_ctx, &s_ctx, &s_arg,
+		xml_tag, buf_ptr, size,
+		xer_decode__unexpected_tag, xer_decode__primitive_body);
+	switch(rc.code) {
+	case RC_OK:
+		if(!s_arg.decoded_something) {
+			char ch;
+			ASN_DEBUG("Primitive body is not recognized, "
+				"supplying empty one");
+			/*
+			 * Decoding opportunity has come and gone.
+			 * Where's the result?
+			 * Try to feed with empty body, see if it eats it.
+			 */
+			if(prim_body_decoder(s_arg.type_descriptor,
+				s_arg.struct_key, &ch, 0)
+					!= XPBD_BODY_CONSUMED) {
+				/*
+				 * This decoder does not like empty stuff.
+				 */
+				ASN__DECODE_FAILED;
+			}
+		}
+		break;
+	case RC_WMORE:
+		/*
+		 * Redo the whole thing later.
+		 * We don't have a context to save intermediate parsing state.
+		 */
+		rc.consumed = 0;
+		break;
+	case RC_FAIL:
+		rc.consumed = 0;
+		if(s_arg.want_more)
+			rc.code = RC_WMORE;
+		else
+			ASN__DECODE_FAILED;
+		break;
+	}
+	return rc;
+}
+
diff --git a/e2sm/lib/asn_internal.c b/e2sm/lib/asn_internal.c
new file mode 100644
index 0000000..004660b
--- /dev/null
+++ b/e2sm/lib/asn_internal.c
@@ -0,0 +1,49 @@
+#include <asn_internal.h>
+
+ssize_t
+asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key,
+                        const char *fmt, ...) {
+    char scratch[64];
+    char *buf = scratch;
+    size_t buf_size = sizeof(scratch);
+    int wrote;
+    int cb_ret;
+
+    do {
+        va_list args;
+        va_start(args, fmt);
+
+        wrote = vsnprintf(buf, buf_size, fmt, args);
+        if(wrote < (ssize_t)buf_size) {
+            if(wrote < 0) {
+                if(buf != scratch) FREEMEM(buf);
+		va_end(args);
+                return -1;
+            }
+            break;
+        }
+
+        buf_size <<= 1;
+        if(buf == scratch) {
+            buf = MALLOC(buf_size);
+            if(!buf) { va_end(args); return -1; }
+        } else {
+            void *p = REALLOC(buf, buf_size);
+            if(!p) {
+                FREEMEM(buf);
+		va_end(args);
+                return -1;
+            }
+            buf = p;
+        }
+    } while(1);
+
+    cb_ret = cb(buf, wrote, key);
+    if(buf != scratch) FREEMEM(buf);
+    if(cb_ret < 0) {
+        return -1;
+    }
+
+    return wrote;
+}
+
diff --git a/e2sm/lib/asn_random_fill.c b/e2sm/lib/asn_random_fill.c
new file mode 100644
index 0000000..2e3e892
--- /dev/null
+++ b/e2sm/lib/asn_random_fill.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_random_fill.h>
+#include <constr_TYPE.h>
+
+int
+asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+                size_t length) {
+
+    if(td && td->op->random_fill) {
+        asn_random_fill_result_t res =
+            td->op->random_fill(td, struct_ptr, 0, length);
+        return (res.code == ARFILL_OK) ? 0 : -1;
+    } else {
+        return -1;
+    }
+}
+
+static uintmax_t
+asn__intmax_range(intmax_t lb, intmax_t ub) {
+    assert(lb <= ub);
+    if((ub < 0) == (lb < 0)) {
+        return ub - lb;
+    } else if(lb < 0) {
+        return 1 + ((uintmax_t)ub + (uintmax_t)-(lb + 1));
+    } else {
+        assert(!"Unreachable");
+        return 0;
+    }
+}
+
+intmax_t
+asn_random_between(intmax_t lb, intmax_t rb) {
+    if(lb == rb) {
+        return lb;
+    } else {
+        const uintmax_t intmax_max = ((~(uintmax_t)0) >> 1);
+        uintmax_t range = asn__intmax_range(lb, rb);
+        uintmax_t value = 0;
+        uintmax_t got_entropy = 0;
+
+        assert(RAND_MAX > 0xffffff);    /* Seen 7ffffffd! */
+        assert(range < intmax_max);
+
+        for(; got_entropy < range;) {
+            got_entropy = (got_entropy << 24) | 0xffffff;
+#ifdef WIN32
+            value = (value << 24) | (rand() % 0xffffff); //MCHECK:for building on Windows
+#else
+            value = (value << 24) | (random() % 0xffffff); //MCHECK:for building on Linux
+#endif
+        }
+
+        return lb + (intmax_t)(value % (range + 1));
+    }
+}
diff --git a/e2sm/lib/ber_decoder.c b/e2sm/lib/ber_decoder.c
new file mode 100644
index 0000000..75d6016
--- /dev/null
+++ b/e2sm/lib/ber_decoder.c
@@ -0,0 +1,283 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {					\
+		size_t num = num_bytes;					\
+		ptr = ((const char *)ptr) + num;			\
+		size -= num;						\
+		consumed_myself += num;					\
+	} while(0)
+#undef	RETURN
+#define	RETURN(_code)	do {						\
+		asn_dec_rval_t rval;					\
+		rval.code = _code;					\
+		if(opt_ctx) opt_ctx->step = step; /* Save context */	\
+		if(_code == RC_OK || opt_ctx)				\
+			rval.consumed = consumed_myself;		\
+		else							\
+			rval.consumed = 0;	/* Context-free */	\
+		return rval;						\
+	} while(0)
+
+/*
+ * The BER decoder of any type.
+ */
+asn_dec_rval_t
+ber_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+           const void *ptr, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return type_descriptor->op->ber_decoder(opt_codec_ctx, type_descriptor,
+		struct_ptr,	/* Pointer to the destination structure */
+		ptr, size,	/* Buffer and its size */
+		0		/* Default tag mode is 0 */
+		);
+}
+
+/*
+ * Check the set of <TL<TL<TL...>>> tags matches the definition.
+ */
+asn_dec_rval_t
+ber_check_tags(const asn_codec_ctx_t *opt_codec_ctx,
+               const asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx,
+               const void *ptr, size_t size, int tag_mode, int last_tag_form,
+               ber_tlv_len_t *last_length, int *opt_tlv_form) {
+    ssize_t consumed_myself = 0;
+	ssize_t tag_len;
+	ssize_t len_len;
+	ber_tlv_tag_t tlv_tag;
+	ber_tlv_len_t tlv_len;
+	ber_tlv_len_t limit_len = -1;
+	int expect_00_terminators = 0;
+	int tlv_constr = -1;	/* If CHOICE, opt_tlv_form is not given */
+	int step = opt_ctx ? opt_ctx->step : 0;	/* Where we left previously */
+	int tagno;
+
+	/*
+	 * Make sure we didn't exceed the maximum stack size.
+	 */
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		RETURN(RC_FAIL);
+
+	/*
+	 * So what does all this implicit skip stuff mean?
+	 * Imagine two types,
+	 * 	A ::= [5] IMPLICIT	T
+	 * 	B ::= [2] EXPLICIT	T
+	 * Where T is defined as
+	 *	T ::= [4] IMPLICIT SEQUENCE { ... }
+	 * 
+	 * Let's say, we are starting to decode type A, given the
+	 * following TLV stream: <5> <0>. What does this mean?
+	 * It means that the type A contains type T which is,
+	 * in turn, empty.
+	 * Remember though, that we are still in A. We cannot
+	 * just pass control to the type T decoder. Why? Because
+	 * the type T decoder expects <4> <0>, not <5> <0>.
+	 * So, we must make sure we are going to receive <5> while
+	 * still in A, then pass control to the T decoder, indicating
+	 * that the tag <4> was implicitly skipped. The decoder of T
+	 * hence will be prepared to treat <4> as valid tag, and decode
+	 * it appropriately.
+	 */
+
+	tagno = step	/* Continuing where left previously */
+		+ (tag_mode==1?-1:0)
+		;
+	ASN_DEBUG("ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)",
+		td->name, (long)size, tag_mode, step, tagno);
+	/* assert(td->tags_count >= 1) May not be the case for CHOICE or ANY */
+
+	if(tag_mode == 0 && tagno == (int)td->tags_count) {
+		/*
+		 * This must be the _untagged_ ANY type,
+		 * which outermost tag isn't known in advance.
+		 * Fetch the tag and length separately.
+		 */
+		tag_len = ber_fetch_tag(ptr, size, &tlv_tag);
+		switch(tag_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+		tlv_constr = BER_TLV_CONSTRUCTED(ptr);
+		len_len = ber_fetch_length(tlv_constr,
+			(const char *)ptr + tag_len, size - tag_len, &tlv_len);
+		switch(len_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+		ASN_DEBUG("Advancing %ld in ANY case",
+			(long)(tag_len + len_len));
+		ADVANCE(tag_len + len_len);
+	} else {
+		assert(tagno < (int)td->tags_count);	/* At least one loop */
+	}
+	for((void)tagno; tagno < (int)td->tags_count; tagno++, step++) {
+
+		/*
+		 * Fetch and process T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, size, &tlv_tag);
+			ASN_DEBUG("Fetching tag from {%p,%ld}: "
+				"len %ld, step %d, tagno %d got %s",
+				ptr, (long)size,
+				(long)tag_len, step, tagno,
+				ber_tlv_tag_string(tlv_tag));
+		switch(tag_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		tlv_constr = BER_TLV_CONSTRUCTED(ptr);
+
+		/*
+		 * If {I}, don't check anything.
+		 * If {I,B,C}, check B and C unless we're at I.
+		 */
+		if(tag_mode != 0 && step == 0) {
+			/*
+			 * We don't expect tag to match here.
+			 * It's just because we don't know how the tag
+			 * is supposed to look like.
+			 */
+		} else {
+		    assert(tagno >= 0);	/* Guaranteed by the code above */
+		    if(tlv_tag != td->tags[tagno]) {
+			/*
+			 * Unexpected tag. Too bad.
+			 */
+		    	ASN_DEBUG("Expected: %s, "
+				"expectation failed (tn=%d, tm=%d)",
+				ber_tlv_tag_string(td->tags[tagno]),
+				tagno, tag_mode
+			);
+			RETURN(RC_FAIL);
+		    }
+		}
+
+		/*
+		 * Attention: if there are more tags expected,
+		 * ensure that the current tag is presented
+		 * in constructed form (it contains other tags!).
+		 * If this one is the last one, check that the tag form
+		 * matches the one given in descriptor.
+		 */
+		if(tagno < ((int)td->tags_count - 1)) {
+			if(tlv_constr == 0) {
+				ASN_DEBUG("tlv_constr = %d, expfail",
+					tlv_constr);
+				RETURN(RC_FAIL);
+			}
+		} else {
+			if(last_tag_form != tlv_constr
+			&& last_tag_form != -1) {
+				ASN_DEBUG("last_tag_form %d != %d",
+					last_tag_form, tlv_constr);
+				RETURN(RC_FAIL);
+			}
+		}
+
+		/*
+		 * Fetch and process L from TLV.
+		 */
+		len_len = ber_fetch_length(tlv_constr,
+			(const char *)ptr + tag_len, size - tag_len, &tlv_len);
+		ASN_DEBUG("Fetching len = %ld", (long)len_len);
+		switch(len_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		/*
+		 * FIXME
+		 * As of today, the chain of tags
+		 * must either contain several indefinite length TLVs,
+		 * or several definite length ones.
+		 * No mixing is allowed.
+		 */
+		if(tlv_len == -1) {
+			/*
+			 * Indefinite length.
+			 */
+			if(limit_len == -1) {
+				expect_00_terminators++;
+			} else {
+				ASN_DEBUG("Unexpected indefinite length "
+					"in a chain of definite lengths");
+				RETURN(RC_FAIL);
+			}
+			ADVANCE(tag_len + len_len);
+			continue;
+		} else {
+			if(expect_00_terminators) {
+				ASN_DEBUG("Unexpected definite length "
+					"in a chain of indefinite lengths");
+				RETURN(RC_FAIL);
+			}
+		}
+
+		/*
+		 * Check that multiple TLVs specify ever decreasing length,
+		 * which is consistent.
+		 */
+		if(limit_len == -1) {
+			limit_len    = tlv_len + tag_len + len_len;
+			if(limit_len < 0) {
+				/* Too great tlv_len value? */
+				RETURN(RC_FAIL);
+			}
+		} else if(limit_len != tlv_len + tag_len + len_len) {
+			/*
+			 * Inner TLV specifies length which is inconsistent
+			 * with the outer TLV's length value.
+			 */
+			ASN_DEBUG("Outer TLV is %ld and inner is %ld",
+				(long)limit_len, (long)tlv_len);
+			RETURN(RC_FAIL);
+		}
+
+		ADVANCE(tag_len + len_len);
+
+		limit_len -= (tag_len + len_len);
+		if((ssize_t)size > limit_len) {
+			/*
+			 * Make sure that we won't consume more bytes
+			 * from the parent frame than the inferred limit.
+			 */
+			size = limit_len;
+		}
+	}
+
+	if(opt_tlv_form)
+		*opt_tlv_form = tlv_constr;
+	if(expect_00_terminators)
+		*last_length = -expect_00_terminators;
+	else
+		*last_length = tlv_len;
+
+	RETURN(RC_OK);
+}
diff --git a/e2sm/lib/ber_tlv_length.c b/e2sm/lib/ber_tlv_length.c
new file mode 100644
index 0000000..0a0deec
--- /dev/null
+++ b/e2sm/lib/ber_tlv_length.c
@@ -0,0 +1,168 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ber_tlv_length.h>
+#include <ber_tlv_tag.h>
+
+ssize_t
+ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
+		ber_tlv_len_t *len_r) {
+	const uint8_t *buf = (const uint8_t *)bufptr;
+	unsigned oct;
+
+	if(size == 0)
+		return 0;	/* Want more */
+
+	oct = *(const uint8_t *)buf;
+	if((oct & 0x80) == 0) {
+		/*
+		 * Short definite length.
+		 */
+		*len_r = oct;	/* & 0x7F */
+		return 1;
+	} else {
+		ber_tlv_len_t len;
+		size_t skipped;
+
+		if(_is_constructed && oct == 0x80) {
+			*len_r = -1;	/* Indefinite length */
+			return 1;
+		}
+
+		if(oct == 0xff) {
+			/* Reserved in standard for future use. */
+			return -1;
+		}
+
+		oct &= 0x7F;	/* Leave only the 7 LS bits */
+		for(len = 0, buf++, skipped = 1;
+			oct && (++skipped <= size); buf++, oct--) {
+
+			/* Verify that we won't overflow. */
+			if(!(len >> ((8 * sizeof(len)) - (8+1)))) {
+				len = (len << 8) | *buf;
+			} else {
+				/* Too large length value. */
+				return -1;
+			}
+		}
+
+		if(oct == 0) {
+			if(len < 0 || len > RSSIZE_MAX) {
+				/* Length value out of sane range. */
+				return -1;
+			}
+
+			*len_r = len;
+			return skipped;
+		}
+
+		return 0;	/* Want more */
+	}
+
+}
+
+ssize_t
+ber_skip_length(const asn_codec_ctx_t *opt_codec_ctx,
+		int _is_constructed, const void *ptr, size_t size) {
+	ber_tlv_len_t vlen;	/* Length of V in TLV */
+	ssize_t tl;		/* Length of L in TLV */
+	ssize_t ll;		/* Length of L in TLV */
+	size_t skip;
+
+	/*
+	 * Make sure we didn't exceed the maximum stack size.
+	 */
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		return -1;
+
+	/*
+	 * Determine the size of L in TLV.
+	 */
+	ll = ber_fetch_length(_is_constructed, ptr, size, &vlen);
+	if(ll <= 0) return ll;
+
+	/*
+	 * Definite length.
+	 */
+	if(vlen >= 0) {
+		skip = ll + vlen;
+		if(skip > size)
+			return 0;	/* Want more */
+		return skip;
+	}
+
+	/*
+	 * Indefinite length!
+	 */
+	ASN_DEBUG("Skipping indefinite length");
+	for(skip = ll, ptr = ((const char *)ptr) + ll, size -= ll;;) {
+		ber_tlv_tag_t tag;
+
+		/* Fetch the tag */
+		tl = ber_fetch_tag(ptr, size, &tag);
+		if(tl <= 0) return tl;
+
+		ll = ber_skip_length(opt_codec_ctx,
+			BER_TLV_CONSTRUCTED(ptr),
+			((const char *)ptr) + tl, size - tl);
+		if(ll <= 0) return ll;
+
+		skip += tl + ll;
+
+		/*
+		 * This may be the end of the indefinite length structure,
+		 * two consecutive 0 octets.
+		 * Check if it is true.
+		 */
+		if(((const uint8_t *)ptr)[0] == 0
+		&& ((const uint8_t *)ptr)[1] == 0)
+			return skip;
+
+		ptr = ((const char *)ptr) + tl + ll;
+		size -= tl + ll;
+	}
+
+	/* UNREACHABLE */
+}
+
+size_t
+der_tlv_length_serialize(ber_tlv_len_t len, void *bufp, size_t size) {
+	size_t required_size;	/* Size of len encoding */
+	uint8_t *buf = (uint8_t *)bufp;
+	uint8_t *end;
+	int i;
+
+	if(len <= 127) {
+		/* Encoded in 1 octet */
+		if(size) *buf = (uint8_t)len;
+		return 1;
+	}
+
+	/*
+	 * Compute the size of the subsequent bytes.
+	 */
+	for(required_size = 1, i = 8; i < 8 * (int)sizeof(len); i += 8) {
+		if(len >> i)
+			required_size++;
+		else
+			break;
+	}
+
+	if(size <= required_size)
+		return required_size + 1;
+
+	*buf++ = (uint8_t)(0x80 | required_size);  /* Length of the encoding */
+
+	/*
+	 * Produce the len encoding, space permitting.
+	 */
+	end = buf + required_size;
+	for(i -= 8; buf < end; i -= 8, buf++)
+		*buf = (uint8_t)(len >> i);
+
+	return required_size + 1;
+}
+
diff --git a/e2sm/lib/ber_tlv_tag.c b/e2sm/lib/ber_tlv_tag.c
new file mode 100644
index 0000000..4a7d732
--- /dev/null
+++ b/e2sm/lib/ber_tlv_tag.c
@@ -0,0 +1,144 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ber_tlv_tag.h>
+#include <errno.h>
+
+ssize_t
+ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
+	ber_tlv_tag_t val;
+	ber_tlv_tag_t tclass;
+	size_t skipped;
+
+	if(size == 0)
+		return 0;
+
+	val = *(const uint8_t *)ptr;
+	tclass = (val >> 6);
+	if((val &= 0x1F) != 0x1F) {
+		/*
+		 * Simple form: everything encoded in a single octet.
+		 * Tag Class is encoded using two least significant bits.
+		 */
+		*tag_r = (val << 2) | tclass;
+		return 1;
+	}
+
+	/*
+	 * Each octet contains 7 bits of useful information.
+	 * The MSB is 0 if it is the last octet of the tag.
+	 */
+	for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2;
+			skipped <= size;
+				ptr = ((const char *)ptr) + 1, skipped++) {
+		unsigned int oct = *(const uint8_t *)ptr;
+		if(oct & 0x80) {
+			val = (val << 7) | (oct & 0x7F);
+			/*
+			 * Make sure there are at least 9 bits spare
+			 * at the MS side of a value.
+			 */
+			if(val >> ((8 * sizeof(val)) - 9)) {
+				/*
+				 * We would not be able to accomodate
+				 * any more tag bits.
+				 */
+				return -1;
+			}
+		} else {
+			val = (val << 7) | oct;
+			*tag_r = (val << 2) | tclass;
+			return skipped;
+		}
+	}
+
+	return 0;	/* Want more */
+}
+
+
+ssize_t
+ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) {
+	char buf[sizeof("[APPLICATION ]") + 32];
+	ssize_t ret;
+
+	ret = ber_tlv_tag_snprint(tag, buf, sizeof(buf));
+	if(ret >= (ssize_t)sizeof(buf) || ret < 2) {
+		errno = EPERM;
+		return -1;
+	}
+
+	return fwrite(buf, 1, ret, f);
+}
+
+ssize_t
+ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) {
+	const char *type = 0;
+	int ret;
+
+	switch(tag & 0x3) {
+	case ASN_TAG_CLASS_UNIVERSAL:	type = "UNIVERSAL ";	break;
+	case ASN_TAG_CLASS_APPLICATION:	type = "APPLICATION ";	break;
+	case ASN_TAG_CLASS_CONTEXT:	type = "";		break;
+	case ASN_TAG_CLASS_PRIVATE:	type = "PRIVATE ";	break;
+	}
+
+	ret = snprintf(buf, size, "[%s%u]", type, ((unsigned)tag) >> 2);
+	if(ret <= 0 && size) buf[0] = '\0';	/* against broken libc's */
+
+	return ret;
+}
+
+char *
+ber_tlv_tag_string(ber_tlv_tag_t tag) {
+	static char buf[sizeof("[APPLICATION ]") + 32];
+
+	(void)ber_tlv_tag_snprint(tag, buf, sizeof(buf));
+
+	return buf;
+}
+
+
+size_t
+ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufp, size_t size) {
+	int tclass = BER_TAG_CLASS(tag);
+	ber_tlv_tag_t tval = BER_TAG_VALUE(tag);
+	uint8_t *buf = (uint8_t *)bufp;
+	uint8_t *end;
+	size_t required_size;
+	size_t i;
+
+	if(tval <= 30) {
+		/* Encoded in 1 octet */
+		if(size) buf[0] = (tclass << 6) | tval;
+		return 1;
+	} else if(size) {
+		*buf++ = (tclass << 6) | 0x1F;
+		size--;
+	}
+
+	/*
+	 * Compute the size of the subsequent bytes.
+	 */
+	for(required_size = 1, i = 7; i < 8 * sizeof(tval); i += 7) {
+		if(tval >> i)
+			required_size++;
+		else
+			break;
+	}
+
+	if(size < required_size)
+		return required_size + 1;
+
+	/*
+	 * Fill in the buffer, space permitting.
+	 */
+	end = buf + required_size - 1;
+	for(i -= 7; buf < end; i -= 7, buf++)
+		*buf = 0x80 | ((tval >> i) & 0x7F);
+	*buf = (tval & 0x7F);	/* Last octet without high bit */
+
+	return required_size + 1;
+}
+
diff --git a/e2sm/lib/constr_CHOICE.c b/e2sm/lib/constr_CHOICE.c
new file mode 100644
index 0000000..86dcbb0
--- /dev/null
+++ b/e2sm/lib/constr_CHOICE.c
@@ -0,0 +1,1533 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_CHOICE.h>
+#include <per_opentype.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num;\
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * See the definitions.
+ */
+static unsigned _fetch_present_idx(const void *struct_ptr, unsigned off,
+                                   unsigned size);
+static void _set_present_idx(void *sptr, unsigned offset, unsigned size,
+                             unsigned pres);
+static const void *_get_member_ptr(const asn_TYPE_descriptor_t *,
+                                   const void *sptr, asn_TYPE_member_t **elm,
+                                   unsigned *present);
+
+/*
+ * Tags are canonically sorted in the tag to member table.
+ */
+static int
+_search4tag(const void *ap, const void *bp) {
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+	int a_class = BER_TAG_CLASS(a->el_tag);
+	int b_class = BER_TAG_CLASS(b->el_tag);
+
+	if(a_class == b_class) {
+		ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+		ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+		if(a_value == b_value)
+			return 0;
+		else if(a_value < b_value)
+			return -1;
+		else
+			return 1;
+	} else if(a_class < b_class) {
+		return -1;
+	} else {
+		return 1;
+	}
+}
+
+/*
+ * The decoder of the CHOICE type.
+ */
+asn_dec_rval_t
+CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_CHOICE_specifics_t *specs =
+		(const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
+
+	/*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	ssize_t tag_len;	/* Length of TLV's T */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	ASN_DEBUG("Decoding %s as CHOICE", td->name);
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		if(tag_mode || td->tags_count) {
+			rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+				tag_mode, -1, &ctx->left, 0);
+			if(rval.code != RC_OK) {
+				ASN_DEBUG("%s tagging check failed: %d",
+					td->name, rval.code);
+				return rval;
+			}
+
+			if(ctx->left >= 0) {
+				/* ?Substracted below! */
+				ctx->left += rval.consumed;
+			}
+			ADVANCE(rval.consumed);
+		} else {
+			ctx->left = -1;
+		}
+
+		NEXT_PHASE(ctx);
+
+		ASN_DEBUG("Structure consumes %ld bytes, buffer %ld",
+			(long)ctx->left, (long)size);
+
+		/* Fall through */
+	case 1:
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		ASN_DEBUG("In %s CHOICE tag length %d", td->name, (int)tag_len);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+		do {
+			const asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key;
+
+			key.el_tag = tlv_tag;
+			t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+					specs->tag2el, specs->tag2el_count,
+					sizeof(specs->tag2el[0]), _search4tag);
+			if(t2m) {
+				/*
+				 * Found the element corresponding to the tag.
+				 */
+				NEXT_PHASE(ctx);
+				ctx->step = t2m->el_no;
+				break;
+			} else if(specs->ext_start == -1) {
+				ASN_DEBUG("Unexpected tag %s "
+					"in non-extensible CHOICE %s",
+					ber_tlv_tag_string(tlv_tag), td->name);
+				RETURN(RC_FAIL);
+			} else {
+				/* Skip this tag */
+				ssize_t skip;
+
+				ASN_DEBUG("Skipping unknown tag %s",
+					ber_tlv_tag_string(tlv_tag));
+
+				skip = ber_skip_length(opt_codec_ctx,
+					BER_TLV_CONSTRUCTED(ptr),
+					(const char *)ptr + tag_len,
+					LEFT - tag_len);
+
+				switch(skip) {
+				case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+					/* Fall through */
+				case -1: RETURN(RC_FAIL);
+				}
+
+				ADVANCE(skip + tag_len);
+				RETURN(RC_OK);
+			}
+		} while(0);
+
+	case 2:
+		/*
+		 * PHASE 2.
+		 * Read in the element.
+		 */
+	    do {
+		asn_TYPE_member_t *elm;/* CHOICE's element */
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+
+		elm = &elements[ctx->step];
+
+		/*
+		 * Compute the position of the member inside a structure,
+		 * and also a type of containment (it may be contained
+		 * as pointer or using inline inclusion).
+		 */
+		if(elm->flags & ATF_POINTER) {
+			/* Member is a pointer to another structure */
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			/*
+			 * A pointer to a pointer
+			 * holding the start of the structure
+			 */
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+		/* Set presence to be able to free it properly at any time */
+		_set_present_idx(st, specs->pres_offset,
+				specs->pres_size, ctx->step + 1);
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		rval = elm->type->op->ber_decoder(opt_codec_ctx, elm->type,
+				memb_ptr2, ptr, LEFT, elm->tag_mode);
+		switch(rval.code) {
+		case RC_OK:
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			RETURN(RC_FAIL);
+		case RC_FAIL: /* Fatal error */
+			RETURN(rval.code);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  } while(0);
+
+		NEXT_PHASE(ctx);
+
+		/* Fall through */
+	case 3:
+		ASN_DEBUG("CHOICE %s Leftover: %ld, size = %ld, tm=%d, tc=%d",
+			td->name, (long)ctx->left, (long)size,
+			tag_mode, td->tags_count);
+
+		if(ctx->left > 0) {
+			/*
+			 * The type must be fully decoded
+			 * by the CHOICE member-specific decoder.
+			 */
+			RETURN(RC_FAIL);
+		}
+
+		if(ctx->left == -1
+		&& !(tag_mode || td->tags_count)) {
+			/*
+			 * This is an untagged CHOICE.
+			 * It doesn't contain nothing
+			 * except for the member itself, including all its tags.
+			 * The decoding is completed.
+			 */
+			NEXT_PHASE(ctx);
+			break;
+		}
+
+		/*
+		 * Read in the "end of data chunks"'s.
+		 */
+		while(ctx->left < 0) {
+			ssize_t tl;
+
+			tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+			switch(tl) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			/*
+			 * Expected <0><0>...
+			 */
+			if(((const uint8_t *)ptr)[0] == 0) {
+				if(LEFT < 2) {
+					if(SIZE_VIOLATION)
+						RETURN(RC_FAIL);
+					else
+						RETURN(RC_WMORE);
+				} else if(((const uint8_t *)ptr)[1] == 0) {
+					/*
+					 * Correctly finished with <0><0>.
+					 */
+					ADVANCE(2);
+					ctx->left++;
+					continue;
+				}
+			} else {
+				ASN_DEBUG("Unexpected continuation in %s",
+					td->name);
+				RETURN(RC_FAIL);
+			}
+
+			/* UNREACHABLE */
+		}
+
+		NEXT_PHASE(ctx);
+	case 4:
+		/* No meaningful work here */
+		break;
+	}
+	
+	RETURN(RC_OK);
+}
+
+asn_enc_rval_t
+CHOICE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elm;	/* CHOICE element */
+	asn_enc_rval_t erval = {0,0,0};
+	const void *memb_ptr;
+	size_t computed_size = 0;
+	unsigned present;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("%s %s as CHOICE",
+		cb?"Encoding":"Estimating", td->name);
+
+	present = _fetch_present_idx(sptr,
+		specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present == 0 || present > td->elements_count) {
+		if(present == 0 && td->elements_count == 0) {
+			/* The CHOICE is empty?! */
+			erval.encoded = 0;
+			ASN__ENCODED_OK(erval);
+		}
+		ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Seek over the present member of the structure.
+	 */
+	elm = &td->elements[present-1];
+	if(elm->flags & ATF_POINTER) {
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(memb_ptr == 0) {
+			if(elm->optional) {
+				erval.encoded = 0;
+				ASN__ENCODED_OK(erval);
+			}
+			/* Mandatory element absent */
+			ASN__ENCODE_FAILED;
+		}
+	} else {
+        memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+    }
+
+	/*
+	 * If the CHOICE itself is tagged EXPLICIT:
+	 * T ::= [2] EXPLICIT CHOICE { ... }
+	 * Then emit the appropriate tags.
+	 */
+	if(tag_mode == 1 || td->tags_count) {
+		/*
+		 * For this, we need to pre-compute the member.
+		 */
+		ssize_t ret;
+
+		/* Encode member with its tag */
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			elm->tag_mode, elm->tag, 0, 0);
+		if(erval.encoded == -1)
+			return erval;
+
+		/* Encode CHOICE with parent or my own tag */
+		ret = der_write_tags(td, erval.encoded, tag_mode, 1, tag,
+			cb, app_key);
+		if(ret == -1)
+			ASN__ENCODE_FAILED;
+		computed_size += ret;
+	}
+
+	/*
+	 * Encode the single underlying member.
+	 */
+	erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+		elm->tag_mode, elm->tag, cb, app_key);
+	if(erval.encoded == -1)
+		return erval;
+
+	ASN_DEBUG("Encoded CHOICE member in %ld bytes (+%ld)",
+		(long)erval.encoded, (long)computed_size);
+
+	erval.encoded += computed_size;
+
+	return erval;
+}
+
+ber_tlv_tag_t
+CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	unsigned present;
+
+	assert(tag_mode == 0); (void)tag_mode;
+	assert(tag == 0); (void)tag;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size);
+
+	if(present > 0 && present <= td->elements_count) {
+		const asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)
+					((const char *)ptr + elm->memb_offset);
+		} else {
+			memb_ptr = (const void *)
+					((const char *)ptr + elm->memb_offset);
+		}
+
+		return asn_TYPE_outmost_tag(elm->type, memb_ptr,
+			elm->tag_mode, elm->tag);
+	} else {
+		return (ber_tlv_tag_t)-1;
+	}
+}
+
+int
+CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional)
+					return 0;
+				ASN__CTFAIL(app_key, td, sptr,
+					"%s: mandatory CHOICE element %s absent (%s:%d)",
+					td->name, elm->name, __FILE__, __LINE__);
+				return -1;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		if(elm->encoding_constraints.general_constraints) {
+			return elm->encoding_constraints.general_constraints(elm->type, memb_ptr,
+				ctfailcb, app_key);
+		} else {
+			return elm->type->encoding_constraints.general_constraints(elm->type,
+					memb_ptr, ctfailcb, app_key);
+		}
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: no CHOICE element given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+#undef	XER_ADVANCE
+#define	XER_ADVANCE(num_bytes)	do {			\
+		size_t num = num_bytes;			\
+		buf_ptr = (const void *)(((const char *)buf_ptr) + num); \
+		size -= num;				\
+		consumed_myself += num;			\
+	} while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const char *opt_mname, const void *buf_ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval;		/* Return value of a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* Element index */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	if(ctx->phase == 0 && !*xml_tag)
+		ctx->phase = 1;	/* Skip the outer tag checking phase */
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 * Phase 3: Only waiting for closing tag.
+	 * Phase 4: Skipping unknown extensions.
+	 * Phase 5: PHASED OUT
+	 */
+	for(edx = ctx->step; ctx->phase <= 4;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+		asn_TYPE_member_t *elm;
+
+		/*
+		 * Go inside the member.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval;
+			void *memb_ptr;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+			unsigned old_present;
+
+			elm = &td->elements[edx];
+
+			if(elm->flags & ATF_POINTER) {
+				/* Member is a pointer to another structure */
+				memb_ptr2 = (void **)((char *)st
+					+ elm->memb_offset);
+			} else {
+				memb_ptr = (char *)st + elm->memb_offset;
+				memb_ptr2 = &memb_ptr;
+			}
+
+			/* Start/Continue decoding the inner member */
+			tmprval = elm->type->op->xer_decoder(opt_codec_ctx,
+					elm->type, memb_ptr2, elm->name,
+					buf_ptr, size);
+			XER_ADVANCE(tmprval.consumed);
+			ASN_DEBUG("XER/CHOICE: itdf: [%s] code=%d",
+				elm->type->name, tmprval.code);
+			old_present = _fetch_present_idx(st,
+				specs->pres_offset, specs->pres_size);
+			assert(old_present == 0 || old_present == edx + 1);
+			/* Record what we've got */
+			_set_present_idx(st,
+				specs->pres_offset, specs->pres_size, edx + 1);
+			if(tmprval.code != RC_OK)
+				RETURN(tmprval.code);
+			ctx->phase = 3;
+			/* Fall through */
+		}
+
+		/* No need to wait for closing tag; special mode. */
+		if(ctx->phase == 3 && !*xml_tag) {
+			ctx->phase = 5;	/* Phase out */
+			RETURN(RC_OK);
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+			case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d",
+			ch_size>0?((const uint8_t *)buf_ptr)[0]:'?',
+			ch_size>1?((const uint8_t *)buf_ptr)[1]:'?',
+			ch_size>2?((const uint8_t *)buf_ptr)[2]:'?',
+			ch_size>3?((const uint8_t *)buf_ptr)[3]:'?',
+		xml_tag, tcv);
+
+		/* Skip the extensions section */
+		if(ctx->phase == 4) {
+			ASN_DEBUG("skip_unknown(%d, %ld)",
+				tcv, (long)ctx->left);
+			switch(xer_skip_unknown(tcv, &ctx->left)) {
+			case -1:
+				ctx->phase = 5;
+				RETURN(RC_FAIL);
+			case 1:
+				ctx->phase = 3;
+				/* Fall through */
+			case 0:
+				XER_ADVANCE(ch_size);
+				continue;
+			case 2:
+				ctx->phase = 3;
+				break;
+			}
+		}
+
+		switch(tcv) {
+		case XCT_BOTH:
+			break;	/* No CHOICE? */
+		case XCT_CLOSING:
+			if(ctx->phase != 3)
+				break;
+			XER_ADVANCE(ch_size);
+			ctx->phase = 5;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			if(ctx->phase != 1)
+				break;	/* Really unexpected */
+
+			/*
+			 * Search which inner member corresponds to this tag.
+			 */
+			for(edx = 0; edx < td->elements_count; edx++) {
+				elm = &td->elements[edx];
+				tcv = xer_check_tag(buf_ptr,ch_size,elm->name);
+				switch(tcv) {
+				case XCT_BOTH:
+				case XCT_OPENING:
+					/*
+					 * Process this member.
+					 */
+					ctx->step = edx;
+					ctx->phase = 2;
+					break;
+				case XCT_UNKNOWN_OP:
+				case XCT_UNKNOWN_BO:
+					continue;
+				default:
+					edx = td->elements_count;
+					break;	/* Phase out */
+				}
+				break;
+			}
+			if(edx != td->elements_count)
+				continue;
+
+			/* It is expected extension */
+			if(specs->ext_start != -1) {
+				ASN_DEBUG("Got anticipated extension");
+				/*
+				 * Check for (XCT_BOTH or XCT_UNKNOWN_BO)
+				 * By using a mask. Only record a pure
+				 * <opening> tags.
+				 */
+				if(tcv & XCT_CLOSING) {
+					/* Found </extension> without body */
+					ctx->phase = 3; /* Terminating */
+				} else {
+					ctx->left = 1;
+					ctx->phase = 4; /* Skip ...'s */
+				}
+				XER_ADVANCE(ch_size);
+				continue;
+			}
+
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag [%c%c%c%c] in CHOICE [%s]"
+			" (ph=%d, tag=%s)",
+			ch_size>0?((const uint8_t *)buf_ptr)[0]:'?',
+			ch_size>1?((const uint8_t *)buf_ptr)[1]:'?',
+			ch_size>2?((const uint8_t *)buf_ptr)[2]:'?',
+			ch_size>3?((const uint8_t *)buf_ptr)[3]:'?',
+			td->name, ctx->phase, xml_tag);
+		break;
+	}
+
+	ctx->phase = 5;	/* Phase out, just in case */
+	RETURN(RC_FAIL);
+}
+
+
+asn_enc_rval_t
+CHOICE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                  enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+	const asn_CHOICE_specifics_t *specs =
+        	(const asn_CHOICE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	unsigned present = 0;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+
+	if(present == 0 || present > td->elements_count) {
+		ASN__ENCODE_FAILED;
+	}  else {
+		asn_enc_rval_t tmper = {0,0,0};
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr = NULL;
+		const char *mname = elm->name;
+		unsigned int mlen = strlen(mname);
+
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!memb_ptr) ASN__ENCODE_FAILED;
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+
+        er.encoded = 0;
+
+		if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel);
+		ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+		tmper = elm->type->op->xer_encoder(elm->type, memb_ptr,
+				ilevel + 1, flags, cb, app_key);
+		if(tmper.encoded == -1) return tmper;
+		er.encoded += tmper.encoded;
+
+		ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+	}
+
+	if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+asn_dec_rval_t
+CHOICE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_dec_rval_t rv;
+	const asn_per_constraint_t *ct;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	void *memb_ptr;
+	void **memb_ptr2;
+	void *st = *sptr;
+	int value;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints) ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted */
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		ASN_DEBUG("CHOICE %s got index %d in range %d",
+			td->name, value, ct->range_bits);
+		if(value > ct->upper_bound)
+			ASN__DECODE_FAILED;
+	} else {
+		if(specs->ext_start == -1)
+			ASN__DECODE_FAILED;
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->ext_start;
+		if((unsigned)value >= td->elements_count)
+			ASN__DECODE_FAILED;
+	}
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->from_canonical_order) {
+        ASN_DEBUG("CHOICE presence from wire %d", value);
+		value = specs->from_canonical_order[value];
+        ASN_DEBUG("CHOICE presence index effective %d", value);
+    }
+
+	/* Set presence to be able to free it later */
+	_set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
+
+	elm = &td->elements[value];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+	ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
+
+	if(ct && ct->range_bits >= 0) {
+		rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+			elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	} else {
+		rv = uper_open_type_get(opt_codec_ctx, elm->type,
+			elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	}
+
+	if(rv.code != RC_OK)
+		ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
+			elm->name, td->name, rv.code);
+	return rv;
+}
+
+asn_enc_rval_t
+CHOICE_encode_uper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	const asn_per_constraint_t *ct;
+	const void *memb_ptr;
+	unsigned present;
+	int present_enc;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Encoding %s as CHOICE", td->name);
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized properly, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present == 0 || present > td->elements_count)
+		ASN__ENCODE_FAILED;
+	else
+		present--;
+
+	ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
+
+    /* Adjust if canonical order is different from natural order */
+    if(specs->to_canonical_order)
+        present_enc = specs->to_canonical_order[present];
+    else
+        present_enc = present;
+
+    if(ct && ct->range_bits >= 0) {
+		if(present_enc < ct->lower_bound
+		|| present_enc > ct->upper_bound) {
+			if(ct->flags & APC_EXTENSIBLE) {
+                ASN_DEBUG(
+                    "CHOICE member %d (enc %d) is an extension (%ld..%ld)",
+                    present, present_enc, ct->lower_bound, ct->upper_bound);
+                if(per_put_few_bits(po, 1, 1))
+					ASN__ENCODE_FAILED;
+			} else {
+				ASN__ENCODE_FAILED;
+			}
+			ct = 0;
+		}
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+        ASN_DEBUG("CHOICE member %d (enc %d) is not an extension (%ld..%ld)",
+                  present, present_enc, ct->lower_bound, ct->upper_bound);
+        if(per_put_few_bits(po, 0, 1))
+			ASN__ENCODE_FAILED;
+    }
+
+
+	elm = &td->elements[present];
+    ASN_DEBUG("CHOICE member \"%s\" %d (as %d)", elm->name, present,
+              present_enc);
+    if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+	} else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(ct && ct->range_bits >= 0) {
+        if(per_put_few_bits(po, present_enc, ct->range_bits))
+            ASN__ENCODE_FAILED;
+
+        return elm->type->op->uper_encoder(
+            elm->type, elm->encoding_constraints.per_constraints, memb_ptr, po);
+    } else {
+        asn_enc_rval_t rval = {0,0,0};
+        if(specs->ext_start == -1) ASN__ENCODE_FAILED;
+        if(uper_put_nsnnwn(po, present_enc - specs->ext_start))
+            ASN__ENCODE_FAILED;
+        if(uper_open_type_put(elm->type,
+                              elm->encoding_constraints.per_constraints,
+                              memb_ptr, po))
+            ASN__ENCODE_FAILED;
+        rval.encoded = 0;
+        ASN__ENCODED_OK(rval);
+    }
+}
+
+asn_dec_rval_t
+CHOICE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_dec_rval_t rv;
+	const asn_per_constraint_t *ct;
+	const asn_per_constraint_t *ext_ct = NULL;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	void *memb_ptr;
+	void **memb_ptr2;
+	void *st = *sptr;
+	int value;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) {
+		  ext_ct = ct;
+		  ct = 0;	/* Not restricted */
+		}
+	}
+
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		ASN_DEBUG("CHOICE %s got index %d in range %d",
+		          td->name, value, ct->range_bits);
+		if(value > ct->upper_bound)
+			ASN__DECODE_FAILED;
+	} else {
+		if(specs->ext_start == -1)
+			ASN__DECODE_FAILED;
+		value = aper_get_nsnnwn(pd, ext_ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->ext_start;
+		if((unsigned)value >= td->elements_count)
+			ASN__DECODE_FAILED;
+	}
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->from_canonical_order)
+		value = specs->from_canonical_order[value];
+
+	/* Set presence to be able to free it later */
+	_set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
+
+	elm = &td->elements[value];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+	ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
+
+	if(ct && ct->range_bits >= 0) {
+		rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+		                                 elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	} else {
+		rv = aper_open_type_get(opt_codec_ctx, elm->type,
+		                        elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	}
+
+	if(rv.code != RC_OK)
+		ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
+		          elm->name, td->name, rv.code);
+	return rv;
+}
+
+asn_enc_rval_t
+CHOICE_encode_aper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   const void *sptr, asn_per_outp_t *po) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm; /* CHOICE's element */
+	const asn_per_constraint_t *ct = NULL;
+	const asn_per_constraint_t *ext_ct = NULL;
+	const void *memb_ptr;
+	unsigned present;
+	int present_enc;
+	
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Encoding %s as CHOICE using ALIGNED PER", td->name);
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = NULL;
+
+	present = _fetch_present_idx(sptr,
+	                             specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized properly, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present <= 0 || (unsigned)present > td->elements_count)
+		ASN__ENCODE_FAILED;
+	else
+		present--;
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->to_canonical_order)
+		present_enc = specs->to_canonical_order[present];
+	else
+	        present_enc = present;
+	
+	ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
+
+	if(ct && (ct->range_bits >= 0)) {
+	  // Value is not within the range of the primary values ?
+	  if(present < ct->lower_bound || present > ct->upper_bound) {
+	    if(ct->flags & APC_EXTENSIBLE) {
+	      ASN_DEBUG("CHOICE member %d (enc %d) is an extension (%ld..%ld)",
+			present, present_enc, ct->lower_bound, ct->upper_bound);
+	      // X691/23.5 Extension marker = 1 
+	      if(per_put_few_bits(po, 1, 1)) {
+		ASN__ENCODE_FAILED;
+	      }
+	    } else {
+	      ASN__ENCODE_FAILED;
+	    }
+	    // no more need of constraint.
+	    ext_ct = ct;
+	    ct = NULL;
+	  }
+	}
+	
+	if(ct && (ct->flags & APC_EXTENSIBLE)) {
+	  ASN_DEBUG("CHOICE member %d (enc %d) is not an extension (%ld..%ld)",
+		    present, present, ct->lower_bound, ct->upper_bound);
+	  // X691.23.5 Extension marker = 0
+	  if(per_put_few_bits(po, 0, 1)) {
+	    ASN__ENCODE_FAILED;
+	  }
+	}
+
+	elm = &td->elements[present];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr = *(const void *const *)((const char *)sptr + elm->memb_offset);
+		if(!memb_ptr) ASN__ENCODE_FAILED;
+	} else {
+		memb_ptr = (const char *)sptr + elm->memb_offset;
+	}
+
+	if(ct && (ct->range_bits >= 0)) {
+	        // By construction (ct != 0), the alternative value is a non extended one.
+	        // X691/23.7 X691/23.6 alternative value encoded as a range_bits bits value.
+		if(per_put_few_bits(po, present_enc, ct->range_bits))
+			ASN__ENCODE_FAILED;
+
+		return elm->type->op->aper_encoder(elm->type, elm->encoding_constraints.per_constraints,
+		                                   memb_ptr, po);
+	} else {
+		asn_enc_rval_t rval = {0,0,0};
+		if(specs->ext_start == -1)
+			ASN__ENCODE_FAILED;
+		// X691/23.8 normally encoded as a small non negative whole number
+		
+		if(ext_ct && aper_put_nsnnwn(po, ext_ct->range_bits, present_enc - specs->ext_start))
+			ASN__ENCODE_FAILED;
+		if(aper_open_type_put(elm->type, elm->encoding_constraints.per_constraints,
+		                      memb_ptr, po))
+			ASN__ENCODE_FAILED;
+		rval.encoded = 0;
+		ASN__ENCODED_OK(rval);
+	}
+}
+
+int
+CHOICE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+             asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	unsigned present;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+
+	/*
+	 * Print that element.
+	 */
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		/* Print member's name and stuff */
+		if(0) {
+			if(cb(elm->name, strlen(elm->name), app_key) < 0
+			|| cb(": ", 2, app_key) < 0)
+				return -1;
+		}
+
+		return elm->type->op->print_struct(elm->type, memb_ptr, ilevel,
+			cb, app_key);
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr,
+            enum asn_struct_free_method method) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+	if(!td || !ptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as CHOICE", td->name);
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size);
+
+	/*
+	 * Free that element.
+	 */
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
+			if(memb_ptr)
+				ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		} else {
+			memb_ptr = (void *)((char *)ptr + elm->memb_offset);
+			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
+		}
+	}
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(ptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(ptr, 0, specs->struct_size);
+        break;
+    }
+}
+
+
+/*
+ * The following functions functions offer protection against -fshort-enums,
+ * compatible with little- and big-endian machines.
+ * If assertion is triggered, either disable -fshort-enums, or add an entry
+ * here with the ->pres_size of your target stracture.
+ * Unless the target structure is packed, the ".present" member
+ * is guaranteed to be aligned properly. ASN.1 compiler itself does not
+ * produce packed code.
+ */
+static unsigned
+_fetch_present_idx(const void *struct_ptr, unsigned pres_offset,
+                   unsigned pres_size) {
+    const void *present_ptr;
+	unsigned present;
+
+	present_ptr = ((const char *)struct_ptr) + pres_offset;
+
+	switch(pres_size) {
+	case sizeof(int):	present = *(const unsigned int *)present_ptr; break;
+	case sizeof(short):	present = *(const unsigned short *)present_ptr; break;
+	case sizeof(char):	present = *(const unsigned char *)present_ptr; break;
+	default:
+		/* ANSI C mandates enum to be equivalent to integer */
+		assert(pres_size != sizeof(int));
+		return 0;	/* If not aborted, pass back safe value */
+	}
+
+	return present;
+}
+
+static void
+_set_present_idx(void *struct_ptr, unsigned pres_offset, unsigned pres_size,
+                 unsigned present) {
+    void *present_ptr;
+	present_ptr = ((char *)struct_ptr) + pres_offset;
+
+	switch(pres_size) {
+	case sizeof(int):	*(unsigned int *)present_ptr   = present; break;
+	case sizeof(short):	*(unsigned short *)present_ptr = present; break;
+	case sizeof(char):	*(unsigned char *)present_ptr  = present; break;
+	default:
+		/* ANSI C mandates enum to be equivalent to integer */
+		assert(pres_size != sizeof(int));
+	}
+}
+
+static const void *
+_get_member_ptr(const asn_TYPE_descriptor_t *td, const void *sptr,
+                asn_TYPE_member_t **elm_ptr, unsigned *present_out) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+    if(!sptr) {
+        *elm_ptr = NULL;
+        *present_out = 0;
+        return NULL;
+    }
+
+    /*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+    *present_out = present;
+
+    /*
+     * The presence index is intentionally 1-based to avoid
+     * treating zeroed structure as a valid one.
+     */
+	if(present > 0 && present <= td->elements_count) {
+        asn_TYPE_member_t *const elm = &td->elements[present - 1];
+        const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+        *elm_ptr = elm;
+        return memb_ptr;
+    } else {
+        *elm_ptr = NULL;
+        return NULL;
+    }
+
+}
+
+int
+CHOICE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) {
+    asn_TYPE_member_t *aelm;
+    asn_TYPE_member_t *belm;
+    unsigned apresent = 0;
+    unsigned bpresent = 0;
+    const void *amember = _get_member_ptr(td, aptr, &aelm, &apresent);
+    const void *bmember = _get_member_ptr(td, bptr, &belm, &bpresent);
+
+    if(amember && bmember) {
+        if(apresent == bpresent) {
+            assert(aelm == belm);
+            return aelm->type->op->compare_struct(aelm->type, amember, bmember);
+        } else if(apresent < bpresent) {
+            return -1;
+        } else {
+            return 1;
+        }
+    } else if(!amember) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+/*
+ * Return the 1-based choice variant presence index.
+ * Returns 0 in case of error.
+ */
+unsigned
+CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    return _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+}
+
+/*
+ * Sets or resets the 1-based choice variant presence index.
+ * In case a previous index is not zero, the currently selected structure
+ * member is freed and zeroed-out first.
+ * Returns 0 on success and -1 on error.
+ */
+int
+CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *sptr,
+                            unsigned present) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned old_present;
+
+    if(!sptr) {
+        return -1;
+    }
+
+    if(present > td->elements_count)
+        return -1;
+
+    old_present =
+        _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+    if(present == old_present)
+        return 0;
+
+    if(old_present != 0) {
+        assert(old_present <= td->elements_count);
+        ASN_STRUCT_RESET(*td, sptr);
+    }
+
+    _set_present_idx(sptr, specs->pres_offset, specs->pres_size, present);
+
+    return 0;
+}
+
+
+asn_random_fill_result_t
+CHOICE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constr,
+                   size_t max_length) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_random_fill_result_t res;
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    const asn_TYPE_member_t *elm;
+    unsigned present;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *st = *sptr;
+
+    if(max_length == 0) return result_skipped;
+
+    (void)constr;
+
+    if(st == NULL) {
+        st = CALLOC(1, specs->struct_size);
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    present = asn_random_between(1, td->elements_count);
+    elm = &td->elements[present - 1];
+
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+
+    res = elm->type->op->random_fill(elm->type, memb_ptr2,
+                                    &elm->encoding_constraints, max_length);
+    _set_present_idx(st, specs->pres_offset, specs->pres_size, present);
+    if(res.code == ARFILL_OK) {
+        *sptr = st;
+    } else {
+        if(st == *sptr) {
+            ASN_STRUCT_RESET(*td, st);
+        } else {
+            ASN_STRUCT_FREE(*td, st);
+        }
+    }
+
+    return res;
+}
+
+
+asn_TYPE_operation_t asn_OP_CHOICE = {
+	CHOICE_free,
+	CHOICE_print,
+	CHOICE_compare,
+	CHOICE_decode_ber,
+	CHOICE_encode_der,
+	CHOICE_decode_xer,
+	CHOICE_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	CHOICE_decode_oer,
+	CHOICE_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	CHOICE_decode_uper,
+	CHOICE_encode_uper,
+	CHOICE_decode_aper,
+	CHOICE_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	CHOICE_random_fill,
+	CHOICE_outmost_tag
+};
diff --git a/e2sm/lib/constr_CHOICE_oer.c b/e2sm/lib/constr_CHOICE_oer.c
new file mode 100644
index 0000000..a4c591c
--- /dev/null
+++ b/e2sm/lib/constr_CHOICE_oer.c
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_CHOICE.h>
+#include <errno.h>
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)                    \
+    do {                                 \
+        asn_dec_rval_t rval;             \
+        rval.code = _code;               \
+        rval.consumed = consumed_myself; \
+        return rval;                     \
+    } while(0)
+
+#undef  ADVANCE
+#define ADVANCE(num_bytes)               \
+    do {                                 \
+        size_t num = num_bytes;          \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+#undef  SET_PHASE
+#define SET_PHASE(ctx, value) \
+    do {                      \
+        ctx->phase = value;   \
+        ctx->step = 0;        \
+    } while(0)
+
+/*
+ * Tags are canonically sorted in the tag to member table.
+ */
+static int
+_search4tag(const void *ap, const void *bp) {
+    const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+    const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+    int a_class = BER_TAG_CLASS(a->el_tag);
+    int b_class = BER_TAG_CLASS(b->el_tag);
+
+    if(a_class == b_class) {
+        ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+        ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+        if(a_value == b_value)
+            return 0;
+        else if(a_value < b_value)
+            return -1;
+        else
+            return 1;
+    } else if(a_class < b_class) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+/*
+ * X.696 (08/2015) #8.7 Encoding of tags
+ */
+static ssize_t
+oer_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
+    ber_tlv_tag_t val;
+    ber_tlv_tag_t tclass;
+    size_t skipped;
+
+    if(size == 0)
+        return 0;
+
+    val = *(const uint8_t *)ptr;
+    tclass = (val >> 6);
+    if((val & 0x3F) != 0x3F) {
+        /* #8.7.1 */
+        *tag_r = ((val & 0x3F) << 2) | tclass;
+        return 1;
+    }
+
+    /*
+     * Each octet contains 7 bits of useful information.
+     * The MSB is 0 if it is the last octet of the tag.
+     */
+    for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; skipped <= size;
+        ptr = ((const char *)ptr) + 1, skipped++) {
+        unsigned int oct = *(const uint8_t *)ptr;
+        if(oct & 0x80) {
+            val = (val << 7) | (oct & 0x7F);
+            /*
+             * Make sure there are at least 9 bits spare
+             * at the MS side of a value.
+             */
+            if(val >> ((8 * sizeof(val)) - 9)) {
+                /*
+                 * We would not be able to accomodate
+                 * any more tag bits.
+                 */
+                return -1;
+            }
+        } else {
+            val = (val << 7) | oct;
+            *tag_r = (val << 2) | tclass;
+            return skipped;
+        }
+    }
+
+    return 0; /* Want more */
+}
+
+asn_dec_rval_t
+CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *ptr, size_t size) {
+    /*
+     * Bring closer parts of structure description.
+     */
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_TYPE_member_t *elements = td->elements;
+
+    /*
+     * Parts of the structure being constructed.
+     */
+    void *st = *struct_ptr; /* Target structure. */
+    asn_struct_ctx_t *ctx;  /* Decoder context */
+
+    ssize_t consumed_myself = 0; /* Consumed bytes from ptr */
+
+    (void)constraints;
+
+    ASN_DEBUG("Decoding %s as CHOICE", td->name);
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Discover the tag.
+         */
+        ber_tlv_tag_t tlv_tag; /* T from TLV */
+        ssize_t tag_len;       /* Length of TLV's T */
+
+        tag_len = oer_fetch_tag(ptr, size, &tlv_tag);
+        switch(tag_len) {
+        case 0:
+            ASN__DECODE_STARVED;
+        case -1:
+            ASN__DECODE_FAILED;
+        }
+
+        do {
+            const asn_TYPE_tag2member_t *t2m;
+            asn_TYPE_tag2member_t key = {0, 0, 0, 0};
+            key.el_tag = tlv_tag;
+
+            t2m = (const asn_TYPE_tag2member_t *)bsearch(
+                &key, specs->tag2el, specs->tag2el_count,
+                sizeof(specs->tag2el[0]), _search4tag);
+            if(t2m) {
+                /*
+                 * Found the element corresponding to the tag.
+                 */
+                NEXT_PHASE(ctx);
+                ctx->step = t2m->el_no;
+                break;
+            } else if(specs->ext_start == -1) {
+                ASN_DEBUG(
+                    "Unexpected tag %s "
+                    "in non-extensible CHOICE %s",
+                    ber_tlv_tag_string(tlv_tag), td->name);
+                RETURN(RC_FAIL);
+            } else {
+                /* Skip open type extension */
+                ASN_DEBUG(
+                    "Not implemented skipping open type extension for tag %s",
+                    ber_tlv_tag_string(tlv_tag));
+                RETURN(RC_FAIL);
+            }
+        } while(0);
+
+
+        ADVANCE(tag_len);
+    }
+        /* Fall through */
+    case 1: {
+        asn_TYPE_member_t *elm = &elements[ctx->step]; /* CHOICE's element */
+        void *memb_ptr;         /* Pointer to the member */
+        void **memb_ptr2;       /* Pointer to that pointer */
+        asn_dec_rval_t rval = {0,0};
+
+        /*
+         * Compute the position of the member inside a structure,
+         * and also a type of containment (it may be contained
+         * as pointer or using inline inclusion).
+         */
+        if(elm->flags & ATF_POINTER) {
+            /* Member is a pointer to another structure */
+            memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+        } else {
+            /*
+             * A pointer to a pointer
+             * holding the start of the structure
+             */
+            memb_ptr = (char *)st + elm->memb_offset;
+            memb_ptr2 = &memb_ptr;
+        }
+
+        /* Set presence to be able to free it properly at any time */
+        (void)CHOICE_variant_set_presence(td, st, ctx->step + 1);
+
+        if(specs->ext_start >= 0 && specs->ext_start <= ctx->step) {
+            ssize_t got =
+                oer_open_type_get(opt_codec_ctx, elm->type,
+                                  elm->encoding_constraints.oer_constraints,
+                                  memb_ptr2, ptr, size);
+            if(got < 0) ASN__DECODE_FAILED;
+            if(got == 0) ASN__DECODE_STARVED;
+            rval.code = RC_OK;
+            rval.consumed = got;
+        } else {
+            rval = elm->type->op->oer_decoder(
+                opt_codec_ctx, elm->type,
+                elm->encoding_constraints.oer_constraints, memb_ptr2, ptr,
+                size);
+        }
+        rval.consumed += consumed_myself;
+        switch(rval.code) {
+        case RC_OK:
+            NEXT_PHASE(ctx);
+        case RC_WMORE:
+            break;
+        case RC_FAIL:
+            SET_PHASE(ctx, 3);  /* => 3 */
+        }
+        return rval;
+    }
+    case 2:
+        /* Already decoded everything */
+        RETURN(RC_OK);
+    case 3:
+        /* Failed to decode, after all */
+        RETURN(RC_FAIL);
+    }
+
+    RETURN(RC_FAIL);
+}
+
+/*
+ * X.696 (08/2015) #8.7 Encoding of tags
+ */
+static ssize_t
+oer_put_tag(ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
+    uint8_t tclass = BER_TAG_CLASS(tag);
+    ber_tlv_tag_t tval = BER_TAG_VALUE(tag);
+
+    if(tval < 0x3F) {
+        uint8_t b = (uint8_t)((tclass << 6) | tval);
+        if(cb(&b, 1, app_key) < 0) {
+            return -1;
+        }
+        return 1;
+    } else {
+        uint8_t buf[1 + 2 * sizeof(tval)];
+        uint8_t *b = &buf[sizeof(buf)-1]; /* Last addressable */
+        size_t encoded;
+        for(; ; tval >>= 7) {
+            if(tval >> 7) {
+                *b-- = 0x80 | (tval & 0x7f);
+            } else {
+                *b-- = tval & 0x7f;
+                break;
+            }
+        }
+        *b = (uint8_t)((tclass << 6) | 0x3F);
+        encoded = sizeof(buf) - (b - buf);
+        if(cb(b, encoded, app_key) < 0) {
+            return -1;
+        }
+        return encoded;
+    }
+
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+CHOICE_encode_oer(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_TYPE_member_t *elm; /* CHOICE element */
+    unsigned present;
+    const void *memb_ptr;
+    ber_tlv_tag_t tag;
+    ssize_t tag_len;
+    asn_enc_rval_t er = {0, 0, 0};
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("OER %s encoding as CHOICE", td->name);
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN_DEBUG("CHOICE %s member is not selected", td->name);
+        ASN__ENCODE_FAILED;
+    }
+
+    elm = &td->elements[present-1];
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(memb_ptr == 0) {
+            /* Mandatory element absent */
+            ASN__ENCODE_FAILED;
+        }
+    } else {
+        memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+    }
+
+    tag = asn_TYPE_outmost_tag(elm->type, memb_ptr, elm->tag_mode, elm->tag);
+    if(tag == 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    tag_len = oer_put_tag(tag, cb, app_key);
+    if(tag_len < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    if(specs->ext_start >= 0 && (unsigned)specs->ext_start <= (present-1)) {
+        ssize_t encoded = oer_open_type_put(elm->type,
+                               elm->encoding_constraints.oer_constraints,
+                               memb_ptr, cb, app_key);
+        if(encoded < 0) ASN__ENCODE_FAILED;
+        er.encoded = tag_len + encoded;
+    } else {
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded >= 0) er.encoded += tag_len;
+    }
+
+    return er;
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/constr_SEQUENCE.c b/e2sm/lib/constr_SEQUENCE.c
new file mode 100644
index 0000000..43dcac7
--- /dev/null
+++ b/e2sm/lib/constr_SEQUENCE.c
@@ -0,0 +1,2059 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SEQUENCE.h>
+#include <OPEN_TYPE.h>
+#include <per_opentype.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num; \
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#undef	PHASE_OUT
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+#define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * Check whether we are inside the extensions group.
+ */
+#define IN_EXTENSION_GROUP(specs, memb_idx) \
+    ((specs)->first_extension >= 0          \
+     && (unsigned)(specs)->first_extension <= (memb_idx))
+
+/*
+ * Tags are canonically sorted in the tag2element map.
+ */
+static int
+_t2e_cmp(const void *ap, const void *bp) {
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+	int a_class = BER_TAG_CLASS(a->el_tag);
+	int b_class = BER_TAG_CLASS(b->el_tag);
+
+	if(a_class == b_class) {
+		ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+		ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+		if(a_value == b_value) {
+			if(a->el_no > b->el_no)
+				return 1;
+			/*
+			 * Important: we do not check
+			 * for a->el_no <= b->el_no!
+			 */
+			return 0;
+		} else if(a_value < b_value)
+			return -1;
+		else
+			return 1;
+	} else if(a_class < b_class) {
+		return -1;
+	} else {
+		return 1;
+	}
+}
+
+
+/*
+ * The decoder of the SEQUENCE type.
+ */
+asn_dec_rval_t
+SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                    const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elements = td->elements;
+
+    /*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* SEQUENCE element's index */
+
+	ASN_DEBUG("Decoding %s as SEQUENCE", td->name);
+	
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+			tag_mode, 1, &ctx->left, 0);
+		if(rval.code != RC_OK) {
+			ASN_DEBUG("%s tagging check failed: %d",
+				td->name, rval.code);
+			return rval;
+		}
+
+		if(ctx->left >= 0)
+			ctx->left += rval.consumed; /* ?Substracted below! */
+		ADVANCE(rval.consumed);
+
+		NEXT_PHASE(ctx);
+
+		ASN_DEBUG("Structure consumes %ld bytes, buffer %ld",
+			(long)ctx->left, (long)size);
+
+		/* Fall through */
+	case 1:
+		/*
+		 * PHASE 1.
+		 * From the place where we've left it previously,
+		 * try to decode the next member from the list of
+		 * this structure's elements.
+		 * (ctx->step) stores the member being processed
+		 * between invocations and the microphase {0,1} of parsing
+		 * that member:
+		 * 	step = (<member_number> * 2 + <microphase>).
+		 */
+	  for(edx = ((size_t)ctx->step >> 1); edx < td->elements_count;
+			edx++, ctx->step = (ctx->step & ~1) + 2) {
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+		ssize_t tag_len;	/* Length of TLV's T */
+		size_t opt_edx_end;	/* Next non-optional element */
+		size_t n;
+		int use_bsearch;
+
+		if(ctx->step & 1)
+			goto microphase2;
+
+		/*
+		 * MICROPHASE 1: Synchronize decoding.
+		 */
+		ASN_DEBUG("In %s SEQUENCE left %d, edx=%" ASN_PRI_SIZE " flags=%d"
+				" opt=%d ec=%d",
+			td->name, (int)ctx->left, edx,
+			elements[edx].flags, elements[edx].optional,
+			td->elements_count);
+
+        if(ctx->left == 0 /* No more stuff is expected */
+           && (
+                  /* Explicit OPTIONAL specification reaches the end */
+                  (edx + elements[edx].optional == td->elements_count) ||
+                  /* All extensions are optional */
+                  IN_EXTENSION_GROUP(specs, edx))) {
+            ASN_DEBUG("End of SEQUENCE %s", td->name);
+            /*
+             * Found the legitimate end of the structure.
+             */
+            PHASE_OUT(ctx);
+            RETURN(RC_OK);
+        }
+
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		ASN_DEBUG("Current tag in %s SEQUENCE for element %" ASN_PRI_SIZE " "
+			"(%s) is %s encoded in %d bytes, of frame %ld",
+			td->name, edx, elements[edx].name,
+			ber_tlv_tag_string(tlv_tag), (int)tag_len, (long)LEFT);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+        if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) {
+            if(LEFT < 2) {
+                if(SIZE_VIOLATION) {
+                    RETURN(RC_FAIL);
+                } else {
+                    RETURN(RC_WMORE);
+                }
+            } else if(((const uint8_t *)ptr)[1] == 0) {
+                ASN_DEBUG("edx = %" ASN_PRI_SIZE ", opt = %d, ec=%d", edx,
+                          elements[edx].optional, td->elements_count);
+                if((edx + elements[edx].optional == td->elements_count)
+                   || IN_EXTENSION_GROUP(specs, edx)) {
+                    /*
+                     * Yeah, baby! Found the terminator
+                     * of the indefinite length structure.
+                     */
+                    /*
+                     * Proceed to the canonical
+                     * finalization function.
+                     * No advancing is necessary.
+                     */
+                    goto phase3;
+                }
+            }
+        }
+
+		/*
+		 * Find the next available type with this tag.
+		 */
+		use_bsearch = 0;
+		opt_edx_end = edx + elements[edx].optional + 1;
+		if(opt_edx_end > td->elements_count)
+			opt_edx_end = td->elements_count;	/* Cap */
+		else if(opt_edx_end - edx > 8) {
+			/* Limit the scope of linear search... */
+			opt_edx_end = edx + 8;
+			use_bsearch = 1;
+			/* ... and resort to bsearch() */
+		}
+		for(n = edx; n < opt_edx_end; n++) {
+			if(BER_TAGS_EQUAL(tlv_tag, elements[n].tag)) {
+				/*
+				 * Found element corresponding to the tag
+				 * being looked at.
+				 * Reposition over the right element.
+				 */
+				edx = n;
+				ctx->step = 1 + 2 * edx;	/* Remember! */
+				goto microphase2;
+			} else if(elements[n].flags & ATF_ANY_TYPE) {
+				/*
+				 * This is the ANY type, which may bear
+				 * any flag whatsoever.
+				 */
+				edx = n;
+				ctx->step = 1 + 2 * edx;	/* Remember! */
+				goto microphase2;
+			} else if(elements[n].tag == (ber_tlv_tag_t)-1) {
+				use_bsearch = 1;
+				break;
+			}
+		}
+		if(use_bsearch) {
+			/*
+			 * Resort to a binary search over
+			 * sorted array of tags.
+			 */
+			const asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key = {0, 0, 0, 0};
+			key.el_tag = tlv_tag;
+			key.el_no = edx;
+			t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+				specs->tag2el, specs->tag2el_count,
+				sizeof(specs->tag2el[0]), _t2e_cmp);
+			if(t2m) {
+				const asn_TYPE_tag2member_t *best = 0;
+				const asn_TYPE_tag2member_t *t2m_f, *t2m_l;
+				size_t edx_max = edx + elements[edx].optional;
+				/*
+				 * Rewind to the first element with that tag,
+				 * `cause bsearch() does not guarantee order.
+				 */
+				t2m_f = t2m + t2m->toff_first;
+				t2m_l = t2m + t2m->toff_last;
+				for(t2m = t2m_f; t2m <= t2m_l; t2m++) {
+					if(t2m->el_no > edx_max) break;
+					if(t2m->el_no < edx) continue;
+					best = t2m;
+				}
+				if(best) {
+					edx = best->el_no;
+					ctx->step = 1 + 2 * edx;
+					goto microphase2;
+				}
+			}
+			n = opt_edx_end;
+		}
+		if(n == opt_edx_end) {
+			/*
+			 * If tag is unknown, it may be either
+			 * an unknown (thus, incorrect) tag,
+			 * or an extension (...),
+			 * or an end of the indefinite-length structure.
+			 */
+			if(!IN_EXTENSION_GROUP(specs,
+				edx + elements[edx].optional)) {
+				ASN_DEBUG("Unexpected tag %s (at %" ASN_PRI_SIZE ")",
+					ber_tlv_tag_string(tlv_tag), edx);
+				ASN_DEBUG("Expected tag %s (%s)%s",
+					ber_tlv_tag_string(elements[edx].tag),
+					elements[edx].name,
+					elements[edx].optional
+						?" or alternatives":"");
+				RETURN(RC_FAIL);
+			} else {
+				/* Skip this tag */
+				ssize_t skip;
+				edx += elements[edx].optional;
+
+				ASN_DEBUG("Skipping unexpected %s (at %" ASN_PRI_SIZE ")",
+					ber_tlv_tag_string(tlv_tag), edx);
+				skip = ber_skip_length(opt_codec_ctx,
+					BER_TLV_CONSTRUCTED(ptr),
+					(const char *)ptr + tag_len,
+					LEFT - tag_len);
+				ASN_DEBUG("Skip length %d in %s",
+					(int)skip, td->name);
+				switch(skip) {
+				case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+					/* Fall through */
+				case -1: RETURN(RC_FAIL);
+				}
+
+				ADVANCE(skip + tag_len);
+				ctx->step -= 2;
+				edx--;
+				continue;  /* Try again with the next tag */
+			}
+		}
+
+		/*
+		 * MICROPHASE 2: Invoke the member-specific decoder.
+		 */
+		ctx->step |= 1;		/* Confirm entering next microphase */
+	microphase2:
+		ASN_DEBUG("Inside SEQUENCE %s MF2", td->name);
+		
+		/*
+		 * Compute the position of the member inside a structure,
+		 * and also a type of containment (it may be contained
+		 * as pointer or using inline inclusion).
+		 */
+		if(elements[edx].flags & ATF_POINTER) {
+			/* Member is a pointer to another structure */
+			memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset);
+		} else {
+			/*
+			 * A pointer to a pointer
+			 * holding the start of the structure
+			 */
+			memb_ptr = (char *)st + elements[edx].memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		if(elements[edx].flags & ATF_OPEN_TYPE) {
+			rval = OPEN_TYPE_ber_get(opt_codec_ctx, td, st, &elements[edx], ptr, LEFT);
+        } else {
+			rval = elements[edx].type->op->ber_decoder(opt_codec_ctx,
+					elements[edx].type,
+					memb_ptr2, ptr, LEFT,
+					elements[edx].tag_mode);
+		}
+		ASN_DEBUG("In %s SEQUENCE decoded %" ASN_PRI_SIZE " %s of %d "
+			"in %d bytes rval.code %d, size=%d",
+			td->name, edx, elements[edx].type->name,
+			(int)LEFT, (int)rval.consumed, rval.code, (int)size);
+		switch(rval.code) {
+		case RC_OK:
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			ASN_DEBUG("Size violation (c->l=%ld <= s=%ld)",
+				(long)ctx->left, (long)size);
+			/* Fall through */
+		case RC_FAIL: /* Fatal error */
+			RETURN(RC_FAIL);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  }	/* for(all structure members) */
+
+	phase3:
+		ctx->phase = 3;
+        /* Fall through */
+	case 3:	/* 00 and other tags expected */
+	case 4:	/* only 00's expected */
+
+		ASN_DEBUG("SEQUENCE %s Leftover: %ld, size = %ld",
+			td->name, (long)ctx->left, (long)size);
+
+		/*
+		 * Skip everything until the end of the SEQUENCE.
+		 */
+		while(ctx->left) {
+			ssize_t tl, ll;
+
+			tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+			switch(tl) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			/*
+			 * If expected <0><0>...
+			 */
+			if(ctx->left < 0
+				&& ((const uint8_t *)ptr)[0] == 0) {
+				if(LEFT < 2) {
+					if(SIZE_VIOLATION)
+						RETURN(RC_FAIL);
+					else
+						RETURN(RC_WMORE);
+				} else if(((const uint8_t *)ptr)[1] == 0) {
+					/*
+					 * Correctly finished with <0><0>.
+					 */
+					ADVANCE(2);
+					ctx->left++;
+					ctx->phase = 4;
+					continue;
+				}
+			}
+
+			if(!IN_EXTENSION_GROUP(specs, td->elements_count)
+			|| ctx->phase == 4) {
+				ASN_DEBUG("Unexpected continuation "
+					"of a non-extensible type "
+					"%s (SEQUENCE): %s",
+					td->name,
+					ber_tlv_tag_string(tlv_tag));
+				RETURN(RC_FAIL);
+			}
+
+			ll = ber_skip_length(opt_codec_ctx,
+				BER_TLV_CONSTRUCTED(ptr),
+				(const char *)ptr + tl, LEFT - tl);
+			switch(ll) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			ADVANCE(tl + ll);
+		}
+
+		PHASE_OUT(ctx);
+	}
+	
+	RETURN(RC_OK);
+}
+
+
+/*
+ * The DER encoder of the SEQUENCE type.
+ */
+asn_enc_rval_t
+SEQUENCE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int tag_mode, ber_tlv_tag_t tag,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t computed_size = 0;
+	asn_enc_rval_t erval = {0,0,0};
+	ssize_t ret;
+	size_t edx;
+
+	ASN_DEBUG("%s %s as SEQUENCE",
+		cb?"Encoding":"Estimating", td->name);
+
+	/*
+	 * Gather the length of the underlying members sequence.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+
+		const void *memb_ptr;		/* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present",
+					elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+			continue;
+
+		erval = elm->type->op->der_encoder(elm->type, *memb_ptr2,
+			elm->tag_mode, elm->tag,
+			0, 0);
+		if(erval.encoded == -1)
+			return erval;
+		computed_size += erval.encoded;
+		ASN_DEBUG("Member %" ASN_PRI_SIZE " %s estimated %ld bytes",
+			edx, elm->name, (long)erval.encoded);
+	}
+
+	/*
+	 * Encode the TLV for the sequence itself.
+	 */
+	ret = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key);
+	ASN_DEBUG("Wrote tags: %ld (+%ld)", (long)ret, (long)computed_size);
+	if(ret == -1)
+		ASN__ENCODE_FAILED;
+	erval.encoded = computed_size + ret;
+
+	if(!cb) ASN__ENCODED_OK(erval);
+
+	/*
+	 * Encode all members.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		asn_enc_rval_t tmperval = {0,0,0};
+        const void *memb_ptr;           /* Pointer to the member */
+        const void *const *memb_ptr2;   /* Pointer to that pointer */
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) continue;
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+        if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+            continue;
+
+		tmperval = elm->type->op->der_encoder(elm->type, *memb_ptr2,
+			elm->tag_mode, elm->tag, cb, app_key);
+		if(tmperval.encoded == -1)
+			return tmperval;
+		computed_size -= tmperval.encoded;
+		ASN_DEBUG("Member %" ASN_PRI_SIZE " %s of SEQUENCE %s encoded in %ld bytes",
+			edx, elm->name, td->name, (long)tmperval.encoded);
+	}
+
+	if(computed_size != 0)
+		/*
+		 * Encoded size is not equal to the computed size.
+		 */
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(erval);
+}
+
+
+#undef	XER_ADVANCE
+#define XER_ADVANCE(num_bytes)           \
+    do {                                 \
+        size_t num = (num_bytes);        \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                    const char *opt_mname, const void *ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SEQUENCE_specifics_t *specs
+		= (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * ... and parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval;		/* Return value from a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* Element index */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 * Phase 3: Skipping unknown extensions.
+	 * Phase 4: PHASED OUT
+	 */
+	for(edx = ctx->step; ctx->phase <= 3;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+		asn_TYPE_member_t *elm;
+
+		/*
+		 * Go inside the inner member of a sequence.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval;
+			void *memb_ptr_dontuse;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+
+			elm = &td->elements[edx];
+
+			if(elm->flags & ATF_POINTER) {
+				/* Member is a pointer to another structure */
+				memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+			} else {
+				memb_ptr_dontuse = (char *)st + elm->memb_offset;
+				memb_ptr2 = &memb_ptr_dontuse;  /* Only use of memb_ptr_dontuse */
+			}
+
+			if(elm->flags & ATF_OPEN_TYPE) {
+				tmprval = OPEN_TYPE_xer_get(opt_codec_ctx, td, st, elm, ptr, size);
+			} else {
+				/* Invoke the inner type decoder, m.b. multiple times */
+				tmprval = elm->type->op->xer_decoder(opt_codec_ctx,
+						elm->type, memb_ptr2, elm->name,
+						ptr, size);
+			}
+			XER_ADVANCE(tmprval.consumed);
+			if(tmprval.code != RC_OK)
+				RETURN(tmprval.code);
+			ctx->phase = 1;	/* Back to body processing */
+			ctx->step = ++edx;
+			ASN_DEBUG("XER/SEQUENCE phase => %d, step => %d",
+				ctx->phase, ctx->step);
+			/* Fall through */
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, ptr, size,
+			&ch_type);
+		if(ch_size == -1) {
+		    RETURN(RC_FAIL);
+		} else {
+			switch(ch_type) {
+			case PXER_WMORE:
+				RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/SEQUENCE: tcv = %d, ph=%d [%s]",
+			tcv, ctx->phase, xml_tag);
+
+		/* Skip the extensions section */
+		if(ctx->phase == 3) {
+			switch(xer_skip_unknown(tcv, &ctx->left)) {
+			case -1:
+				ctx->phase = 4;
+				RETURN(RC_FAIL);
+			case 0:
+				XER_ADVANCE(ch_size);
+				continue;
+			case 1:
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;
+				continue;
+			case 2:
+				ctx->phase = 1;
+				break;
+			}
+		}
+
+		switch(tcv) {
+		case XCT_CLOSING:
+			if(ctx->phase == 0) break;
+			ctx->phase = 0;
+			/* Fall through */
+		case XCT_BOTH:
+            if(ctx->phase == 0) {
+                if(edx >= td->elements_count ||
+                   /* Explicit OPTIONAL specs reaches the end */
+                   (edx + elements[edx].optional == td->elements_count) ||
+                   /* All extensions are optional */
+                   IN_EXTENSION_GROUP(specs, edx)) {
+                    XER_ADVANCE(ch_size);
+					ctx->phase = 4;	/* Phase out */
+					RETURN(RC_OK);
+				} else {
+					ASN_DEBUG("Premature end of XER SEQUENCE");
+					RETURN(RC_FAIL);
+				}
+			}
+			/* Fall through */
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%" ASN_PRI_SIZE "",
+				tcv, ctx->phase, edx);
+			if(ctx->phase != 1) {
+				break;	/* Really unexpected */
+			}
+
+			if(edx < td->elements_count) {
+				/*
+				 * Search which member corresponds to this tag.
+				 */
+				size_t n;
+				size_t edx_end = edx + elements[edx].optional + 1;
+				if(edx_end > td->elements_count)
+					edx_end = td->elements_count;
+				for(n = edx; n < edx_end; n++) {
+					elm = &td->elements[n];
+					tcv = xer_check_tag(ptr, ch_size, elm->name);
+					switch(tcv) {
+					case XCT_BOTH:
+					case XCT_OPENING:
+						/*
+						 * Process this member.
+						 */
+						ctx->step = edx = n;
+						ctx->phase = 2;
+						break;
+					case XCT_UNKNOWN_OP:
+					case XCT_UNKNOWN_BO:
+						continue;
+					default:
+						n = edx_end;
+						break;	/* Phase out */
+					}
+					break;
+				}
+				if(n != edx_end)
+					continue;
+			} else {
+				ASN_DEBUG("Out of defined members: %" ASN_PRI_SIZE "/%u",
+					edx, td->elements_count);
+			}
+
+			/* It is expected extension */
+			if(IN_EXTENSION_GROUP(specs,
+				edx + (edx < td->elements_count
+					? elements[edx].optional : 0))) {
+				ASN_DEBUG("Got anticipated extension at %" ASN_PRI_SIZE "",
+					edx);
+				/*
+				 * Check for (XCT_BOTH or XCT_UNKNOWN_BO)
+				 * By using a mask. Only record a pure
+				 * <opening> tags.
+				 */
+				if(tcv & XCT_CLOSING) {
+					/* Found </extension> without body */
+				} else {
+					ctx->left = 1;
+					ctx->phase = 3;	/* Skip ...'s */
+				}
+				XER_ADVANCE(ch_size);
+				continue;
+			}
+
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag in SEQUENCE [%c%c%c%c%c%c]",
+			size>0?((const char *)ptr)[0]:'.',
+			size>1?((const char *)ptr)[1]:'.',
+			size>2?((const char *)ptr)[2]:'.',
+			size>3?((const char *)ptr)[3]:'.',
+			size>4?((const char *)ptr)[4]:'.',
+			size>5?((const char *)ptr)[5]:'.');
+		break;
+	}
+
+	ctx->phase = 4;	/* "Phase out" on hard failure */
+	RETURN(RC_FAIL);
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int ilevel, enum xer_encoder_flags_e flags,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    int xcan = (flags & XER_F_CANONICAL);
+    asn_TYPE_descriptor_t *tmp_def_val_td = 0;
+    void *tmp_def_val = 0;
+    size_t edx;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    er.encoded = 0;
+
+    for(edx = 0; edx < td->elements_count; edx++) {
+        asn_enc_rval_t tmper = {0,0,0};
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        const void *memb_ptr;
+        const char *mname = elm->name;
+        unsigned int mlen = strlen(mname);
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!memb_ptr) {
+                assert(tmp_def_val == 0);
+                if(elm->default_value_set) {
+                    if(elm->default_value_set(&tmp_def_val)) {
+                        ASN__ENCODE_FAILED;
+                    } else {
+                        memb_ptr = tmp_def_val;
+                        tmp_def_val_td = elm->type;
+                    }
+                } else if(elm->optional) {
+                    continue;
+                } else {
+                    /* Mandatory element is missing */
+                    ASN__ENCODE_FAILED;
+                }
+            }
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+
+        if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+        ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+        /* Print the member itself */
+        tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1,
+                                           flags, cb, app_key);
+        if(tmp_def_val) {
+            ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val);
+            tmp_def_val = 0;
+        }
+        if(tmper.encoded == -1) return tmper;
+        er.encoded += tmper.encoded;
+
+        ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+    }
+
+    if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+    ASN__ENCODED_OK(er);
+cb_failed:
+    if(tmp_def_val) ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val);
+    ASN__ENCODE_FAILED;
+}
+
+int
+SEQUENCE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+               asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t edx;
+	int ret;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/* Dump preamble */
+	if(cb(td->name, strlen(td->name), app_key) < 0
+	|| cb(" ::= {", 6, app_key) < 0)
+		return -1;
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional) continue;
+				/* Print <absent> line */
+				/* Fall through */
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		/* Indentation */
+		_i_INDENT(1);
+
+		/* Print the member's name and stuff */
+		if(cb(elm->name, strlen(elm->name), app_key) < 0
+		|| cb(": ", 2, app_key) < 0)
+			return -1;
+
+		/* Print the member itself */
+		ret = elm->type->op->print_struct(elm->type, memb_ptr, ilevel + 1,
+			cb, app_key);
+		if(ret) return ret;
+	}
+
+	ilevel--;
+	_i_INDENT(1);
+
+	return (cb("}", 1, app_key) < 0) ? -1 : 0;
+}
+
+void
+SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
+              enum asn_struct_free_method method) {
+    size_t edx;
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_struct_ctx_t *ctx; /* Decoder context */
+
+	if(!td || !sptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as SEQUENCE", td->name);
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
+			if(memb_ptr)
+				ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		} else {
+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
+			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
+		}
+	}
+
+	/* Clean parsing context */
+	ctx = (asn_struct_ctx_t *)((char *)sptr + specs->ctx_offset);
+	FREEMEM(ctx->ptr);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(
+            sptr, 0,
+            ((const asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size);
+        break;
+    }
+}
+
+int
+SEQUENCE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    size_t edx;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	/*
+	 * Iterate over structure members and check their validity.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional)
+					continue;
+				ASN__CTFAIL(app_key, td, sptr,
+				"%s: mandatory element %s absent (%s:%d)",
+				td->name, elm->name, __FILE__, __LINE__);
+				return -1;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		if(elm->encoding_constraints.general_constraints) {
+			int ret = elm->encoding_constraints.general_constraints(elm->type, memb_ptr,
+				ctfailcb, app_key);
+			if(ret) return ret;
+		} else {
+			return elm->type->encoding_constraints.general_constraints(elm->type,
+				memb_ptr, ctfailcb, app_key);
+		}
+	}
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, void **sptr,
+                     asn_per_data_t *pd) {
+    const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	void *st = *sptr;	/* Target structure. */
+	int extpresent;		/* Extension additions are present */
+	uint8_t *opres;		/* Presence of optional root members */
+	asn_per_data_t opmd;
+	asn_dec_rval_t rv;
+	size_t edx;
+
+	(void)constraints;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as SEQUENCE (UPER)", td->name);
+
+	/* Handle extensions */
+	if(specs->first_extension < 0) {
+		extpresent = 0;
+	} else {
+		extpresent = per_get_few_bits(pd, 1);
+		if(extpresent < 0) ASN__DECODE_STARVED;
+	}
+
+	/* Prepare a place and read-in the presence bitmap */
+	memset(&opmd, 0, sizeof(opmd));
+	if(specs->roms_count) {
+		opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
+		if(!opres) ASN__DECODE_FAILED;
+		/* Get the presence map */
+		if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
+			FREEMEM(opres);
+			ASN__DECODE_STARVED;
+		}
+		opmd.buffer = opres;
+		opmd.nbits = specs->roms_count;
+		ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
+			td->name, specs->roms_count, *opres);
+	} else {
+		opres = 0;
+	}
+
+	/*
+	 * Get the sequence ROOT elements.
+	 */
+    for(edx = 0;
+        edx < (specs->first_extension < 0 ? td->elements_count
+                                          : (size_t)specs->first_extension);
+        edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+
+		assert(!IN_EXTENSION_GROUP(specs, edx));
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+
+		/* Deal with optionality */
+		if(elm->optional) {
+			int present = per_get_few_bits(&opmd, 1);
+			ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
+				td->name, elm->name, present,
+				(int)opmd.nboff, (int)opmd.nbits);
+			if(present == 0) {
+				/* This element is not present */
+				if(elm->default_value_set) {
+					/* Fill-in DEFAULT */
+					if(elm->default_value_set(memb_ptr2)) {
+						FREEMEM(opres);
+						ASN__DECODE_FAILED;
+					}
+					ASN_DEBUG("Filled-in default");
+				}
+				/* The member is just not present */
+				continue;
+			}
+			/* Fall through */
+		}
+
+		/* Fetch the member from the stream */
+		ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
+
+		if(elm->flags & ATF_OPEN_TYPE) {
+			rv = OPEN_TYPE_uper_get(opt_codec_ctx, td, st, elm, pd);
+		} else {
+			rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+					elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+		}
+		if(rv.code != RC_OK) {
+			ASN_DEBUG("Failed decode %s in %s",
+				elm->name, td->name);
+			FREEMEM(opres);
+			return rv;
+		}
+	}
+
+	/* Optionality map is not needed anymore */
+	FREEMEM(opres);
+
+	/*
+	 * Deal with extensions.
+	 */
+	if(extpresent) {
+		ssize_t bmlength;
+		uint8_t *epres;		/* Presence of extension members */
+		asn_per_data_t epmd;
+
+		bmlength = uper_get_nslength(pd);
+		if(bmlength < 0) ASN__DECODE_STARVED;
+
+		ASN_DEBUG("Extensions %" ASN_PRI_SSIZE " present in %s", bmlength, td->name);
+
+		epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
+		if(!epres) ASN__DECODE_STARVED;
+
+		/* Get the extensions map */
+		if(per_get_many_bits(pd, epres, 0, bmlength)) {
+			FREEMEM(epres);
+			ASN__DECODE_STARVED;
+		}
+
+		memset(&epmd, 0, sizeof(epmd));
+		epmd.buffer = epres;
+		epmd.nbits = bmlength;
+		ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
+			td->name, (long)bmlength, *epres);
+
+	    /* Go over extensions and read them in */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            void *memb_ptr;   /* Pointer to the member */
+            void **memb_ptr2; /* Pointer to that pointer */
+            int present;
+
+            /* Fetch the pointer to this member */
+            if(elm->flags & ATF_POINTER) {
+                memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+            } else {
+                memb_ptr = (void *)((char *)st + elm->memb_offset);
+                memb_ptr2 = &memb_ptr;
+            }
+
+            present = per_get_few_bits(&epmd, 1);
+            if(present <= 0) {
+                if(present < 0) break; /* No more extensions */
+                continue;
+            }
+
+            ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name,
+                      *memb_ptr2);
+            rv = uper_open_type_get(opt_codec_ctx, elm->type,
+                                    elm->encoding_constraints.per_constraints,
+                                    memb_ptr2, pd);
+            if(rv.code != RC_OK) {
+                FREEMEM(epres);
+                return rv;
+            }
+	    }
+
+		/* Skip over overflow extensions which aren't present
+		 * in this system's version of the protocol */
+		for(;;) {
+			ASN_DEBUG("Getting overflow extensions");
+			switch(per_get_few_bits(&epmd, 1)) {
+			case -1: break;
+			case 0: continue;
+			default:
+				if(uper_open_type_skip(opt_codec_ctx, pd)) {
+					FREEMEM(epres);
+					ASN__DECODE_STARVED;
+				}
+                ASN_DEBUG("Skipped overflow extension");
+                continue;
+			}
+			break;
+		}
+
+		FREEMEM(epres);
+	}
+
+    if(specs->first_extension >= 0) {
+        unsigned i;
+        /* Fill DEFAULT members in extensions */
+        for(i = specs->roms_count; i < specs->roms_count + specs->aoms_count;
+            i++) {
+            asn_TYPE_member_t *elm;
+            void **memb_ptr2; /* Pointer to member pointer */
+
+            edx = specs->oms[i];
+            elm = &td->elements[edx];
+
+            if(!elm->default_value_set) continue;
+
+            /* Fetch the pointer to this member */
+            if(elm->flags & ATF_POINTER) {
+                memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+                if(*memb_ptr2) continue;
+            } else {
+                continue; /* Extensions are all optionals */
+            }
+
+            /* Set default value */
+            if(elm->default_value_set(memb_ptr2)) {
+                ASN__DECODE_FAILED;
+            }
+        }
+    }
+
+	rv.consumed = 0;
+	rv.code = RC_OK;
+	return rv;
+}
+
+static int
+SEQUENCE__handle_extensions(const asn_TYPE_descriptor_t *td, const void *sptr,
+                            asn_per_outp_t *po1, asn_per_outp_t *po2) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    int exts_present = 0;
+    int exts_count = 0;
+    size_t edx;
+
+    if(specs->first_extension < 0) {
+        return 0;
+    }
+
+    /* Find out which extensions are present */
+    for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        const void *memb_ptr;         /* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+        int present;
+
+        /* Fetch the pointer to this member */
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            present = (*memb_ptr2 != 0);
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+        ASN_DEBUG("checking %s:%s (@%" ASN_PRI_SIZE ") present => %d", elm->name,
+                  elm->type->name, edx, present);
+        exts_count++;
+        exts_present += present;
+
+        /* Encode as presence marker */
+        if(po1 && per_put_few_bits(po1, present, 1)) {
+            return -1;
+        }
+        /* Encode as open type field */
+        if(po2 && present
+           && uper_open_type_put(elm->type,
+                                 elm->encoding_constraints.per_constraints,
+                                 *memb_ptr2, po2))
+            return -1;
+    }
+
+    return exts_present ? exts_count : 0;
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_uper(const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, const void *sptr,
+                     asn_per_outp_t *po) {
+    const asn_SEQUENCE_specifics_t *specs
+		= (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	int n_extensions;
+	size_t edx;
+	size_t i;
+
+	(void)constraints;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE (UPER)", td->name);
+
+	/*
+	 * X.691#18.1 Whether structure is extensible
+	 * and whether to encode extensions
+	 */
+    if(specs->first_extension < 0) {
+        n_extensions = 0; /* There are no extensions to encode */
+    } else {
+        n_extensions = SEQUENCE__handle_extensions(td, sptr, 0, 0);
+        if(n_extensions < 0) ASN__ENCODE_FAILED;
+        if(per_put_few_bits(po, n_extensions ? 1 : 0, 1)) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+	/* Encode a presence bitmap */
+	for(i = 0; i < specs->roms_count; i++) {
+		asn_TYPE_member_t *elm;
+		const void *memb_ptr;		/* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+        int present;
+
+		edx = specs->oms[i];
+		elm = &td->elements[edx];
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            present = (*memb_ptr2 != 0);
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		/* Eliminate default values */
+        if(present && elm->default_value_cmp
+           && elm->default_value_cmp(*memb_ptr2) == 0)
+            present = 0;
+
+		ASN_DEBUG("Element %s %s %s->%s is %s",
+			elm->flags & ATF_POINTER ? "ptr" : "inline",
+			elm->default_value_cmp ? "def" : "wtv",
+			td->name, elm->name, present ? "present" : "absent");
+		if(per_put_few_bits(po, present, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Encode the sequence ROOT elements.
+	 */
+    ASN_DEBUG("first_extension = %d, elements = %d", specs->first_extension,
+              td->elements_count);
+	for(edx = 0;
+		edx < ((specs->first_extension < 0) ? td->elements_count
+                                            : (size_t)specs->first_extension);
+		edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;         /* Pointer to the member */
+		const void *const *memb_ptr2; /* Pointer to that pointer */
+
+		ASN_DEBUG("About to encode %s", elm->type->name);
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present",
+					elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+			continue;
+
+        ASN_DEBUG("Encoding %s->%s:%s", td->name, elm->name, elm->type->name);
+        er = elm->type->op->uper_encoder(
+            elm->type, elm->encoding_constraints.per_constraints, *memb_ptr2,
+            po);
+        if(er.encoded == -1) return er;
+    }
+
+	/* No extensions to encode */
+	if(!n_extensions) ASN__ENCODED_OK(er);
+
+	ASN_DEBUG("Length of extensions %d bit-map", n_extensions);
+	/* #18.8. Write down the presence bit-map length. */
+	if(uper_put_nslength(po, n_extensions))
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Bit-map of %d elements", n_extensions);
+	/* #18.7. Encoding the extensions presence bit-map. */
+	/* TODO: act upon NOTE in #18.7 for canonical PER */
+	if(SEQUENCE__handle_extensions(td, sptr, po, 0) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Writing %d extensions", n_extensions);
+	/* #18.9. Encode extensions as open type fields. */
+	if(SEQUENCE__handle_extensions(td, sptr, 0, po) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+SEQUENCE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	void *st = *sptr;	/* Target structure. */
+	int extpresent;		/* Extension additions are present */
+	uint8_t *opres;		/* Presence of optional root members */
+	asn_per_data_t opmd;
+	asn_dec_rval_t rv;
+	size_t edx;
+
+	(void)constraints;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as SEQUENCE (APER)", td->name);
+
+	/* Handle extensions */
+	if(specs->first_extension < 0) {
+		extpresent = 0;
+	} else {
+		extpresent = per_get_few_bits(pd, 1);
+		if(extpresent < 0) ASN__DECODE_STARVED;
+	}
+
+	/* Prepare a place and read-in the presence bitmap */
+	memset(&opmd, 0, sizeof(opmd));
+	if(specs->roms_count) {
+		opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
+		if(!opres) ASN__DECODE_FAILED;
+		/* Get the presence map */
+		if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
+			FREEMEM(opres);
+			ASN__DECODE_STARVED;
+		}
+		opmd.buffer = opres;
+		opmd.nbits = specs->roms_count;
+		ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
+		          td->name, specs->roms_count, *opres);
+	} else {
+		opres = 0;
+	}
+
+	/*
+	 * Get the sequence ROOT elements.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+#if 0
+		int padding;
+#endif
+
+		if(IN_EXTENSION_GROUP(specs, edx))
+			continue;
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+#if 0
+		/* Get Padding */
+		padding = (8 - (pd->moved % 8)) % 8;
+		if(padding > 0)
+			ASN_DEBUG("For element %s,offset= %ld Padding bits = %d", td->name, pd->moved, padding);
+#if 0 /* old way of removing padding */
+		per_get_few_bits(pd, padding);
+#else /* Experimental fix proposed by @mhanna123 */
+		if(edx != (td->elements_count-1))
+			per_get_few_bits(pd, padding);
+		else {
+			if(specs->roms_count && (padding > 0))
+				ASN_DEBUG(">>>>> not skipping padding of %d bits for element:%ld out of %d", padding, edx, td->elements_count);
+			else
+				per_get_few_bits(pd, padding);
+		}
+#endif /* dealing with padding */
+#endif
+		/* Deal with optionality */
+		if(elm->optional) {
+			int present = per_get_few_bits(&opmd, 1);
+			ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
+			          td->name, elm->name, present,
+			          (int)opmd.nboff, (int)opmd.nbits);
+			if(present == 0) {
+				/* This element is not present */
+				if(elm->default_value_set) {
+					/* Fill-in DEFAULT */
+					if(elm->default_value_set(memb_ptr2)) {
+						FREEMEM(opres);
+						ASN__DECODE_FAILED;
+					}
+					ASN_DEBUG("Filled-in default");
+				}
+				/* The member is just not present */
+				continue;
+			}
+			/* Fall through */
+		}
+
+		/* Fetch the member from the stream */
+		ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
+
+		if(elm->flags & ATF_OPEN_TYPE) {
+			rv = OPEN_TYPE_aper_get(opt_codec_ctx, td, st, elm, pd);
+		} else {
+			rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+					elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+		}
+		if(rv.code != RC_OK) {
+			ASN_DEBUG("Failed decode %s in %s",
+			          elm->name, td->name);
+			FREEMEM(opres);
+			return rv;
+		}
+	}
+
+	/* Optionality map is not needed anymore */
+	FREEMEM(opres);
+
+	/*
+	 * Deal with extensions.
+	 */
+	if(extpresent) {
+		ssize_t bmlength;
+		uint8_t *epres;		/* Presence of extension members */
+		asn_per_data_t epmd;
+
+		bmlength = aper_get_nslength(pd);
+		if(bmlength < 0) ASN__DECODE_STARVED;
+
+		ASN_DEBUG("Extensions %" ASN_PRI_SSIZE " present in %s", bmlength, td->name);
+
+		epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
+		if(!epres) ASN__DECODE_STARVED;
+
+		/* Get the extensions map */
+		if(per_get_many_bits(pd, epres, 0, bmlength))
+			ASN__DECODE_STARVED;
+
+		memset(&epmd, 0, sizeof(epmd));
+		epmd.buffer = epres;
+		epmd.nbits = bmlength;
+		ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
+		          td->name, bmlength, *epres);
+
+		/* Go over extensions and read them in */
+		for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+			asn_TYPE_member_t *elm = &td->elements[edx];
+			void *memb_ptr;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+			int present;
+
+			if(!IN_EXTENSION_GROUP(specs, edx)) {
+				ASN_DEBUG("%ld is not extension", edx);
+				continue;
+			}
+
+			/* Fetch the pointer to this member */
+			if(elm->flags & ATF_POINTER) {
+				memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+			} else {
+				memb_ptr = (void *)((char *)st + elm->memb_offset);
+				memb_ptr2 = &memb_ptr;
+			}
+
+			present = per_get_few_bits(&epmd, 1);
+			if(present <= 0) {
+				if(present < 0) break;	/* No more extensions */
+				continue;
+			}
+
+			ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2);
+			rv = aper_open_type_get(opt_codec_ctx, elm->type,
+			                        elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+			if(rv.code != RC_OK) {
+				FREEMEM(epres);
+				return rv;
+			}
+		}
+
+		/* Skip over overflow extensions which aren't present
+		 * in this system's version of the protocol */
+		for(;;) {
+			ASN_DEBUG("Getting overflow extensions");
+			switch(per_get_few_bits(&epmd, 1)) {
+			case -1:
+				break;
+			case 0:
+				continue;
+			default:
+				if(aper_open_type_skip(opt_codec_ctx, pd)) {
+					FREEMEM(epres);
+					ASN__DECODE_STARVED;
+				}
+			}
+			break;
+		}
+
+		FREEMEM(epres);
+	}
+
+	/* Fill DEFAULT members in extensions */
+	for(edx = specs->roms_count; edx < specs->roms_count
+	        + specs->aoms_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void **memb_ptr2;	/* Pointer to member pointer */
+
+		if(!elm->default_value_set) continue;
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st
+			                      + elm->memb_offset);
+			if(*memb_ptr2) continue;
+		} else {
+			continue;	/* Extensions are all optionals */
+		}
+
+		/* Set default value */
+		if(elm->default_value_set(memb_ptr2)) {
+			ASN__DECODE_FAILED;
+		}
+	}
+
+	rv.consumed = 0;
+	rv.code = RC_OK;
+	return rv;
+}
+
+static int
+SEQUENCE_handle_extensions_aper(const asn_TYPE_descriptor_t *td,
+                                const void *sptr,
+                                asn_per_outp_t *po1, asn_per_outp_t *po2) {
+	const asn_SEQUENCE_specifics_t *specs
+	    = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	int exts_present = 0;
+	int exts_count = 0;
+	size_t edx;
+
+	if(specs->first_extension < 0) {
+		return 0;
+	}
+
+	/* Find out which extensions are present */
+	for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;           /* Pointer to the member */
+		const void * const *memb_ptr2;  /* Pointer to that pointer */
+		int present;
+
+		if(!IN_EXTENSION_GROUP(specs, edx)) {
+			ASN_DEBUG("%s (@%ld) is not extension", elm->type->name, edx);
+			continue;
+		}
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			present = (*memb_ptr2 != 0);
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		ASN_DEBUG("checking %s (@%ld) present => %d",
+		          elm->type->name, edx, present);
+		exts_count++;
+		exts_present += present;
+
+		/* Encode as presence marker */
+		if(po1 && per_put_few_bits(po1, present, 1))
+			return -1;
+		/* Encode as open type field */
+		if(po2 && present && aper_open_type_put(elm->type,
+		                                        elm->encoding_constraints.per_constraints, *memb_ptr2, po2))
+			return -1;
+
+	}
+
+	return exts_present ? exts_count : 0;
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_aper(const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints,
+                     const void *sptr, asn_per_outp_t *po) {
+	const asn_SEQUENCE_specifics_t *specs
+	    = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	int n_extensions;
+	size_t edx;
+	size_t i;
+
+	(void)constraints;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE (APER)", td->name);
+
+	/*
+	 * X.691#18.1 Whether structure is extensible
+	 * and whether to encode extensions
+	 */
+	if(specs->first_extension < 0) {
+		n_extensions = 0; /* There are no extensions to encode */
+	} else {
+		n_extensions = SEQUENCE_handle_extensions_aper(td, sptr, 0, 0);
+		if(n_extensions < 0) ASN__ENCODE_FAILED;
+		if(per_put_few_bits(po, n_extensions ? 1 : 0, 1)) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+	/* Encode a presence bitmap */
+	for(i = 0; i < specs->roms_count; i++) {
+		asn_TYPE_member_t *elm;
+		const void *memb_ptr;	 /* Pointer to the member */
+		const void * const *memb_ptr2;       /* Pointer to that pointer */
+		int present;
+
+		edx = specs->oms[i];
+		elm = &td->elements[edx];
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			present = (*memb_ptr2 != 0);
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		/* Eliminate default values */
+		if(present && elm->default_value_cmp
+		        && elm->default_value_cmp(memb_ptr2) == 1)
+			present = 0;
+
+		ASN_DEBUG("Element %s %s %s->%s is %s",
+		          elm->flags & ATF_POINTER ? "ptr" : "inline",
+		          elm->default_value_cmp ? "def" : "wtv",
+		          td->name, elm->name, present ? "present" : "absent");
+		if(per_put_few_bits(po, present, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Encode the sequence ROOT elements.
+	 */
+	ASN_DEBUG("first_extension = %d, elements = %d", specs->first_extension,
+              td->elements_count);
+	for(edx = 0;
+		edx < ((specs->first_extension < 0) ? td->elements_count
+                                            : (size_t)specs->first_extension);
+		edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;          /* Pointer to the member */
+		const void * const *memb_ptr2; /* Pointer to that pointer */
+
+		if(IN_EXTENSION_GROUP(specs, edx))
+			continue;
+
+		ASN_DEBUG("About to encode %s", elm->type->name);
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %ld not present",
+				          elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(memb_ptr2) == 1)
+			continue;
+
+		ASN_DEBUG("Encoding %s->%s", td->name, elm->name);
+		er = elm->type->op->aper_encoder(elm->type, elm->encoding_constraints.per_constraints,
+		                                 *memb_ptr2, po);
+		if(er.encoded == -1)
+			return er;
+	}
+
+	/* No extensions to encode */
+	if(!n_extensions) ASN__ENCODED_OK(er);
+
+	ASN_DEBUG("Length of %d bit-map", n_extensions);
+	/* #18.8. Write down the presence bit-map length. */
+	if(aper_put_nslength(po, n_extensions))
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Bit-map of %d elements", n_extensions);
+	/* #18.7. Encoding the extensions presence bit-map. */
+	/* TODO: act upon NOTE in #18.7 for canonical PER */
+	if(SEQUENCE_handle_extensions_aper(td, sptr, po, 0) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Writing %d extensions", n_extensions);
+	/* #18.9. Encode extensions as open type fields. */
+	if(SEQUENCE_handle_extensions_aper(td, sptr, 0, po) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+SEQUENCE_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                 const void *bptr) {
+    size_t edx;
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *amemb;
+		const void *bmemb;
+        int ret;
+
+		if(elm->flags & ATF_POINTER) {
+            amemb =
+                *(const void *const *)((const char *)aptr + elm->memb_offset);
+            bmemb =
+                *(const void *const *)((const char *)bptr + elm->memb_offset);
+            if(!amemb) {
+                if(!bmemb) continue;
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(bmemb) == 0) {
+                    /* A is absent, but B is present and equal to DEFAULT */
+                    continue;
+                }
+                return -1;
+            } else if(!bmemb) {
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(amemb) == 0) {
+                    /* B is absent, but A is present and equal to DEFAULT */
+                    continue;
+                }
+                return 1;
+            }
+		} else {
+            amemb = (const void *)((const char *)aptr + elm->memb_offset);
+            bmemb = (const void *)((const char *)bptr + elm->memb_offset);
+		}
+
+        ret = elm->type->op->compare_struct(elm->type, amemb, bmemb);
+        if(ret != 0) return ret;
+    }
+
+    return 0;
+}
+
+asn_TYPE_operation_t asn_OP_SEQUENCE = {
+	SEQUENCE_free,
+	SEQUENCE_print,
+	SEQUENCE_compare,
+	SEQUENCE_decode_ber,
+	SEQUENCE_encode_der,
+	SEQUENCE_decode_xer,
+	SEQUENCE_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SEQUENCE_decode_oer,
+	SEQUENCE_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SEQUENCE_decode_uper,
+	SEQUENCE_encode_uper,
+	SEQUENCE_decode_aper,
+	SEQUENCE_encode_aper,
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SEQUENCE_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
+
+asn_random_fill_result_t
+SEQUENCE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constr,
+                   size_t max_length) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 0};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    void *st = *sptr;
+    size_t edx;
+
+    if(max_length == 0) return result_skipped;
+
+    (void)constr;
+
+    if(st == NULL) {
+        st = CALLOC(1, specs->struct_size);
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    for(edx = 0; edx < td->elements_count; edx++) {
+        const asn_TYPE_member_t *elm = &td->elements[edx];
+        void *memb_ptr;   /* Pointer to the member */
+        void **memb_ptr2; /* Pointer to that pointer */
+        asn_random_fill_result_t tmpres;
+
+        if(elm->optional && asn_random_between(0, 4) == 2) {
+            /* Sometimes decide not to fill the optional value */
+            continue;
+        }
+
+        if(elm->flags & ATF_POINTER) {
+            /* Member is a pointer to another structure */
+            memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+        } else {
+            memb_ptr = (char *)st + elm->memb_offset;
+            memb_ptr2 = &memb_ptr;
+        }
+
+        tmpres = elm->type->op->random_fill(
+            elm->type, memb_ptr2, &elm->encoding_constraints,
+            max_length > result_ok.length ? max_length - result_ok.length : 0);
+        switch(tmpres.code) {
+        case ARFILL_OK:
+            result_ok.length += tmpres.length;
+            continue;
+        case ARFILL_SKIPPED:
+            assert(!(elm->flags & ATF_POINTER) || *memb_ptr2 == NULL);
+            continue;
+        case ARFILL_FAILED:
+            if(st == *sptr) {
+                ASN_STRUCT_RESET(*td, st);
+            } else {
+                ASN_STRUCT_FREE(*td, st);
+            }
+            return tmpres;
+        }
+    }
+
+    *sptr = st;
+
+    return result_ok;
+}
+
diff --git a/e2sm/lib/constr_SEQUENCE_OF.c b/e2sm/lib/constr_SEQUENCE_OF.c
new file mode 100644
index 0000000..10f18cf
--- /dev/null
+++ b/e2sm/lib/constr_SEQUENCE_OF.c
@@ -0,0 +1,358 @@
+/*-
+ * Copyright (c) 2003, 2004, 2006 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SEQUENCE_OF.h>
+#include <asn_SEQUENCE_OF.h>
+
+/*
+ * The DER encoder of the SEQUENCE OF type.
+ */
+asn_enc_rval_t
+SEQUENCE_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *ptr,
+                       int tag_mode, ber_tlv_tag_t tag,
+                       asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_TYPE_member_t *elm = td->elements;
+	const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(ptr);
+	size_t computed_size = 0;
+	ssize_t encoding_size = 0;
+	asn_enc_rval_t erval = {0,0,0};
+	int edx;
+
+	ASN_DEBUG("Estimating size of SEQUENCE OF %s", td->name);
+
+	/*
+	 * Gather the length of the underlying members sequence.
+	 */
+	for(edx = 0; edx < list->count; edx++) {
+		void *memb_ptr = list->array[edx];
+		if(!memb_ptr) continue;
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			0, elm->tag,
+			0, 0);
+		if(erval.encoded == -1)
+			return erval;
+		computed_size += erval.encoded;
+	}
+
+	/*
+	 * Encode the TLV for the sequence itself.
+	 */
+	encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag,
+		cb, app_key);
+	if(encoding_size == -1) {
+		erval.encoded = -1;
+		erval.failed_type = td;
+		erval.structure_ptr = ptr;
+		return erval;
+	}
+
+	computed_size += encoding_size;
+	if(!cb) {
+		erval.encoded = computed_size;
+		ASN__ENCODED_OK(erval);
+	}
+
+	ASN_DEBUG("Encoding members of SEQUENCE OF %s", td->name);
+
+	/*
+	 * Encode all members.
+	 */
+	for(edx = 0; edx < list->count; edx++) {
+		void *memb_ptr = list->array[edx];
+		if(!memb_ptr) continue;
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			0, elm->tag,
+			cb, app_key);
+		if(erval.encoded == -1)
+			return erval;
+		encoding_size += erval.encoded;
+	}
+
+	if(computed_size != (size_t)encoding_size) {
+		/*
+		 * Encoded size is not equal to the computed size.
+		 */
+		erval.encoded = -1;
+		erval.failed_type = td;
+		erval.structure_ptr = ptr;
+	} else {
+		erval.encoded = computed_size;
+		erval.structure_ptr = 0;
+		erval.failed_type = 0;
+	}
+
+	return erval;
+}
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                       int ilevel, enum xer_encoder_flags_e flags,
+                       asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(sptr);
+    const char *mname = specs->as_XMLValueList
+                            ? 0
+                            : ((*elm->name) ? elm->name : elm->type->xml_tag);
+    size_t mlen = mname ? strlen(mname) : 0;
+    int xcan = (flags & XER_F_CANONICAL);
+    int i;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    er.encoded = 0;
+
+    for(i = 0; i < list->count; i++) {
+        asn_enc_rval_t tmper = {0,0,0};
+        void *memb_ptr = list->array[i];
+        if(!memb_ptr) continue;
+
+        if(mname) {
+            if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+            ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+        }
+
+        tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1,
+                                           flags, cb, app_key);
+        if(tmper.encoded == -1) return tmper;
+        er.encoded += tmper.encoded;
+        if(tmper.encoded == 0 && specs->as_XMLValueList) {
+            const char *name = elm->type->xml_tag;
+            size_t len = strlen(name);
+            if(!xcan) ASN__TEXT_INDENT(1, ilevel + 1);
+            ASN__CALLBACK3("<", 1, name, len, "/>", 2);
+        }
+
+        if(mname) {
+            ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+        }
+    }
+
+    if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+    ASN__ENCODED_OK(er);
+cb_failed:
+    ASN__ENCODE_FAILED;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_uper(const asn_TYPE_descriptor_t *td,
+                        const asn_per_constraints_t *constraints,
+                        const void *sptr, asn_per_outp_t *po) {
+    const asn_anonymous_sequence_ *list;
+	const asn_per_constraint_t *ct;
+	asn_enc_rval_t er = {0,0,0};
+	const asn_TYPE_member_t *elm = td->elements;
+	size_t encoded_edx;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+    list = _A_CSEQUENCE_FROM_VOID(sptr);
+
+    er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
+
+    if(constraints) ct = &constraints->size;
+    else if(td->encoding_constraints.per_constraints)
+        ct = &td->encoding_constraints.per_constraints->size;
+    else ct = 0;
+
+    /* If extensible constraint, check if size is in root */
+    if(ct) {
+        int not_in_root =
+            (list->count < ct->lower_bound || list->count > ct->upper_bound);
+        ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
+                  ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+        if(ct->flags & APC_EXTENSIBLE) {
+            /* Declare whether size is in extension root */
+            if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED;
+            if(not_in_root) ct = 0;
+        } else if(not_in_root && ct->effective_bits >= 0) {
+            ASN__ENCODE_FAILED;
+        }
+
+    }
+
+    if(ct && ct->effective_bits >= 0) {
+        /* X.691, #19.5: No length determinant */
+        if(per_put_few_bits(po, list->count - ct->lower_bound,
+                            ct->effective_bits))
+            ASN__ENCODE_FAILED;
+    } else if(list->count == 0) {
+        /* When the list is empty add only the length determinant
+         * X.691, #20.6 and #11.9.4.1
+         */
+        if (uper_put_length(po, 0, 0)) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+    for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) {
+        ssize_t may_encode;
+        size_t edx;
+        int need_eom = 0;
+
+        if(ct && ct->effective_bits >= 0) {
+            may_encode = list->count;
+        } else {
+            may_encode =
+                uper_put_length(po, list->count - encoded_edx, &need_eom);
+            if(may_encode < 0) ASN__ENCODE_FAILED;
+        }
+
+        for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) {
+            void *memb_ptr = list->array[edx];
+            if(!memb_ptr) ASN__ENCODE_FAILED;
+            er = elm->type->op->uper_encoder(
+                elm->type, elm->encoding_constraints.per_constraints, memb_ptr,
+                po);
+            if(er.encoded == -1) ASN__ENCODE_FAILED;
+        }
+
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+
+        encoded_edx += may_encode;
+    }
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_aper(const asn_TYPE_descriptor_t *td,
+                        const asn_per_constraints_t *constraints,
+                        const void *sptr, asn_per_outp_t *po) {
+	const asn_anonymous_sequence_ *list;
+	const asn_per_constraint_t *ct;
+	asn_enc_rval_t er = {0,0,0};
+	asn_TYPE_member_t *elm = td->elements;
+	int seq;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	list = _A_CSEQUENCE_FROM_VOID(sptr);
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE OF size (%d) using ALIGNED PER", td->name, list->count);
+
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	/* If extensible constraint, check if size is in root */
+	if(ct) {
+		int not_in_root = (list->count < ct->lower_bound
+				|| list->count > ct->upper_bound);
+		ASN_DEBUG("lb %ld ub %ld %s",
+			ct->lower_bound, ct->upper_bound,
+			ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+		if(ct->flags & APC_EXTENSIBLE) {
+			/* Declare whether size is in extension root */
+			if(per_put_few_bits(po, not_in_root, 1))
+				ASN__ENCODE_FAILED;
+			if(not_in_root) ct = 0;
+		} else if(not_in_root && ct->effective_bits >= 0)
+			ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+/*		 if(per_put_few_bits(po, list->count - ct->lower_bound,
+				 ct->effective_bits))
+			 ASN__ENCODE_FAILED;
+*/
+		if (aper_put_length(po, ct->upper_bound - ct->lower_bound + 1, list->count - ct->lower_bound) < 0)
+			ASN__ENCODE_FAILED;
+	}
+
+	for(seq = -1; seq < list->count;) {
+		ssize_t mayEncode;
+		if(seq < 0) seq = 0;
+		if(ct && ct->effective_bits >= 0) {
+			mayEncode = list->count;
+		} else {
+			mayEncode = aper_put_length(po, -1, list->count - seq);
+			if(mayEncode < 0) ASN__ENCODE_FAILED;
+		}
+
+		while(mayEncode--) {
+			void *memb_ptr = list->array[seq++];
+			if(!memb_ptr) ASN__ENCODE_FAILED;
+			er = elm->type->op->aper_encoder(elm->type,
+				elm->encoding_constraints.per_constraints, memb_ptr, po);
+			if(er.encoded == -1)
+				ASN__ENCODE_FAILED;
+		}
+	}
+
+	ASN__ENCODED_OK(er);
+}
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+SEQUENCE_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+               const void *bptr) {
+    const asn_anonymous_sequence_ *a = _A_CSEQUENCE_FROM_VOID(aptr);
+    const asn_anonymous_sequence_ *b = _A_CSEQUENCE_FROM_VOID(bptr);
+    ssize_t idx;
+
+    if(a && b) {
+        ssize_t common_length = (a->count < b->count ? a->count : b->count);
+        for(idx = 0; idx < common_length; idx++) {
+            int ret = td->elements->type->op->compare_struct(
+                td->elements->type, a->array[idx], b->array[idx]);
+            if(ret) return ret;
+        }
+
+        if(idx < b->count) /* more elements in b */
+            return -1;    /* a is shorter, so put it first */
+        if(idx < a->count) return 1;
+
+    } else if(!a) {
+        return -1;
+    } else if(!b) {
+        return 1;
+    }
+
+    return 0;
+}
+
+
+asn_TYPE_operation_t asn_OP_SEQUENCE_OF = {
+	SEQUENCE_OF_free,
+	SEQUENCE_OF_print,
+	SEQUENCE_OF_compare,
+	SEQUENCE_OF_decode_ber,
+	SEQUENCE_OF_encode_der,
+	SEQUENCE_OF_decode_xer,
+	SEQUENCE_OF_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SEQUENCE_OF_decode_oer, /* Same as SET OF decoder. */
+	SEQUENCE_OF_encode_oer, /* Same as SET OF encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SEQUENCE_OF_decode_uper, /* Same as SET OF decoder */
+	SEQUENCE_OF_encode_uper,
+	SEQUENCE_OF_decode_aper,
+	SEQUENCE_OF_encode_aper,
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SEQUENCE_OF_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
diff --git a/e2sm/lib/constr_SEQUENCE_oer.c b/e2sm/lib/constr_SEQUENCE_oer.c
new file mode 100644
index 0000000..ecb589c
--- /dev/null
+++ b/e2sm/lib/constr_SEQUENCE_oer.c
@@ -0,0 +1,561 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_SEQUENCE.h>
+#include <OPEN_TYPE.h>
+#include <errno.h>
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef  ADVANCE
+#define ADVANCE(num_bytes)                   \
+    do {                                     \
+        size_t num = num_bytes;              \
+        ptr = ((const char *)ptr) + num;     \
+        size -= num;                         \
+        consumed_myself += num;              \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#undef PHASE_OUT
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+
+/*
+ * Check whether we are inside the extensions group.
+ */
+#define IN_EXTENSION_GROUP(specs, memb_idx) \
+    ((specs)->first_extension >= 0          \
+     && (unsigned)(specs)->first_extension <= (memb_idx))
+
+#define IN_ROOT_GROUP_PRED(edx)                            \
+    edx < (specs->first_extension < 0 ? td->elements_count \
+                                      : (size_t)specs->first_extension)
+
+#define FOR_IN_ROOT_GROUP(edx) for(edx = 0; IN_ROOT_GROUP_PRED(edx); edx++)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)   do {                    \
+                rval.code = _code;              \
+                rval.consumed = consumed_myself;\
+                return rval;                    \
+        } while(0)
+
+/*
+ * Return pointer to a member.
+ */
+static void **
+element_ptrptr(void *struct_ptr, asn_TYPE_member_t *elm, void **tmp_save_ptr) {
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        return (void **)((char *)struct_ptr + elm->memb_offset);
+    } else {
+        assert(tmp_save_ptr);
+        *tmp_save_ptr = (void *)((char *)struct_ptr + elm->memb_offset);
+        return tmp_save_ptr;
+    }
+}
+
+static const void *
+element_ptr(const void *struct_ptr, const asn_TYPE_member_t *elm) {
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        return *(const void *const *)((const char *)struct_ptr
+                                      + elm->memb_offset);
+    } else {
+        return (const void *)((const char *)struct_ptr + elm->memb_offset);
+    }
+}
+
+asn_dec_rval_t
+SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_oer_constraints_t *constraints, void **struct_ptr,
+                    const void *ptr, size_t size) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    void *st = *struct_ptr; /* Target structure */
+    asn_struct_ctx_t *ctx; /* Decoder context */
+    size_t consumed_myself = 0; /* Consumed bytes from ptr. */
+
+    (void)constraints;
+
+    if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+        ASN__DECODE_FAILED;
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+    /*
+     * Start to parse where left previously.
+     */
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Fetch preamble.
+         */
+        asn_bit_data_t *preamble;
+        int has_extensions_bit = (specs->first_extension >= 0);
+        size_t preamble_bits = (has_extensions_bit + specs->roms_count);
+        size_t preamble_bytes = ((7 + preamble_bits) >> 3);
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 0", td->name);
+
+        ASN_DEBUG(
+            "Expecting preamble bits %" ASN_PRI_SIZE " for %s (including %d extension bits)",
+            preamble_bits, td->name, has_extensions_bit);
+
+        if(preamble_bytes > size) {
+            ASN__DECODE_STARVED;
+        }
+
+        preamble = asn_bit_data_new_contiguous(ptr, preamble_bits);
+        if(!preamble) {
+            RETURN(RC_FAIL);
+        }
+        preamble->nboff = has_extensions_bit;
+        ctx->ptr = preamble;
+        ADVANCE(preamble_bytes);
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 1: {
+        /* Decode components of the extension root */
+        asn_bit_data_t *preamble = ctx->ptr;
+        size_t edx;
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 1 (Root)", td->name);
+
+        assert(preamble);
+
+        for(edx = (ctx->step >> 1); IN_ROOT_GROUP_PRED(edx);
+            edx++, ctx->step = (ctx->step & ~1) + 2) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+
+            ASN_DEBUG("Decoding %s->%s", td->name, elm->name);
+
+            assert(!IN_EXTENSION_GROUP(specs, edx));
+
+            if(ctx->step & 1) {
+                goto microphase2_decode_continues;
+            }
+
+
+            if(elm->optional) {
+                int32_t present = asn_get_few_bits(preamble, 1);
+                if(present < 0) {
+                    ASN_DEBUG("Presence map ended prematurely: %d", present);
+                    RETURN(RC_FAIL);
+                } else if(present == 0) {
+                    if(elm->default_value_set) {
+                        /* Fill-in DEFAULT */
+                        void *tmp;
+                        if(elm->default_value_set(
+                               element_ptrptr(st, elm, &tmp))) {
+                            RETURN(RC_FAIL);
+                        }
+                    }
+                    /* The member is not present. */
+                    continue;
+                }
+                /* Present OPTIONAL or DEFAULT component. */
+            }
+
+            /*
+             * MICROPHASE 2: Invoke the member-specific decoder.
+             */
+            ctx->step |= 1; /* Confirm entering next microphase */
+        microphase2_decode_continues:
+            if(elm->flags & ATF_OPEN_TYPE) {
+                rval = OPEN_TYPE_oer_get(opt_codec_ctx, td, st, elm, ptr, size);
+            } else {
+                void *save_memb_ptr; /* Temporary reference. */
+                void **memb_ptr2;  /* Pointer to a pointer to a memmber */
+
+                memb_ptr2 = element_ptrptr(st, elm, &save_memb_ptr);
+
+                rval = elm->type->op->oer_decoder(
+                    opt_codec_ctx, elm->type,
+                    elm->encoding_constraints.oer_constraints, memb_ptr2, ptr,
+                    size);
+            }
+            switch(rval.code) {
+            case RC_OK:
+                ADVANCE(rval.consumed);
+                break;
+            case RC_WMORE:
+                ASN_DEBUG("More bytes needed at element %s \"%s\"", td->name,
+                          elm->name);
+                ADVANCE(rval.consumed);
+                RETURN(RC_WMORE);
+            case RC_FAIL:
+                ASN_DEBUG("Decoding failed at element %s \"%s\"", td->name,
+                          elm->name);
+                RETURN(RC_FAIL);
+            }
+        } /* for(all root members) */
+
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 2:
+        assert(ctx->ptr);
+        {
+        /* Cleanup preamble. */
+        asn_bit_data_t *preamble = ctx->ptr;
+        asn_bit_data_t *extadds;
+        int has_extensions_bit = (specs->first_extension >= 0);
+        int extensions_present =
+            has_extensions_bit
+            && (preamble->buffer == NULL
+                || (((const uint8_t *)preamble->buffer)[0] & 0x80));
+        uint8_t unused_bits;
+        size_t len = 0;
+        ssize_t len_len;
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 2", td->name);
+
+        preamble->buffer = 0; /* Will do extensions_present==1 next time. */
+
+        if(!extensions_present) {
+            ctx->phase = 10;
+            RETURN(RC_OK);
+        }
+
+        /*
+         * X.696 (08/2015) #16.1 (c), #16.4
+         * Read in the extension addition presence bitmap.
+         */
+
+        len_len = oer_fetch_length(ptr, size, &len);
+        if(len_len > 0) {
+            ADVANCE(len_len);
+        } else if(len_len < 0) {
+            RETURN(RC_FAIL);
+        } else {
+            RETURN(RC_WMORE);
+        }
+
+        if(len == 0) {
+            /* 16.4.1-2 */
+            RETURN(RC_FAIL);
+        } else if(len > size) {
+            RETURN(RC_WMORE);
+        }
+
+        /* Account for unused bits */
+        unused_bits = 0x7 & *(const uint8_t *)ptr;
+        ADVANCE(1);
+        len--;
+        if(unused_bits && len == 0) {
+            RETURN(RC_FAIL);
+        }
+
+        /* Get the extensions map */
+        extadds = asn_bit_data_new_contiguous(ptr, len * 8 - unused_bits);
+        if(!extadds) {
+            RETURN(RC_FAIL);
+        }
+        FREEMEM(preamble);
+        ctx->ptr = extadds;
+        ADVANCE(len);
+    }
+        NEXT_PHASE(ctx);
+        ctx->step =
+            (specs->first_extension < 0 ? td->elements_count
+                                        : (size_t)specs->first_extension);
+        /* Fall through */
+    case 3:
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 3 (Extensions)", td->name);
+        for(; ctx->step < (signed)td->elements_count; ctx->step++) {
+            asn_bit_data_t *extadds = ctx->ptr;
+            size_t edx = ctx->step;
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            void *tmp_memb_ptr;
+            void **memb_ptr2 = element_ptrptr(st, elm, &tmp_memb_ptr);
+
+            switch(asn_get_few_bits(extadds, 1)) {
+            case -1:
+                /*
+                 * Not every one of our extensions is known to the remote side.
+                 * Continue filling in their defaults though.
+                 */
+                /* Fall through */
+            case 0:
+                /* Fill-in DEFAULT */
+                if(elm->default_value_set
+                   && elm->default_value_set(memb_ptr2)) {
+                    RETURN(RC_FAIL);
+                }
+                continue;
+            case 1: {
+                /* Read OER open type */
+                ssize_t ot_size =
+                    oer_open_type_get(opt_codec_ctx, elm->type,
+                                      elm->encoding_constraints.oer_constraints,
+                                      memb_ptr2, ptr, size);
+                assert(ot_size <= (ssize_t)size);
+                if(ot_size > 0) {
+                    ADVANCE(ot_size);
+                } else if(ot_size < 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    /* Roll back open type parsing */
+                    asn_get_undo(extadds, 1);
+                    RETURN(RC_WMORE);
+                }
+                break;
+            }
+            default:
+                RETURN(RC_FAIL);
+            }
+        }
+
+        NEXT_PHASE(ctx);
+        /* Fall through */
+    case 4:
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 4", td->name);
+        /* Read in the rest of Open Types while ignoring them */
+        for(;;) {
+            asn_bit_data_t *extadds = ctx->ptr;
+            switch(asn_get_few_bits(extadds, 1)) {
+            case 0:
+                continue;
+            case 1: {
+                ssize_t skipped = oer_open_type_skip(ptr, size);
+                if(skipped > 0) {
+                    ADVANCE(skipped);
+                } else if(skipped < 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    asn_get_undo(extadds, 1);
+                    RETURN(RC_WMORE);
+                }
+                continue;
+            }
+            case -1:
+                /* No more Open Type encoded components */
+                break;
+            default:
+                RETURN(RC_FAIL);
+            }
+            break;
+        }
+    }
+
+    RETURN(RC_OK);
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+SEQUENCE_encode_oer(const asn_TYPE_descriptor_t *td,
+                    const asn_oer_constraints_t *constraints, const void *sptr,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+    size_t computed_size = 0;
+    int has_extensions_bit = (specs->first_extension >= 0);
+    size_t preamble_bits = (has_extensions_bit + specs->roms_count);
+    uint32_t has_extensions = 0;
+    size_t edx;
+    int ret;
+
+    (void)constraints;
+
+    if(preamble_bits) {
+        asn_bit_outp_t preamble;
+
+        memset(&preamble, 0, sizeof(preamble));
+        preamble.output = cb;
+        preamble.op_key = app_key;
+
+        if(has_extensions_bit) {
+            for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+                asn_TYPE_member_t *elm = &td->elements[edx];
+                const void *memb_ptr = element_ptr(sptr, elm);
+                if(memb_ptr) {
+                    if(elm->default_value_cmp
+                       && elm->default_value_cmp(memb_ptr) == 0) {
+                        /* Do not encode default values in extensions */
+                    } else {
+                        has_extensions = 1;
+                        break;
+                    }
+                }
+            }
+            ret = asn_put_few_bits(&preamble, has_extensions, 1);
+            assert(ret == 0);
+            if(ret < 0) {
+                ASN__ENCODE_FAILED;
+            }
+        }
+
+        /*
+         * Encode optional components bitmap.
+         */
+        if(specs->roms_count) {
+            FOR_IN_ROOT_GROUP(edx) {
+                asn_TYPE_member_t *elm = &td->elements[edx];
+
+                if(IN_EXTENSION_GROUP(specs, edx)) break;
+
+                if(elm->optional) {
+                    const void *memb_ptr = element_ptr(sptr, elm);
+                    uint32_t has_component = memb_ptr != NULL;
+                    if(has_component && elm->default_value_cmp
+                       && elm->default_value_cmp(memb_ptr) == 0) {
+                        has_component = 0;
+                    }
+                    ret = asn_put_few_bits(&preamble, has_component, 1);
+                    if(ret < 0) {
+                        ASN__ENCODE_FAILED;
+                    }
+                }
+            }
+        }
+
+        asn_put_aligned_flush(&preamble);
+        computed_size += preamble.flushed_bytes;
+    }   /* if(preamble_bits) */
+
+    /*
+     * Put root components and extensions root.
+     */
+    for(edx = 0; edx < td->elements_count; edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        asn_enc_rval_t er = {0,0,0};
+        const void *memb_ptr;
+
+        if(IN_EXTENSION_GROUP(specs, edx)) break;
+
+        memb_ptr = element_ptr(sptr, elm);
+        if(memb_ptr) {
+            if(elm->default_value_cmp
+               && elm->default_value_cmp(memb_ptr) == 0) {
+                /* Skip default values in encoding */
+                continue;
+            }
+        } else {
+            if(elm->optional) continue;
+            /* Mandatory element is missing */
+            ASN__ENCODE_FAILED;
+        }
+        if(!elm->type->op->oer_encoder) {
+            ASN_DEBUG("OER encoder is not defined for type %s", elm->type->name);
+            ASN__ENCODE_FAILED;
+        }
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded == -1) {
+            ASN_DEBUG("... while encoding %s member \"%s\"\n", td->name,
+                      elm->name);
+            return er;
+        }
+        computed_size += er.encoded;
+    }
+
+    /*
+     * Before encode extensions, encode extensions additions presense bitmap
+     # X.696 (08/2015) #16.4.
+     */
+    if(has_extensions) {
+        asn_bit_outp_t extadds;
+
+        /* Special case allowing us to use exactly one byte for #8.6 */
+        size_t aoms_length_bits = specs->aoms_count;
+        size_t aoms_length_bytes = (7 + aoms_length_bits) >> 3;
+        uint8_t unused_bits = 0x07 & (8 - (aoms_length_bits & 0x07));
+
+        assert(1 + aoms_length_bytes <= 127);
+
+        memset(&extadds, 0, sizeof(extadds));
+        extadds.output = cb;
+        extadds.op_key = app_key;
+
+        /* #8.6 length determinant */
+        ret = asn_put_few_bits(&extadds, (1 + aoms_length_bytes), 8);
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        /* Number of unused bytes, #16.4.2 */
+        ret = asn_put_few_bits(&extadds, unused_bits, 8);
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        /* Encode presence bitmap #16.4.3 */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            const void *memb_ptr = element_ptr(sptr, elm);
+            if(memb_ptr && elm->default_value_cmp
+               && elm->default_value_cmp(memb_ptr) == 0) {
+                memb_ptr = 0;   /* Do not encode default value. */
+            }
+            ret |= asn_put_few_bits(&extadds, memb_ptr ? 1 : 0, 1);
+        }
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        asn_put_aligned_flush(&extadds);
+        computed_size += extadds.flushed_bytes;
+
+        /* Now, encode extensions */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            const void *memb_ptr = element_ptr(sptr, elm);
+
+            if(memb_ptr) {
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(memb_ptr) == 0) {
+                    /* Do not encode default value. */
+                } else {
+                    ssize_t wrote = oer_open_type_put(
+                        elm->type, elm->encoding_constraints.oer_constraints,
+                        memb_ptr, cb, app_key);
+                    if(wrote == -1) {
+                        ASN__ENCODE_FAILED;
+                    }
+                    computed_size += wrote;
+                }
+            } else if(!elm->optional) {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    }   /* if(has_extensions) */
+
+
+    {
+        asn_enc_rval_t er = {0, 0, 0};
+        er.encoded = computed_size;
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/constr_SET_OF.c b/e2sm/lib/constr_SET_OF.c
new file mode 100644
index 0000000..bf1dc27
--- /dev/null
+++ b/e2sm/lib/constr_SET_OF.c
@@ -0,0 +1,1441 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SET_OF.h>
+#include <asn_SET_OF.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num;\
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#undef	PHASE_OUT
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+#define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * The decoder of the SET OF type.
+ */
+asn_dec_rval_t
+SET_OF_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements; /* Single one */
+
+    /*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	ASN_DEBUG("Decoding %s as SET OF", td->name);
+	
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+			tag_mode, 1, &ctx->left, 0);
+		if(rval.code != RC_OK) {
+			ASN_DEBUG("%s tagging check failed: %d",
+				td->name, rval.code);
+			return rval;
+		}
+
+		if(ctx->left >= 0)
+			ctx->left += rval.consumed; /* ?Substracted below! */
+		ADVANCE(rval.consumed);
+
+		ASN_DEBUG("Structure consumes %ld bytes, "
+			"buffer %ld", (long)ctx->left, (long)size);
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 1:
+		/*
+		 * PHASE 1.
+		 * From the place where we've left it previously,
+		 * try to decode the next item.
+		 */
+	  for(;; ctx->step = 0) {
+		ssize_t tag_len;	/* Length of TLV's T */
+
+		if(ctx->step & 1)
+			goto microphase2;
+
+		/*
+		 * MICROPHASE 1: Synchronize decoding.
+		 */
+
+		if(ctx->left == 0) {
+			ASN_DEBUG("End of SET OF %s", td->name);
+			/*
+			 * No more things to decode.
+			 * Exit out of here.
+			 */
+			PHASE_OUT(ctx);
+			RETURN(RC_OK);
+		}
+
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+		if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) {
+			if(LEFT < 2) {
+				if(SIZE_VIOLATION)
+					RETURN(RC_FAIL);
+				else
+					RETURN(RC_WMORE);
+			} else if(((const uint8_t *)ptr)[1] == 0) {
+				/*
+				 * Found the terminator of the
+				 * indefinite length structure.
+				 */
+				break;
+			}
+		}
+
+		/* Outmost tag may be unknown and cannot be fetched/compared */
+		if(elm->tag != (ber_tlv_tag_t)-1) {
+		    if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) {
+			/*
+			 * The new list member of expected type has arrived.
+			 */
+		    } else {
+			ASN_DEBUG("Unexpected tag %s fixed SET OF %s",
+				ber_tlv_tag_string(tlv_tag), td->name);
+			ASN_DEBUG("%s SET OF has tag %s",
+				td->name, ber_tlv_tag_string(elm->tag));
+			RETURN(RC_FAIL);
+		    }
+		}
+
+		/*
+		 * MICROPHASE 2: Invoke the member-specific decoder.
+		 */
+		ctx->step |= 1;		/* Confirm entering next microphase */
+	microphase2:
+		
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		rval = elm->type->op->ber_decoder(opt_codec_ctx,
+				elm->type, &ctx->ptr, ptr, LEFT, 0);
+		ASN_DEBUG("In %s SET OF %s code %d consumed %d",
+			td->name, elm->type->name,
+			rval.code, (int)rval.consumed);
+		switch(rval.code) {
+		case RC_OK:
+			{
+				asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+				if(ASN_SET_ADD(list, ctx->ptr) != 0)
+					RETURN(RC_FAIL);
+				else
+					ctx->ptr = 0;
+			}
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			/* Fall through */
+		case RC_FAIL: /* Fatal error */
+			ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+			ctx->ptr = 0;
+			RETURN(RC_FAIL);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  }	/* for(all list members) */
+
+		NEXT_PHASE(ctx);
+	case 2:
+		/*
+		 * Read in all "end of content" TLVs.
+		 */
+		while(ctx->left < 0) {
+			if(LEFT < 2) {
+				if(LEFT > 0 && ((const char *)ptr)[0] != 0) {
+					/* Unexpected tag */
+					RETURN(RC_FAIL);
+				} else {
+					RETURN(RC_WMORE);
+				}
+			}
+			if(((const char *)ptr)[0] == 0
+			&& ((const char *)ptr)[1] == 0) {
+				ADVANCE(2);
+				ctx->left++;
+			} else {
+				RETURN(RC_FAIL);
+			}
+		}
+
+		PHASE_OUT(ctx);
+	}
+	
+	RETURN(RC_OK);
+}
+
+/*
+ * Internally visible buffer holding a single encoded element.
+ */
+struct _el_buffer {
+	uint8_t *buf;
+	size_t length;
+	size_t allocated_size;
+    unsigned bits_unused;
+};
+/* Append bytes to the above structure */
+static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) {
+    struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr;
+
+    if(el_buf->length + size > el_buf->allocated_size) {
+        size_t new_size = el_buf->allocated_size ? el_buf->allocated_size : 8;
+        void *p;
+
+        do {
+            new_size <<= 2;
+        } while(el_buf->length + size > new_size);
+
+        p = REALLOC(el_buf->buf, new_size);
+        if(p) {
+            el_buf->buf = p;
+            el_buf->allocated_size = new_size;
+        } else {
+            return -1;
+        }
+    }
+
+    memcpy(el_buf->buf + el_buf->length, buffer, size);
+
+    el_buf->length += size;
+    return 0;
+}
+
+static void assert_unused_bits(const struct _el_buffer* p) {
+    if(p->length) {
+        assert((p->buf[p->length-1] & ~(0xff << p->bits_unused)) == 0);
+    } else {
+        assert(p->bits_unused == 0);
+    }
+}
+
+static int _el_buf_cmp(const void *ap, const void *bp) {
+    const struct _el_buffer *a = (const struct _el_buffer *)ap;
+    const struct _el_buffer *b = (const struct _el_buffer *)bp;
+    size_t common_len;
+    int ret = 0;
+
+    if(a->length < b->length)
+        common_len = a->length;
+    else
+        common_len = b->length;
+
+    if (a->buf && b->buf) {
+        ret = memcmp(a->buf, b->buf, common_len);
+    }
+    if(ret == 0) {
+        if(a->length < b->length)
+            ret = -1;
+        else if(a->length > b->length)
+            ret = 1;
+        /* Ignore unused bits. */
+        assert_unused_bits(a);
+        assert_unused_bits(b);
+    }
+
+    return ret;
+}
+
+static void
+SET_OF__encode_sorted_free(struct _el_buffer *el_buf, size_t count) {
+    size_t i;
+
+    for(i = 0; i < count; i++) {
+        FREEMEM(el_buf[i].buf);
+    }
+
+    FREEMEM(el_buf);
+}
+
+enum SET_OF__encode_method {
+    SOES_DER,   /* Distinguished Encoding Rules */
+    SOES_CUPER  /* Canonical Unaligned Packed Encoding Rules */
+};
+
+static struct _el_buffer *
+SET_OF__encode_sorted(const asn_TYPE_member_t *elm,
+                      const asn_anonymous_set_ *list,
+                      enum SET_OF__encode_method method) {
+    struct _el_buffer *encoded_els;
+    int edx;
+
+    encoded_els =
+        (struct _el_buffer *)CALLOC(list->count, sizeof(encoded_els[0]));
+    if(encoded_els == NULL) {
+        return NULL;
+    }
+
+	/*
+	 * Encode all members.
+	 */
+    for(edx = 0; edx < list->count; edx++) {
+        const void *memb_ptr = list->array[edx];
+        struct _el_buffer *encoding_el = &encoded_els[edx];
+        asn_enc_rval_t erval = {0,0,0};
+
+        if(!memb_ptr) break;
+
+        /*
+		 * Encode the member into the prepared space.
+		 */
+        switch(method) {
+        case SOES_DER:
+            erval = elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag,
+                                               _el_addbytes, encoding_el);
+            break;
+        case SOES_CUPER:
+            erval = uper_encode(elm->type,
+                                elm->encoding_constraints.per_constraints,
+                                memb_ptr, _el_addbytes, encoding_el);
+            if(erval.encoded != -1) {
+                size_t extra_bits = erval.encoded % 8;
+                assert(encoding_el->length == (size_t)(erval.encoded + 7) / 8);
+                encoding_el->bits_unused = (8 - extra_bits) & 0x7;
+            }
+            break;
+        default:
+            assert(!"Unreachable");
+            break;
+        }
+        if(erval.encoded < 0) break;
+	}
+
+    if(edx == list->count) {
+        /*
+         * Sort the encoded elements according to their encoding.
+         */
+        qsort(encoded_els, list->count, sizeof(encoded_els[0]), _el_buf_cmp);
+
+        return encoded_els;
+    } else {
+        SET_OF__encode_sorted_free(encoded_els, edx);
+        return NULL;
+    }
+}
+
+
+/*
+ * The DER encoder of the SET OF type.
+ */
+asn_enc_rval_t
+SET_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+    size_t computed_size = 0;
+    ssize_t encoding_size = 0;
+    struct _el_buffer *encoded_els;
+    int edx;
+
+	ASN_DEBUG("Estimating size for SET OF %s", td->name);
+
+    /*
+     * Gather the length of the underlying members sequence.
+     */
+    for(edx = 0; edx < list->count; edx++) {
+        void *memb_ptr = list->array[edx];
+        asn_enc_rval_t erval = {0,0,0};
+
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+
+        erval =
+            elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag, 0, 0);
+        if(erval.encoded == -1) return erval;
+        computed_size += erval.encoded;
+	}
+
+
+    /*
+     * Encode the TLV for the sequence itself.
+     */
+    encoding_size =
+        der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key);
+    if(encoding_size < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    computed_size += encoding_size;
+
+    if(!cb || list->count == 0) {
+        asn_enc_rval_t erval = {0,0,0};
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    }
+
+    ASN_DEBUG("Encoding members of %s SET OF", td->name);
+
+    /*
+     * DER mandates dynamic sorting of the SET OF elements
+     * according to their encodings. Build an array of the
+     * encoded elements.
+     */
+    encoded_els = SET_OF__encode_sorted(elm, list, SOES_DER);
+
+    /*
+     * Report encoded elements to the application.
+     * Dispose of temporary sorted members table.
+     */
+    for(edx = 0; edx < list->count; edx++) {
+        struct _el_buffer *encoded_el = &encoded_els[edx];
+        /* Report encoded chunks to the application */
+        if(cb(encoded_el->buf, encoded_el->length, app_key) < 0) {
+            break;
+        } else {
+            encoding_size += encoded_el->length;
+        }
+    }
+
+    SET_OF__encode_sorted_free(encoded_els, list->count);
+
+    if(edx == list->count) {
+        asn_enc_rval_t erval = {0,0,0};
+        assert(computed_size == (size_t)encoding_size);
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    } else {
+        ASN__ENCODE_FAILED;
+    }
+}
+
+#undef	XER_ADVANCE
+#define	XER_ADVANCE(num_bytes)	do {			\
+		size_t num = num_bytes;			\
+		buf_ptr = ((const char *)buf_ptr) + num;\
+		size -= num;				\
+		consumed_myself += num;			\
+	} while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const char *opt_mname, const void *buf_ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *element = td->elements;
+	const char *elm_tag;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * ... and parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval = {RC_OK, 0};/* Return value from a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/* Which tag is expected for the downstream */
+	if(specs->as_XMLValueList) {
+		elm_tag = (specs->as_XMLValueList == 1) ? 0 : "";
+	} else {
+		elm_tag = (*element->name)
+				? element->name : element->type->xml_tag;
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 */
+	for(; ctx->phase <= 2;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+
+		/*
+		 * Go inside the inner member of a set.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval = {RC_OK, 0};
+
+			/* Invoke the inner type decoder, m.b. multiple times */
+			ASN_DEBUG("XER/SET OF element [%s]", elm_tag);
+			tmprval = element->type->op->xer_decoder(opt_codec_ctx,
+					element->type, &ctx->ptr, elm_tag,
+					buf_ptr, size);
+			if(tmprval.code == RC_OK) {
+				asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+				if(ASN_SET_ADD(list, ctx->ptr) != 0)
+					RETURN(RC_FAIL);
+				ctx->ptr = 0;
+				XER_ADVANCE(tmprval.consumed);
+			} else {
+				XER_ADVANCE(tmprval.consumed);
+				RETURN(tmprval.code);
+			}
+			ctx->phase = 1;	/* Back to body processing */
+			ASN_DEBUG("XER/SET OF phase => %d", ctx->phase);
+			/* Fall through */
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context,
+			buf_ptr, size, &ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+            case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s",
+			tcv, ctx->phase, xml_tag);
+		switch(tcv) {
+		case XCT_CLOSING:
+			if(ctx->phase == 0) break;
+			ctx->phase = 0;
+			/* Fall through */
+		case XCT_BOTH:
+			if(ctx->phase == 0) {
+				/* No more things to decode */
+				XER_ADVANCE(ch_size);
+				ctx->phase = 3;	/* Phase out */
+				RETURN(RC_OK);
+			}
+			/* Fall through */
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase);
+			if(ctx->phase == 1) {
+				/*
+				 * Process a single possible member.
+				 */
+				ctx->phase = 2;
+				continue;
+			}
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag in SET OF");
+		break;
+	}
+
+	ctx->phase = 3;	/* "Phase out" on hard failure */
+	RETURN(RC_FAIL);
+}
+
+
+
+typedef struct xer_tmp_enc_s {
+	void *buffer;
+	size_t offset;
+	size_t size;
+} xer_tmp_enc_t;
+static int
+SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) {
+	xer_tmp_enc_t *t = (xer_tmp_enc_t *)key;
+	if(t->offset + size >= t->size) {
+		size_t newsize = (t->size << 2) + size;
+		void *p = REALLOC(t->buffer, newsize);
+		if(!p) return -1;
+		t->buffer = p;
+		t->size = newsize;
+	}
+	memcpy((char *)t->buffer + t->offset, buffer, size);
+	t->offset += size;
+	return 0;
+}
+static int
+SET_OF_xer_order(const void *aptr, const void *bptr) {
+	const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr;
+	const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr;
+	size_t minlen = a->offset;
+	int ret;
+	if(b->offset < minlen) minlen = b->offset;
+	/* Well-formed UTF-8 has this nice lexicographical property... */
+	ret = memcmp(a->buffer, b->buffer, minlen);
+	if(ret != 0) return ret;
+	if(a->offset == b->offset)
+		return 0;
+	if(a->offset == minlen)
+		return -1;
+	return 1;
+}
+
+
+asn_enc_rval_t
+SET_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                  enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+    const char *mname = specs->as_XMLValueList
+		? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag);
+	size_t mlen = mname ? strlen(mname) : 0;
+	int xcan = (flags & XER_F_CANONICAL);
+	xer_tmp_enc_t *encs = 0;
+	size_t encs_count = 0;
+	void *original_app_key = app_key;
+	asn_app_consume_bytes_f *original_cb = cb;
+	int i;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	if(xcan) {
+		encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0]));
+		if(!encs) ASN__ENCODE_FAILED;
+		cb = SET_OF_encode_xer_callback;
+	}
+
+	er.encoded = 0;
+
+	for(i = 0; i < list->count; i++) {
+		asn_enc_rval_t tmper = {0,0,0};
+
+		void *memb_ptr = list->array[i];
+		if(!memb_ptr) continue;
+
+		if(encs) {
+			memset(&encs[encs_count], 0, sizeof(encs[0]));
+			app_key = &encs[encs_count];
+			encs_count++;
+		}
+
+		if(mname) {
+			if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+			ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+		}
+
+		if(!xcan && specs->as_XMLValueList == 1)
+			ASN__TEXT_INDENT(1, ilevel + 1);
+		tmper = elm->type->op->xer_encoder(elm->type, memb_ptr,
+				ilevel + (specs->as_XMLValueList != 2),
+				flags, cb, app_key);
+		if(tmper.encoded == -1) return tmper;
+		er.encoded += tmper.encoded;
+		if(tmper.encoded == 0 && specs->as_XMLValueList) {
+			const char *name = elm->type->xml_tag;
+			size_t len = strlen(name);
+			ASN__CALLBACK3("<", 1, name, len, "/>", 2);
+		}
+
+		if(mname) {
+			ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+		}
+
+	}
+
+	if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	if(encs) {
+		xer_tmp_enc_t *enc = encs;
+		xer_tmp_enc_t *end = encs + encs_count;
+		ssize_t control_size = 0;
+
+		er.encoded = 0;
+		cb = original_cb;
+		app_key = original_app_key;
+		qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order);
+
+		for(; enc < end; enc++) {
+			ASN__CALLBACK(enc->buffer, enc->offset);
+			FREEMEM(enc->buffer);
+			enc->buffer = 0;
+			control_size += enc->offset;
+		}
+		assert(control_size == er.encoded);
+	}
+
+	goto cleanup;
+cb_failed:
+	ASN__ENCODE_FAILED;
+cleanup:
+	if(encs) {
+		size_t n;
+		for(n = 0; n < encs_count; n++) {
+			FREEMEM(encs[n].buffer);
+		}
+		FREEMEM(encs);
+	}
+	ASN__ENCODED_OK(er);
+}
+
+int
+SET_OF_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+             asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_TYPE_member_t *elm = td->elements;
+	const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+	int ret;
+	int i;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/* Dump preamble */
+	if(cb(td->name, strlen(td->name), app_key) < 0
+	|| cb(" ::= {", 6, app_key) < 0)
+		return -1;
+
+	for(i = 0; i < list->count; i++) {
+		const void *memb_ptr = list->array[i];
+		if(!memb_ptr) continue;
+
+		_i_INDENT(1);
+
+		ret = elm->type->op->print_struct(elm->type, memb_ptr,
+			ilevel + 1, cb, app_key);
+		if(ret) return ret;
+	}
+
+	ilevel--;
+	_i_INDENT(1);
+
+	return (cb("}", 1, app_key) < 0) ? -1 : 0;
+}
+
+void
+SET_OF_free(const asn_TYPE_descriptor_t *td, void *ptr,
+            enum asn_struct_free_method method) {
+    if(td && ptr) {
+		const asn_SET_OF_specifics_t *specs;
+		asn_TYPE_member_t *elm = td->elements;
+		asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr);
+		asn_struct_ctx_t *ctx;	/* Decoder context */
+		int i;
+
+		/*
+		 * Could not use set_of_empty() because of (*free)
+		 * incompatibility.
+		 */
+		for(i = 0; i < list->count; i++) {
+			void *memb_ptr = list->array[i];
+			if(memb_ptr)
+			ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		}
+		list->count = 0;	/* No meaningful elements left */
+
+		asn_set_empty(list);	/* Remove (list->array) */
+
+		specs = (const asn_SET_OF_specifics_t *)td->specifics;
+		ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
+		if(ctx->ptr) {
+			ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+			ctx->ptr = 0;
+		}
+
+        switch(method) {
+        case ASFM_FREE_EVERYTHING:
+            FREEMEM(ptr);
+            break;
+        case ASFM_FREE_UNDERLYING:
+            break;
+        case ASFM_FREE_UNDERLYING_AND_RESET:
+            memset(ptr, 0, specs->struct_size);
+            break;
+        }
+    }
+}
+
+int
+SET_OF_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const asn_TYPE_member_t *elm = td->elements;
+	asn_constr_check_f *constr;
+	const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+	int i;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	constr = elm->encoding_constraints.general_constraints;
+	if(!constr) constr = elm->type->encoding_constraints.general_constraints;
+
+	/*
+	 * Iterate over the members of an array.
+	 * Validate each in turn, until one fails.
+	 */
+	for(i = 0; i < list->count; i++) {
+		const void *memb_ptr = list->array[i];
+		int ret;
+
+		if(!memb_ptr) continue;
+
+		ret = constr(elm->type, memb_ptr, ctfailcb, app_key);
+		if(ret) return ret;
+	}
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    asn_dec_rval_t rv = {RC_OK, 0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements; /* Single one */
+    void *st = *sptr;
+	asn_anonymous_set_ *list;
+	const asn_per_constraint_t *ct;
+	int repeat = 0;
+	ssize_t nelems;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}                                                                       
+	list = _A_SET_FROM_VOID(st);
+
+	/* Figure out which constraints to use */
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted! */
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+		nelems = per_get_few_bits(pd, ct->effective_bits);
+		ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
+			(long)nelems, ct->lower_bound, td->name);
+		if(nelems < 0)  ASN__DECODE_STARVED;
+		nelems += ct->lower_bound;
+	} else {
+		nelems = -1;
+	}
+
+	do {
+		int i;
+		if(nelems < 0) {
+			nelems = uper_get_length(pd, -1, 0, &repeat);
+            ASN_DEBUG("Got to decode %" ASN_PRI_SSIZE " elements (eff %d)",
+                      nelems, (int)(ct ? ct->effective_bits : -1));
+            if(nelems < 0) ASN__DECODE_STARVED;
+		}
+
+		for(i = 0; i < nelems; i++) {
+			void *ptr = 0;
+			ASN_DEBUG("SET OF %s decoding", elm->type->name);
+			rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+				elm->encoding_constraints.per_constraints, &ptr, pd);
+			ASN_DEBUG("%s SET OF %s decoded %d, %p",
+				td->name, elm->type->name, rv.code, ptr);
+			if(rv.code == RC_OK) {
+				if(ASN_SET_ADD(list, ptr) == 0) {
+                    if(rv.consumed == 0 && nelems > 200) {
+                        /* Protect from SET OF NULL compression bombs. */
+                        ASN__DECODE_FAILED;
+                    }
+					continue;
+                }
+				ASN_DEBUG("Failed to add element into %s",
+					td->name);
+				/* Fall through */
+				rv.code = RC_FAIL;
+			} else {
+				ASN_DEBUG("Failed decoding %s of %s (SET OF)",
+					elm->type->name, td->name);
+			}
+			if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
+			return rv;
+		}
+
+		nelems = -1;	/* Allow uper_get_length() */
+	} while(repeat);
+
+	ASN_DEBUG("Decoded %s as SET OF", td->name);
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+asn_enc_rval_t
+SET_OF_encode_uper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+    const asn_anonymous_set_ *list;
+    const asn_per_constraint_t *ct;
+    const asn_TYPE_member_t *elm = td->elements;
+    struct _el_buffer *encoded_els;
+    asn_enc_rval_t er = {0,0,0};
+    size_t encoded_edx;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    list = _A_CSET_FROM_VOID(sptr);
+
+    er.encoded = 0;
+
+    ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
+
+    if(constraints) ct = &constraints->size;
+    else if(td->encoding_constraints.per_constraints)
+        ct = &td->encoding_constraints.per_constraints->size;
+    else ct = 0;
+
+    /* If extensible constraint, check if size is in root */
+    if(ct) {
+        int not_in_root =
+            (list->count < ct->lower_bound || list->count > ct->upper_bound);
+        ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
+                  ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+        if(ct->flags & APC_EXTENSIBLE) {
+            /* Declare whether size is in extension root */
+            if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED;
+            if(not_in_root) ct = 0;
+        } else if(not_in_root && ct->effective_bits >= 0) {
+            ASN__ENCODE_FAILED;
+        }
+
+    }
+
+    if(ct && ct->effective_bits >= 0) {
+        /* X.691, #19.5: No length determinant */
+        if(per_put_few_bits(po, list->count - ct->lower_bound,
+                            ct->effective_bits))
+            ASN__ENCODE_FAILED;
+    } else if(list->count == 0) {
+        /* When the list is empty add only the length determinant
+         * X.691, #20.6 and #11.9.4.1
+         */
+        if (uper_put_length(po, 0, 0)) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+
+    /*
+     * Canonical UPER #22.1 mandates dynamic sorting of the SET OF elements
+     * according to their encodings. Build an array of the encoded elements.
+     */
+    encoded_els = SET_OF__encode_sorted(elm, list, SOES_CUPER);
+
+    for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) {
+        ssize_t may_encode;
+        size_t edx;
+        int need_eom = 0;
+
+        if(ct && ct->effective_bits >= 0) {
+            may_encode = list->count;
+        } else {
+            may_encode =
+                uper_put_length(po, list->count - encoded_edx, &need_eom);
+            if(may_encode < 0) ASN__ENCODE_FAILED;
+        }
+
+        for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) {
+            const struct _el_buffer *el = &encoded_els[edx];
+            if(asn_put_many_bits(po, el->buf,
+                                 (8 * el->length) - el->bits_unused) < 0) {
+                break;
+            }
+        }
+
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+
+        encoded_edx += may_encode;
+    }
+
+    SET_OF__encode_sorted_free(encoded_els, list->count);
+
+    if((ssize_t)encoded_edx == list->count) {
+        ASN__ENCODED_OK(er);
+    } else {
+        ASN__ENCODE_FAILED;
+    }
+}
+
+asn_dec_rval_t
+SET_OF_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv = {RC_OK, 0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm = td->elements; /* Single one */
+	void *st = *sptr;
+	asn_anonymous_set_ *list;
+	const asn_per_constraint_t *ct;
+	int repeat = 0;
+	ssize_t nelems;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+	list = _A_SET_FROM_VOID(st);
+
+	/* Figure out which constraints to use */
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted! */
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+		nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
+		ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
+		          (long)nelems, ct->lower_bound, td->name);
+		if(nelems < 0)  ASN__DECODE_STARVED;
+		nelems += ct->lower_bound;
+	} else {
+		nelems = -1;
+	}
+
+	do {
+		int i;
+		if(nelems < 0) {
+			nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1,
+			                         ct ? ct->effective_bits : -1, &repeat);
+			ASN_DEBUG("Got to decode %d elements (eff %d)",
+			          (int)nelems, (int)(ct ? ct->effective_bits : -1));
+			if(nelems < 0) ASN__DECODE_STARVED;
+		}
+
+		for(i = 0; i < nelems; i++) {
+			void *ptr = 0;
+			ASN_DEBUG("SET OF %s decoding", elm->type->name);
+			rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+			                                 elm->encoding_constraints.per_constraints, &ptr, pd);
+			ASN_DEBUG("%s SET OF %s decoded %d, %p",
+			          td->name, elm->type->name, rv.code, ptr);
+			if(rv.code == RC_OK) {
+				if(ASN_SET_ADD(list, ptr) == 0)
+					continue;
+				ASN_DEBUG("Failed to add element into %s",
+				          td->name);
+				/* Fall through */
+				rv.code = RC_FAIL;
+			} else {
+				ASN_DEBUG("Failed decoding %s of %s (SET OF)",
+				          elm->type->name, td->name);
+			}
+			if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
+			return rv;
+		}
+
+		nelems = -1;	/* Allow uper_get_length() */
+	} while(repeat);
+
+	ASN_DEBUG("Decoded %s as SET OF", td->name);
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+struct comparable_ptr {
+    const asn_TYPE_descriptor_t *td;
+    const void *sptr;
+};
+
+static int
+SET_OF__compare_cb(const void *aptr, const void *bptr) {
+    const struct comparable_ptr *a = aptr;
+    const struct comparable_ptr *b = bptr;
+    assert(a->td == b->td);
+    return a->td->op->compare_struct(a->td, a->sptr, b->sptr);
+}
+
+int
+SET_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+               const void *bptr) {
+    const asn_anonymous_set_ *a = _A_CSET_FROM_VOID(aptr);
+    const asn_anonymous_set_ *b = _A_CSET_FROM_VOID(bptr);
+
+    if(a && b) {
+        struct comparable_ptr *asorted;
+        struct comparable_ptr *bsorted;
+        ssize_t common_length;
+        ssize_t idx;
+
+        if(a->count == 0) {
+            if(b->count) return -1;
+            return 0;
+        } else if(b->count == 0) {
+            return 1;
+        }
+
+        asorted = MALLOC(a->count * sizeof(asorted[0]));
+        bsorted = MALLOC(b->count * sizeof(bsorted[0]));
+        if(!asorted || !bsorted) {
+            FREEMEM(asorted);
+            FREEMEM(bsorted);
+            return -1;
+        }
+
+        for(idx = 0; idx < a->count; idx++) {
+            asorted[idx].td = td->elements->type;
+            asorted[idx].sptr = a->array[idx];
+        }
+
+        for(idx = 0; idx < b->count; idx++) {
+            bsorted[idx].td = td->elements->type;
+            bsorted[idx].sptr = b->array[idx];
+        }
+
+        qsort(asorted, a->count, sizeof(asorted[0]), SET_OF__compare_cb);
+        qsort(bsorted, b->count, sizeof(bsorted[0]), SET_OF__compare_cb);
+
+        common_length = (a->count < b->count ? a->count : b->count);
+        for(idx = 0; idx < common_length; idx++) {
+            int ret = td->elements->type->op->compare_struct(
+                td->elements->type, asorted[idx].sptr, bsorted[idx].sptr);
+            if(ret) {
+                FREEMEM(asorted);
+                FREEMEM(bsorted);
+                return ret;
+            }
+        }
+
+        FREEMEM(asorted);
+        FREEMEM(bsorted);
+
+        if(idx < b->count) /* more elements in b */
+            return -1;     /* a is shorter, so put it first */
+        if(idx < a->count) return 1;
+    } else if(!a) {
+        return -1;
+    } else if(!b) {
+        return 1;
+    }
+
+	return 0;
+}
+
+
+asn_TYPE_operation_t asn_OP_SET_OF = {
+	SET_OF_free,
+	SET_OF_print,
+	SET_OF_compare,
+	SET_OF_decode_ber,
+	SET_OF_encode_der,
+	SET_OF_decode_xer,
+	SET_OF_encode_xer,
+#ifdef ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SET_OF_decode_oer,
+	SET_OF_encode_oer,
+#endif
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SET_OF_decode_uper,
+	SET_OF_encode_uper,
+	SET_OF_decode_aper,
+	0,	/* SET_OF_encode_aper */
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SET_OF_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
+
+asn_random_fill_result_t
+SET_OF_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constraints,
+                   size_t max_length) {
+    const asn_SET_OF_specifics_t *specs =
+        (const asn_SET_OF_specifics_t *)td->specifics;
+    asn_random_fill_result_t res_ok = {ARFILL_OK, 0};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    const asn_TYPE_member_t *elm = td->elements;
+    void *st = *sptr;
+    long max_elements = 5;
+    long slb = 0;   /* Lower size bound */
+    long sub = 0;   /* Upper size bound */
+    size_t rnd_len;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (*sptr = CALLOC(1, specs->struct_size));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    switch(asn_random_between(0, 6)) {
+    case 0: max_elements = 0; break;
+    case 1: max_elements = 1; break;
+    case 2: max_elements = 5; break;
+    case 3: max_elements = max_length; break;
+    case 4: max_elements = max_length / 2; break;
+    case 5: max_elements = max_length / 4; break;
+    default: break;
+    }
+    sub = slb + max_elements;
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_SEMI_CONSTRAINED) {
+            slb = pc->lower_bound;
+            sub = pc->lower_bound + max_elements;
+        } else if(pc->flags & APC_CONSTRAINED) {
+            slb = pc->lower_bound;
+            sub = pc->upper_bound;
+            if(sub - slb > max_elements) sub = slb + max_elements;
+        }
+    }
+
+    /* Bias towards edges of allowed space */
+    switch(asn_random_between(-1, 4)) {
+    default:
+    case -1:
+        /* Prepare lengths somewhat outside of constrained range. */
+        if(constraints->per_constraints
+           && (constraints->per_constraints->size.flags & APC_EXTENSIBLE)) {
+            switch(asn_random_between(0, 5)) {
+            default:
+            case 0:
+                rnd_len = 0;
+                break;
+            case 1:
+                if(slb > 0) {
+                    rnd_len = slb - 1;
+                } else {
+                    rnd_len = 0;
+                }
+                break;
+            case 2:
+                rnd_len = asn_random_between(0, slb);
+                break;
+            case 3:
+                if(sub < (ssize_t)max_length) {
+                    rnd_len = sub + 1;
+                } else {
+                    rnd_len = max_length;
+                }
+                break;
+            case 4:
+                if(sub < (ssize_t)max_length) {
+                    rnd_len = asn_random_between(sub + 1, max_length);
+                } else {
+                    rnd_len = max_length;
+                }
+                break;
+            case 5:
+                rnd_len = max_length;
+                break;
+            }
+            break;
+        }
+        /* Fall through */
+    case 0:
+        rnd_len = asn_random_between(slb, sub);
+        break;
+    case 1:
+        if(slb < sub) {
+            rnd_len = asn_random_between(slb + 1, sub);
+            break;
+        }
+        /* Fall through */
+    case 2:
+        rnd_len = asn_random_between(slb, slb);
+        break;
+    case 3:
+        if(slb < sub) {
+            rnd_len = asn_random_between(slb, sub - 1);
+            break;
+        }
+        /* Fall through */
+    case 4:
+        rnd_len = asn_random_between(sub, sub);
+        break;
+    }
+
+    for(; rnd_len > 0; rnd_len--) {
+        asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+        void *ptr = 0;
+        asn_random_fill_result_t tmpres = elm->type->op->random_fill(
+            elm->type, &ptr, &elm->encoding_constraints,
+            (max_length > res_ok.length ? max_length - res_ok.length : 0)
+                / rnd_len);
+        switch(tmpres.code) {
+        case ARFILL_OK:
+            ASN_SET_ADD(list, ptr);
+            res_ok.length += tmpres.length;
+            break;
+        case ARFILL_SKIPPED:
+            break;
+        case ARFILL_FAILED:
+            assert(ptr == 0);
+            return tmpres;
+        }
+    }
+
+    return res_ok;
+}
+
diff --git a/e2sm/lib/constr_SET_OF_oer.c b/e2sm/lib/constr_SET_OF_oer.c
new file mode 100644
index 0000000..5200518
--- /dev/null
+++ b/e2sm/lib/constr_SET_OF_oer.c
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_SET_OF.h>
+#include <asn_SET_OF.h>
+#include <errno.h>
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef  ADVANCE
+#define ADVANCE(num_bytes)                   \
+    do {                                     \
+        size_t num = num_bytes;              \
+        ptr = ((const char *)ptr) + num;     \
+        size -= num;                         \
+        consumed_myself += num;              \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+#undef  SET_PHASE
+#define SET_PHASE(ctx, value) \
+    do {                      \
+        ctx->phase = value;   \
+        ctx->step = 0;        \
+    } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)                    \
+    do {                                 \
+        asn_dec_rval_t rval;             \
+        rval.code = _code;               \
+        rval.consumed = consumed_myself; \
+        return rval;                     \
+    } while(0)
+
+/*
+ * The SEQUENCE OF and SET OF values utilize a "quantity field".
+ * It is is a pointless combination of #8.6 (length determinant, capable
+ * of encoding tiny and huge numbers in the shortest possible number of octets)
+ * and the variable sized integer. What could have been encoded by #8.6 alone
+ * is required to be encoded by #8.6 followed by that number of unsigned octets.
+ * This doesn't make too much sense. It seems that the original version of OER
+ * standard have been using the unconstrained unsigned integer as a quantity
+ * field, and this legacy have gone through ISO/ITU-T standardization process.
+ */
+static ssize_t
+oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) {
+    const uint8_t *b;
+    const uint8_t *bend;
+    size_t len = 0;
+    size_t qty;
+
+    ssize_t len_len = oer_fetch_length(ptr, size, &len);
+    if(len_len <= 0) {
+        *qty_r = 0;
+        return len_len;
+    }
+
+    if((len_len + len) > size) {
+        *qty_r = 0;
+        return 0;
+    }
+
+    b = (const uint8_t *)ptr + len_len;
+    bend = b + len;
+
+    /* Skip the leading 0-bytes */
+    for(; b < bend && *b == 0; b++) {
+    }
+
+    if((bend - b) > (ssize_t)sizeof(size_t)) {
+        /* Length is not representable by the native size_t type */
+        *qty_r = 0;
+        return -1;
+    }
+
+    for(qty = 0; b < bend; b++) {
+        qty = (qty << 8) + *b;
+    }
+
+    if(qty > RSIZE_MAX) { /* A bit of C11 validation */
+        *qty_r = 0;
+        return -1;
+    }
+
+    *qty_r = qty;
+    assert((size_t)len_len + len == (size_t)(bend - (const uint8_t *)ptr));
+    return len_len + len;
+}
+
+asn_dec_rval_t
+SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *ptr, size_t size) {
+    const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    void *st = *struct_ptr; /* Target structure */
+    asn_struct_ctx_t *ctx; /* Decoder context */
+    size_t consumed_myself = 0; /* Consumed bytes from ptr. */
+
+    (void)constraints;
+
+    if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+        ASN__DECODE_FAILED;
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+    /*
+     * Start to parse where left previously.
+     */
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Fetch number of elements to decode.
+         */
+        size_t length = 0;
+        size_t len_size = oer_fetch_quantity(ptr, size, &length);
+        switch(len_size) {
+        case 0:
+            RETURN(RC_WMORE);
+        case -1:
+            RETURN(RC_FAIL);
+        default:
+            ADVANCE(len_size);
+            ctx->left = length;
+        }
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 1: {
+        /* Decode components of the extension root */
+        asn_TYPE_member_t *elm = td->elements;
+        asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+        const void *base_ptr = ptr;
+        ber_tlv_len_t base_ctx_left = ctx->left;
+
+        assert(td->elements_count == 1);
+
+        ASN_DEBUG("OER SET OF %s Decoding PHASE 1", td->name);
+
+        for(; ctx->left > 0; ctx->left--) {
+            asn_dec_rval_t rv = elm->type->op->oer_decoder(
+                opt_codec_ctx, elm->type,
+                elm->encoding_constraints.oer_constraints, &ctx->ptr, ptr,
+                size);
+            ADVANCE(rv.consumed);
+            switch(rv.code) {
+            case RC_OK:
+                if(ASN_SET_ADD(list, ctx->ptr) != 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    ctx->ptr = 0;
+                    /*
+                     * This check is to avoid compression bomb with
+                     * specs like SEQUENCE/SET OF NULL which don't
+                     * consume data at all.
+                     */
+                    if(rv.consumed == 0 && base_ptr == ptr
+                       && (base_ctx_left - ctx->left) > 200) {
+                        ASN__DECODE_FAILED;
+                    }
+                    break;
+                }
+            case RC_WMORE:
+                RETURN(RC_WMORE);
+            case RC_FAIL:
+                ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+                ctx->ptr = 0;
+                SET_PHASE(ctx, 3);
+                RETURN(RC_FAIL);
+            }
+        }
+        /* Decoded decently. */
+        NEXT_PHASE(ctx);
+    }
+        /* Fall through */
+    case 2:
+        /* Ignore fully decoded */
+        assert(ctx->left == 0);
+        RETURN(RC_OK);
+    case 3:
+        /* Failed to decode. */
+        RETURN(RC_FAIL);
+    }
+
+    return rval;
+}
+
+static ssize_t
+oer_put_quantity(size_t qty, asn_app_consume_bytes_f *cb, void *app_key) {
+    uint8_t buf[1 + sizeof(size_t)];
+    uint8_t *b = &buf[sizeof(size_t)]; /* Last addressable */
+    size_t encoded;
+
+    do {
+        *b-- = qty;
+        qty >>= 8;
+    } while(qty);
+
+    *b = sizeof(buf) - (b-buf) - 1;
+    encoded = sizeof(buf) - (b-buf);
+    if(cb(b, encoded, app_key) < 0)
+        return -1;
+    return encoded;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+SET_OF_encode_oer(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_TYPE_member_t *elm;
+    const asn_anonymous_set_ *list;
+    size_t computed_size = 0;
+    ssize_t qty_len;
+    int n;
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    elm = td->elements;
+    list = _A_CSET_FROM_VOID(sptr);
+
+    qty_len = oer_put_quantity(list->count, cb, app_key);
+    if(qty_len < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    computed_size += qty_len;
+
+    for(n = 0; n < list->count; n++) {
+        void *memb_ptr = list->array[n];
+        asn_enc_rval_t er = {0,0,0};
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded < 0) {
+            return er;
+        } else {
+            computed_size += er.encoded;
+        }
+    }
+
+    {
+        asn_enc_rval_t erval = {0,0,0};
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2sm/lib/constr_TYPE.c b/e2sm/lib/constr_TYPE.c
new file mode 100644
index 0000000..aefaefd
--- /dev/null
+++ b/e2sm/lib/constr_TYPE.c
@@ -0,0 +1,80 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_TYPE.h>
+#include <errno.h>
+
+/*
+ * Version of the ASN.1 infrastructure shipped with compiler.
+ */
+int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; }
+
+static asn_app_consume_bytes_f _print2fp;
+
+/*
+ * Return the outmost tag of the type.
+ */
+ber_tlv_tag_t
+asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor,
+		const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) {
+
+	if(tag_mode)
+		return tag;
+
+	if(type_descriptor->tags_count)
+		return type_descriptor->tags[0];
+
+	return type_descriptor->op->outmost_tag(type_descriptor, struct_ptr, 0, 0);
+}
+
+/*
+ * Print the target language's structure in human readable form.
+ */
+int
+asn_fprint(FILE *stream, const asn_TYPE_descriptor_t *td,
+           const void *struct_ptr) {
+    if(!stream) stream = stdout;
+    if(!td || !struct_ptr) {
+        errno = EINVAL;
+        return -1;
+	}
+
+	/* Invoke type-specific printer */
+    if(td->op->print_struct(td, struct_ptr, 1, _print2fp, stream)) {
+        return -1;
+    }
+
+    /* Terminate the output */
+    if(_print2fp("\n", 1, stream)) {
+        return -1;
+    }
+
+    return fflush(stream);
+}
+
+/* Dump the data into the specified stdio stream */
+static int
+_print2fp(const void *buffer, size_t size, void *app_key) {
+	FILE *stream = (FILE *)app_key;
+
+	if(fwrite(buffer, 1, size, stream) != size)
+		return -1;
+
+	return 0;
+}
+
+
+/*
+ * Some compilers do not support variable args macros.
+ * This function is a replacement of ASN_DEBUG() macro.
+ */
+void ASN_DEBUG_f(const char *fmt, ...);
+void ASN_DEBUG_f(const char *fmt, ...) {
+	va_list ap;
+	va_start(ap, fmt);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, "\n");
+	va_end(ap);
+}
diff --git a/e2sm/lib/constraints.c b/e2sm/lib/constraints.c
new file mode 100644
index 0000000..df3c6c1
--- /dev/null
+++ b/e2sm/lib/constraints.c
@@ -0,0 +1,93 @@
+#include <asn_internal.h>
+#include <constraints.h>
+
+int
+asn_generic_no_constraint(const asn_TYPE_descriptor_t *type_descriptor,
+                          const void *struct_ptr,
+                          asn_app_constraint_failed_f *cb, void *key) {
+    (void)type_descriptor;	/* Unused argument */
+	(void)struct_ptr;	/* Unused argument */
+	(void)cb;	/* Unused argument */
+	(void)key;	/* Unused argument */
+
+	/* Nothing to check */
+	return 0;
+}
+
+int
+asn_generic_unknown_constraint(const asn_TYPE_descriptor_t *type_descriptor,
+                               const void *struct_ptr,
+                               asn_app_constraint_failed_f *cb, void *key) {
+    (void)type_descriptor;	/* Unused argument */
+	(void)struct_ptr;	/* Unused argument */
+	(void)cb;	/* Unused argument */
+	(void)key;	/* Unused argument */
+
+	/* Unknown how to check */
+	return 0;
+}
+
+struct errbufDesc {
+    const asn_TYPE_descriptor_t *failed_type;
+    const void *failed_struct_ptr;
+	char *errbuf;
+	size_t errlen;
+};
+
+static void
+_asn_i_ctfailcb(void *key, const asn_TYPE_descriptor_t *td, const void *sptr,
+                const char *fmt, ...) {
+    struct errbufDesc *arg = key;
+	va_list ap;
+	ssize_t vlen;
+	ssize_t maxlen;
+
+	arg->failed_type = td;
+	arg->failed_struct_ptr = sptr;
+
+	maxlen = arg->errlen;
+	if(maxlen <= 0)
+		return;
+
+	va_start(ap, fmt);
+	vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap);
+	va_end(ap);
+	if(vlen >= maxlen) {
+		arg->errbuf[maxlen-1] = '\0';	/* Ensuring libc correctness */
+		arg->errlen = maxlen - 1;	/* Not counting termination */
+		return;
+	} else if(vlen >= 0) {
+		arg->errbuf[vlen] = '\0';	/* Ensuring libc correctness */
+		arg->errlen = vlen;		/* Not counting termination */
+	} else {
+		/*
+		 * The libc on this system is broken.
+		 */
+		vlen = sizeof("<broken vsnprintf>") - 1;
+		maxlen--;
+		arg->errlen = vlen < maxlen ? vlen : maxlen;
+		memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
+		arg->errbuf[arg->errlen] = 0;
+	}
+
+	return;
+}
+
+int
+asn_check_constraints(const asn_TYPE_descriptor_t *type_descriptor,
+                      const void *struct_ptr, char *errbuf, size_t *errlen) {
+    struct errbufDesc arg;
+    int ret;
+
+    arg.failed_type = 0;
+    arg.failed_struct_ptr = 0;
+    arg.errbuf = errbuf;
+    arg.errlen = errlen ? *errlen : 0;
+
+    ret = type_descriptor->encoding_constraints.general_constraints(
+        type_descriptor, struct_ptr, _asn_i_ctfailcb, &arg);
+    if(ret == -1 && errlen) *errlen = arg.errlen;
+
+    return ret;
+}
+
diff --git a/e2sm/lib/der_encoder.c b/e2sm/lib/der_encoder.c
new file mode 100644
index 0000000..2c6a6f7
--- /dev/null
+++ b/e2sm/lib/der_encoder.c
@@ -0,0 +1,194 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <errno.h>
+
+static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
+	asn_app_consume_bytes_f *cb, void *app_key, int constructed);
+
+/*
+ * The DER encoder of any type.
+ */
+asn_enc_rval_t
+der_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr,
+           asn_app_consume_bytes_f *consume_bytes, void *app_key) {
+    ASN_DEBUG("DER encoder invoked for %s",
+		type_descriptor->name);
+
+	/*
+	 * Invoke type-specific encoder.
+	 */
+    return type_descriptor->op->der_encoder(
+        type_descriptor, struct_ptr, /* Pointer to the destination structure */
+        0, 0, consume_bytes, app_key);
+}
+
+/*
+ * Argument type and callback necessary for der_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+	void *buffer;
+	size_t left;
+} enc_to_buf_arg;
+static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+	enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+	if(arg->left < size)
+		return -1;	/* Data exceeds the available buffer size */
+
+	memcpy(arg->buffer, buffer, size);
+	arg->buffer = ((char *)arg->buffer) + size;
+	arg->left -= size;
+
+	return 0;
+}
+
+/*
+ * A variant of the der_encode() which encodes the data into the provided buffer
+ */
+asn_enc_rval_t
+der_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor,
+                     const void *struct_ptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg arg;
+	asn_enc_rval_t ec;
+
+	arg.buffer = buffer;
+	arg.left = buffer_size;
+
+	ec = type_descriptor->op->der_encoder(type_descriptor,
+		struct_ptr,	/* Pointer to the destination structure */
+		0, 0, encode_to_buffer_cb, &arg);
+	if(ec.encoded != -1) {
+		assert(ec.encoded == (ssize_t)(buffer_size - arg.left));
+		/* Return the encoded contents size */
+	}
+	return ec;
+}
+
+
+/*
+ * Write out leading TL[v] sequence according to the type definition.
+ */
+ssize_t
+der_write_tags(const asn_TYPE_descriptor_t *sd, size_t struct_length,
+               int tag_mode, int last_tag_form,
+               ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */
+               asn_app_consume_bytes_f *cb, void *app_key) {
+#define ASN1_DER_MAX_TAGS_COUNT 4
+    ber_tlv_tag_t
+        tags_buf_scratch[ASN1_DER_MAX_TAGS_COUNT * sizeof(ber_tlv_tag_t)];
+    ssize_t lens[ASN1_DER_MAX_TAGS_COUNT * sizeof(ssize_t)];
+    const ber_tlv_tag_t *tags; /* Copy of tags stream */
+    int tags_count;            /* Number of tags */
+    size_t overall_length;
+    int i;
+
+    ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)",
+		sd->name, tag_mode, sd->tags_count,
+		ber_tlv_tag_string(tag),
+		tag_mode
+			?(sd->tags_count+1
+				-((tag_mode == -1) && sd->tags_count))
+			:sd->tags_count
+	);
+
+    if(sd->tags_count + 1 > ASN1_DER_MAX_TAGS_COUNT) {
+        ASN_DEBUG("System limit %d on tags count", ASN1_DER_MAX_TAGS_COUNT);
+        return -1;
+    }
+
+	if(tag_mode) {
+		/*
+		 * Instead of doing shaman dance like we do in ber_check_tags(),
+		 * allocate a small array on the stack
+		 * and initialize it appropriately.
+		 */
+		int stag_offset;
+		ber_tlv_tag_t *tags_buf = tags_buf_scratch;
+		tags_count = sd->tags_count
+			+ 1	/* EXPLICIT or IMPLICIT tag is given */
+			- ((tag_mode == -1) && sd->tags_count);
+		/* Copy tags over */
+		tags_buf[0] = tag;
+		stag_offset = -1 + ((tag_mode == -1) && sd->tags_count);
+		for(i = 1; i < tags_count; i++)
+			tags_buf[i] = sd->tags[i + stag_offset];
+		tags = tags_buf;
+	} else {
+		tags = sd->tags;
+		tags_count = sd->tags_count;
+	}
+
+	/* No tags to write */
+	if(tags_count == 0)
+		return 0;
+
+	/*
+	 * Array of tags is initialized.
+	 * Now, compute the size of the TLV pairs, from right to left.
+	 */
+	overall_length = struct_length;
+	for(i = tags_count - 1; i >= 0; --i) {
+		lens[i] = der_write_TL(tags[i], overall_length, 0, 0, 0);
+		if(lens[i] == -1) return -1;
+		overall_length += lens[i];
+		lens[i] = overall_length - lens[i];
+	}
+
+	if(!cb) return overall_length - struct_length;
+
+	ASN_DEBUG("Encoding %s TL sequence (%d elements)", sd->name,
+                  tags_count);
+
+	/*
+	 * Encode the TL sequence for real.
+	 */
+	for(i = 0; i < tags_count; i++) {
+		ssize_t len;
+		int _constr;
+
+		/* Check if this tag happens to be constructed */
+		_constr = (last_tag_form || i < (tags_count - 1));
+
+		len = der_write_TL(tags[i], lens[i], cb, app_key, _constr);
+		if(len == -1) return -1;
+	}
+
+	return overall_length - struct_length;
+}
+
+static ssize_t
+der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
+		asn_app_consume_bytes_f *cb, void *app_key,
+		int constructed) {
+	uint8_t buf[32];
+	size_t size = 0;
+	int buf_size = cb?sizeof(buf):0;
+	ssize_t tmp;
+
+	/* Serialize tag (T from TLV) into possibly zero-length buffer */
+	tmp = ber_tlv_tag_serialize(tag, buf, buf_size);
+	if(tmp == -1 || tmp > (ssize_t)sizeof(buf)) return -1;
+	size += tmp;
+
+	/* Serialize length (L from TLV) into possibly zero-length buffer */
+	tmp = der_tlv_length_serialize(len, buf+size, buf_size?buf_size-size:0);
+	if(tmp == -1) return -1;
+	size += tmp;
+
+	if(size > sizeof(buf))
+		return -1;
+
+	/*
+	 * If callback is specified, invoke it, and check its return value.
+	 */
+	if(cb) {
+		if(constructed) *buf |= 0x20;
+		if(cb(buf, size, app_key) < 0)
+			return -1;
+	}
+
+	return size;
+}
diff --git a/e2sm/lib/oer_decoder.c b/e2sm/lib/oer_decoder.c
new file mode 100644
index 0000000..0701738
--- /dev/null
+++ b/e2sm/lib/oer_decoder.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+
+/*
+ * The OER decoder of any type.
+ */
+asn_dec_rval_t
+oer_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+           const void *ptr, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return type_descriptor->op->oer_decoder(opt_codec_ctx, type_descriptor, 0,
+		struct_ptr,	/* Pointer to the destination structure */
+		ptr, size	/* Buffer and its size */
+		);
+}
+
+/*
+ * Open Type is encoded as a length (#8.6) followed by that number of bytes.
+ * Since we're just skipping, reading the length would be enough.
+ */
+ssize_t
+oer_open_type_skip(const void *bufptr, size_t size) {
+    size_t len = 0;
+    return oer_fetch_length(bufptr, size, &len);
+}
+
+/*
+ * Read the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t
+oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const struct asn_TYPE_descriptor_s *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *bufptr, size_t size) {
+    asn_dec_rval_t dr;
+    size_t container_len = 0;
+    ssize_t len_len;
+    enum asn_struct_free_method dispose_method =
+        (*struct_ptr) ? ASFM_FREE_UNDERLYING_AND_RESET : ASFM_FREE_EVERYTHING;
+
+    /* Get the size of a length determinant */
+    len_len = oer_fetch_length(bufptr, size, &container_len);
+    if(len_len <= 0) {
+        return len_len; /* Error or more data expected */
+    }
+
+    /*
+     * len_len can't be bigger than size, but size without len_len
+     * should be bigger or equal to container length
+     */
+    if(size - len_len < container_len) {
+        /* More data is expected */
+        return 0;
+    }
+
+    dr = td->op->oer_decoder(opt_codec_ctx, td, constraints, struct_ptr,
+                         (const uint8_t *)bufptr + len_len, container_len);
+    if(dr.code == RC_OK) {
+        return len_len + container_len;
+    } else {
+        /* Even if RC_WMORE, we can't get more data into a closed container. */
+        td->op->free_struct(td, *struct_ptr, dispose_method);
+        *struct_ptr = NULL;
+        return -1;
+    }
+}
+
+
+asn_dec_rval_t
+oer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_oer_constraints_t *constraints, void **sptr,
+                     const void *ptr, size_t size) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+    ssize_t len_len;
+
+    (void)td;
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    if(!st) {
+        st = (ASN__PRIMITIVE_TYPE_t *)(*sptr = CALLOC(
+                                           1, sizeof(ASN__PRIMITIVE_TYPE_t)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+
+    /*
+     * X.696 (08/2015) #27.2
+     * Encode length determinant as _number of octets_, but only
+     * if upper bound is not equal to lower bound.
+     */
+    len_len = oer_fetch_length(ptr, size, &expected_length);
+    if(len_len > 0) {
+        rval.consumed = len_len;
+        ptr = (const char *)ptr + len_len;
+        size -= len_len;
+    } else if(len_len == 0) {
+        ASN__DECODE_STARVED;
+    } else if(len_len < 0) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
diff --git a/e2sm/lib/oer_encoder.c b/e2sm/lib/oer_encoder.c
new file mode 100644
index 0000000..a284cc2
--- /dev/null
+++ b/e2sm/lib/oer_encoder.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+
+/*
+ * The OER encoder of any type.
+ */
+asn_enc_rval_t
+oer_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr,
+           asn_app_consume_bytes_f *consume_bytes, void *app_key) {
+    ASN_DEBUG("OER encoder invoked for %s", type_descriptor->name);
+
+    /*
+     * Invoke type-specific encoder.
+     */
+    return type_descriptor->op->oer_encoder(
+        type_descriptor, 0,
+        struct_ptr, /* Pointer to the destination structure */
+        consume_bytes, app_key);
+}
+
+/*
+ * Argument type and callback necessary for oer_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+        void *buffer;
+        size_t left;
+} enc_to_buf_arg;
+static int
+encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+    enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+    if(arg->left < size) return -1; /* Data exceeds the available buffer size */
+
+    memcpy(arg->buffer, buffer, size);
+    arg->buffer = ((char *)arg->buffer) + size;
+    arg->left -= size;
+
+    return 0;
+}
+
+/*
+ * A variant of the oer_encode() which encodes the data into the provided buffer
+ */
+asn_enc_rval_t
+oer_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor,
+                     const asn_oer_constraints_t *constraints,
+                     const void *struct_ptr, /* Structure to be encoded */
+                     void *buffer,           /* Pre-allocated buffer */
+                     size_t buffer_size      /* Initial buffer size (maximum) */
+) {
+    enc_to_buf_arg arg;
+    asn_enc_rval_t ec;
+
+    arg.buffer = buffer;
+    arg.left = buffer_size;
+
+    if(type_descriptor->op->oer_encoder == NULL) {
+        ec.encoded = -1;
+        ec.failed_type = type_descriptor;
+        ec.structure_ptr = struct_ptr;
+        ASN_DEBUG("OER encoder is not defined for %s",
+                type_descriptor->name);
+    } else {
+        ec = type_descriptor->op->oer_encoder(
+            type_descriptor, constraints,
+            struct_ptr, /* Pointer to the destination structure */
+            encode_to_buffer_cb, &arg);
+        if(ec.encoded != -1) {
+            assert(ec.encoded == (ssize_t)(buffer_size - arg.left));
+            /* Return the encoded contents size */
+        }
+    }
+    return ec;
+}
+
+asn_enc_rval_t
+oer_encode_primitive(const asn_TYPE_descriptor_t *td,
+                     const asn_oer_constraints_t *constraints, const void *sptr,
+                     asn_app_consume_bytes_f *cb, void *app_key) {
+    const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr;
+    asn_enc_rval_t er = {0, 0, 0};
+    ssize_t ret;
+
+    (void)constraints;
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("Encoding %s (%" ASN_PRI_SIZE " bytes)", td ? td->name : "", st->size);
+
+    /*
+     * X.696 (08/2015) #27.2
+     */
+    ret = oer_serialize_length(st->size, cb, app_key);
+    if(ret < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    er.encoded += ret;
+
+    er.encoded += st->size;
+    if(cb(st->buf, st->size, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        ASN__ENCODED_OK(er);
+    }
+}
+
+static int
+oer__count_bytes(const void *buffer, size_t size, void *bytes_ptr) {
+    size_t *bytes = bytes_ptr;
+    (void)buffer;
+    *bytes += size;
+    return 0;
+}
+
+ssize_t
+oer_open_type_put(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t serialized_byte_count = 0;
+    asn_enc_rval_t er = {0,0,0};
+    ssize_t len_len;
+
+    er = td->op->oer_encoder(td, constraints, sptr, oer__count_bytes,
+                             &serialized_byte_count);
+    if(er.encoded < 0) return -1;
+    assert(serialized_byte_count == (size_t)er.encoded);
+
+    len_len = oer_serialize_length(serialized_byte_count, cb, app_key);
+    if(len_len == -1) return -1;
+
+    er = td->op->oer_encoder(td, constraints, sptr, cb, app_key);
+    if(er.encoded < 0) return -1;
+    assert(serialized_byte_count == (size_t)er.encoded);
+
+    return len_len + er.encoded;
+}
+
diff --git a/e2sm/lib/oer_support.c b/e2sm/lib/oer_support.c
new file mode 100644
index 0000000..b15a3bc
--- /dev/null
+++ b/e2sm/lib/oer_support.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+
+#include <oer_support.h>
+
+/*
+ * Fetch the length determinant (X.696 08/2015, #8.6) into *len_r.
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t
+oer_fetch_length(const void *bufptr, size_t size, size_t *len_r) {
+    uint8_t first_byte;
+    size_t len_len;    /* Length of the length determinant */
+    const uint8_t *b;
+    const uint8_t *bend;
+    size_t len;
+
+    if(size == 0) {
+        *len_r = 0;
+        return 0;
+    }
+
+    first_byte = *(const uint8_t *)bufptr;
+    if((first_byte & 0x80) == 0) {   /* Short form */
+        *len_r = first_byte; /* 0..127 */
+        return 1;
+    }
+
+    len_len = (first_byte & 0x7f);
+    if((1 + len_len) > size) {
+        *len_r = 0;
+        return 0;
+    }
+
+    b = (const uint8_t *)bufptr + 1;
+    bend = b + len_len;
+
+    for(; b < bend && *b == 0; b++) {
+        /* Skip the leading 0-bytes */
+    }
+
+    if((bend - b) > (ssize_t)sizeof(size_t)) {
+        /* Length is not representable by the native size_t type */
+        *len_r = 0;
+        return -1;
+    }
+
+    for(len = 0; b < bend; b++) {
+        len = (len << 8) + *b;
+    }
+
+    if(len > RSIZE_MAX) { /* A bit of C11 validation */
+        *len_r = 0;
+        return -1;
+    }
+
+    *len_r = len;
+    assert(len_len + 1 == (size_t)(bend - (const uint8_t *)bufptr));
+    return len_len + 1;
+}
+
+
+/*
+ * Serialize OER length. Returns the number of bytes serialized
+ * or -1 if a given callback returned with negative result.
+ */
+ssize_t
+oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb,
+                     void *app_key) {
+    uint8_t scratch[1 + sizeof(length)];
+    uint8_t *sp = scratch;
+    int littleEndian = 1;   /* Run-time detection */
+    const uint8_t *pstart;
+    const uint8_t *pend;
+    const uint8_t *p;
+    int add;
+
+    if(length <= 127) {
+        uint8_t b = length;
+        if(cb(&b, 1, app_key) < 0) {
+            return -1;
+        }
+        return 1;
+    }
+
+    if(*(char *)&littleEndian) {
+        pstart = (const uint8_t *)&length + sizeof(length) - 1;
+        pend = (const uint8_t *)&length;
+        add = -1;
+    } else {
+        pstart = (const uint8_t *)&length;
+        pend = pstart + sizeof(length);
+        add = 1;
+    }
+
+    for(p = pstart; p != pend; p += add) {
+        /* Skip leading zeros. */
+        if(*p) break;
+    }
+
+    for(sp = scratch + 1; ; p += add) {
+        *sp++ = *p;
+        if(p == pend) break;
+    }
+    assert((sp - scratch) - 1 <= 0x7f);
+    scratch[0] = 0x80 + ((sp - scratch) - 1);
+
+    if(cb(scratch, sp - scratch, app_key) < 0) {
+        return -1;
+    }
+
+    return sp - scratch;
+}
+
diff --git a/e2sm/lib/pdu_collection.c b/e2sm/lib/pdu_collection.c
new file mode 100644
index 0000000..deea97d
--- /dev/null
+++ b/e2sm/lib/pdu_collection.c
@@ -0,0 +1,39 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ */
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+extern struct asn_TYPE_descriptor_s asn_DEF_Criticality;
+extern struct asn_TYPE_descriptor_s asn_DEF_Presence;
+extern struct asn_TYPE_descriptor_s asn_DEF_ProcedureCode;
+extern struct asn_TYPE_descriptor_s asn_DEF_TriggeringMessage;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_KPM_RANFunctionDefinition;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_KPM_ActionDefinition;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_KPM_IndicationHeader;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_KPM_IndicationMessage;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_RC_RANFunctionDefinition;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_RC_ControlHeader;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_RC_ControlMessage;
+extern struct asn_TYPE_descriptor_s asn_DEF_E2SM_KPM_EventTriggerDefinition;
+extern struct asn_TYPE_descriptor_s asn_DEF_RANcallProcess_ID_string;
+
+
+struct asn_TYPE_descriptor_s *asn_pdu_collection[] = {
+	/* From module E2SM-KPM-RC in e2sm-kpm-rc.asn */
+	&asn_DEF_Criticality,	
+	&asn_DEF_Presence,	
+	&asn_DEF_ProcedureCode,	
+	&asn_DEF_TriggeringMessage,	
+	&asn_DEF_E2SM_KPM_RANFunctionDefinition,	
+	&asn_DEF_E2SM_KPM_ActionDefinition,	
+	&asn_DEF_E2SM_KPM_IndicationHeader,	
+	&asn_DEF_E2SM_KPM_IndicationMessage,	
+	&asn_DEF_E2SM_RC_RANFunctionDefinition,	
+	&asn_DEF_E2SM_RC_ControlHeader,	
+	&asn_DEF_E2SM_RC_ControlMessage,	
+	&asn_DEF_E2SM_KPM_EventTriggerDefinition,	
+	&asn_DEF_RANcallProcess_ID_string,	
+	0
+};
+
diff --git a/e2sm/lib/per_decoder.c b/e2sm/lib/per_decoder.c
new file mode 100644
index 0000000..8a3e39d
--- /dev/null
+++ b/e2sm/lib/per_decoder.c
@@ -0,0 +1,185 @@
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <per_decoder.h>
+
+/*
+ * Decode a "Production of a complete encoding", X.691#10.1.
+ * The complete encoding contains at least one byte, and is an integral
+ * multiple of 8 bytes.
+ */
+asn_dec_rval_t
+uper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buffer, size_t size) {
+    asn_dec_rval_t rval;
+
+	rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
+	if(rval.consumed) {
+		/*
+		 * We've always given 8-aligned data,
+		 * so convert bits to integral bytes.
+		 */
+		rval.consumed += 7;
+		rval.consumed >>= 3;
+	} else if(rval.code == RC_OK) {
+		if(size) {
+			if(((const uint8_t *)buffer)[0] == 0) {
+				rval.consumed = 1;	/* 1 byte */
+			} else {
+				ASN_DEBUG("Expecting single zeroed byte");
+				rval.code = RC_FAIL;
+			}
+		} else {
+			/* Must contain at least 8 bits. */
+			rval.code = RC_WMORE;
+		}
+	}
+
+	return rval;
+}
+
+asn_dec_rval_t
+uper_decode(const asn_codec_ctx_t *opt_codec_ctx,
+            const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer,
+            size_t size, int skip_bits, int unused_bits) {
+    asn_codec_ctx_t s_codec_ctx;
+	asn_dec_rval_t rval;
+	asn_per_data_t pd;
+
+	if(skip_bits < 0 || skip_bits > 7
+	|| unused_bits < 0 || unused_bits > 7
+	|| (unused_bits > 0 && !size))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/* Fill in the position indicator */
+	memset(&pd, 0, sizeof(pd));
+	pd.buffer = (const uint8_t *)buffer;
+	pd.nboff = skip_bits;
+	pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from <limits.h> */
+	if(pd.nboff > pd.nbits)
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	if(!td->op->uper_decoder)
+		ASN__DECODE_FAILED;	/* PER is not compiled in */
+	rval = td->op->uper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+	if(rval.code == RC_OK) {
+		/* Return the number of consumed bits */
+		rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
+					+ pd.nboff - skip_bits;
+		ASN_DEBUG("PER decoding consumed %ld, counted %ld",
+			(long)rval.consumed, (long)pd.moved);
+		assert(rval.consumed == pd.moved);
+	} else {
+		/* PER codec is not a restartable */
+		rval.consumed = 0;
+	}
+	return rval;
+}
+
+asn_dec_rval_t
+aper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buffer, size_t size) {
+	asn_dec_rval_t rval;
+
+	rval = aper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
+	if(rval.consumed) {
+		/*
+		 * We've always given 8-aligned data,
+		 * so convert bits to integral bytes.
+		 */
+		rval.consumed += 7;
+		rval.consumed >>= 3;
+	} else if(rval.code == RC_OK) {
+		if(size) {
+			if(((const uint8_t *)buffer)[0] == 0) {
+				rval.consumed = 1;	/* 1 byte */
+			} else {
+				ASN_DEBUG("Expecting single zeroed byte");
+				rval.code = RC_FAIL;
+			}
+		} else {
+			/* Must contain at least 8 bits. */
+			rval.code = RC_WMORE;
+		}
+	}
+
+	return rval;
+}
+
+asn_dec_rval_t
+aper_decode(const asn_codec_ctx_t *opt_codec_ctx,
+            const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer,
+            size_t size, int skip_bits, int unused_bits) {
+	asn_codec_ctx_t s_codec_ctx;
+	asn_dec_rval_t rval;
+	asn_per_data_t pd;
+
+	if(skip_bits < 0 || skip_bits > 7
+		|| unused_bits < 0 || unused_bits > 7
+		|| (unused_bits > 0 && !size))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/* Fill in the position indicator */
+	memset(&pd, 0, sizeof(pd));
+	pd.buffer = (const uint8_t *)buffer;
+	pd.nboff = skip_bits;
+	pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from <limits.h> */
+	if(pd.nboff > pd.nbits)
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	if(!td->op->aper_decoder)
+		ASN__DECODE_FAILED;	/* PER is not compiled in */
+		rval = td->op->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+	if(rval.code == RC_OK) {
+		/* Return the number of consumed bits */
+		rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
+		+ pd.nboff - skip_bits;
+		ASN_DEBUG("PER decoding consumed %zu, counted %zu",
+				  rval.consumed, pd.moved);
+		assert(rval.consumed == pd.moved);
+	} else {
+		/* PER codec is not a restartable */
+		rval.consumed = 0;
+	}
+	return rval;
+}
+
diff --git a/e2sm/lib/per_encoder.c b/e2sm/lib/per_encoder.c
new file mode 100644
index 0000000..a35e1f0
--- /dev/null
+++ b/e2sm/lib/per_encoder.c
@@ -0,0 +1,265 @@
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <per_encoder.h>
+
+static int _uper_encode_flush_outp(asn_per_outp_t *po);
+
+static int
+ignore_output(const void *data, size_t size, void *app_key) {
+    (void)data;
+    (void)size;
+    (void)app_key;
+    return 0;
+}
+
+asn_enc_rval_t
+uper_encode(const asn_TYPE_descriptor_t *td,
+            const asn_per_constraints_t *constraints, const void *sptr,
+            asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_per_outp_t po;
+    asn_enc_rval_t er = {0,0,0};
+
+    /*
+     * Invoke type-specific encoder.
+     */
+    if(!td || !td->op->uper_encoder)
+        ASN__ENCODE_FAILED;	/* PER is not compiled in */
+
+    po.buffer = po.tmpspace;
+    po.nboff = 0;
+    po.nbits = 8 * sizeof(po.tmpspace);
+    po.output = cb ? cb : ignore_output;
+    po.op_key = app_key;
+    po.flushed_bytes = 0;
+
+    er = td->op->uper_encoder(td, constraints, sptr, &po);
+    if(er.encoded != -1) {
+        size_t bits_to_flush;
+
+        bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
+
+        /* Set number of bits encoded to a firm value */
+        er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
+
+        if(_uper_encode_flush_outp(&po)) ASN__ENCODE_FAILED;
+    }
+
+    return er;
+}
+
+/*
+ * Argument type and callback necessary for uper_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+	void *buffer;
+	size_t left;
+} enc_to_buf_arg;
+static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+	enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+	if(arg->left < size)
+		return -1;	/* Data exceeds the available buffer size */
+
+	memcpy(arg->buffer, buffer, size);
+	arg->buffer = ((char *)arg->buffer) + size;
+	arg->left -= size;
+
+	return 0;
+}
+
+asn_enc_rval_t
+uper_encode_to_buffer(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg key;
+
+    key.buffer = buffer;
+    key.left = buffer_size;
+
+    if(td) ASN_DEBUG("Encoding \"%s\" using UNALIGNED PER", td->name);
+
+    return uper_encode(td, constraints, sptr, encode_to_buffer_cb, &key);
+}
+
+typedef struct enc_dyn_arg {
+	void *buffer;
+	size_t length;
+	size_t allocated;
+} enc_dyn_arg;
+static int
+encode_dyn_cb(const void *buffer, size_t size, void *key) {
+    enc_dyn_arg *arg = key;
+    if(arg->length + size >= arg->allocated) {
+        size_t new_size = arg->allocated ? arg->allocated : 8;
+        void *p;
+
+        do {
+            new_size <<= 2;
+        } while(arg->length + size >= new_size);
+
+        p = REALLOC(arg->buffer, new_size);
+        if(!p) {
+            FREEMEM(arg->buffer);
+            memset(arg, 0, sizeof(*arg));
+            return -1;
+        }
+        arg->buffer = p;
+        arg->allocated = new_size;
+    }
+    memcpy(((char *)arg->buffer) + arg->length, buffer, size);
+    arg->length += size;
+    return 0;
+}
+ssize_t
+uper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, void **buffer_r) {
+    asn_enc_rval_t er = {0,0,0};
+	enc_dyn_arg key;
+
+	memset(&key, 0, sizeof(key));
+
+	er = uper_encode(td, constraints, sptr, encode_dyn_cb, &key);
+	switch(er.encoded) {
+	case -1:
+		FREEMEM(key.buffer);
+		return -1;
+	case 0:
+		FREEMEM(key.buffer);
+		key.buffer = MALLOC(1);
+		if(key.buffer) {
+			*(char *)key.buffer = '\0';
+			*buffer_r = key.buffer;
+			return 1;
+		} else {
+			return -1;
+		}
+	default:
+		*buffer_r = key.buffer;
+		ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+		return ((er.encoded + 7) >> 3);
+	}
+}
+
+/*
+ * Internally useful functions.
+ */
+
+/* Flush partially filled buffer */
+static int
+_uper_encode_flush_outp(asn_per_outp_t *po) {
+	uint8_t *buf;
+
+	if(po->nboff == 0 && po->buffer == po->tmpspace)
+		return 0;
+
+	buf = po->buffer + (po->nboff >> 3);
+	/* Make sure we account for the last, partially filled */
+	if(po->nboff & 0x07) {
+		buf[0] &= 0xff << (8 - (po->nboff & 0x07));
+		buf++;
+	}
+
+	return po->output(po->tmpspace, buf - po->tmpspace, po->op_key);
+}
+
+asn_enc_rval_t
+aper_encode_to_buffer(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg key;
+
+    key.buffer = buffer;
+    key.left = buffer_size;
+
+    if(td) ASN_DEBUG("Encoding \"%s\" using ALIGNED PER", td->name);
+
+    return aper_encode(td, constraints, sptr, encode_to_buffer_cb, &key);
+}
+
+ssize_t
+aper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, void **buffer_r) {
+    asn_enc_rval_t er = {0,0,0};
+	enc_dyn_arg key;
+
+	memset(&key, 0, sizeof(key));
+
+	er = aper_encode(td, constraints, sptr, encode_dyn_cb, &key);
+	switch(er.encoded) {
+	case -1:
+		FREEMEM(key.buffer);
+		return -1;
+	case 0:
+		FREEMEM(key.buffer);
+		key.buffer = MALLOC(1);
+		if(key.buffer) {
+			*(char *)key.buffer = '\0';
+			*buffer_r = key.buffer;
+			return 1;
+		} else {
+			return -1;
+		}
+	default:
+		*buffer_r = key.buffer;
+		ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+		return ((er.encoded + 7) >> 3);
+	}
+}
+
+static int
+_aper_encode_flush_outp(asn_per_outp_t *po) {
+	uint8_t *buf;
+
+	if(po->nboff == 0 && po->buffer == po->tmpspace)
+		return 0;
+
+	buf = po->buffer + (po->nboff >> 3);
+	/* Make sure we account for the last, partially filled */
+	if(po->nboff & 0x07) {
+		buf[0] &= 0xff << (8 - (po->nboff & 0x07));
+		buf++;
+	}
+
+	if (po->output) {
+		return po->output(po->tmpspace, buf - po->tmpspace, po->op_key);
+	}
+	return 0;
+}
+
+asn_enc_rval_t
+aper_encode(const asn_TYPE_descriptor_t *td,
+        const asn_per_constraints_t *constraints,
+        const void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_per_outp_t po;
+	asn_enc_rval_t er = {0,0,0};
+
+	/*
+	 * Invoke type-specific encoder.
+	 */
+	if(!td || !td->op->aper_encoder)
+		ASN__ENCODE_FAILED;	 /* PER is not compiled in */
+
+	po.buffer = po.tmpspace;
+	po.nboff = 0;
+	po.nbits = 8 * sizeof(po.tmpspace);
+	po.output = cb;
+	po.op_key = app_key;
+	po.flushed_bytes = 0;
+
+	er = td->op->aper_encoder(td, constraints, sptr, &po);
+	if(er.encoded != -1) {
+		size_t bits_to_flush;
+
+		bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
+
+		/* Set number of bits encoded to a firm value */
+		er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
+
+		if(_aper_encode_flush_outp(&po))
+			ASN__ENCODE_FAILED;
+	}
+
+	return er;
+}
diff --git a/e2sm/lib/per_opentype.c b/e2sm/lib/per_opentype.c
new file mode 100644
index 0000000..28f3cb6
--- /dev/null
+++ b/e2sm/lib/per_opentype.c
@@ -0,0 +1,533 @@
+/*
+ * Copyright (c) 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <per_support.h>
+#include <constr_TYPE.h>
+#include <per_opentype.h>
+
+typedef struct uper_ugot_key {
+	asn_per_data_t oldpd;	/* Old per data source */
+	size_t unclaimed;
+	size_t ot_moved;	/* Number of bits moved by OT processing */
+	int repeat;
+} uper_ugot_key;
+
+static int uper_ugot_refill(asn_per_data_t *pd);
+static int per_skip_bits(asn_per_data_t *pd, int skip_nbits);
+static asn_dec_rval_t uper_sot_suck(const asn_codec_ctx_t *,
+                                    const asn_TYPE_descriptor_t *td,
+                                    const asn_per_constraints_t *constraints,
+                                    void **sptr, asn_per_data_t *pd);
+
+/*
+ * Encode an "open type field".
+ * #10.1, #10.2
+ */
+int
+uper_open_type_put(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+    void *buf;
+    void *bptr;
+    ssize_t size;
+
+    ASN_DEBUG("Open type put %s ...", td->name);
+
+    size = uper_encode_to_new_buffer(td, constraints, sptr, &buf);
+    if(size <= 0) return -1;
+
+    ASN_DEBUG("Open type put %s of length %" ASN_PRI_SSIZE " + overhead (1byte?)", td->name,
+              size);
+
+    bptr = buf;
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size, &need_eom);
+        ASN_DEBUG("Prepending length %" ASN_PRI_SSIZE
+                  " to %s and allowing to save %" ASN_PRI_SSIZE,
+                  size, td->name, may_save);
+        if(may_save < 0) break;
+        if(per_put_many_bits(po, bptr, may_save * 8)) break;
+        bptr = (char *)bptr + may_save;
+        size -= may_save;
+        if(need_eom && uper_put_length(po, 0, 0)) {
+            FREEMEM(buf);
+            return -1;
+        }
+    } while(size);
+
+    FREEMEM(buf);
+    if(size) return -1;
+
+    return 0;
+}
+
+static asn_dec_rval_t
+uper_open_type_get_simple(const asn_codec_ctx_t *ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr,
+                          asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+	ssize_t chunk_bytes;
+	int repeat;
+	uint8_t *buf = 0;
+	size_t bufLen = 0;
+	size_t bufSize = 0;
+	asn_per_data_t spd;
+	size_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s...", td->name);
+
+	do {
+		chunk_bytes = uper_get_length(pd, -1, 0, &repeat);
+		if(chunk_bytes < 0) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		if(bufLen + chunk_bytes > bufSize) {
+			void *ptr;
+			bufSize = chunk_bytes + (bufSize << 2);
+			ptr = REALLOC(buf, bufSize);
+			if(!ptr) {
+				FREEMEM(buf);
+				ASN__DECODE_FAILED;
+			}
+			buf = ptr;
+		}
+		if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		bufLen += chunk_bytes;
+	} while(repeat);
+
+	ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name,
+		(long)bufLen);
+
+	memset(&spd, 0, sizeof(spd));
+	spd.buffer = buf;
+	spd.nbits = bufLen << 3;
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->uper_decoder(ctx, td, constraints, sptr, &spd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+	if(rv.code == RC_OK) {
+		/* Check padding validity */
+		padding = spd.nbits - spd.nboff;
+                if (((padding > 0 && padding < 8) ||
+		/* X.691#10.1.3 */
+		(spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) &&
+                    per_get_few_bits(&spd, padding) == 0) {
+			/* Everything is cool */
+			FREEMEM(buf);
+			return rv;
+		}
+		FREEMEM(buf);
+		if(padding >= 8) {
+			ASN_DEBUG("Too large padding %d in open type", (int)padding);
+			ASN__DECODE_FAILED;
+		} else {
+			ASN_DEBUG("No padding");
+		}
+	} else {
+		FREEMEM(buf);
+		/* rv.code could be RC_WMORE, nonsense in this context */
+		rv.code = RC_FAIL; /* Noone would give us more */
+	}
+
+	return rv;
+}
+
+static asn_dec_rval_t CC_NOTUSED
+uper_open_type_get_complex(const asn_codec_ctx_t *ctx,
+                           const asn_TYPE_descriptor_t *td,
+                           asn_per_constraints_t *constraints, void **sptr,
+                           asn_per_data_t *pd) {
+    uper_ugot_key arg;
+	asn_dec_rval_t rv;
+	ssize_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s from %s", td->name,
+		asn_bit_data_string(pd));
+	arg.oldpd = *pd;
+	arg.unclaimed = 0;
+	arg.ot_moved = 0;
+	arg.repeat = 1;
+	pd->refill = uper_ugot_refill;
+	pd->refill_key = &arg;
+	pd->nbits = pd->nboff;	/* 0 good bits at this point, will refill */
+	pd->moved = 0;	/* This now counts the open type size in bits */
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->uper_decoder(ctx, td, constraints, sptr, pd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+#define	UPDRESTOREPD	do {						\
+	/* buffer and nboff are valid, preserve them. */		\
+	pd->nbits = arg.oldpd.nbits - (pd->moved - arg.ot_moved);	\
+	pd->moved = arg.oldpd.moved + (pd->moved - arg.ot_moved);	\
+	pd->refill = arg.oldpd.refill;					\
+	pd->refill_key = arg.oldpd.refill_key;				\
+  } while(0)
+
+	if(rv.code != RC_OK) {
+		UPDRESTOREPD;
+		return rv;
+	}
+
+	ASN_DEBUG("OpenType %s pd%s old%s unclaimed=%d, repeat=%d", td->name,
+		asn_bit_data_string(pd),
+		asn_bit_data_string(&arg.oldpd),
+		(int)arg.unclaimed, (int)arg.repeat);
+
+	padding = pd->moved % 8;
+	if(padding) {
+		int32_t pvalue;
+		if(padding > 7) {
+			ASN_DEBUG("Too large padding %d in open type",
+				(int)padding);
+			rv.code = RC_FAIL;
+			UPDRESTOREPD;
+			return rv;
+		}
+		padding = 8 - padding;
+		ASN_DEBUG("Getting padding of %d bits", (int)padding);
+		pvalue = per_get_few_bits(pd, padding);
+		switch(pvalue) {
+		case -1:
+			ASN_DEBUG("Padding skip failed");
+			UPDRESTOREPD;
+			ASN__DECODE_STARVED;
+		case 0: break;
+		default:
+			ASN_DEBUG("Non-blank padding (%d bits 0x%02x)",
+				(int)padding, (int)pvalue);
+			UPDRESTOREPD;
+			ASN__DECODE_FAILED;
+		}
+	}
+	if(pd->nboff != pd->nbits) {
+		ASN_DEBUG("Open type %s overhead pd%s old%s", td->name,
+			asn_bit_data_string(pd), asn_bit_data_string(&arg.oldpd));
+		if(1) {
+			UPDRESTOREPD;
+			ASN__DECODE_FAILED;
+		} else {
+			arg.unclaimed += pd->nbits - pd->nboff;
+		}
+	}
+
+	/* Adjust pd back so it points to original data */
+	UPDRESTOREPD;
+
+	/* Skip data not consumed by the decoder */
+	if(arg.unclaimed) {
+		ASN_DEBUG("Getting unclaimed %d", (int)arg.unclaimed);
+		switch(per_skip_bits(pd, arg.unclaimed)) {
+		case -1:
+			ASN_DEBUG("Claim of %d failed", (int)arg.unclaimed);
+			ASN__DECODE_STARVED;
+		case 0:
+			ASN_DEBUG("Got claim of %d", (int)arg.unclaimed);
+			break;
+		default:
+			/* Padding must be blank */
+			ASN_DEBUG("Non-blank unconsumed padding");
+			ASN__DECODE_FAILED;
+		}
+		arg.unclaimed = 0;
+	}
+
+	if(arg.repeat) {
+		ASN_DEBUG("Not consumed the whole thing");
+		rv.code = RC_FAIL;
+		return rv;
+	}
+
+	return rv;
+}
+
+
+asn_dec_rval_t
+uper_open_type_get(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    return uper_open_type_get_simple(ctx, td, constraints, sptr, pd);
+}
+
+int
+uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
+	asn_TYPE_descriptor_t s_td;
+    asn_TYPE_operation_t s_op;
+	asn_dec_rval_t rv;
+
+	s_td.name = "<unknown extension>";
+	s_td.op = &s_op;
+    s_op.uper_decoder = uper_sot_suck;
+
+	rv = uper_open_type_get(ctx, &s_td, 0, 0, pd);
+	if(rv.code != RC_OK)
+		return -1;
+	else
+		return 0;
+}
+
+/*
+ * Internal functions.
+ */
+
+static asn_dec_rval_t
+uper_sot_suck(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
+              const asn_per_constraints_t *constraints, void **sptr,
+              asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+
+	(void)ctx;
+	(void)td;
+	(void)constraints;
+	(void)sptr;
+
+	while(per_get_few_bits(pd, 1) >= 0);
+
+	rv.code = RC_OK;
+	rv.consumed = pd->moved;
+
+	return rv;
+}
+
+static int
+uper_ugot_refill(asn_per_data_t *pd) {
+	uper_ugot_key *arg = pd->refill_key;
+	ssize_t next_chunk_bytes, next_chunk_bits;
+	ssize_t avail;
+
+	asn_per_data_t *oldpd = &arg->oldpd;
+
+	ASN_DEBUG("REFILLING pd->moved=%ld, oldpd->moved=%ld",
+		(long)pd->moved, (long)oldpd->moved);
+
+	/* Advance our position to where pd is */
+	oldpd->buffer = pd->buffer;
+	oldpd->nboff  = pd->nboff;
+	oldpd->nbits -= pd->moved - arg->ot_moved;
+	oldpd->moved += pd->moved - arg->ot_moved;
+	arg->ot_moved = pd->moved;
+
+	if(arg->unclaimed) {
+		/* Refill the container */
+		if(per_get_few_bits(oldpd, 1))
+			return -1;
+		if(oldpd->nboff == 0) {
+			assert(0);
+			return -1;
+		}
+		pd->buffer = oldpd->buffer;
+		pd->nboff = oldpd->nboff - 1;
+		pd->nbits = oldpd->nbits;
+		ASN_DEBUG("UNCLAIMED <- return from (pd->moved=%ld)",
+			(long)pd->moved);
+		return 0;
+	}
+
+	if(!arg->repeat) {
+		ASN_DEBUG("Want more but refill doesn't have it");
+		return -1;
+	}
+
+	next_chunk_bytes = uper_get_length(oldpd, -1, 0, &arg->repeat);
+	ASN_DEBUG("Open type LENGTH %ld bytes at off %ld, repeat %ld",
+		(long)next_chunk_bytes, (long)oldpd->moved, (long)arg->repeat);
+	if(next_chunk_bytes < 0) return -1;
+	if(next_chunk_bytes == 0) {
+		pd->refill = 0;	/* No more refills, naturally */
+		assert(!arg->repeat);	/* Implementation guarantee */
+	}
+	next_chunk_bits = next_chunk_bytes << 3;
+	avail = oldpd->nbits - oldpd->nboff;
+	if(avail >= next_chunk_bits) {
+		pd->nbits = oldpd->nboff + next_chunk_bits;
+		arg->unclaimed = 0;
+		ASN_DEBUG("!+Parent frame %ld bits, alloting %ld [%ld..%ld] (%ld)",
+			(long)next_chunk_bits, (long)oldpd->moved,
+			(long)oldpd->nboff, (long)oldpd->nbits,
+			(long)(oldpd->nbits - oldpd->nboff));
+	} else {
+		pd->nbits = oldpd->nbits;
+		arg->unclaimed = next_chunk_bits - avail;
+		ASN_DEBUG("!-Parent frame %ld, require %ld, will claim %ld",
+			(long)avail, (long)next_chunk_bits,
+			(long)arg->unclaimed);
+	}
+	pd->buffer = oldpd->buffer;
+	pd->nboff = oldpd->nboff;
+	ASN_DEBUG("Refilled pd%s old%s",
+		asn_bit_data_string(pd), asn_bit_data_string(oldpd));
+	return 0;
+}
+
+static int
+per_skip_bits(asn_per_data_t *pd, int skip_nbits) {
+	int hasNonZeroBits = 0;
+	while(skip_nbits > 0) {
+		int skip;
+
+		/* per_get_few_bits() is more efficient when nbits <= 24 */
+		if(skip_nbits < 24)
+			skip = skip_nbits;
+		else
+			skip = 24;
+		skip_nbits -= skip;
+
+		switch(per_get_few_bits(pd, skip)) {
+		case -1: return -1;	/* Starving */
+		case 0: continue;	/* Skipped empty space */
+		default: hasNonZeroBits = 1; continue;
+		}
+	}
+	return hasNonZeroBits;
+}
+
+static asn_dec_rval_t
+aper_open_type_get_simple(const asn_codec_ctx_t *ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv;
+	ssize_t chunk_bytes;
+	int repeat;
+	uint8_t *buf = 0;
+	size_t bufLen = 0;
+	size_t bufSize = 0;
+	asn_per_data_t spd;
+	size_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s...", td->name);
+
+	do {
+	        chunk_bytes = aper_get_length(pd, -1, -1, &repeat);
+		if(chunk_bytes < 0) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		if(bufLen + chunk_bytes > bufSize) {
+			void *ptr;
+			bufSize = chunk_bytes + (bufSize << 2);
+			ptr = REALLOC(buf, bufSize);
+			if(!ptr) {
+				FREEMEM(buf);
+				ASN__DECODE_FAILED;
+			}
+			buf = ptr;
+		}
+		if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		bufLen += chunk_bytes;
+	} while(repeat);
+
+	ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name,
+		(long)bufLen);
+
+	memset(&spd, 0, sizeof(spd));
+	spd.buffer = buf;
+	spd.nbits = bufLen << 3;
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->aper_decoder(ctx, td, constraints, sptr, &spd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+	if(rv.code == RC_OK) {
+		/* Check padding validity */
+		padding = spd.nbits - spd.nboff;
+                if (((padding > 0 && padding < 8) ||
+		/* X.691#10.1.3 */
+		(spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) &&
+                    per_get_few_bits(&spd, padding) == 0) {
+			/* Everything is cool */
+			FREEMEM(buf);
+			return rv;
+		}
+		FREEMEM(buf);
+		if(padding >= 8) {
+			ASN_DEBUG("Too large padding %d in open type", (int)padding);
+			ASN__DECODE_FAILED;
+		} else {
+			ASN_DEBUG("No padding");
+		}
+	} else {
+		FREEMEM(buf);
+		/* rv.code could be RC_WMORE, nonsense in this context */
+		rv.code = RC_FAIL; /* Noone would give us more */
+	}
+
+	return rv;
+}
+
+int
+aper_open_type_put(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   const void *sptr, asn_per_outp_t *po) {
+	void *buf;
+	void *bptr;
+	ssize_t size;
+	size_t toGo;
+
+	ASN_DEBUG("Open type put %s ...", td->name);
+
+	size = aper_encode_to_new_buffer(td, constraints, sptr, &buf);
+	if(size <= 0) return -1;
+
+	for(bptr = buf, toGo = size; toGo;) {
+		ssize_t maySave = aper_put_length(po, -1, toGo);
+		if(maySave < 0) break;
+		if(per_put_many_bits(po, bptr, maySave * 8)) break;
+		bptr = (char *)bptr + maySave;
+		toGo -= maySave;
+	}
+
+	FREEMEM(buf);
+	if(toGo) return -1;
+
+	ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)",
+			  td->name, size);
+
+	return 0;
+}
+
+asn_dec_rval_t
+aper_open_type_get(const asn_codec_ctx_t *ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   void **sptr, asn_per_data_t *pd) {
+
+	return aper_open_type_get_simple(ctx, td, constraints, sptr, pd);
+}
+
+int
+aper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
+	asn_TYPE_descriptor_t s_td;
+	asn_dec_rval_t rv;
+	asn_TYPE_operation_t op_t;
+
+	memset(&op_t, 0, sizeof(op_t));
+	s_td.name = "<unknown extension>";
+	s_td.op = &op_t;
+	s_td.op->aper_decoder = uper_sot_suck;
+
+	rv = aper_open_type_get(ctx, &s_td, 0, 0, pd);
+	if(rv.code != RC_OK)
+		return -1;
+	else
+		return 0;
+}
+
+
diff --git a/e2sm/lib/per_support.c b/e2sm/lib/per_support.c
new file mode 100644
index 0000000..2c87a76
--- /dev/null
+++ b/e2sm/lib/per_support.c
@@ -0,0 +1,492 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+#include <per_support.h>
+
+/*
+ * X.691-201508 #10.9 General rules for encoding a length determinant.
+ * Get the optionally constrained length "n" from the stream.
+ */
+ssize_t
+uper_get_length(asn_per_data_t *pd, int ebits, size_t lower_bound,
+                int *repeat) {
+    ssize_t value;
+
+    *repeat = 0;
+
+    /* #11.9.4.1 Encoding if constrained (according to effective bits) */
+    if(ebits >= 0 && ebits <= 16) {
+        value = per_get_few_bits(pd, ebits);
+        if(value >= 0) value += lower_bound;
+        return value;
+    }
+
+	value = per_get_few_bits(pd, 8);
+    if((value & 0x80) == 0) { /* #11.9.3.6 */
+        return (value & 0x7F);
+    } else if((value & 0x40) == 0) { /* #11.9.3.7 */
+        /* bit 8 ... set to 1 and bit 7 ... set to zero */
+        value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8);
+        return value; /* potential -1 from per_get_few_bits passes through. */
+    } else if(value < 0) {
+        ASN_DEBUG("END of stream reached for PER");
+        return -1;
+    }
+    value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */
+    if(value < 1 || value > 4) {
+        return -1; /* Prohibited by #11.9.3.8 */
+    }
+    *repeat = 1;
+    return (16384 * value);
+}
+
+/*
+ * Get the normally small length "n".
+ * This procedure used to decode length of extensions bit-maps
+ * for SET and SEQUENCE types.
+ */
+ssize_t
+uper_get_nslength(asn_per_data_t *pd) {
+	ssize_t length;
+
+	ASN_DEBUG("Getting normally small length");
+
+	if(per_get_few_bits(pd, 1) == 0) {
+		length = per_get_few_bits(pd, 6) + 1;
+		if(length <= 0) return -1;
+		ASN_DEBUG("l=%d", (int)length);
+		return length;
+	} else {
+		int repeat;
+		length = uper_get_length(pd, -1, 0, &repeat);
+		if(length >= 0 && !repeat) return length;
+		return -1; /* Error, or do not support >16K extensions */
+	}
+}
+
+/*
+ * Get the normally small non-negative whole number.
+ * X.691, #10.6
+ */
+ssize_t
+uper_get_nsnnwn(asn_per_data_t *pd) {
+	ssize_t value;
+
+	value = per_get_few_bits(pd, 7);
+	if(value & 64) {	/* implicit (value < 0) */
+		value &= 63;
+		value <<= 2;
+		value |= per_get_few_bits(pd, 2);
+		if(value & 128)	/* implicit (value < 0) */
+			return -1;
+		if(value == 0)
+			return 0;
+		if(value >= 3)
+			return -1;
+		value = per_get_few_bits(pd, 8 * value);
+		return value;
+	}
+
+	return value;
+}
+
+/*
+ * X.691-11/2008, #11.6
+ * Encoding of a normally small non-negative whole number
+ */
+int
+uper_put_nsnnwn(asn_per_outp_t *po, int n) {
+	int bytes;
+
+	if(n <= 63) {
+		if(n < 0) return -1;
+		return per_put_few_bits(po, n, 7);
+	}
+	if(n < 256)
+		bytes = 1;
+	else if(n < 65536)
+		bytes = 2;
+	else if(n < 256 * 65536)
+		bytes = 3;
+	else
+		return -1;	/* This is not a "normally small" value */
+	if(per_put_few_bits(po, bytes, 8))
+		return -1;
+
+	return per_put_few_bits(po, n, 8 * bytes);
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) {
+	unsigned long lhalf;    /* Lower half of the number*/
+	long half;
+
+	if(nbits <= 31) {
+		half = per_get_few_bits(pd, nbits);
+		if(half < 0) return -1;
+		*out_value = half;
+		return 0;
+	}
+
+	if((size_t)nbits > 8 * sizeof(*out_value))
+		return -1;  /* RANGE */
+
+	half = per_get_few_bits(pd, 31);
+	if(half < 0) return -1;
+
+	if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31))
+		return -1;
+
+	*out_value = ((unsigned long)half << (nbits - 31)) | lhalf;
+	return 0;
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int
+uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v,
+                                    int nbits) {
+    if(nbits <= 31) {
+        return per_put_few_bits(po, v, nbits);
+    } else {
+        /* Put higher portion first, followed by lower 31-bit */
+        if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31))
+            return -1;
+        return per_put_few_bits(po, v, 31);
+    }
+}
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Put the length "n" (or part of it) into the stream.
+ */
+ssize_t
+uper_put_length(asn_per_outp_t *po, size_t length, int *need_eom) {
+    int dummy = 0;
+    if(!need_eom) need_eom = &dummy;
+
+    if(length <= 127) {	/* #11.9.3.6 */
+        *need_eom = 0;
+        return per_put_few_bits(po, length, 8)
+            ? -1 : (ssize_t)length;
+    } else if(length < 16384) { /* #10.9.3.7 */
+        *need_eom = 0;
+        return per_put_few_bits(po, length|0x8000, 16)
+            ? -1 : (ssize_t)length;
+    }
+
+    *need_eom = 0 == (length & 16383);
+    length >>= 14;
+    if(length > 4) {
+        *need_eom = 0;
+        length = 4;
+    }
+
+    return per_put_few_bits(po, 0xC0 | length, 8)
+            ? -1 : (ssize_t)(length << 14);
+
+}
+
+
+/*
+ * Put the normally small length "n" into the stream.
+ * This procedure used to encode length of extensions bit-maps
+ * for SET and SEQUENCE types.
+ */
+int
+uper_put_nslength(asn_per_outp_t *po, size_t length) {
+    if(length <= 64) {
+        /* #11.9.3.4 */
+        if(length == 0) return -1;
+        return per_put_few_bits(po, length - 1, 7) ? -1 : 0;
+    } else {
+        int need_eom = 0;
+        if(uper_put_length(po, length, &need_eom) != (ssize_t)length
+           || need_eom) {
+            /* This might happen in case of >16K extensions */
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+static int
+per__long_range(long lb, long ub, unsigned long *range_r) {
+    unsigned long bounds_range;
+    if((ub < 0) == (lb < 0)) {
+        bounds_range = ub - lb;
+    } else if(lb < 0) {
+        assert(ub >= 0);
+        bounds_range = 1 + ((unsigned long)ub + (unsigned long)-(lb + 1));
+    } else {
+        assert(!"Unreachable");
+        return -1;
+    }
+    *range_r = bounds_range;
+    return 0;
+}
+
+int
+per_long_range_rebase(long v, long lb, long ub, unsigned long *output) {
+    unsigned long range;
+
+    assert(lb <= ub);
+
+    if(v < lb || v > ub || per__long_range(lb, ub, &range) < 0) {
+        /* Range error. */
+        return -1;
+    }
+
+    /*
+     * Fundamentally what we're doing is returning (v-lb).
+     * However, this triggers undefined behavior when the word width
+     * of signed (v) is the same as the size of unsigned (*output).
+     * In practice, it triggers the UndefinedSanitizer. Therefore we shall
+     * compute the ranges accurately to avoid C's undefined behavior.
+     */
+    if((v < 0) == (lb < 0)) {
+        *output = v-lb;
+        return 0;
+    } else if(v < 0) {
+        unsigned long rebased = 1 + (unsigned long)-(v+1) + (unsigned long)lb;
+        assert(rebased <= range);   /* By construction */
+        *output = rebased;
+        return 0;
+    } else if(lb < 0) {
+        unsigned long rebased = 1 + (unsigned long)-(lb+1) + (unsigned long)v;
+        assert(rebased <= range);   /* By construction */
+        *output = rebased;
+        return 0;
+    } else {
+        assert(!"Unreachable");
+        return -1;
+    }
+}
+
+int
+per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp) {
+    unsigned long range;
+
+    if(per__long_range(lb, ub, &range) != 0) {
+        return -1;
+    }
+
+    if(inp > range) {
+        /*
+         * We can encode something in the given number of bits that technically
+         * exceeds the range. This is an avenue for security errors,
+         * so we don't allow that.
+         */
+        return -1;
+    }
+
+    if(inp <= LONG_MAX) {
+        *outp = (long)inp + lb;
+    } else {
+        *outp = (lb + LONG_MAX + 1) + (long)((inp - LONG_MAX) - 1);
+    }
+
+    return 0;
+}
+
+int32_t
+aper_get_align(asn_per_data_t *pd) {
+
+	if(pd->nboff & 0x7) {
+		ASN_DEBUG("Aligning %ld bits", 8 - ((unsigned long)pd->nboff & 0x7));
+		return per_get_few_bits(pd, 8 - (pd->nboff & 0x7));
+	}
+	return 0;
+}
+
+ssize_t
+aper_get_length(asn_per_data_t *pd, int range, int ebits, int *repeat) {
+	ssize_t value;
+
+	*repeat = 0;
+
+	// First check effective_bits parameter.
+	if (ebits >= 0) {
+	  if (range <= 65536 && range >= 0)
+	    return aper_get_nsnnwn(pd, range);
+	}
+	
+	if (aper_get_align(pd) < 0)
+		return -1;
+
+	if(ebits >= 0) return per_get_few_bits(pd, ebits);
+
+	value = per_get_few_bits(pd, 8);
+	if(value < 0) return -1;
+	if((value & 128) == 0)  /* #10.9.3.6 */
+		return (value & 0x7F);
+	if((value & 64) == 0) { /* #10.9.3.7 */
+		value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
+		if(value < 0) return -1;
+		return value;
+	}
+	value &= 63;	/* this is "m" from X.691, #10.9.3.8 */
+	if(value < 1 || value > 4)
+		return -1;
+	*repeat = 1;
+	return (16384 * value);
+}
+
+ssize_t
+aper_get_nslength(asn_per_data_t *pd) {
+	ssize_t length;
+
+	ASN_DEBUG("Getting normally small length");
+
+	if(per_get_few_bits(pd, 1) == 0) {
+		length = per_get_few_bits(pd, 6) + 1;
+		if(length <= 0) return -1;
+		ASN_DEBUG("l=%ld", length);
+		return length;
+	} else {
+		int repeat;
+		length = aper_get_length(pd, -1, -1, &repeat);
+		if(length >= 0 && !repeat) return length;
+		return -1; /* Error, or do not support >16K extensions */
+	}
+}
+
+ssize_t
+aper_get_nsnnwn(asn_per_data_t *pd, int range) {
+	ssize_t value;
+	int bytes = 0;
+
+	ASN_DEBUG("getting nsnnwn with range %d", range);
+
+	if(range <= 255) {
+		int i;
+
+		if (range < 0) return -1;
+		/* 1 -> 8 bits */
+		for (i = 1; i <= 8; i++) {
+			int upper = 1 << i;
+			if (upper >= range)
+				break;
+		}
+		value = per_get_few_bits(pd, i);
+		return value;
+	} else if (range == 256){
+		/* 1 byte */
+		bytes = 1;
+	} else if (range <= 65536) {
+		/* 2 bytes */
+		bytes = 2;
+	} else {
+		return -1;
+	}
+	if (aper_get_align(pd) < 0)
+		return -1;
+	value = per_get_few_bits(pd, 8 * bytes);
+	return value;
+}
+
+int aper_put_align(asn_per_outp_t *po) {
+
+	if(po->nboff & 0x7) {
+		ASN_DEBUG("Aligning %ld bits", 8 - ((unsigned long)po->nboff & 0x7));
+		if(per_put_few_bits(po, 0x00, (8 - (po->nboff & 0x7))))
+			return -1;
+	}
+	return 0;
+}
+
+ssize_t
+aper_put_length(asn_per_outp_t *po, int range, size_t length) {
+
+	ASN_DEBUG("APER put length %zu with range %d", length, range);
+
+	/* 10.9 X.691 Note 2 */
+	if (range <= 65536 && range >= 0)
+		return aper_put_nsnnwn(po, range, length);
+
+	if (aper_put_align(po) < 0)
+		return -1;
+
+	if(length <= 127)	   /* #10.9.3.6 */{
+		return per_put_few_bits(po, length, 8)
+		? -1 : (ssize_t)length;
+	}
+	else if(length < 16384) /* #10.9.3.7 */
+		return per_put_few_bits(po, length|0x8000, 16)
+		? -1 : (ssize_t)length;
+
+	length >>= 14;
+	if(length > 4) length = 4;
+
+	return per_put_few_bits(po, 0xC0 | length, 8)
+	? -1 : (ssize_t)(length << 14);
+}
+
+
+int
+aper_put_nslength(asn_per_outp_t *po, size_t length) {
+
+	if(length <= 64) {
+		/* #10.9.3.4 */
+		if(length == 0) return -1;
+		return per_put_few_bits(po, length-1, 7) ? -1 : 0;
+	} else {
+		if(aper_put_length(po, -1, length) != (ssize_t)length) {
+			/* This might happen in case of >16K extensions */
+			return -1;
+		}
+	}
+
+	return 0;
+}
+
+int
+aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
+	int bytes;
+
+    ASN_DEBUG("aper put nsnnwn %d with range %d", number, range);
+	/* 10.5.7.1 X.691 */
+	if(range < 0) {
+		int i;
+		for (i = 1; ; i++) {
+			int bits = 1 << (8 * i);
+			if (number <= bits)
+				break;
+		}
+		bytes = i;
+		assert(i <= 4);
+	}
+	if(range <= 255) {
+		int i;
+		for (i = 1; i <= 8; i++) {
+			int bits = 1 << i;
+			if (range <= bits)
+				break;
+		}
+		return per_put_few_bits(po, number, i);
+	} else if(range == 256) {
+		bytes = 1;
+	} else if(range <= 65536) {
+		bytes = 2;
+	} else { /* Ranges > 64K */
+		int i;
+		for (i = 1; ; i++) {
+			int bits = 1 << (8 * i);
+			if (range <= bits)
+				break;
+		}
+		assert(i <= 4);
+		bytes = i;
+	}
+	if(aper_put_align(po) < 0) /* Aligning on octet */
+		return -1;
+/* 	if(per_put_few_bits(po, bytes, 8))
+		return -1;
+*/
+    return per_put_few_bits(po, number, 8 * bytes);
+}
diff --git a/e2sm/lib/xer_decoder.c b/e2sm/lib/xer_decoder.c
new file mode 100644
index 0000000..5b87703
--- /dev/null
+++ b/e2sm/lib/xer_decoder.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <xer_support.h>		/* XER/XML parsing support */
+
+
+/*
+ * Decode the XER encoding of a given type.
+ */
+asn_dec_rval_t
+xer_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *td, void **struct_ptr,
+           const void *buffer, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return td->op->xer_decoder(opt_codec_ctx, td, struct_ptr, 0, buffer, size);
+}
+
+
+
+struct xer__cb_arg {
+	pxml_chunk_type_e	chunk_type;
+	size_t			chunk_size;
+	const void		*chunk_buf;
+	int callback_not_invoked;
+};
+
+static int
+xer__token_cb(pxml_chunk_type_e type, const void *_chunk_data, size_t _chunk_size, void *key) {
+	struct xer__cb_arg *arg = (struct xer__cb_arg *)key;
+	arg->chunk_type = type;
+	arg->chunk_size = _chunk_size;
+	arg->chunk_buf = _chunk_data;
+	arg->callback_not_invoked = 0;
+	return -1;	/* Terminate the XML parsing */
+}
+
+/*
+ * Fetch the next token from the XER/XML stream.
+ */
+ssize_t
+xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_type_e *ch_type) {
+	struct xer__cb_arg arg;
+	int new_stateContext = *stateContext;
+	ssize_t ret;
+
+	arg.callback_not_invoked = 1;
+	ret = pxml_parse(&new_stateContext, buffer, size, xer__token_cb, &arg);
+	if(ret < 0) return -1;
+	if(arg.callback_not_invoked) {
+		assert(ret == 0);	/* No data was consumed */
+        *ch_type = PXER_WMORE;
+		return 0;		/* Try again with more data */
+	} else {
+		assert(arg.chunk_size);
+		assert(arg.chunk_buf == buffer);
+	}
+
+	/*
+	 * Translate the XML chunk types into more convenient ones.
+	 */
+	switch(arg.chunk_type) {
+	case PXML_TEXT:
+		*ch_type = PXER_TEXT;
+		break;
+	case PXML_TAG:
+		*ch_type = PXER_WMORE;
+		return 0;	/* Want more */
+	case PXML_TAG_END:
+		*ch_type = PXER_TAG;
+		break;
+	case PXML_COMMENT:
+	case PXML_COMMENT_END:
+		*ch_type = PXER_COMMENT;
+		break;
+	}
+
+	*stateContext = new_stateContext;
+	return arg.chunk_size;
+}
+
+#define	CSLASH	0x2f	/* '/' */
+#define	LANGLE	0x3c	/* '<' */
+#define	RANGLE	0x3e	/* '>' */
+
+xer_check_tag_e
+xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
+	const char *buf = (const char *)buf_ptr;
+	const char *end;
+	xer_check_tag_e ct = XCT_OPENING;
+
+	if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) {
+		if(size >= 2)
+			ASN_DEBUG("Broken XML tag: \"%c...%c\"",
+			buf[0], buf[size - 1]);
+		return XCT_BROKEN;
+	}
+
+	/*
+	 * Determine the tag class.
+	 */
+	if(buf[1] == CSLASH) {
+		buf += 2;	/* advance past "</" */
+		size -= 3;	/* strip "</" and ">" */
+		ct = XCT_CLOSING;
+		if(size > 0 && buf[size-1] == CSLASH)
+			return XCT_BROKEN;	/* </abc/> */
+	} else {
+		buf++;		/* advance past "<" */
+		size -= 2;	/* strip "<" and ">" */
+		if(size > 0 && buf[size-1] == CSLASH) {
+			ct = XCT_BOTH;
+			size--;	/* One more, for "/" */
+		}
+	}
+
+	/* Sometimes we don't care about the tag */
+	if(!need_tag || !*need_tag)
+		return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+
+	/*
+	 * Determine the tag name.
+	 */
+	for(end = buf + size; buf < end; buf++, need_tag++) {
+		int b = *buf, n = *need_tag;
+		if(b != n) {
+			if(n == 0) {
+				switch(b) {
+				case 0x09: case 0x0a: case 0x0c: case 0x0d:
+				case 0x20:
+					/* "<abc def/>": whitespace is normal */
+					return ct;
+				}
+			}
+			return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+		}
+		if(b == 0)
+			return XCT_BROKEN;	/* Embedded 0 in buf?! */
+	}
+	if(*need_tag)
+		return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+
+	return ct;
+}
+
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {				\
+		size_t num = (num_bytes);			\
+		buf_ptr = ((const char *)buf_ptr) + num;	\
+		size -= num;					\
+		consumed_myself += num;				\
+	} while(0)
+
+#undef	RETURN
+#define	RETURN(_code)	do {					\
+		rval.code = _code;				\
+		rval.consumed = consumed_myself;		\
+		if(rval.code != RC_OK)				\
+			ASN_DEBUG("Failed with %d", rval.code);	\
+		return rval;					\
+	} while(0)
+
+#define	XER_GOT_BODY(chunk_buf, chunk_size, size)	do {	\
+		ssize_t converted_size = body_receiver		\
+			(struct_key, chunk_buf, chunk_size,	\
+				(size_t)chunk_size < size);	\
+		if(converted_size == -1) RETURN(RC_FAIL);	\
+		if(converted_size == 0				\
+			&& size == (size_t)chunk_size)		\
+			RETURN(RC_WMORE);			\
+		chunk_size = converted_size;			\
+	} while(0)
+#define	XER_GOT_EMPTY()	do {					\
+	if(body_receiver(struct_key, 0, 0, size > 0) == -1)	\
+			RETURN(RC_FAIL);			\
+	} while(0)
+
+/*
+ * Generalized function for decoding the primitive values.
+ */
+asn_dec_rval_t
+xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx,
+	asn_struct_ctx_t *ctx,	/* Type decoder context */
+	void *struct_key,
+	const char *xml_tag,	/* Expected XML tag */
+	const void *buf_ptr, size_t size,
+	int (*opt_unexpected_tag_decoder)
+		(void *struct_key, const void *chunk_buf, size_t chunk_size),
+	ssize_t (*body_receiver)
+		(void *struct_key, const void *chunk_buf, size_t chunk_size,
+			int have_more)
+	) {
+
+	asn_dec_rval_t rval;
+	ssize_t consumed_myself = 0;
+
+	(void)opt_codec_ctx;
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 */
+	if(ctx->phase > 1) RETURN(RC_FAIL);
+	for(;;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, buf_ptr, size,
+			&ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+			case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:		/* Got XML comment */
+				ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TEXT:
+				if(ctx->phase == 0) {
+					/*
+					 * We have to ignore whitespace here,
+					 * but in order to be forward compatible
+					 * with EXTENDED-XER (EMBED-VALUES, #25)
+					 * any text is just ignored here.
+					 */
+				} else {
+					XER_GOT_BODY(buf_ptr, ch_size, size);
+				}
+				ADVANCE(ch_size);
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		assert(ch_type == PXER_TAG && size);
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		/*
+		 * Phase 0:
+		 * 	Expecting the opening tag
+		 * 	for the type being processed.
+		 * Phase 1:
+		 * 	Waiting for the closing XML tag.
+		 */
+		switch(tcv) {
+		case XCT_BOTH:
+			if(ctx->phase) break;
+			/* Finished decoding of an empty element */
+			XER_GOT_EMPTY();
+			ADVANCE(ch_size);
+			ctx->phase = 2;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_OPENING:
+			if(ctx->phase) break;
+			ADVANCE(ch_size);
+			ctx->phase = 1;	/* Processing body phase */
+			continue;
+		case XCT_CLOSING:
+			if(!ctx->phase) break;
+			ADVANCE(ch_size);
+			ctx->phase = 2;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_UNKNOWN_BO:
+			/*
+			 * Certain tags in the body may be expected.
+			 */
+			if(opt_unexpected_tag_decoder
+			&& opt_unexpected_tag_decoder(struct_key,
+					buf_ptr, ch_size) >= 0) {
+				/* Tag's processed fine */
+				ADVANCE(ch_size);
+				if(!ctx->phase) {
+					/* We are not expecting
+					 * the closing tag anymore. */
+					ctx->phase = 2;	/* Phase out */
+					RETURN(RC_OK);
+				}
+				continue;
+			}
+			/* Fall through */
+		default:
+			break;		/* Unexpected tag */
+		}
+
+		ASN_DEBUG("Unexpected XML tag (expected \"%s\")", xml_tag);
+		break;	/* Dark and mysterious things have just happened */
+	}
+
+	RETURN(RC_FAIL);
+}
+
+
+size_t
+xer_whitespace_span(const void *chunk_buf, size_t chunk_size) {
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+
+	for(; p < pend; p++) {
+		switch(*p) {
+		/* X.693, #8.1.4
+		 * HORISONTAL TAB (9)
+		 * LINE FEED (10) 
+		 * CARRIAGE RETURN (13) 
+		 * SPACE (32)
+		 */
+		case 0x09: case 0x0a: case 0x0d: case 0x20:
+			continue;
+		default:
+			break;
+		}
+		break;
+	}
+	return (p - (const char *)chunk_buf);
+}
+
+/*
+ * This is a vastly simplified, non-validating XML tree skipper.
+ */
+int
+xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth) {
+	assert(*depth > 0);
+	switch(tcv) {
+	case XCT_BOTH:
+	case XCT_UNKNOWN_BO:
+		/* These negate each other. */
+		return 0;
+	case XCT_OPENING:
+	case XCT_UNKNOWN_OP:
+		++(*depth);
+		return 0;
+	case XCT_CLOSING:
+	case XCT_UNKNOWN_CL:
+		if(--(*depth) == 0)
+			return (tcv == XCT_CLOSING) ? 2 : 1;
+		return 0;
+	default:
+		return -1;
+	}
+}
diff --git a/e2sm/lib/xer_encoder.c b/e2sm/lib/xer_encoder.c
new file mode 100644
index 0000000..4177ede
--- /dev/null
+++ b/e2sm/lib/xer_encoder.c
@@ -0,0 +1,237 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <stdio.h>
+#include <errno.h>
+
+/*
+ * The XER encoder of any type. May be invoked by the application.
+ */
+asn_enc_rval_t
+xer_encode(const asn_TYPE_descriptor_t *td, const void *sptr,
+           enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *cb,
+           void *app_key) {
+    asn_enc_rval_t er = {0, 0, 0};
+	asn_enc_rval_t tmper;
+	const char *mname;
+	size_t mlen;
+	int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2;
+
+	if(!td || !sptr) goto cb_failed;
+
+	mname = td->xml_tag;
+	mlen = strlen(mname);
+
+	ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+	tmper = td->op->xer_encoder(td, sptr, 1, xer_flags, cb, app_key);
+	if(tmper.encoded == -1) return tmper;
+	er.encoded += tmper.encoded;
+
+	ASN__CALLBACK3("</", 2, mname, mlen, ">\n", xcan);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+/*
+ * This is a helper function for xer_fprint, which directs all incoming data
+ * into the provided file descriptor.
+ */
+static int
+xer__print2fp(const void *buffer, size_t size, void *app_key) {
+	FILE *stream = (FILE *)app_key;
+
+	if(fwrite(buffer, 1, size, stream) != size)
+		return -1;
+
+	return 0;
+}
+
+int
+xer_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, const void *sptr) {
+	asn_enc_rval_t er = {0,0,0};
+
+	if(!stream) stream = stdout;
+	if(!td || !sptr)
+		return -1;
+
+	er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream);
+	if(er.encoded == -1)
+		return -1;
+
+	return fflush(stream);
+}
+
+struct xer_buffer {
+    char *buffer;
+    size_t buffer_size;
+    size_t allocated_size;
+};
+
+static int
+xer__buffer_append(const void *buffer, size_t size, void *app_key) {
+    struct xer_buffer *xb = app_key;
+
+    while(xb->buffer_size + size + 1 > xb->allocated_size) {
+        size_t new_size = 2 * (xb->allocated_size ? xb->allocated_size : 64);
+        char *new_buf = MALLOC(new_size);
+        if(!new_buf) return -1;
+        if (xb->buffer) {
+            memcpy(new_buf, xb->buffer, xb->buffer_size);
+        }
+        FREEMEM(xb->buffer);
+        xb->buffer = new_buf;
+        xb->allocated_size = new_size;
+    }
+
+    memcpy(xb->buffer + xb->buffer_size, buffer, size);
+    xb->buffer_size += size;
+    xb->buffer[xb->buffer_size] = '\0';
+    return 0;
+}
+
+enum xer_equivalence_e
+xer_equivalent(const struct asn_TYPE_descriptor_s *td, const void *struct1,
+               const void *struct2, FILE *opt_debug_stream) {
+    struct xer_buffer xb1 = {0, 0, 0};
+    struct xer_buffer xb2 = {0, 0, 0};
+    asn_enc_rval_t e1, e2;
+    asn_dec_rval_t rval;
+    void *sptr = NULL;
+
+    if(!td || !struct1 || !struct2) {
+        if(opt_debug_stream) {
+            if(!td) fprintf(opt_debug_stream, "Type descriptor missing\n");
+            if(!struct1) fprintf(opt_debug_stream, "Structure 1 missing\n");
+            if(!struct2) fprintf(opt_debug_stream, "Structure 2 missing\n");
+        }
+        return XEQ_FAILURE;
+    }
+
+    e1 = xer_encode(td, struct1, XER_F_BASIC, xer__buffer_append, &xb1);
+    if(e1.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of %s failed\n", td->name);
+        }
+        FREEMEM(xb1.buffer);
+        return XEQ_ENCODE1_FAILED;
+    }
+
+    e2 = xer_encode(td, struct2, XER_F_BASIC, xer__buffer_append, &xb2);
+    if(e2.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of %s failed\n", td->name);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ENCODE1_FAILED;
+    }
+
+    if(xb1.buffer_size != xb2.buffer_size
+       || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structures XER-encoded into different byte streams:\n=== "
+                    "Structure 1 ===\n%s\n=== Structure 2 ===\n%s\n",
+                    xb1.buffer, xb2.buffer);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_DIFFERENT;
+    } else {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Both structures encoded into the same XER byte stream "
+                    "of size %" ASN_PRI_SIZE ":\n%s",
+                    xb1.buffer_size, xb1.buffer);
+        }
+    }
+
+    rval = xer_decode(NULL, td, (void **)&sptr, xb1.buffer,
+               xb1.buffer_size);
+    switch(rval.code) {
+    case RC_OK:
+        break;
+    case RC_WMORE:
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structure %s XER decode unexpectedly requires "
+                    "more data:\n%s\n",
+                    td->name, xb1.buffer);
+        }
+        /* Fall through */
+    case RC_FAIL:
+    default:
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structure %s XER decoding resulted in failure.\n",
+                    td->name);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_DECODE_FAILED;
+    }
+
+    if(rval.consumed != xb1.buffer_size
+       && ((rval.consumed > xb1.buffer_size)
+           || xer_whitespace_span(xb1.buffer + rval.consumed,
+                                  xb1.buffer_size - rval.consumed)
+                  != (xb1.buffer_size - rval.consumed))) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Round-trip decode of %s required less bytes (%" ASN_PRI_SIZE ") than "
+                    "encoded (%" ASN_PRI_SIZE ")\n",
+                    td->name, rval.consumed, xb1.buffer_size);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+    /*
+     * Reuse xb2 to encode newly decoded structure.
+     */
+    FREEMEM(xb2.buffer);
+    memset(&xb2, 0, sizeof(xb2));
+
+    e2 = xer_encode(td, sptr, XER_F_BASIC, xer__buffer_append, &xb2);
+    if(e2.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of round-trip decode of %s failed\n",
+                    td->name);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+    ASN_STRUCT_FREE(*td, sptr);
+    sptr = 0;
+
+    if(xb1.buffer_size != xb2.buffer_size
+       || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "XER Encoding of round-trip decode of %s resulted in "
+                    "different byte stream:\n"
+                    "=== Original ===\n%s\n"
+                    "=== Round-tripped ===\n%s\n",
+                    xb1.buffer, xb2.buffer, td->name);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+	FREEMEM(xb1.buffer);
+	FREEMEM(xb2.buffer);
+	return XEQ_SUCCESS;
+}
+
diff --git a/e2sm/lib/xer_support.c b/e2sm/lib/xer_support.c
new file mode 100644
index 0000000..36b4bfb
--- /dev/null
+++ b/e2sm/lib/xer_support.c
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com.
+ * Copyright (c) 2003, 2004, 2005 Lev Walkin <vlm@lionet.info>.
+ * 	All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <xer_support.h>
+
+/* Parser states */
+typedef enum {
+	ST_TEXT,
+	ST_TAG_START,
+	ST_TAG_BODY,
+	ST_TAG_QUOTE_WAIT,
+	ST_TAG_QUOTED_STRING,
+	ST_TAG_UNQUOTED_STRING,
+	ST_COMMENT_WAIT_DASH1,	/* "<!--"[1] */
+	ST_COMMENT_WAIT_DASH2,	/* "<!--"[2] */
+	ST_COMMENT,
+	ST_COMMENT_CLO_DASH2,	/* "-->"[0] */
+	ST_COMMENT_CLO_RT	/* "-->"[1] */
+} pstate_e;
+
+static const int
+_charclass[256] = {
+	0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0,
+	0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+	1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+	2,2,2,2,2,2,2,2, 2,2,0,0,0,0,0,0,	/* 01234567 89       */
+	0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,	/*  ABCDEFG HIJKLMNO */
+	3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0,	/* PQRSTUVW XYZ      */
+	0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,	/*  abcdefg hijklmno */
+	3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0	/* pqrstuvw xyz      */
+};
+#define WHITESPACE(c)	(_charclass[(unsigned char)(c)] == 1)
+#define ALNUM(c)	(_charclass[(unsigned char)(c)] >= 2)
+#define ALPHA(c)	(_charclass[(unsigned char)(c)] == 3)
+
+/* Aliases for characters, ASCII/UTF-8 */
+#define	EXCLAM	0x21	/* '!' */
+#define	CQUOTE	0x22	/* '"' */
+#define	CDASH	0x2d	/* '-' */
+#define	CSLASH	0x2f	/* '/' */
+#define	LANGLE	0x3c	/* '<' */
+#define	CEQUAL	0x3d	/* '=' */
+#define	RANGLE	0x3e	/* '>' */
+#define	CQUEST	0x3f	/* '?' */
+
+/* Invoke token callback */
+#define	TOKEN_CB_CALL(type, _ns, _current_too, _final) do {	\
+		int _ret;					\
+		pstate_e ns  = _ns;				\
+		ssize_t _sz = (p - chunk_start) + _current_too;	\
+		if (!_sz) {					\
+			/* Shortcut */				\
+			state = _ns;				\
+			break;					\
+		}						\
+		_ret = cb(type, chunk_start, _sz, key);		\
+		if(_ret < _sz) {				\
+			if(_current_too && _ret == -1)		\
+				state = ns;			\
+			goto finish;				\
+		}						\
+		chunk_start = p + _current_too;			\
+		state = ns;					\
+	} while(0)
+
+#define TOKEN_CB(_type, _ns, _current_too)			\
+	TOKEN_CB_CALL(_type, _ns, _current_too, 0)
+
+#define PXML_TAG_FINAL_CHUNK_TYPE      PXML_TAG_END
+#define PXML_COMMENT_FINAL_CHUNK_TYPE  PXML_COMMENT_END
+
+#define TOKEN_CB_FINAL(_type, _ns, _current_too)		\
+	TOKEN_CB_CALL( _type ## _FINAL_CHUNK_TYPE , _ns, _current_too, 1)
+
+/*
+ * Parser itself
+ */
+ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_callback_f *cb, void *key) {
+	pstate_e state = (pstate_e)*stateContext;
+	const char *chunk_start = (const char *)xmlbuf;
+	const char *p = chunk_start;
+	const char *end = p + size;
+
+	for(; p < end; p++) {
+	  int C = *(const unsigned char *)p;
+	  switch(state) {
+	  case ST_TEXT:
+		/*
+		 * Initial state: we're in the middle of some text,
+		 * or just have started.
+		 */
+		if (C == LANGLE) 
+			/* We're now in the tag, probably */
+			TOKEN_CB(PXML_TEXT, ST_TAG_START, 0);
+		break;
+	  case ST_TAG_START:
+		if (ALPHA(C) || (C == CSLASH))
+			state = ST_TAG_BODY;
+		else if (C == EXCLAM)
+			state = ST_COMMENT_WAIT_DASH1;
+		else 
+			/*
+			 * Not characters and not whitespace.
+			 * Must be something like "3 < 4".
+			 */
+			TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */
+		break;
+	  case ST_TAG_BODY:
+		switch(C) {
+		case RANGLE:
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+			break;
+		case LANGLE:
+			/*
+			 * The previous tag wasn't completed, but still
+			 * recognized as valid. (Mozilla-compatible)
+			 */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0);	
+			break;
+		case CEQUAL:
+			state = ST_TAG_QUOTE_WAIT;
+			break;
+		}
+		break;
+	  case ST_TAG_QUOTE_WAIT:
+		/*
+		 * State after the equal sign ("=") in the tag.
+		 */
+		switch(C) {
+		case CQUOTE:
+			state = ST_TAG_QUOTED_STRING;
+			break;
+		case RANGLE:
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+			break;
+		default:
+			if(!WHITESPACE(C))
+				/* Unquoted string value */
+				state = ST_TAG_UNQUOTED_STRING;
+		}
+		break;
+	  case ST_TAG_QUOTED_STRING:
+		/*
+		 * Tag attribute's string value in quotes.
+		 */
+		if(C == CQUOTE) {
+			/* Return back to the tag state */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_TAG_UNQUOTED_STRING:
+		if(C == RANGLE) {
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+		} else if(WHITESPACE(C)) {
+			/* Return back to the tag state */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT_WAIT_DASH1:
+		if(C == CDASH) {
+			state = ST_COMMENT_WAIT_DASH2;
+		} else {
+			/* Some ordinary tag. */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT_WAIT_DASH2:
+		if(C == CDASH) {
+			/* Seen "<--" */
+			state = ST_COMMENT;
+		} else {
+			/* Some ordinary tag */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT:
+		if(C == CDASH) {
+			state = ST_COMMENT_CLO_DASH2;
+		}
+		break;
+	  case ST_COMMENT_CLO_DASH2:
+		if(C == CDASH) {
+			state = ST_COMMENT_CLO_RT;
+		} else {
+			/* This is not an end of a comment */
+			state = ST_COMMENT;
+		}
+		break;
+	  case ST_COMMENT_CLO_RT:
+		if(C == RANGLE) {
+			TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1);
+		} else if(C == CDASH) {
+			/* Maintain current state, still waiting for '>' */
+		} else {
+			state = ST_COMMENT;
+		}
+		break;
+	  } /* switch(*ptr) */
+	} /* for() */
+
+	/*
+	 * Flush the partially processed chunk, state permitting.
+	 */
+	if(p - chunk_start) {
+		switch (state) {
+		case ST_COMMENT:
+			TOKEN_CB(PXML_COMMENT, state, 0);
+			break;
+		case ST_TEXT:
+			TOKEN_CB(PXML_TEXT, state, 0);
+			break;
+		default: break;	/* a no-op */
+		}
+	}
+
+finish:
+	*stateContext = (int)state;
+	return chunk_start - (const char *)xmlbuf;
+}
+
diff --git a/e2sm/wrapper.c b/e2sm/wrapper.c
new file mode 100644
index 0000000..9f0fdcf
--- /dev/null
+++ b/e2sm/wrapper.c
@@ -0,0 +1,242 @@
+#include <errno.h>
+#include "wrapper.h"
+#include "OCTET_STRING.h"
+
+
+ssize_t e2sm_encode_ric_control_header(void *buffer, size_t buf_size, void *ueIDbuf, size_t ueIDbuf_size, 
+                        long ricControlStyleType, long ricControlActionID)
+{ 
+        E2SM_RC_ControlHeader_t *controlHeaderIE = (E2SM_RC_ControlHeader_t *)calloc(1, sizeof(E2SM_RC_ControlHeader_t));
+        if(!controlHeaderIE)
+        {
+                fprintf(stderr, "alloc E2SM_RC_ControlHeader failed\n");
+                   return -1;
+        }
+
+        controlHeaderIE->present = E2SM_RC_ControlHeader_PR_controlHeader_Format1;
+        //E2SM_RC_ControlHeader_Format1_t  *controlHeader_Fmt1 = controlHeaderIE->choice.controlHeader_Format1;
+        E2SM_RC_ControlHeader_Format1_t  *controlHeader_Fmt1 = (E2SM_RC_ControlHeader_Format1_t *)calloc(1, sizeof(E2SM_RC_ControlHeader_Format1_t));
+        if(!controlHeader_Fmt1)
+        {
+                fprintf(stderr, "alloc E2SM_RC_ControlHeader failed\n");
+                return -1;
+        }
+        
+        controlHeader_Fmt1->ueId.buf = (uint8_t*)calloc(1, ueIDbuf_size);   
+        memcpy(controlHeader_Fmt1->ueId.buf, ueIDbuf, ueIDbuf_size);        //Check how to get ueIDbuf from string
+        controlHeader_Fmt1->ueId.size = ueIDbuf_size;
+
+        controlHeader_Fmt1->ric_ControlStyle_Type = ricControlStyleType;
+        controlHeader_Fmt1->ric_ControlAction_ID = ricControlActionID;
+
+        controlHeaderIE->choice.controlHeader_Format1 = controlHeader_Fmt1;
+
+        fprintf(stderr, "showing xer of asn_DEF_E2SM_RC_ControlHeader data\n");
+        xer_fprint(stderr, &asn_DEF_E2SM_RC_ControlHeader, controlHeaderIE);
+        fprintf(stderr, "\n");
+        fprintf(stderr, "After xer of asn_DEF_E2SM_RC_ControlHeader data\n");
+   
+        asn_enc_rval_t encode_result;
+        encode_result = aper_encode_to_buffer(&asn_DEF_E2SM_RC_ControlHeader, NULL, controlHeaderIE, buffer, buf_size);
+        ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlHeader, controlHeaderIE);
+        if(encode_result.encoded == -1)
+        {
+                fprintf(stderr, "Cannot encode %s: %s\n", encode_result.failed_type->name, strerror(errno));
+                return -1;
+        }
+        else
+        {
+               return encode_result.encoded;
+        }
+}
+
+
+
+ssize_t e2sm_encode_ric_control_message(void *buffer, size_t buf_size, long targetPrimaryCell, 
+                        long targetCell, long nrOrEUtraCell, long nrCGIOrECGI, void* ranParameterValue, size_t  ranParameterValue_size)
+{
+        E2SM_RC_ControlMessage_t *e2smRcControlMsg = (E2SM_RC_ControlMessage_t*)calloc(1, sizeof(E2SM_RC_ControlMessage_t));
+        if(!e2smRcControlMsg) {
+            fprintf(stderr, "alloc E2SM_RC_ControlMessage_t failed\n");
+        return -1;
+        }
+
+        e2smRcControlMsg->present = E2SM_RC_ControlMessage_PR_controlMessage_Format1;
+
+       // E2SM_RC_ControlMessage_Format1_t *e2smRcControlFormat1 = e2smRcControlMsg->choice.controlMessage_Format1;
+
+        E2SM_RC_ControlMessage_Format1_t *e2smRcControlFormat1 = (E2SM_RC_ControlMessage_Format1_t*)calloc(1, sizeof(E2SM_RC_ControlMessage_Format1_t));
+        if(!e2smRcControlMsg) {
+            fprintf(stderr, "alloc E2SM_RC_ControlMessage_Format1_t failed\n");
+        return -1;
+        }
+        
+
+        e2smRcControlFormat1->ranParameters_List =  
+                        (struct E2SM_RC_ControlMessage_Format1__ranParameters_List*)calloc(1, sizeof(struct E2SM_RC_ControlMessage_Format1__ranParameters_List));
+	if(!e2smRcControlFormat1->ranParameters_List)
+	{
+                fprintf(stderr, "alloc e2smRcControlFormat1->ranParameters_List failed\n");
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                return -1;
+	}
+
+        // Start Target Primary Cell 
+        RANParameter_Item_t *ranParameterItem1 = (RANParameter_Item_t*)calloc(1,sizeof(RANParameter_Item_t));
+        if(!ranParameterItem1) {
+                fprintf(stderr, "alloc RANParameter_Item_t1 failed\n");
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                return -1;
+        }
+
+        
+        ranParameterItem1->ranParameterItem_ID = targetPrimaryCell;     // Target Primary Cell ID value = 1
+        RANParameter_ValueType_t *ranParameterValueType1 = (RANParameter_ValueType_t*)calloc(1, sizeof(RANParameter_ValueType_t));
+        if(!ranParameterValueType1)
+        {
+                fprintf(stderr, "alloc RANParameter_ValueType_t1 failed\n");
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                return -1;
+        }
+        
+        ranParameterValueType1->present = RANParameter_ValueType_PR_ranParameter_Structure;
+        RANParameter_STRUCTURE_t *ranParameterStructure1 = (RANParameter_STRUCTURE_t*)calloc(1, sizeof(RANParameter_STRUCTURE_t));
+        if(!ranParameterStructure1)
+        {
+                fprintf(stderr, "alloc RANParameter_STRUCTURE_t1 failed\n");
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                return -1;
+        }
+
+   
+         // Start Target Cell 
+        RANParameter_Item_t *ranParameterItem2 = (RANParameter_Item_t*)calloc(1,sizeof(RANParameter_Item_t));
+        if(!ranParameterItem2)
+        {
+
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_Item_t2 failed\n");
+                return -1;
+        }
+
+        ranParameterItem2->ranParameterItem_ID = targetCell;    // Target Cell ID value = 2
+        RANParameter_ValueType_t *ranParameterValueType2 = (RANParameter_ValueType_t*)calloc(1, sizeof(RANParameter_ValueType_t));
+        if(!ranParameterValueType2)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_STRUCTURE_t2 failed\n");
+                return -1;
+        }
+        
+
+        ranParameterValueType2->present = RANParameter_ValueType_PR_ranParameter_Structure;
+        RANParameter_STRUCTURE_t *ranParameterStructure2 = (RANParameter_STRUCTURE_t*)calloc(1, sizeof(struct RANParameter_STRUCTURE));
+        if(!ranParameterStructure2)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_STRUCTURE_t2 failed\n");
+                return -1;
+        }
+
+      
+        // Start NR Cell  (or E-UTRA Cell) 
+        RANParameter_Item_t *ranParameterItem3 = (RANParameter_Item_t*)calloc(1,sizeof(RANParameter_Item_t));
+        if(!ranParameterItem3)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_Item_t3 failed\n");
+                return -1;
+        }
+
+        ranParameterItem3->ranParameterItem_ID = nrOrEUtraCell; // NR Cell ID (or E-UTRA Cell ID) value = 
+        RANParameter_ValueType_t *ranParameterValueType3 = (RANParameter_ValueType_t*)calloc(1, sizeof(RANParameter_ValueType_t));
+        if(!ranParameterValueType3)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_Item_t3 failed\n");
+                return -1;
+        }
+
+        ranParameterValueType3->present = RANParameter_ValueType_PR_ranParameter_Structure;
+        RANParameter_STRUCTURE_t *ranParameterStructure3 = (struct RANParameter_STRUCTURE*)calloc(1, sizeof(struct RANParameter_STRUCTURE));
+        if(!ranParameterStructure3)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_Item_t3 failed\n");
+                return -1;
+        }
+
+        // Start NR CGI (or ECGI) 
+        RANParameter_Item_t *ranParameterItem4 = (RANParameter_Item_t*)calloc(1, sizeof(RANParameter_Item_t));
+        if(!ranParameterItem4)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_Item_t4 failed\n");
+                return -1;
+        }
+        ranParameterItem4->ranParameterItem_ID = nrCGIOrECGI;   // NR CGI ID (or ECGI ID) value = 
+        RANParameter_ValueType_t *ranParameterValueType4 = (RANParameter_ValueType_t*)calloc(1, sizeof(RANParameter_ValueType_t));
+        if(!ranParameterValueType4)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_Item_t4 failed\n");
+                return -1;
+        }
+        ranParameterValueType4->present = RANParameter_ValueType_PR_ranParameter_Element;
+        ranParameterValueType4->choice.ranParameter_Element = (RANParameter_ELEMENT_t*)calloc(1, sizeof(RANParameter_ELEMENT_t));
+        if(!ranParameterValueType4->choice.ranParameter_Element)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter_Item_t4 failed\n");
+                return -1;
+        }
+        ranParameterValueType4->choice.ranParameter_Element->keyFlag = 0;
+        ranParameterValueType4->choice.ranParameter_Element->ranParameter_Value.present = RANParameter_Value_PR_valueOctS;
+
+        ranParameterValueType4->choice.ranParameter_Element->ranParameter_Value.choice.valueOctS.buf = 
+                                                (uint8_t*)calloc(1, ranParameterValue_size);
+        if(!ranParameterValueType4->choice.ranParameter_Element->ranParameter_Value.choice.valueOctS.buf)
+        {
+                ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+                fprintf(stderr, "alloc RANParameter Value failed\n");
+                return -1;
+        }
+	memcpy(ranParameterValueType4->choice.ranParameter_Element->ranParameter_Value.choice.valueOctS.buf, ranParameterValue, ranParameterValue_size);
+        ranParameterValueType4->choice.ranParameter_Element->ranParameter_Value.choice.valueOctS.size = ranParameterValue_size;
+        ranParameterItem4->ranParameterItem_valueType = ranParameterValueType4; // NR CGI (or ECGI)
+        
+        ASN_SEQUENCE_ADD(&ranParameterStructure3->sequence_of_ranParameters.list, ranParameterItem4);   // NR CGI (or ECGI)
+        ranParameterValueType3->choice.ranParameter_Structure = ranParameterStructure3; // NR Cell  (or E-UTRA Cell)
+        ranParameterItem3->ranParameterItem_valueType = ranParameterValueType3;
+
+        ASN_SEQUENCE_ADD(&ranParameterStructure2->sequence_of_ranParameters.list, ranParameterItem3);   // NR Cell  (or E-UTRA Cell)
+        ranParameterValueType2->choice.ranParameter_Structure = ranParameterStructure2; // Target Cell
+        ranParameterItem2->ranParameterItem_valueType = ranParameterValueType2;
+
+        ASN_SEQUENCE_ADD(&ranParameterStructure1->sequence_of_ranParameters.list, ranParameterItem2);   // Target Cell
+        ranParameterValueType1->choice.ranParameter_Structure = ranParameterStructure1; // Target Primary Cell
+        ranParameterItem1->ranParameterItem_valueType = ranParameterValueType1;
+
+        ASN_SEQUENCE_ADD(&e2smRcControlFormat1->ranParameters_List->list, ranParameterItem1); // Target Primary Cell
+        e2smRcControlMsg->choice.controlMessage_Format1 = e2smRcControlFormat1;
+
+
+        fprintf(stderr, "showing xer of asn_DEF_E2SM_RC_ControlMessage data\n");
+        xer_fprint(stderr, &asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+        fprintf(stderr, "\n");
+        fprintf(stderr, "After xer of asn_DEF_E2SM_RC_ControlMessage data\n");
+
+        asn_enc_rval_t encode_result;
+        encode_result = aper_encode_to_buffer(&asn_DEF_E2SM_RC_ControlMessage, NULL, e2smRcControlMsg, buffer, buf_size);
+        ASN_STRUCT_FREE(asn_DEF_E2SM_RC_ControlMessage, e2smRcControlMsg);
+        if(encode_result.encoded == -1)
+        {
+                fprintf(stderr, "Cannot encode %s: %s\n", encode_result.failed_type->name, strerror(errno));
+                return -1;
+        }
+        else
+        {
+                return encode_result.encoded;
+        }
+}
+
diff --git a/e2sm/wrapper.h b/e2sm/wrapper.h
new file mode 100644
index 0000000..98dd0a6
--- /dev/null
+++ b/e2sm/wrapper.h
@@ -0,0 +1,47 @@
+#ifndef	_WRAPPER_H_
+#define	_WRAPPER_H_
+
+//#include "ARP.h"
+#include "BOOLEAN.h"
+#include "NativeReal.h"
+#include "NULL.h"
+#include "REAL.h"
+#include "TimeStamp.h"
+#include "OCTET_STRING.h"
+#include "E2SM-RC-ControlHeader-Format1.h"
+#include "E2SM-RC-ControlHeader.h"
+#include "E2SM-RC-ControlMessage-Format1.h"
+#include "E2SM-RC-ControlMessage.h"
+#include "E2SM-RC-RANFunctionDefinition.h"
+#include "INTEGER.h"
+#include "NativeInteger.h"
+#include "OPEN_TYPE.h"
+#include "PrintableString.h"
+#include "RAN-ControlParameter-Item.h"
+#include "RANParameter-ELEMENT.h"
+#include "RANParameter-ID.h"
+#include "RANParameter-Item.h"
+#include "RANParameter-LIST.h"
+#include "RANParameter-Name.h"
+#include "RANParameter-STRUCTURE.h"
+#include "RANParameter-Value.h"
+#include "RANParameter-ValueType.h"
+#include "RANfunction-Name.h"
+#include "RIC-ControlAction-ID.h"
+#include "RIC-ControlAction-Item.h"
+#include "RIC-ControlAction-Name.h"
+#include "RIC-ControlStyle-Item.h"
+#include "RIC-EventTriggerStyle-Item.h"
+#include "RIC-Format-Type.h"
+#include "RIC-Style-Name.h"
+#include "RIC-Style-Type.h"
+#include "UE-Identity.h"
+
+
+extern ssize_t e2sm_encode_ric_control_header(void *buffer, size_t buf_size, void *ueIDbuf, size_t ueIDbuf_size, long ricControlStyleType, long ricControlActionID);
+
+//extern ssize_t e2sm_encode_ric_control_header(void *buffer, size_t buf_size, long ricControlStyleType, long ricControlActionID);
+
+extern ssize_t e2sm_encode_ric_control_message(void *buffer, size_t buf_size, long targetPrimaryCell, long targetCell, long nrOrEUtraCell, long nrCGIOrECGI, void *ranParameterValue, size_t  ranParameterValue_size);
+
+#endif /* _WRAPPER_H_ */
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..9f3d1c0
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,30 @@
+//module gerrit.o-ran-sc.org/r/scp/ric-app
+module nrtric 
+
+go 1.14
+
+require (
+	gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.0.0-00010101000000-000000000000
+	github.com/golang/protobuf v1.5.2
+	golang.org/x/net v0.0.0-20210614182718-04defd469f4e
+        google.golang.org/grpc v1.39.0 
+	k8s.io/utils v0.0.0-20210629042839-4a2b36d8d73f // indirect
+)
+
+replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame
+
+replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2
+
+replace gerrit.o-ran-sc.org/r/com/golog => gerrit.o-ran-sc.org/r/com/golog.git v0.0.2
+
+replace gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common => gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35
+
+replace gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities => gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35
+
+replace gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader => gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35
+
+replace gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm => gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0
+
+replace gerrit.o-ran-sc.org/r/scp/ric-app/control => /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/control
+
+replace gerrit.o-ran-sc.org/r/scp/ric-app/protocol/grpc/ricmsgcommrpc/rc => /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/protocol/grpc/ricmsgcommrpc/rc
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..2346369
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,378 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+gerrit.o-ran-sc.org/r/com/golog.git v0.0.2 h1:Ix6SgFuzd6yW6Ur6+qDlGhDO65UYs8PiIkeAL1VaQ2o=
+gerrit.o-ran-sc.org/r/com/golog.git v0.0.2/go.mod h1:A7hUL52YQSO4dFIZNcj76XQ09C9PftAe3LyL7kqBnok=
+gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0 h1:OKDsIDlttbaoHwleyjflIWVZPgPvYbDhim6gWF0zf5E=
+gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35 h1:TGXHb4DNY8on+ej4S9VUnk2HibIC/5chDy64OE+bQBQ=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35 h1:tkM3yE8UzmuH4nf9TqAmiNBSuIZ2CtcMRH2eBIYIzpQ=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35/go.mod h1:G+4sUBMbLfQ+RrGS65U15tKmbnP+/1b5oLTPmMfyfT4=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35 h1:LcxnUUDwsCzYEISKmkjkyYfg/lnLt8ofkPiGK69vNIA=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35/go.mod h1:2bSaXTpECbZieB8bMnubTqMwF3n+mMBxlTaAXvcduNg=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2 h1:UK7awyRKIkVdokWvvkYvazlg3EWIfMnIqCcJxTnLlDA=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
+github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
+github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
+github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
+github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
+github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
+github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
+github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
+github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
+github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
+github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
+github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
+github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
+github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
+github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
+github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
+github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
+github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
+github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
+github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
+github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk=
+github.com/go-openapi/analysis v0.19.5 h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI=
+github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU=
+github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
+github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
+github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
+github.com/go-openapi/errors v0.19.3 h1:7MGZI1ibQDLasvAz8HuhvYk9eNJbJkCOXWsSjjMS+Zc=
+github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
+github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
+github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
+github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
+github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
+github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
+github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
+github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
+github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
+github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
+github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
+github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
+github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
+github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
+github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs=
+github.com/go-openapi/loads v0.19.4 h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY=
+github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk=
+github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA=
+github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64=
+github.com/go-openapi/runtime v0.19.4 h1:csnOgcgAiuGoM/Po7PEpKDoNulCcF3FGbSnbHfxgjMI=
+github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4=
+github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
+github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
+github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
+github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc=
+github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
+github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
+github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
+github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY=
+github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
+github.com/go-openapi/strfmt v0.19.4 h1:eRvaqAhpL0IL6Trh5fDsGnGhiXndzHFuA05w6sXH6/g=
+github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
+github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
+github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
+github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.7 h1:VRuXN2EnMSsZdauzdss6JBC29YotDqG59BZ+tdlIL1s=
+github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
+github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
+github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
+github.com/go-openapi/validate v0.19.6 h1:WsKw9J1WzYBVxWRYwLqEk3325RL6G0SSWksuamkk6q0=
+github.com/go-openapi/validate v0.19.6/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4=
+github.com/go-redis/redis v6.15.3+incompatible h1:NZ0O90AhLSvSrvLZ/S9h7D4kl1mW2PrKyxL7MyBKO2g=
+github.com/go-redis/redis v6.15.3+incompatible/go.mod h1:W2YCLaZryXHirdd9QqwkiVUxCQsrx8SbLq9Uqk7JS7A=
+github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
+github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
+github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU=
+github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
+github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
+github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
+github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
+github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
+github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
+github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
+github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
+github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
+github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
+github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
+github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w=
+github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
+github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
+github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
+github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8=
+github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM=
+github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY=
+github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
+github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
+github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
+github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
+github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
+github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
+github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
+github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
+github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
+github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
+github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
+github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
+github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
+github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU=
+github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
+github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
+github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
+go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
+go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
+go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA=
+go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
+go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
+go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
+golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
+google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/grpc v1.39.0 h1:Klz8I9kdtkIN6EpHHUOMLCYhTn/2WAe5a0s1hcBkdTI=
+google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
+google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
+k8s.io/utils v0.0.0-20210629042839-4a2b36d8d73f h1:6Cyc8f2OS555SrragQyv4rQ5G7F2haZ6KY2oxO1wzlE=
+k8s.io/utils v0.0.0-20210629042839-4a2b36d8d73f/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
diff --git a/protocol/grpc/ricmsgcommrpc/proto/rc.proto b/protocol/grpc/ricmsgcommrpc/proto/rc.proto
new file mode 100644
index 0000000..6de5b1c
--- /dev/null
+++ b/protocol/grpc/ricmsgcommrpc/proto/rc.proto
@@ -0,0 +1,60 @@
+syntax = "proto3";
+package rc;
+
+enum RICControlCellTypeEnum {
+ 
+    RIC_CONTROL_CELL_UNKWON = 0; 
+    RIC_CONTROL_NR_CELL = 1; 		// Indicates RIC Controls should be set for NR CELL
+    RIC_CONTROL_EUTRAN_CELL = 2;    // Indicates RIC Controls should be set for E_UTRAN CELL
+}
+
+enum RICControlAckEnum {
+ 
+    RIC_CONTROL_ACK_UNKWON = 0; 
+    RIC_CONTROL_NO_ACK = 1; // Optional RIC Control Acknowledgement is not required
+    RIC_CONTROL_ACK = 2;    // Optional RIC Control Acknowledgement is required
+    RIC_CONTROL_NACK = 3;   // Optional RIC Control Acknowledgement is only required to report failure
+}
+
+message RICE2APHeader  {
+        int64          RanFuncId = 1;
+        int64          RICRequestorID = 2;
+}
+
+message RICControlHeader {
+        int64           ControlStyle = 1;
+        int64           ControlActionId = 2;
+        string          UEID = 3;
+}
+
+
+message RICControlMessage {
+	RICControlCellTypeEnum    RICControlCellTypeVal = 1;
+        string         		  TargetCellID = 2;
+		
+}
+
+//RicControl GRPC Req  
+message RicControlGrpcReq {
+	string              e2NodeID = 1;
+	string              plmnID = 2;
+	string              ranName = 3;
+	RICE2APHeader       RICE2APHeaderData = 4;
+	RICControlHeader    RICControlHeaderData = 5;
+	RICControlMessage   RICControlMessageData = 6;
+	RICControlAckEnum   RICControlAckReqVal = 7; //Currently this Parameter is not Encoded as Part of RIC Control message
+}
+
+//RicControlGrpc Rsp
+message RicControlGrpcRsp {
+    int32   rspCode = 1;       //Set rspCode to 0. Acknowledging the receipt of GRPC request
+    string  description = 2;   //Set despcription.
+}
+
+// Services to send gRPC
+service MsgComm {
+    //gRPC call to Send RICControlReqServiceGrpc
+    rpc SendRICControlReqServiceGrpc(RicControlGrpcReq) returns (RicControlGrpcRsp);
+}
+
+
diff --git a/protocol/grpc/ricmsgcommrpc/rc/go.mod b/protocol/grpc/ricmsgcommrpc/rc/go.mod
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/protocol/grpc/ricmsgcommrpc/rc/go.mod
diff --git a/protocol/grpc/ricmsgcommrpc/rc/rc.pb.go b/protocol/grpc/ricmsgcommrpc/rc/rc.pb.go
new file mode 100644
index 0000000..18fbde2
--- /dev/null
+++ b/protocol/grpc/ricmsgcommrpc/rc/rc.pb.go
@@ -0,0 +1,500 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: rc.proto
+
+package rc
+
+import (
+	context "context"
+	fmt "fmt"
+	proto "github.com/golang/protobuf/proto"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+	math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+type RICControlCellTypeEnum int32
+
+const (
+	RICControlCellTypeEnum_RIC_CONTROL_CELL_UNKWON RICControlCellTypeEnum = 0
+	RICControlCellTypeEnum_RIC_CONTROL_NR_CELL     RICControlCellTypeEnum = 1
+	RICControlCellTypeEnum_RIC_CONTROL_EUTRAN_CELL RICControlCellTypeEnum = 2
+)
+
+var RICControlCellTypeEnum_name = map[int32]string{
+	0: "RIC_CONTROL_CELL_UNKWON",
+	1: "RIC_CONTROL_NR_CELL",
+	2: "RIC_CONTROL_EUTRAN_CELL",
+}
+
+var RICControlCellTypeEnum_value = map[string]int32{
+	"RIC_CONTROL_CELL_UNKWON": 0,
+	"RIC_CONTROL_NR_CELL":     1,
+	"RIC_CONTROL_EUTRAN_CELL": 2,
+}
+
+func (x RICControlCellTypeEnum) String() string {
+	return proto.EnumName(RICControlCellTypeEnum_name, int32(x))
+}
+
+func (RICControlCellTypeEnum) EnumDescriptor() ([]byte, []int) {
+	return fileDescriptor_a4fc9282119cff7c, []int{0}
+}
+
+type RICControlAckEnum int32
+
+const (
+	RICControlAckEnum_RIC_CONTROL_ACK_UNKWON RICControlAckEnum = 0
+	RICControlAckEnum_RIC_CONTROL_NO_ACK     RICControlAckEnum = 1
+	RICControlAckEnum_RIC_CONTROL_ACK        RICControlAckEnum = 2
+	RICControlAckEnum_RIC_CONTROL_NACK       RICControlAckEnum = 3
+)
+
+var RICControlAckEnum_name = map[int32]string{
+	0: "RIC_CONTROL_ACK_UNKWON",
+	1: "RIC_CONTROL_NO_ACK",
+	2: "RIC_CONTROL_ACK",
+	3: "RIC_CONTROL_NACK",
+}
+
+var RICControlAckEnum_value = map[string]int32{
+	"RIC_CONTROL_ACK_UNKWON": 0,
+	"RIC_CONTROL_NO_ACK":     1,
+	"RIC_CONTROL_ACK":        2,
+	"RIC_CONTROL_NACK":       3,
+}
+
+func (x RICControlAckEnum) String() string {
+	return proto.EnumName(RICControlAckEnum_name, int32(x))
+}
+
+func (RICControlAckEnum) EnumDescriptor() ([]byte, []int) {
+	return fileDescriptor_a4fc9282119cff7c, []int{1}
+}
+
+type RICE2APHeader struct {
+	RanFuncId            int64    `protobuf:"varint,1,opt,name=RanFuncId,proto3" json:"RanFuncId,omitempty"`
+	RICRequestorID       int64    `protobuf:"varint,2,opt,name=RICRequestorID,proto3" json:"RICRequestorID,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *RICE2APHeader) Reset()         { *m = RICE2APHeader{} }
+func (m *RICE2APHeader) String() string { return proto.CompactTextString(m) }
+func (*RICE2APHeader) ProtoMessage()    {}
+func (*RICE2APHeader) Descriptor() ([]byte, []int) {
+	return fileDescriptor_a4fc9282119cff7c, []int{0}
+}
+
+func (m *RICE2APHeader) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_RICE2APHeader.Unmarshal(m, b)
+}
+func (m *RICE2APHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_RICE2APHeader.Marshal(b, m, deterministic)
+}
+func (m *RICE2APHeader) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_RICE2APHeader.Merge(m, src)
+}
+func (m *RICE2APHeader) XXX_Size() int {
+	return xxx_messageInfo_RICE2APHeader.Size(m)
+}
+func (m *RICE2APHeader) XXX_DiscardUnknown() {
+	xxx_messageInfo_RICE2APHeader.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RICE2APHeader proto.InternalMessageInfo
+
+func (m *RICE2APHeader) GetRanFuncId() int64 {
+	if m != nil {
+		return m.RanFuncId
+	}
+	return 0
+}
+
+func (m *RICE2APHeader) GetRICRequestorID() int64 {
+	if m != nil {
+		return m.RICRequestorID
+	}
+	return 0
+}
+
+type RICControlHeader struct {
+	ControlStyle         int64    `protobuf:"varint,1,opt,name=ControlStyle,proto3" json:"ControlStyle,omitempty"`
+	ControlActionId      int64    `protobuf:"varint,2,opt,name=ControlActionId,proto3" json:"ControlActionId,omitempty"`
+	UEID                 string   `protobuf:"bytes,3,opt,name=UEID,proto3" json:"UEID,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *RICControlHeader) Reset()         { *m = RICControlHeader{} }
+func (m *RICControlHeader) String() string { return proto.CompactTextString(m) }
+func (*RICControlHeader) ProtoMessage()    {}
+func (*RICControlHeader) Descriptor() ([]byte, []int) {
+	return fileDescriptor_a4fc9282119cff7c, []int{1}
+}
+
+func (m *RICControlHeader) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_RICControlHeader.Unmarshal(m, b)
+}
+func (m *RICControlHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_RICControlHeader.Marshal(b, m, deterministic)
+}
+func (m *RICControlHeader) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_RICControlHeader.Merge(m, src)
+}
+func (m *RICControlHeader) XXX_Size() int {
+	return xxx_messageInfo_RICControlHeader.Size(m)
+}
+func (m *RICControlHeader) XXX_DiscardUnknown() {
+	xxx_messageInfo_RICControlHeader.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RICControlHeader proto.InternalMessageInfo
+
+func (m *RICControlHeader) GetControlStyle() int64 {
+	if m != nil {
+		return m.ControlStyle
+	}
+	return 0
+}
+
+func (m *RICControlHeader) GetControlActionId() int64 {
+	if m != nil {
+		return m.ControlActionId
+	}
+	return 0
+}
+
+func (m *RICControlHeader) GetUEID() string {
+	if m != nil {
+		return m.UEID
+	}
+	return ""
+}
+
+type RICControlMessage struct {
+	RICControlCellTypeVal RICControlCellTypeEnum `protobuf:"varint,1,opt,name=RICControlCellTypeVal,proto3,enum=rc.RICControlCellTypeEnum" json:"RICControlCellTypeVal,omitempty"`
+	TargetCellID          string                 `protobuf:"bytes,2,opt,name=TargetCellID,proto3" json:"TargetCellID,omitempty"`
+	XXX_NoUnkeyedLiteral  struct{}               `json:"-"`
+	XXX_unrecognized      []byte                 `json:"-"`
+	XXX_sizecache         int32                  `json:"-"`
+}
+
+func (m *RICControlMessage) Reset()         { *m = RICControlMessage{} }
+func (m *RICControlMessage) String() string { return proto.CompactTextString(m) }
+func (*RICControlMessage) ProtoMessage()    {}
+func (*RICControlMessage) Descriptor() ([]byte, []int) {
+	return fileDescriptor_a4fc9282119cff7c, []int{2}
+}
+
+func (m *RICControlMessage) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_RICControlMessage.Unmarshal(m, b)
+}
+func (m *RICControlMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_RICControlMessage.Marshal(b, m, deterministic)
+}
+func (m *RICControlMessage) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_RICControlMessage.Merge(m, src)
+}
+func (m *RICControlMessage) XXX_Size() int {
+	return xxx_messageInfo_RICControlMessage.Size(m)
+}
+func (m *RICControlMessage) XXX_DiscardUnknown() {
+	xxx_messageInfo_RICControlMessage.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RICControlMessage proto.InternalMessageInfo
+
+func (m *RICControlMessage) GetRICControlCellTypeVal() RICControlCellTypeEnum {
+	if m != nil {
+		return m.RICControlCellTypeVal
+	}
+	return RICControlCellTypeEnum_RIC_CONTROL_CELL_UNKWON
+}
+
+func (m *RICControlMessage) GetTargetCellID() string {
+	if m != nil {
+		return m.TargetCellID
+	}
+	return ""
+}
+
+//RicControl GRPC Req
+type RicControlGrpcReq struct {
+	E2NodeID              string             `protobuf:"bytes,1,opt,name=e2NodeID,proto3" json:"e2NodeID,omitempty"`
+	PlmnID                string             `protobuf:"bytes,2,opt,name=plmnID,proto3" json:"plmnID,omitempty"`
+	RanName               string             `protobuf:"bytes,3,opt,name=ranName,proto3" json:"ranName,omitempty"`
+	RICE2APHeaderData     *RICE2APHeader     `protobuf:"bytes,4,opt,name=RICE2APHeaderData,proto3" json:"RICE2APHeaderData,omitempty"`
+	RICControlHeaderData  *RICControlHeader  `protobuf:"bytes,5,opt,name=RICControlHeaderData,proto3" json:"RICControlHeaderData,omitempty"`
+	RICControlMessageData *RICControlMessage `protobuf:"bytes,6,opt,name=RICControlMessageData,proto3" json:"RICControlMessageData,omitempty"`
+	RICControlAckReqVal   RICControlAckEnum  `protobuf:"varint,7,opt,name=RICControlAckReqVal,proto3,enum=rc.RICControlAckEnum" json:"RICControlAckReqVal,omitempty"`
+	XXX_NoUnkeyedLiteral  struct{}           `json:"-"`
+	XXX_unrecognized      []byte             `json:"-"`
+	XXX_sizecache         int32              `json:"-"`
+}
+
+func (m *RicControlGrpcReq) Reset()         { *m = RicControlGrpcReq{} }
+func (m *RicControlGrpcReq) String() string { return proto.CompactTextString(m) }
+func (*RicControlGrpcReq) ProtoMessage()    {}
+func (*RicControlGrpcReq) Descriptor() ([]byte, []int) {
+	return fileDescriptor_a4fc9282119cff7c, []int{3}
+}
+
+func (m *RicControlGrpcReq) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_RicControlGrpcReq.Unmarshal(m, b)
+}
+func (m *RicControlGrpcReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_RicControlGrpcReq.Marshal(b, m, deterministic)
+}
+func (m *RicControlGrpcReq) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_RicControlGrpcReq.Merge(m, src)
+}
+func (m *RicControlGrpcReq) XXX_Size() int {
+	return xxx_messageInfo_RicControlGrpcReq.Size(m)
+}
+func (m *RicControlGrpcReq) XXX_DiscardUnknown() {
+	xxx_messageInfo_RicControlGrpcReq.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RicControlGrpcReq proto.InternalMessageInfo
+
+func (m *RicControlGrpcReq) GetE2NodeID() string {
+	if m != nil {
+		return m.E2NodeID
+	}
+	return ""
+}
+
+func (m *RicControlGrpcReq) GetPlmnID() string {
+	if m != nil {
+		return m.PlmnID
+	}
+	return ""
+}
+
+func (m *RicControlGrpcReq) GetRanName() string {
+	if m != nil {
+		return m.RanName
+	}
+	return ""
+}
+
+func (m *RicControlGrpcReq) GetRICE2APHeaderData() *RICE2APHeader {
+	if m != nil {
+		return m.RICE2APHeaderData
+	}
+	return nil
+}
+
+func (m *RicControlGrpcReq) GetRICControlHeaderData() *RICControlHeader {
+	if m != nil {
+		return m.RICControlHeaderData
+	}
+	return nil
+}
+
+func (m *RicControlGrpcReq) GetRICControlMessageData() *RICControlMessage {
+	if m != nil {
+		return m.RICControlMessageData
+	}
+	return nil
+}
+
+func (m *RicControlGrpcReq) GetRICControlAckReqVal() RICControlAckEnum {
+	if m != nil {
+		return m.RICControlAckReqVal
+	}
+	return RICControlAckEnum_RIC_CONTROL_ACK_UNKWON
+}
+
+//RicControlGrpc Rsp
+type RicControlGrpcRsp struct {
+	RspCode              int32    `protobuf:"varint,1,opt,name=rspCode,proto3" json:"rspCode,omitempty"`
+	Description          string   `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *RicControlGrpcRsp) Reset()         { *m = RicControlGrpcRsp{} }
+func (m *RicControlGrpcRsp) String() string { return proto.CompactTextString(m) }
+func (*RicControlGrpcRsp) ProtoMessage()    {}
+func (*RicControlGrpcRsp) Descriptor() ([]byte, []int) {
+	return fileDescriptor_a4fc9282119cff7c, []int{4}
+}
+
+func (m *RicControlGrpcRsp) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_RicControlGrpcRsp.Unmarshal(m, b)
+}
+func (m *RicControlGrpcRsp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_RicControlGrpcRsp.Marshal(b, m, deterministic)
+}
+func (m *RicControlGrpcRsp) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_RicControlGrpcRsp.Merge(m, src)
+}
+func (m *RicControlGrpcRsp) XXX_Size() int {
+	return xxx_messageInfo_RicControlGrpcRsp.Size(m)
+}
+func (m *RicControlGrpcRsp) XXX_DiscardUnknown() {
+	xxx_messageInfo_RicControlGrpcRsp.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RicControlGrpcRsp proto.InternalMessageInfo
+
+func (m *RicControlGrpcRsp) GetRspCode() int32 {
+	if m != nil {
+		return m.RspCode
+	}
+	return 0
+}
+
+func (m *RicControlGrpcRsp) GetDescription() string {
+	if m != nil {
+		return m.Description
+	}
+	return ""
+}
+
+func init() {
+	proto.RegisterEnum("rc.RICControlCellTypeEnum", RICControlCellTypeEnum_name, RICControlCellTypeEnum_value)
+	proto.RegisterEnum("rc.RICControlAckEnum", RICControlAckEnum_name, RICControlAckEnum_value)
+	proto.RegisterType((*RICE2APHeader)(nil), "rc.RICE2APHeader")
+	proto.RegisterType((*RICControlHeader)(nil), "rc.RICControlHeader")
+	proto.RegisterType((*RICControlMessage)(nil), "rc.RICControlMessage")
+	proto.RegisterType((*RicControlGrpcReq)(nil), "rc.RicControlGrpcReq")
+	proto.RegisterType((*RicControlGrpcRsp)(nil), "rc.RicControlGrpcRsp")
+}
+
+func init() { proto.RegisterFile("rc.proto", fileDescriptor_a4fc9282119cff7c) }
+
+var fileDescriptor_a4fc9282119cff7c = []byte{
+	// 527 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0x4d, 0x6f, 0xda, 0x40,
+	0x10, 0xad, 0x21, 0x5f, 0x4c, 0xda, 0x84, 0x4c, 0x08, 0x41, 0x34, 0x07, 0xe4, 0x43, 0x85, 0x72,
+	0xe0, 0x40, 0x7f, 0x40, 0x65, 0x2d, 0x34, 0xb1, 0x20, 0x26, 0x1a, 0xa0, 0x39, 0x22, 0x77, 0xbd,
+	0x42, 0x08, 0x63, 0x9b, 0xb5, 0xa9, 0x94, 0x6b, 0x6f, 0xfd, 0xd7, 0x95, 0x97, 0x0d, 0x06, 0xe3,
+	0x1b, 0xf3, 0x66, 0xde, 0x9b, 0x9d, 0x79, 0x83, 0xe1, 0x42, 0xf2, 0x4e, 0x24, 0xc3, 0x24, 0xc4,
+	0x92, 0xe4, 0xe6, 0x14, 0xbe, 0x90, 0xcd, 0xfa, 0x5d, 0xeb, 0xf5, 0x59, 0xb8, 0x9e, 0x90, 0xf8,
+	0x00, 0x15, 0x72, 0x83, 0x9f, 0x9b, 0x80, 0xdb, 0x5e, 0xc3, 0x68, 0x19, 0xed, 0x32, 0x65, 0x00,
+	0x7e, 0x83, 0x2b, 0xb2, 0x19, 0x89, 0xf5, 0x46, 0xc4, 0x49, 0x28, 0xed, 0x5e, 0xa3, 0xa4, 0x4a,
+	0x72, 0xa8, 0x99, 0x40, 0x95, 0x6c, 0xc6, 0xc2, 0x20, 0x91, 0xa1, 0xaf, 0x95, 0x4d, 0xf8, 0xac,
+	0x81, 0x71, 0xf2, 0xee, 0x0b, 0x2d, 0x7e, 0x80, 0x61, 0x1b, 0xae, 0x75, 0x6c, 0xf1, 0x64, 0x11,
+	0x06, 0xb6, 0xa7, 0x1b, 0xe4, 0x61, 0x44, 0x38, 0x99, 0xf6, 0xed, 0x5e, 0xa3, 0xdc, 0x32, 0xda,
+	0x15, 0x52, 0xbf, 0xcd, 0x7f, 0x06, 0xdc, 0x64, 0x6d, 0x5f, 0x44, 0x1c, 0xbb, 0x73, 0x81, 0xaf,
+	0x70, 0x97, 0x81, 0x4c, 0xf8, 0xfe, 0xe4, 0x3d, 0x12, 0xbf, 0x5c, 0x5f, 0x3d, 0xe0, 0xaa, 0xdb,
+	0xec, 0x48, 0xde, 0x39, 0x2e, 0xe8, 0x07, 0x9b, 0x15, 0x15, 0x13, 0xd3, 0x49, 0x26, 0xae, 0x9c,
+	0x8b, 0x24, 0x05, 0xf5, 0x0e, 0x2a, 0x74, 0x80, 0x99, 0x7f, 0xcb, 0x70, 0x43, 0x0b, 0xae, 0xd9,
+	0x4f, 0x32, 0xe2, 0x24, 0xd6, 0xd8, 0x84, 0x0b, 0xd1, 0x75, 0x42, 0x4f, 0xd8, 0x3d, 0xd5, 0xbe,
+	0x42, 0xbb, 0x18, 0xeb, 0x70, 0x16, 0xf9, 0xab, 0x60, 0xa7, 0xa7, 0x23, 0x6c, 0xc0, 0xb9, 0x74,
+	0x03, 0xc7, 0x5d, 0x09, 0x3d, 0xec, 0x47, 0x88, 0x3f, 0xd4, 0xb8, 0x99, 0x79, 0x3d, 0x37, 0x71,
+	0x1b, 0x27, 0x2d, 0xa3, 0x7d, 0xd9, 0xbd, 0xd1, 0x53, 0x65, 0x49, 0x3a, 0xae, 0xc5, 0x67, 0xa8,
+	0xe5, 0x6d, 0x52, 0x1a, 0xa7, 0x4a, 0xa3, 0x76, 0xb8, 0x19, 0x2d, 0x53, 0xc8, 0xc0, 0xc1, 0xfe,
+	0x92, 0xf5, 0xe6, 0x95, 0xd4, 0x99, 0x92, 0xba, 0x3b, 0x94, 0xd2, 0x05, 0x54, 0xcc, 0xc1, 0x27,
+	0xb8, 0xcd, 0x12, 0x16, 0x5f, 0x92, 0x58, 0xa7, 0x7e, 0x9d, 0x2b, 0xbf, 0x72, 0x52, 0x16, 0x5f,
+	0x2a, 0xab, 0x8a, 0x18, 0xe6, 0xe8, 0xc8, 0x83, 0x38, 0x52, 0xfb, 0x8c, 0x23, 0x16, 0x7a, 0xdb,
+	0x13, 0x3c, 0xa5, 0x8f, 0x10, 0x5b, 0x70, 0xe9, 0x89, 0x98, 0xcb, 0x45, 0x94, 0x1e, 0x99, 0xb6,
+	0x61, 0x1f, 0x7a, 0x5c, 0x42, 0xbd, 0xf8, 0x54, 0xf0, 0x2b, 0xdc, 0x93, 0xcd, 0x66, 0x6c, 0xe4,
+	0x4c, 0x68, 0x34, 0x9c, 0xb1, 0xfe, 0x70, 0x38, 0x9b, 0x3a, 0x83, 0xb7, 0x91, 0x53, 0xfd, 0x84,
+	0xf7, 0x6a, 0xa0, 0x5d, 0xd2, 0x21, 0x95, 0xaf, 0x1a, 0x79, 0x56, 0x7f, 0x3a, 0x21, 0xcb, 0xd9,
+	0x26, 0x4b, 0x8f, 0x72, 0xff, 0x9a, 0xf5, 0x9c, 0xd8, 0x54, 0x2f, 0xd8, 0x31, 0x2c, 0x36, 0xc8,
+	0xda, 0xd4, 0x01, 0x0f, 0xda, 0x8c, 0xd2, 0x74, 0xd5, 0xc0, 0x5b, 0xb8, 0xce, 0x71, 0xaa, 0x25,
+	0xac, 0xa9, 0xbf, 0x68, 0x56, 0x9c, 0xa2, 0xe5, 0xee, 0x1b, 0x9c, 0xbf, 0xc4, 0x73, 0x16, 0xae,
+	0x56, 0x38, 0x84, 0x87, 0xb1, 0x08, 0xbc, 0xec, 0x09, 0x24, 0xd6, 0x63, 0x21, 0xff, 0x2c, 0xb8,
+	0x48, 0x57, 0x89, 0x5b, 0x23, 0xf2, 0x27, 0xde, 0x2c, 0x82, 0xe3, 0xe8, 0xf7, 0x99, 0xfa, 0xe6,
+	0x7c, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xb8, 0xbb, 0xfc, 0x7f, 0x04, 0x00, 0x00,
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConn
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion4
+
+// MsgCommClient is the client API for MsgComm service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type MsgCommClient interface {
+	//gRPC call to Send RICControlReqServiceGrpc
+	SendRICControlReqServiceGrpc(ctx context.Context, in *RicControlGrpcReq, opts ...grpc.CallOption) (*RicControlGrpcRsp, error)
+}
+
+type msgCommClient struct {
+	cc *grpc.ClientConn
+}
+
+func NewMsgCommClient(cc *grpc.ClientConn) MsgCommClient {
+	return &msgCommClient{cc}
+}
+
+func (c *msgCommClient) SendRICControlReqServiceGrpc(ctx context.Context, in *RicControlGrpcReq, opts ...grpc.CallOption) (*RicControlGrpcRsp, error) {
+	out := new(RicControlGrpcRsp)
+	err := c.cc.Invoke(ctx, "/rc.MsgComm/SendRICControlReqServiceGrpc", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// MsgCommServer is the server API for MsgComm service.
+type MsgCommServer interface {
+	//gRPC call to Send RICControlReqServiceGrpc
+	SendRICControlReqServiceGrpc(context.Context, *RicControlGrpcReq) (*RicControlGrpcRsp, error)
+}
+
+// UnimplementedMsgCommServer can be embedded to have forward compatible implementations.
+type UnimplementedMsgCommServer struct {
+}
+
+func (*UnimplementedMsgCommServer) SendRICControlReqServiceGrpc(ctx context.Context, req *RicControlGrpcReq) (*RicControlGrpcRsp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method SendRICControlReqServiceGrpc not implemented")
+}
+
+func RegisterMsgCommServer(s *grpc.Server, srv MsgCommServer) {
+	s.RegisterService(&_MsgComm_serviceDesc, srv)
+}
+
+func _MsgComm_SendRICControlReqServiceGrpc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(RicControlGrpcReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(MsgCommServer).SendRICControlReqServiceGrpc(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/rc.MsgComm/SendRICControlReqServiceGrpc",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(MsgCommServer).SendRICControlReqServiceGrpc(ctx, req.(*RicControlGrpcReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+var _MsgComm_serviceDesc = grpc.ServiceDesc{
+	ServiceName: "rc.MsgComm",
+	HandlerType: (*MsgCommServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "SendRICControlReqServiceGrpc",
+			Handler:    _MsgComm_SendRICControlReqServiceGrpc_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "rc.proto",
+}
diff --git a/releases/container-release-ric-app-ts.yaml b/releases/container-release-ric-app-ts.yaml
new file mode 100644
index 0000000..a20d0e2
--- /dev/null
+++ b/releases/container-release-ric-app-ts.yaml
@@ -0,0 +1,10 @@
+---
+distribution_type: container
+container_release_tag: 1.0.1
+container_pull_registry: nexus3.o-ran-sc.org:10004
+container_push_registry: nexus3.o-ran-sc.org:10002
+project: ric-app/rc
+ref: f291db7f83f61976fb46a65e5496317131d5ae82
+containers:
+    - name: ric-app-rc
+      version: 1.0.1
diff --git a/unitTest/grpcClient.sh b/unitTest/grpcClient.sh
new file mode 100644
index 0000000..74ecbba
--- /dev/null
+++ b/unitTest/grpcClient.sh
@@ -0,0 +1,5 @@
+./grpcurl -plaintext -d "{ \"e2NodeID\": \"36000000\", \"plmnID\": \"111\", \"ranName\": \"gnb_131_133_36000000\", \"RICE2APHeaderData\": { \"RanFuncId\": 300, \"RICRequestorID\": 2 }, \"RICControlHeaderData\": { \"ControlStyle\": 3, \"ControlActionId\": 1, \"UEID\": \"00006\" }, \"RICControlMessageData\": { \"RICControlCellTypeVal\": 4, \"TargetCellID\": \"1113\" }, \"RICControlAckReqVal\": 0 }"  10.96.106.3:7777 rc.MsgComm.SendRICControlReqServiceGrpc
+
+#10.96.106.3:7777  is the grpc server ip and port
+#Values of other parameters can be provided as shown above
+
diff --git a/xapp-descriptor/config.json b/xapp-descriptor/config.json
new file mode 100644
index 0000000..adae08c
--- /dev/null
+++ b/xapp-descriptor/config.json
@@ -0,0 +1,46 @@
+{
+  "xapp_name": "rc",
+  "version": "1.0.0",
+  "configPath": "/opt/ric/config/",
+  "containers": [
+    {
+      "name": "rc",
+      "image": {
+        "registry": "nexus3.o-ran-sc.org:10002",
+        "name": "o-ran-sc/scp-ric-app-rc",
+        "tag": "1.0.0"
+      }
+    }
+  ],
+  "messaging": {
+    "ports": [
+      {
+        "name": "rmr-data",
+        "container": "rc",
+        "port": 4560,
+        "rxMessages": ["RIC_CONTROL_RESP"],
+        "txMessages": ["RIC_CONTROL_REQ"],
+        "policies": [],
+        "description": "rmr receive data port for rc"
+      },
+      {
+        "name": "rmr-route",
+        "container": "rc",
+        "port": 4561,
+        "description": "rmr route port for rc"
+      }
+    ]
+  },
+  "rmr": {
+    "protPort": "tcp:4560",
+    "maxSize": 2072,
+    "numWorkers": 1,
+    "rxMessages": ["RIC_CONTROL_RESP"],
+    "txMessages": ["RIC_CONTROL_REQ"],
+    "policies": []
+  },
+  "controls": {
+    "ricHOControlgRpcServerPort" : "7777"
+}
+
+}
diff --git a/xapp-descriptor/schema.json b/xapp-descriptor/schema.json
new file mode 100644
index 0000000..6447d9b
--- /dev/null
+++ b/xapp-descriptor/schema.json
@@ -0,0 +1,29 @@
+{
+"controls-schema.json": {
+        "$schema": "http://json-schema.org/draft-07/schema#", "$id": "#/controls",
+        "type": "object",
+        "title": "Controls Section Schema",
+        "required": [
+                "ricHOControlgRpcServerPort",
+                "logLevel"
+        ],
+        "properties": {
+           "ricHOControlgRpcServerPort": {
+           "$id": "#/properties/ricHOControlgRpcServerPort",
+           "type": "string",
+           "title": "GRPC Port",
+           "default": "7777",
+           "examples": [
+           "7777"
+      ],
+      "logLevel" : {
+      "$id": "#/properties/logLevel",
+      "type": "int",
+      "title": "log level",
+      "default":3,
+       "examples": [3]
+      }
+    }
+    }
+  }
+}
