X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2FrmrCgo%2FrmrCgoTypes.go;h=13bfa164370eaa78c339dc235304b3bb51d1a6b3;hb=b3805a9d29e2c7f6f14e3fedfa1ba504f734eea9;hp=e37b97b51105a0487657816114cc3295eaf1cbcb;hpb=966f2102168cad95b8aa1bc83241b4b6730ab1e2;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/rmrCgo/rmrCgoTypes.go b/E2Manager/rmrCgo/rmrCgoTypes.go index e37b97b..13bfa16 100644 --- a/E2Manager/rmrCgo/rmrCgoTypes.go +++ b/E2Manager/rmrCgo/rmrCgoTypes.go @@ -13,11 +13,14 @@ // 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. -// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + package rmrCgo -// #cgo LDFLAGS: -L/usr/local/lib -lrmr_nng -lnng +// #cgo LDFLAGS: -L/usr/local/lib -lrmr_si // #include // #include // #include @@ -28,13 +31,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, } } @@ -67,11 +71,21 @@ const ( RIC_SCTP_CLEAR_ALL = C.RIC_SCTP_CLEAR_ALL RIC_X2_RESET_RESP = C.RIC_X2_RESET_RESP RIC_X2_RESET = C.RIC_X2_RESET + RIC_E2_TERM_INIT = C.E2_TERM_INIT + 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 ) 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 @@ -117,12 +131,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 @@ -131,10 +150,10 @@ type Context struct { } type RmrMessenger interface { - Init(port string, maxMsgSize int, flags int, logger *logger.Logger) *RmrMessenger - SendMsg(msg *MBuf, maxMsgSize int) (*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() }