Added hash to params payload string print
Change-Id: Ie7ec49455b0cb775cd9826946ad051ff49000e80
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
diff --git a/pkg/teststube2ap/stubE2.go b/pkg/teststube2ap/stubE2.go
index dbd518b..9323555 100644
--- a/pkg/teststube2ap/stubE2.go
+++ b/pkg/teststube2ap/stubE2.go
@@ -198,6 +198,7 @@
params.Mtype = xapp.RIC_SUB_REQ
params.SubId = -1
params.Payload = packedMsg.Buf
+ params.PayloadLen = len(packedMsg.Buf)
params.Meid = trans.meid
params.Xid = trans.xid
params.Mbuf = nil
@@ -282,6 +283,7 @@
//params.SubId = msg.SubId
params.SubId = -1
params.Payload = packedMsg.Buf
+ params.PayloadLen = len(packedMsg.Buf)
params.Meid = msg.Meid
//params.Xid = msg.Xid
params.Mbuf = nil
@@ -354,6 +356,7 @@
params.Mtype = xapp.RIC_SUB_FAILURE
params.SubId = msg.SubId
params.Payload = packedMsg.Buf
+ params.PayloadLen = len(packedMsg.Buf)
params.Meid = msg.Meid
params.Xid = msg.Xid
params.Mbuf = nil
@@ -436,6 +439,7 @@
params.Mtype = xapp.RIC_SUB_DEL_REQ
params.SubId = int(e2SubsId)
params.Payload = packedMsg.Buf
+ params.PayloadLen = len(packedMsg.Buf)
params.Meid = trans.meid
params.Xid = trans.xid
params.Mbuf = nil
@@ -505,6 +509,7 @@
params.Mtype = xapp.RIC_SUB_DEL_RESP
params.SubId = msg.SubId
params.Payload = packedMsg.Buf
+ params.PayloadLen = len(packedMsg.Buf)
params.Meid = msg.Meid
params.Xid = msg.Xid
params.Mbuf = nil
@@ -576,6 +581,7 @@
params.Mtype = xapp.RIC_SUB_DEL_FAILURE
params.SubId = msg.SubId
params.Payload = packedMsg.Buf
+ params.PayloadLen = len(packedMsg.Buf)
params.Meid = msg.Meid
params.Xid = msg.Xid
params.Mbuf = nil
diff --git a/pkg/xapptweaks/rmrparams.go b/pkg/xapptweaks/rmrparams.go
index 812a43e..f0ac9fb 100644
--- a/pkg/xapptweaks/rmrparams.go
+++ b/pkg/xapptweaks/rmrparams.go
@@ -21,6 +21,7 @@
import (
"bytes"
+ "crypto/md5"
"fmt"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
)
@@ -34,7 +35,8 @@
func (params *RMRParams) String() string {
var b bytes.Buffer
- fmt.Fprintf(&b, "params(Src=%s Mtype=%d SubId=%d Xid=%s Meid=%s Paylens=%d/%d)", params.Src, params.Mtype, params.SubId, params.Xid, params.Meid.RanName, params.PayloadLen, len(params.Payload))
+ sum := md5.Sum(params.Payload)
+ fmt.Fprintf(&b, "params(Src=%s Mtype=%d SubId=%d Xid=%s Meid=%s Paylens=%d/%d Payhash=%x)", params.Src, params.Mtype, params.SubId, params.Xid, params.Meid.RanName, params.PayloadLen, len(params.Payload), sum)
return b.String()
}