#
#----------------------------------------------------------
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:4-u18.04-nng as xapp-base
+FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:5-u18.04-nng as xapp-base
RUN apt-get update -y \
&&apt-get install -y \
apt-utils \
RUN curl -s https://packagecloud.io/install/repositories/o-ran-sc/master/script.deb.sh | bash
# RMR
-ARG RMRVERSION=3.6.5
+ARG RMRVERSION=3.7.2
#RUN apt-get install -y rmr=${RMRVERSION} rmr-dev=${RMRVERSION}
RUN wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb
RUN wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
}
}
-func (m *RMRClient) Allocate() *C.rmr_mbuf_t {
- buf := C.rmr_alloc_msg(m.context, 0)
+func (m *RMRClient) Allocate(size int) *C.rmr_mbuf_t {
+ buf := C.rmr_alloc_msg(m.context, C.int(size))
if buf == nil {
Logger.Error("rmrClient: Allocating message buffer failed!")
}
}
func (m *RMRClient) CopyBuffer(params *RMRParams) *C.rmr_mbuf_t {
- txBuffer := params.Mbuf
- if txBuffer == nil {
- txBuffer = m.Allocate()
- if txBuffer == nil {
- return nil
- }
+ if params.Mbuf != nil {
+ m.Free(params.Mbuf)
+ params.Mbuf = nil
}
- txBuffer.mtype = C.int(params.Mtype)
- txBuffer.sub_id = C.int(params.SubId)
- txBuffer.len = C.int(len(params.Payload))
+ payLen := len(params.Payload)
if params.PayloadLen != 0 {
- txBuffer.len = C.int(params.PayloadLen)
+ payLen = params.PayloadLen
+ }
+
+ txBuffer := m.Allocate(payLen)
+ if txBuffer == nil {
+ return nil
}
+ txBuffer.mtype = C.int(params.Mtype)
+ txBuffer.sub_id = C.int(params.SubId)
+ txBuffer.len = C.int(payLen)
+
datap := C.CBytes(params.Payload)
defer C.free(datap)