X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2FrmrCgo%2FrmrCgoTypes.go;h=d3886b48d8e24fb9ea7cd3fbd063bf5900d1bde8;hb=0fb24ff00209041b316352327e2c73b699943131;hp=3f8b1892a6c94771cc92906b237e0d23109c0469;hpb=2c9d450c93e4f0b312a68d39429efb685ec02022;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/rmrCgo/rmrCgoTypes.go b/E2Manager/rmrCgo/rmrCgoTypes.go index 3f8b189..d3886b4 100644 --- a/E2Manager/rmrCgo/rmrCgoTypes.go +++ b/E2Manager/rmrCgo/rmrCgoTypes.go @@ -1,6 +1,7 @@ // // Copyright 2019 AT&T Intellectual Property // Copyright 2019 Nokia +// Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ package rmrCgo -// #cgo LDFLAGS: -L/usr/local/lib -lrmr_nng -lnng +// #cgo LDFLAGS: -L/usr/local/lib -lrmr_si // #include // #include // #include @@ -31,13 +32,14 @@ import ( "unsafe" ) -func NewMBuf(mType int, len int, meid string, payload *[]byte, xAction *[]byte) *MBuf { +func NewMBuf(mType int, len int, meid string, payload *[]byte, xAction *[]byte, msgSrc unsafe.Pointer) *MBuf { return &MBuf{ - MType: mType, - Len: len, - Meid: meid, - Payload: payload, - XAction: xAction, + mType, + len, + meid, + payload, + xAction, + msgSrc, } } @@ -74,11 +76,21 @@ const ( RAN_CONNECTED = C.RAN_CONNECTED RAN_RESTARTED = C.RAN_RESTARTED RAN_RECONFIGURED = C.RAN_RECONFIGURED + E2_TERM_KEEP_ALIVE_REQ = C.E2_TERM_KEEP_ALIVE_REQ + E2_TERM_KEEP_ALIVE_RESP = C.E2_TERM_KEEP_ALIVE_RESP + RIC_E2_SETUP_REQ = C.RIC_E2_SETUP_REQ + RIC_E2_SETUP_RESP = C.RIC_E2_SETUP_RESP + RIC_E2_SETUP_FAILURE = C.RIC_E2_SETUP_FAILURE + RIC_SERVICE_QUERY = C.RIC_SERVICE_QUERY + RIC_SERVICE_UPDATE = C.RIC_SERVICE_UPDATE + RIC_SERVICE_UPDATE_ACK = C.RIC_SERVICE_UPDATE_ACK + RIC_SERVICE_UPDATE_FAILURE = C.RIC_SERVICE_UPDATE_FAILURE ) const ( RMR_MAX_XACTION_LEN = int(C.RMR_MAX_XID) RMR_MAX_MEID_LEN = int(C.RMR_MAX_MEID) + RMR_MAX_SRC_LEN = int(C.RMR_MAX_SRC) //states RMR_OK = C.RMR_OK @@ -124,12 +136,17 @@ type MBuf struct { Meid string //Managed entity id (RAN name) Payload *[]byte XAction *[]byte + msgSrc unsafe.Pointer } func (m MBuf) String() string { return fmt.Sprintf("{ MType: %d, Len: %d, Meid: %q, Xaction: %q, Payload: [%x] }", m.MType, m.Len, m.Meid, m.XAction, m.Payload) } +func (m MBuf) GetMsgSrc() unsafe.Pointer { + return m.msgSrc +} + type Context struct { MaxMsgSize int Flags int @@ -138,10 +155,10 @@ type Context struct { } type RmrMessenger interface { - Init(port string, maxMsgSize int, flags int, logger *logger.Logger) *RmrMessenger - SendMsg(msg *MBuf) (*MBuf, error) + Init(port string, maxMsgSize int, flags int, logger *logger.Logger) RmrMessenger + SendMsg(msg *MBuf, printLogs bool) (*MBuf, error) + WhSendMsg(msg *MBuf, printLogs bool) (*MBuf, error) RecvMsg() (*MBuf, error) - RtsMsg(msg *MBuf) IsReady() bool Close() }