-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apMsgIndication struct {
- e2apMessage
- msgC *C.RICIndication_t
-}
-
-func (e2apMsg *e2apMsgIndication) Set(data *e2ap.E2APIndication) error {
-
- e2apMsg.msgC = &C.RICIndication_t{}
- C.initIndication(e2apMsg.msgC)
-
- e2apMsg.msgC.ranFunctionID = (C.uint16_t)(data.FunctionId)
- e2apMsg.msgC.ricIndicationSN = (C.int32_t)(data.IndicationSn)
- e2apMsg.msgC.ricIndicationType = (C.uint64_t)(data.IndicationType)
-
- if err := (&e2apEntryRequestID{entry: &e2apMsg.msgC.ricRequestID}).set(&data.RequestId); err != nil {
- return err
- }
- if err := (&e2apEntryIndicationHeader{entry: &e2apMsg.msgC.ricIndicationHeader}).set(&data.IndicationHeader); err != nil {
- return err
- }
- if err := (&e2apEntryIndicationMessage{entry: &e2apMsg.msgC.ricIndicationMessage}).set(&data.IndicationMessage); err != nil {
- return err
- }
- /* NOT SUPPORTED
- if err := (&e2apEntryCallProcessId{entry: &e2apMsg.msgC.ricCallProcessID}).set(&data.CallProcessId); err != nil {
- return err
- }
- */
- return nil
-}
-
-func (e2apMsg *e2apMsgIndication) Get() (error, *e2ap.E2APIndication) {
-
- data := &e2ap.E2APIndication{}
-
- data.FunctionId = (e2ap.FunctionId)(e2apMsg.msgC.ranFunctionID)
- data.IndicationSn = (int32)(e2apMsg.msgC.ricIndicationSN)
- data.IndicationType = (uint64)(e2apMsg.msgC.ricIndicationType)
-
- if err := (&e2apEntryRequestID{entry: &e2apMsg.msgC.ricRequestID}).get(&data.RequestId); err != nil {
- return err, data
- }
- if err := (&e2apEntryIndicationHeader{entry: &e2apMsg.msgC.ricIndicationHeader}).get(&data.IndicationHeader); err != nil {
- return err, data
- }
- if err := (&e2apEntryIndicationMessage{entry: &e2apMsg.msgC.ricIndicationMessage}).get(&data.IndicationMessage); err != nil {
- return err, data
- }
- /* NOT SUPPORTED
- if err := (&e2apEntryCallProcessId{entry: &e2apMsg.msgC.ricCallProcessID}).get(&data.CallProcessId); err != nil {
- return err,data
- }
- */
- return nil, data
-}
-
-func (e2apMsg *e2apMsgIndication) PduPack(logBuf []byte, data *packer.PackedData) error {
-
- /* NOT SUPPORTED
- callProcId := e2apEntryCallProcessId{entry: &e2apMsg.msgC.ricCallProcessID}
- if err := callProcId.pack(); err != nil {
- return err
- }
- */
- var buflen uint32 = (uint32)(len(data.Buf))
- errorNro := C.packRICIndication((*C.size_t)(unsafe.Pointer(&buflen)), (*C.uchar)(unsafe.Pointer(&data.Buf[0])), (*C.char)(unsafe.Pointer(&logBuf[0])), e2apMsg.msgC)
- if errorNro != C.e2err_OK {
- return fmt.Errorf("%s", C.GoString(C.getE2ErrorString(errorNro)))
- }
- data.Buf = data.Buf[0:buflen]
- return nil
-}
-
-func (e2apMsg *e2apMsgIndication) PduUnPack(logBuf []byte, data *packer.PackedData) error {
-
- e2apMsg.msgC = &C.RICIndication_t{}
- C.initIndication(e2apMsg.msgC)
-
- e2apMsg.e2apMessage.PduUnPack(logBuf, data)
- if e2apMsg.e2apMessage.messageInfo.messageType != C.cE2InitiatingMessage || e2apMsg.e2apMessage.messageInfo.messageId != C.cRICIndication {
- return fmt.Errorf("unpackE2AP_pdu failed -> %s", e2apMsg.e2apMessage.String())
- }
- errorNro := C.getRICIndicationData(e2apMsg.e2apMessage.pdu, e2apMsg.msgC)
- if errorNro != C.e2err_OK {
- return fmt.Errorf("%s", C.GoString(C.getE2ErrorString(errorNro)))
- }
-
- /* NOT SUPPORTED
- callProcId := e2apEntryCallProcessId{entry: &e2apMsg.msgC.ricCallProcessID}
- if err := callProcId.unpack(); err != nil {
- return err
- }
- */
- return nil
-}
-
-func (e2apMsg *e2apMsgIndication) Pack(trg *packer.PackedData) (error, *packer.PackedData) {
- return packer.PduPackerPackAllocTrg(e2apMsg, trg)
-}
-
-func (e2apMsg *e2apMsgIndication) UnPack(msg *packer.PackedData) error {
- return packer.PduPackerUnPack(e2apMsg, msg)
-}
-
-func (e2apMsg *e2apMsgIndication) String() string {
- var b bytes.Buffer
- fmt.Fprintln(&b, "ricIndication.")
- fmt.Fprintln(&b, " ricRequestID.")
- fmt.Fprintln(&b, " ricRequestorID =", e2apMsg.msgC.ricRequestID.ricRequestorID)
- fmt.Fprintln(&b, " ricRequestSequenceNumber =", e2apMsg.msgC.ricRequestID.ricRequestSequenceNumber)
- fmt.Fprintln(&b, " ranFunctionID =", e2apMsg.msgC.ranFunctionID)
-
- fmt.Fprintln(&b, " ricActionID =", e2apMsg.msgC.ricActionID)
- fmt.Fprintln(&b, " ricIndicationSN =", e2apMsg.msgC.ricIndicationSN)
- fmt.Fprintln(&b, " ricIndicationType =", e2apMsg.msgC.ricIndicationType)
- fmt.Fprintln(&b, " ricIndication.ricIndicationHeader.")
- fmt.Fprintln(&b, " interfaceID.globalENBIDPresent =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBIDPresent)
- if e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBIDPresent {
- fmt.Fprintln(&b, " interfaceID.globalENBID.pLMNIdentity.contentLength =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.contentLength)
- fmt.Fprintln(&b, " interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0] =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0])
- fmt.Fprintln(&b, " interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1] =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1])
- fmt.Fprintln(&b, " interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2] =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2])
- fmt.Fprintln(&b, " interfaceID.globalENBID.nodeID.bits =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBID.nodeID.bits)
- fmt.Fprintln(&b, " interfaceID.globalENBID.nodeID.nodeID =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalENBID.nodeID.nodeID)
- }
- fmt.Fprintln(&b, " interfaceID.globalGNBIDPresent =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBIDPresent)
- if e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBIDPresent {
- fmt.Fprintln(&b, " interfaceID.globalGNBID.pLMNIdentity.contentLength =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.contentLength)
- fmt.Fprintln(&b, " interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[0] =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[0])
- fmt.Fprintln(&b, " interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[1] =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[1])
- fmt.Fprintln(&b, " interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[2] =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[2])
- fmt.Fprintln(&b, " interfaceID.globalGNBID.nodeID.bits =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBID.nodeID.bits)
- fmt.Fprintln(&b, " interfaceID.globalGNBID.nodeID.nodeID =", e2apMsg.msgC.ricIndicationHeader.interfaceID.globalGNBID.nodeID.nodeID)
- }
- fmt.Fprintln(&b, " ricIndication.ricIndicationMessage.interfaceMessage.contentLength =", e2apMsg.msgC.ricIndicationMessage.interfaceMessage.contentLength)
- fmt.Fprintln(&b, " ricIndication.ricIndicationMessage.interfaceMessage.data =", e2apMsg.msgC.ricIndicationMessage.interfaceMessage.data[:e2apMsg.msgC.ricIndicationMessage.interfaceMessage.contentLength])
- // fmt.Fprintln(&b," ricIndication.ricCallProcessID.ricCallProcessIDVal =", e2apMsg.msgC.ricCallProcessID.ricCallProcessIDVal)
- return b.String()
-}
-