GetPortData() returns policies
[ric-plt/xapp-frame.git] / pkg / xapp / types.go
old mode 100644 (file)
new mode 100755 (executable)
index 110244b..b6fc49b
@@ -23,18 +23,17 @@ import (
        "unsafe"
 )
 
-// To be removed ...
-type RMRStatistics struct{}
-
 type RMRClient struct {
-       context       unsafe.Pointer
-       ready         int
-       wg            sync.WaitGroup
-       mux           sync.Mutex
-       stat          map[string]Counter
-       consumers     []MessageConsumer
-       readyCb       ReadyCB
-       readyCbParams interface{}
+       contextMux        sync.Mutex
+       context           unsafe.Pointer
+       ready             int
+       wg                sync.WaitGroup
+       mux               sync.Mutex
+       stat              map[string]Counter
+       consumers         []MessageConsumer
+       readyCb           ReadyCB
+       readyCbParams     interface{}
+       maxRetryOnFailure int
 }
 
 type RMRMeid struct {
@@ -43,6 +42,42 @@ type RMRMeid struct {
        RanName string
 }
 
+func (meid *RMRMeid) String() string {
+       str := "meid("
+       pad := ""
+       if len(meid.PlmnID) > 0 {
+               str += pad + "PlmnID=" + meid.PlmnID
+               pad = " "
+       }
+       if len(meid.EnbID) > 0 {
+               str += pad + "EnbID=" + meid.EnbID
+               pad = " "
+       }
+       if len(meid.RanName) > 0 {
+               str += pad + "RanName=" + meid.RanName
+               pad = " "
+       }
+       str += ")"
+       return str
+}
+
+type MessageConsumerFunc func(*RMRParams) error
+
+func (fn MessageConsumerFunc) Consume(params *RMRParams) error {
+       return fn(params)
+}
+
 type MessageConsumer interface {
        Consume(params *RMRParams) error
 }
+
+type PortData struct {
+       Name              string
+       Port              int
+       MaxSize           int
+       ThreadType        int
+       LowLatency        bool
+       FastAck           bool
+       Policies          []int
+       MaxRetryOnFailure int
+}