Allocate a new buffer when retrying 46/1146/1 v0.0.17
authorMohamed Abukar <abukar.mohamed@nokia.com>
Mon, 14 Oct 2019 16:29:24 +0000 (19:29 +0300)
committerMohamed Abukar <abukar.mohamed@nokia.com>
Mon, 14 Oct 2019 16:29:50 +0000 (19:29 +0300)
Change-Id: I9bd79f3d4f2c71dd0c487a27b2f2a6252b668ce1
Signed-off-by: Mohamed Abukar <abukar.mohamed@nokia.com>
pkg/xapp/config.go
pkg/xapp/mtypes.go
pkg/xapp/rmr.go

index 404a9b9..94e88a1 100755 (executable)
@@ -99,4 +99,4 @@ func (*Configurator) GetStringSlice(key string) []string {
 
 func (*Configurator) GetStringMap(key string) map[string]interface{} {
        return viper.GetStringMap(key)
-}
\ No newline at end of file
+}
index ab4c85f..5cee681 100755 (executable)
@@ -28,181 +28,181 @@ import "C"
 //
 //-----------------------------------------------------------------------------
 var RICMessageTypes = map[string]int{
-       "RIC_SUB_REQ":                  C.RIC_SUB_REQ,
-       "RIC_SUB_RESP":                 C.RIC_SUB_RESP,
-       "RIC_SUB_FAILURE":              C.RIC_SUB_FAILURE,
-       "RIC_SUB_DEL_REQ":              C.RIC_SUB_DEL_REQ,
-       "RIC_SUB_DEL_RESP":             C.RIC_SUB_DEL_RESP,
-       "RIC_SUB_DEL_FAILURE":          C.RIC_SUB_DEL_FAILURE,
-       "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,
-       "RIC_CONTROL_REQ":              C.RIC_CONTROL_REQ,
-       "RIC_CONTROL_ACK":              C.RIC_CONTROL_ACK,
-       "RIC_CONTROL_FAILURE":          C.RIC_CONTROL_FAILURE,
-       "RIC_INDICATION":               C.RIC_INDICATION,
-       "RIC_SERVICE_QUERY":            C.RIC_SERVICE_QUERY,
-       "RIC_X2_SETUP_REQ":             C.RIC_X2_SETUP_REQ,
-       "RIC_X2_SETUP_RESP":            C.RIC_X2_SETUP_RESP,
-       "RIC_X2_SETUP_FAILURE":         C.RIC_X2_SETUP_FAILURE,
-       "RIC_X2_RESET":                 C.RIC_X2_RESET,
-       "RIC_X2_RESET_RESP":            C.RIC_X2_RESET_RESP,
-       "RIC_ENDC_X2_SETUP_REQ":        C.RIC_ENDC_X2_SETUP_REQ,
-       "RIC_ENDC_X2_SETUP_RESP":       C.RIC_ENDC_X2_SETUP_RESP,
-       "RIC_ENDC_X2_SETUP_FAILURE":    C.RIC_ENDC_X2_SETUP_FAILURE,
-       "RIC_ENDC_CONF_UPDATE":         C.RIC_ENDC_CONF_UPDATE,
-       "RIC_ENDC_CONF_UPDATE_ACK":     C.RIC_ENDC_CONF_UPDATE_ACK,
-       "RIC_ENDC_CONF_UPDATE_FAILURE": C.RIC_ENDC_CONF_UPDATE_FAILURE,
-       "RIC_RES_STATUS_REQ":           C.RIC_RES_STATUS_REQ,
-       "RIC_RES_STATUS_RESP":          C.RIC_RES_STATUS_RESP,
-       "RIC_RES_STATUS_FAILURE":       C.RIC_RES_STATUS_FAILURE,
-       "RIC_ENB_CONF_UPDATE":          C.RIC_ENB_CONF_UPDATE,
-       "RIC_ENB_CONF_UPDATE_ACK":      C.RIC_ENB_CONF_UPDATE_ACK,
-       "RIC_ENB_CONF_UPDATE_FAILURE":  C.RIC_ENB_CONF_UPDATE_FAILURE,
-       "RIC_ENB_LOAD_INFORMATION":     C.RIC_ENB_LOAD_INFORMATION,
-       "RIC_GNB_STATUS_INDICATION":    C.RIC_GNB_STATUS_INDICATION,
-       "RIC_RESOURCE_STATUS_UPDATE":   C.RIC_RESOURCE_STATUS_UPDATE,
-       "RIC_ERROR_INDICATION":         C.RIC_ERROR_INDICATION,
-       "RIC_SGNB_ADDITION_REQ":        C.RIC_SGNB_ADDITION_REQ,
-       "RIC_SGNB_ADDITION_ACK":        C.RIC_SGNB_ADDITION_ACK,
-       "RIC_SGNB_ADDITION_REJECT":     C.RIC_SGNB_ADDITION_REJECT,
-       "RIC_SGNB_MOD_REQUEST":         C.RIC_SGNB_MOD_REQUEST,
-       "RIC_SGNB_MOD_REQUEST_ACK":     C.RIC_SGNB_MOD_REQUEST_ACK,
-       "RIC_SGNB_MOD_REQUEST_REJECT":  C.RIC_SGNB_MOD_REQUEST_REJ,
-       "RIC_SGNB_MOD_REQUIRED":        C.RIC_SGNB_MOD_REQUIRED,
-       "RIC_SGNB_MOD_CONFIRM":         C.RIC_SGNB_MOD_CONFIRM,
-       "RIC_SGNB_MOD_REFUSE":          C.RIC_SGNB_MOD_REFUSE,
-       "RIC_SGNB_RELEASE_REQUEST":     C.RIC_SGNB_RELEASE_REQUEST,
-       "RIC_SGNB_RELEASE_CONFIRM":     C.RIC_SGNB_RELEASE_CONFIRM,
-       "RIC_SGNB_RELEASE_REQUIRED":    C.RIC_SGNB_RELEASE_REQUIRED,
-       "RIC_SGNB_RELEASE_REQUEST_ACK": C.RIC_SGNB_RELEASE_REQUEST_ACK,
+       "RIC_SUB_REQ":                         C.RIC_SUB_REQ,
+       "RIC_SUB_RESP":                        C.RIC_SUB_RESP,
+       "RIC_SUB_FAILURE":                     C.RIC_SUB_FAILURE,
+       "RIC_SUB_DEL_REQ":                     C.RIC_SUB_DEL_REQ,
+       "RIC_SUB_DEL_RESP":                    C.RIC_SUB_DEL_RESP,
+       "RIC_SUB_DEL_FAILURE":                 C.RIC_SUB_DEL_FAILURE,
+       "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,
+       "RIC_CONTROL_REQ":                     C.RIC_CONTROL_REQ,
+       "RIC_CONTROL_ACK":                     C.RIC_CONTROL_ACK,
+       "RIC_CONTROL_FAILURE":                 C.RIC_CONTROL_FAILURE,
+       "RIC_INDICATION":                      C.RIC_INDICATION,
+       "RIC_SERVICE_QUERY":                   C.RIC_SERVICE_QUERY,
+       "RIC_X2_SETUP_REQ":                    C.RIC_X2_SETUP_REQ,
+       "RIC_X2_SETUP_RESP":                   C.RIC_X2_SETUP_RESP,
+       "RIC_X2_SETUP_FAILURE":                C.RIC_X2_SETUP_FAILURE,
+       "RIC_X2_RESET":                        C.RIC_X2_RESET,
+       "RIC_X2_RESET_RESP":                   C.RIC_X2_RESET_RESP,
+       "RIC_ENDC_X2_SETUP_REQ":               C.RIC_ENDC_X2_SETUP_REQ,
+       "RIC_ENDC_X2_SETUP_RESP":              C.RIC_ENDC_X2_SETUP_RESP,
+       "RIC_ENDC_X2_SETUP_FAILURE":           C.RIC_ENDC_X2_SETUP_FAILURE,
+       "RIC_ENDC_CONF_UPDATE":                C.RIC_ENDC_CONF_UPDATE,
+       "RIC_ENDC_CONF_UPDATE_ACK":            C.RIC_ENDC_CONF_UPDATE_ACK,
+       "RIC_ENDC_CONF_UPDATE_FAILURE":        C.RIC_ENDC_CONF_UPDATE_FAILURE,
+       "RIC_RES_STATUS_REQ":                  C.RIC_RES_STATUS_REQ,
+       "RIC_RES_STATUS_RESP":                 C.RIC_RES_STATUS_RESP,
+       "RIC_RES_STATUS_FAILURE":              C.RIC_RES_STATUS_FAILURE,
+       "RIC_ENB_CONF_UPDATE":                 C.RIC_ENB_CONF_UPDATE,
+       "RIC_ENB_CONF_UPDATE_ACK":             C.RIC_ENB_CONF_UPDATE_ACK,
+       "RIC_ENB_CONF_UPDATE_FAILURE":         C.RIC_ENB_CONF_UPDATE_FAILURE,
+       "RIC_ENB_LOAD_INFORMATION":            C.RIC_ENB_LOAD_INFORMATION,
+       "RIC_GNB_STATUS_INDICATION":           C.RIC_GNB_STATUS_INDICATION,
+       "RIC_RESOURCE_STATUS_UPDATE":          C.RIC_RESOURCE_STATUS_UPDATE,
+       "RIC_ERROR_INDICATION":                C.RIC_ERROR_INDICATION,
+       "RIC_SGNB_ADDITION_REQ":               C.RIC_SGNB_ADDITION_REQ,
+       "RIC_SGNB_ADDITION_ACK":               C.RIC_SGNB_ADDITION_ACK,
+       "RIC_SGNB_ADDITION_REJECT":            C.RIC_SGNB_ADDITION_REJECT,
+       "RIC_SGNB_MOD_REQUEST":                C.RIC_SGNB_MOD_REQUEST,
+       "RIC_SGNB_MOD_REQUEST_ACK":            C.RIC_SGNB_MOD_REQUEST_ACK,
+       "RIC_SGNB_MOD_REQUEST_REJECT":         C.RIC_SGNB_MOD_REQUEST_REJ,
+       "RIC_SGNB_MOD_REQUIRED":               C.RIC_SGNB_MOD_REQUIRED,
+       "RIC_SGNB_MOD_CONFIRM":                C.RIC_SGNB_MOD_CONFIRM,
+       "RIC_SGNB_MOD_REFUSE":                 C.RIC_SGNB_MOD_REFUSE,
+       "RIC_SGNB_RELEASE_REQUEST":            C.RIC_SGNB_RELEASE_REQUEST,
+       "RIC_SGNB_RELEASE_CONFIRM":            C.RIC_SGNB_RELEASE_CONFIRM,
+       "RIC_SGNB_RELEASE_REQUIRED":           C.RIC_SGNB_RELEASE_REQUIRED,
+       "RIC_SGNB_RELEASE_REQUEST_ACK":        C.RIC_SGNB_RELEASE_REQUEST_ACK,
        "RIC_SECONDARY_RAT_DATA_USAGE_REPORT": C.RIC_SECONDARY_RAT_DATA_USAGE_REPORT,
-       "RIC_SN_STATUS_TRANSFER":       C.RIC_SN_STATUS_TRANSFER,
-       "RIC_SGNB_RECONF_COMPLETE":     C.RIC_SGNB_RECONF_COMPLETE,
-       "RIC_RRC_TRANSFER":             C.RIC_RRC_TRANSFER,
-       "RIC_UE_CONTEXT_RELEASE":       C.RIC_UE_CONTEXT_RELEASE,
-       "DC_ADM_INT_CONTROL":           C.DC_ADM_INT_CONTROL,
-       "DC_ADM_INT_CONTROL_ACK":       C.DC_ADM_INT_CONTROL_ACK,
+       "RIC_SN_STATUS_TRANSFER":              C.RIC_SN_STATUS_TRANSFER,
+       "RIC_SGNB_RECONF_COMPLETE":            C.RIC_SGNB_RECONF_COMPLETE,
+       "RIC_RRC_TRANSFER":                    C.RIC_RRC_TRANSFER,
+       "RIC_UE_CONTEXT_RELEASE":              C.RIC_UE_CONTEXT_RELEASE,
+       "DC_ADM_INT_CONTROL":                  C.DC_ADM_INT_CONTROL,
+       "DC_ADM_INT_CONTROL_ACK":              C.DC_ADM_INT_CONTROL_ACK,
 }
 
 //-----------------------------------------------------------------------------
 //
 //-----------------------------------------------------------------------------
 const (
-       RIC_SUB_REQ                  = C.RIC_SUB_REQ
-       RIC_SUB_RESP                 = C.RIC_SUB_RESP
-       RIC_SUB_FAILURE              = C.RIC_SUB_FAILURE
-       RIC_SUB_DEL_REQ              = C.RIC_SUB_DEL_REQ
-       RIC_SUB_DEL_RESP             = C.RIC_SUB_DEL_RESP
-       RIC_SUB_DEL_FAILURE          = C.RIC_SUB_DEL_FAILURE
-       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
-       RIC_CONTROL_REQ              = C.RIC_CONTROL_REQ
-       RIC_CONTROL_ACK              = C.RIC_CONTROL_ACK
-       RIC_CONTROL_FAILURE          = C.RIC_CONTROL_FAILURE
-       RIC_INDICATION               = C.RIC_INDICATION
-       RIC_SERVICE_QUERY            = C.RIC_SERVICE_QUERY
-       RIC_X2_SETUP_REQ             = C.RIC_X2_SETUP_REQ
-       RIC_X2_SETUP_RESP            = C.RIC_X2_SETUP_RESP
-       RIC_X2_SETUP_FAILURE         = C.RIC_X2_SETUP_FAILURE
-       RIC_X2_RESET                 = C.RIC_X2_RESET
-       RIC_X2_RESET_RESP            = C.RIC_X2_RESET_RESP
-       RIC_ENDC_X2_SETUP_REQ        = C.RIC_ENDC_X2_SETUP_REQ
-       RIC_ENDC_X2_SETUP_RESP       = C.RIC_ENDC_X2_SETUP_RESP
-       RIC_ENDC_X2_SETUP_FAILURE    = C.RIC_ENDC_X2_SETUP_FAILURE
-       RIC_ENDC_CONF_UPDATE         = C.RIC_ENDC_CONF_UPDATE
-       RIC_ENDC_CONF_UPDATE_ACK     = C.RIC_ENDC_CONF_UPDATE_ACK
-       RIC_ENDC_CONF_UPDATE_FAILURE = C.RIC_ENDC_CONF_UPDATE_FAILURE
-       RIC_RES_STATUS_REQ           = C.RIC_RES_STATUS_REQ
-       RIC_RES_STATUS_RESP          = C.RIC_RES_STATUS_RESP
-       RIC_RES_STATUS_FAILURE       = C.RIC_RES_STATUS_FAILURE
-       RIC_ENB_CONF_UPDATE          = C.RIC_ENB_CONF_UPDATE
-       RIC_ENB_CONF_UPDATE_ACK      = C.RIC_ENB_CONF_UPDATE_ACK
-       RIC_ENB_CONF_UPDATE_FAILURE  = C.RIC_ENB_CONF_UPDATE_FAILURE
-       RIC_ENB_LOAD_INFORMATION     = C.RIC_ENB_LOAD_INFORMATION
-       RIC_GNB_STATUS_INDICATION    = C.RIC_GNB_STATUS_INDICATION
-       RIC_RESOURCE_STATUS_UPDATE   = C.RIC_RESOURCE_STATUS_UPDATE
-       RIC_ERROR_INDICATION         = C.RIC_ERROR_INDICATION
-       RIC_SGNB_ADDITION_REQ        = C.RIC_SGNB_ADDITION_REQ
-       RIC_SGNB_ADDITION_ACK        = C.RIC_SGNB_ADDITION_ACK
-       RIC_SGNB_ADDITION_REJECT     = C.RIC_SGNB_ADDITION_REJECT
-       RIC_SGNB_MOD_REQUEST         = C.RIC_SGNB_MOD_REQUEST
-       RIC_SGNB_MOD_REQUEST_ACK     = C.RIC_SGNB_MOD_REQUEST_ACK
-       RIC_SGNB_MOD_REQUEST_REJECT  = C.RIC_SGNB_MOD_REQUEST_REJ
-       RIC_SGNB_MOD_REQUIRED        = C.RIC_SGNB_MOD_REQUIRED
-       RIC_SGNB_MOD_CONFIRM         = C.RIC_SGNB_MOD_CONFIRM
-       RIC_SGNB_MOD_REFUSE          = C.RIC_SGNB_MOD_REFUSE
-       RIC_SGNB_RELEASE_REQUEST     = C.RIC_SGNB_RELEASE_REQUEST
-       RIC_SGNB_RELEASE_CONFIRM     = C.RIC_SGNB_RELEASE_CONFIRM
-       RIC_SGNB_RELEASE_REQUIRED    = C.RIC_SGNB_RELEASE_REQUIRED
-       RIC_SGNB_RELEASE_REQUEST_ACK = C.RIC_SGNB_RELEASE_REQUEST_ACK
+       RIC_SUB_REQ                         = C.RIC_SUB_REQ
+       RIC_SUB_RESP                        = C.RIC_SUB_RESP
+       RIC_SUB_FAILURE                     = C.RIC_SUB_FAILURE
+       RIC_SUB_DEL_REQ                     = C.RIC_SUB_DEL_REQ
+       RIC_SUB_DEL_RESP                    = C.RIC_SUB_DEL_RESP
+       RIC_SUB_DEL_FAILURE                 = C.RIC_SUB_DEL_FAILURE
+       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
+       RIC_CONTROL_REQ                     = C.RIC_CONTROL_REQ
+       RIC_CONTROL_ACK                     = C.RIC_CONTROL_ACK
+       RIC_CONTROL_FAILURE                 = C.RIC_CONTROL_FAILURE
+       RIC_INDICATION                      = C.RIC_INDICATION
+       RIC_SERVICE_QUERY                   = C.RIC_SERVICE_QUERY
+       RIC_X2_SETUP_REQ                    = C.RIC_X2_SETUP_REQ
+       RIC_X2_SETUP_RESP                   = C.RIC_X2_SETUP_RESP
+       RIC_X2_SETUP_FAILURE                = C.RIC_X2_SETUP_FAILURE
+       RIC_X2_RESET                        = C.RIC_X2_RESET
+       RIC_X2_RESET_RESP                   = C.RIC_X2_RESET_RESP
+       RIC_ENDC_X2_SETUP_REQ               = C.RIC_ENDC_X2_SETUP_REQ
+       RIC_ENDC_X2_SETUP_RESP              = C.RIC_ENDC_X2_SETUP_RESP
+       RIC_ENDC_X2_SETUP_FAILURE           = C.RIC_ENDC_X2_SETUP_FAILURE
+       RIC_ENDC_CONF_UPDATE                = C.RIC_ENDC_CONF_UPDATE
+       RIC_ENDC_CONF_UPDATE_ACK            = C.RIC_ENDC_CONF_UPDATE_ACK
+       RIC_ENDC_CONF_UPDATE_FAILURE        = C.RIC_ENDC_CONF_UPDATE_FAILURE
+       RIC_RES_STATUS_REQ                  = C.RIC_RES_STATUS_REQ
+       RIC_RES_STATUS_RESP                 = C.RIC_RES_STATUS_RESP
+       RIC_RES_STATUS_FAILURE              = C.RIC_RES_STATUS_FAILURE
+       RIC_ENB_CONF_UPDATE                 = C.RIC_ENB_CONF_UPDATE
+       RIC_ENB_CONF_UPDATE_ACK             = C.RIC_ENB_CONF_UPDATE_ACK
+       RIC_ENB_CONF_UPDATE_FAILURE         = C.RIC_ENB_CONF_UPDATE_FAILURE
+       RIC_ENB_LOAD_INFORMATION            = C.RIC_ENB_LOAD_INFORMATION
+       RIC_GNB_STATUS_INDICATION           = C.RIC_GNB_STATUS_INDICATION
+       RIC_RESOURCE_STATUS_UPDATE          = C.RIC_RESOURCE_STATUS_UPDATE
+       RIC_ERROR_INDICATION                = C.RIC_ERROR_INDICATION
+       RIC_SGNB_ADDITION_REQ               = C.RIC_SGNB_ADDITION_REQ
+       RIC_SGNB_ADDITION_ACK               = C.RIC_SGNB_ADDITION_ACK
+       RIC_SGNB_ADDITION_REJECT            = C.RIC_SGNB_ADDITION_REJECT
+       RIC_SGNB_MOD_REQUEST                = C.RIC_SGNB_MOD_REQUEST
+       RIC_SGNB_MOD_REQUEST_ACK            = C.RIC_SGNB_MOD_REQUEST_ACK
+       RIC_SGNB_MOD_REQUEST_REJECT         = C.RIC_SGNB_MOD_REQUEST_REJ
+       RIC_SGNB_MOD_REQUIRED               = C.RIC_SGNB_MOD_REQUIRED
+       RIC_SGNB_MOD_CONFIRM                = C.RIC_SGNB_MOD_CONFIRM
+       RIC_SGNB_MOD_REFUSE                 = C.RIC_SGNB_MOD_REFUSE
+       RIC_SGNB_RELEASE_REQUEST            = C.RIC_SGNB_RELEASE_REQUEST
+       RIC_SGNB_RELEASE_CONFIRM            = C.RIC_SGNB_RELEASE_CONFIRM
+       RIC_SGNB_RELEASE_REQUIRED           = C.RIC_SGNB_RELEASE_REQUIRED
+       RIC_SGNB_RELEASE_REQUEST_ACK        = C.RIC_SGNB_RELEASE_REQUEST_ACK
        RIC_SECONDARY_RAT_DATA_USAGE_REPORT = C.RIC_SECONDARY_RAT_DATA_USAGE_REPORT
-       RIC_SN_STATUS_TRANSFER       = C.RIC_SN_STATUS_TRANSFER
-       RIC_SGNB_RECONF_COMPLETE     = C.RIC_SGNB_RECONF_COMPLETE
-       RIC_RRC_TRANSFER             = C.RIC_RRC_TRANSFER
-       RIC_UE_CONTEXT_RELEASE       = C.RIC_UE_CONTEXT_RELEASE
-       DC_ADM_INT_CONTROL           = C.DC_ADM_INT_CONTROL
-       DC_ADM_INT_CONTROL_ACK       = C.DC_ADM_INT_CONTROL_ACK
+       RIC_SN_STATUS_TRANSFER              = C.RIC_SN_STATUS_TRANSFER
+       RIC_SGNB_RECONF_COMPLETE            = C.RIC_SGNB_RECONF_COMPLETE
+       RIC_RRC_TRANSFER                    = C.RIC_RRC_TRANSFER
+       RIC_UE_CONTEXT_RELEASE              = C.RIC_UE_CONTEXT_RELEASE
+       DC_ADM_INT_CONTROL                  = C.DC_ADM_INT_CONTROL
+       DC_ADM_INT_CONTROL_ACK              = C.DC_ADM_INT_CONTROL_ACK
 )
 
 //-----------------------------------------------------------------------------
 //
 //-----------------------------------------------------------------------------
 var RicMessageTypeToName = map[int]string{
-       RIC_SUB_REQ:                  "RIC SUBSCRIPTION REQUEST",
-       RIC_SUB_RESP:                 "RIC SUBSCRIPTION RESPONSE",
-       RIC_SUB_FAILURE:              "RIC SUBSCRIPTION FAILURE",
-       RIC_SUB_DEL_REQ:              "RIC SUBSCRIPTION DELETE REQUEST",
-       RIC_SUB_DEL_RESP:             "RIC SUBSCRIPTION DELETE RESPONSE",
-       RIC_SUB_DEL_FAILURE:          "RIC SUBSCRIPTION DELETE FAILURE",
-       RIC_SERVICE_UPDATE:           "RIC SERVICE UPDATE",
-       RIC_SERVICE_UPDATE_ACK:       "RIC SERVICE UPDATE ACKNOWLEDGE",
-       RIC_SERVICE_UPDATE_FAILURE:   "RIC SERVICE UPDATE FAILURE",
-       RIC_CONTROL_REQ:              "RIC CONTROL REQUEST",
-       RIC_CONTROL_ACK:              "RIC CONTROL ACKNOWLEDGE",
-       RIC_CONTROL_FAILURE:          "RIC CONTROL FAILURE",
-       RIC_INDICATION:               "RIC INDICATION",
-       RIC_SERVICE_QUERY:            "RIC SERVICE QUERY",
-       RIC_X2_SETUP_REQ:             "RIC X2 SETUP REQUEST",
-       RIC_X2_SETUP_RESP:            "RIC X2 SETUP RESPONSE",
-       RIC_X2_SETUP_FAILURE:         "RIC X2 SETUP FAILURE",
-       RIC_X2_RESET:                 "RIC X2 RESET REQUEST",
-       RIC_X2_RESET_RESP:            "RIC X2 RESET RESPONSE",
-       RIC_ENDC_X2_SETUP_REQ:        "RIC EN-DC X2 SETUP REQUEST",
-       RIC_ENDC_X2_SETUP_RESP:       "RIC EN-DC X2 SETUP RESPONSE",
-       RIC_ENDC_X2_SETUP_FAILURE:    "RIC EN-DC X2 SETUP FAILURE",
-       RIC_ENDC_CONF_UPDATE:         "RIC EN-DC CONFIGURATION UPDATE",
-       RIC_ENDC_CONF_UPDATE_ACK:     "RIC EN-DC CONFIGURATION UPDATE ACKNOWLEDGE",
-       RIC_ENDC_CONF_UPDATE_FAILURE: "RIC EN-DC CONFIGURATION UPDATE FAILURE",
-       RIC_RES_STATUS_REQ:           "RIC RESOURCE STATUS REQUEST",
-       RIC_RES_STATUS_RESP:          "RIC RESOURCE STATUS RESPONSE",
-       RIC_RES_STATUS_FAILURE:       "RIC RESOURCE STATUS FAILURE",
-       RIC_ENB_CONF_UPDATE:          "RIC ENB CONFIGURATION UPDATE",
-       RIC_ENB_CONF_UPDATE_ACK:      "RIC ENB CONFIGURATION UPDATE ACKNOWLEDGE",
-       RIC_ENB_CONF_UPDATE_FAILURE:  "RIC ENB CONFIGURATION UPDATE FAILURE",
-       RIC_ENB_LOAD_INFORMATION:     "RIC ENB LOAD INFORMATION",
-       RIC_GNB_STATUS_INDICATION:    "RIC GNB STATUS INDICATION",
-       RIC_RESOURCE_STATUS_UPDATE:   "RIC RESOURCE STATUS UPDATE",
-       RIC_ERROR_INDICATION:         "RIC ERROR INDICATION",
-       RIC_SGNB_ADDITION_REQ:        "RIC SGNB ADDITION REQ",
-       RIC_SGNB_ADDITION_ACK:        "RIC SGNB ADDITION ACK",
-       RIC_SGNB_ADDITION_REJECT:     "RIC SGNB ADDITION REJECT",
-       RIC_SGNB_MOD_REQUEST:         "RIC SGNB MOD REQUEST REQ",
-       RIC_SGNB_MOD_REQUEST_ACK:     "RIC SGNB MOD REQUEST ACK",
-       RIC_SGNB_MOD_REQUEST_REJECT:  "RIC SGNB MOD REQUEST REJ",
-       RIC_SGNB_MOD_REQUIRED:        "RIC SGNB MOD REQUIRED",
-       RIC_SGNB_MOD_CONFIRM:         "RIC SGNB MOD CONFIRM",
-       RIC_SGNB_MOD_REFUSE:          "RIC SGNB MOD REFUSE",
-       RIC_SGNB_RELEASE_REQUEST:     "RIC SGNB RELEASE REQUEST",
-       RIC_SGNB_RELEASE_CONFIRM:     "RIC SGNB RELEASE CONFIRM",
-       RIC_SGNB_RELEASE_REQUIRED:    "RIC SGNB RELEASE REQUIRED",
-       RIC_SGNB_RELEASE_REQUEST_ACK: "RIC SGNB RELEASE REQUEST ACK",
+       RIC_SUB_REQ:                         "RIC SUBSCRIPTION REQUEST",
+       RIC_SUB_RESP:                        "RIC SUBSCRIPTION RESPONSE",
+       RIC_SUB_FAILURE:                     "RIC SUBSCRIPTION FAILURE",
+       RIC_SUB_DEL_REQ:                     "RIC SUBSCRIPTION DELETE REQUEST",
+       RIC_SUB_DEL_RESP:                    "RIC SUBSCRIPTION DELETE RESPONSE",
+       RIC_SUB_DEL_FAILURE:                 "RIC SUBSCRIPTION DELETE FAILURE",
+       RIC_SERVICE_UPDATE:                  "RIC SERVICE UPDATE",
+       RIC_SERVICE_UPDATE_ACK:              "RIC SERVICE UPDATE ACKNOWLEDGE",
+       RIC_SERVICE_UPDATE_FAILURE:          "RIC SERVICE UPDATE FAILURE",
+       RIC_CONTROL_REQ:                     "RIC CONTROL REQUEST",
+       RIC_CONTROL_ACK:                     "RIC CONTROL ACKNOWLEDGE",
+       RIC_CONTROL_FAILURE:                 "RIC CONTROL FAILURE",
+       RIC_INDICATION:                      "RIC INDICATION",
+       RIC_SERVICE_QUERY:                   "RIC SERVICE QUERY",
+       RIC_X2_SETUP_REQ:                    "RIC X2 SETUP REQUEST",
+       RIC_X2_SETUP_RESP:                   "RIC X2 SETUP RESPONSE",
+       RIC_X2_SETUP_FAILURE:                "RIC X2 SETUP FAILURE",
+       RIC_X2_RESET:                        "RIC X2 RESET REQUEST",
+       RIC_X2_RESET_RESP:                   "RIC X2 RESET RESPONSE",
+       RIC_ENDC_X2_SETUP_REQ:               "RIC EN-DC X2 SETUP REQUEST",
+       RIC_ENDC_X2_SETUP_RESP:              "RIC EN-DC X2 SETUP RESPONSE",
+       RIC_ENDC_X2_SETUP_FAILURE:           "RIC EN-DC X2 SETUP FAILURE",
+       RIC_ENDC_CONF_UPDATE:                "RIC EN-DC CONFIGURATION UPDATE",
+       RIC_ENDC_CONF_UPDATE_ACK:            "RIC EN-DC CONFIGURATION UPDATE ACKNOWLEDGE",
+       RIC_ENDC_CONF_UPDATE_FAILURE:        "RIC EN-DC CONFIGURATION UPDATE FAILURE",
+       RIC_RES_STATUS_REQ:                  "RIC RESOURCE STATUS REQUEST",
+       RIC_RES_STATUS_RESP:                 "RIC RESOURCE STATUS RESPONSE",
+       RIC_RES_STATUS_FAILURE:              "RIC RESOURCE STATUS FAILURE",
+       RIC_ENB_CONF_UPDATE:                 "RIC ENB CONFIGURATION UPDATE",
+       RIC_ENB_CONF_UPDATE_ACK:             "RIC ENB CONFIGURATION UPDATE ACKNOWLEDGE",
+       RIC_ENB_CONF_UPDATE_FAILURE:         "RIC ENB CONFIGURATION UPDATE FAILURE",
+       RIC_ENB_LOAD_INFORMATION:            "RIC ENB LOAD INFORMATION",
+       RIC_GNB_STATUS_INDICATION:           "RIC GNB STATUS INDICATION",
+       RIC_RESOURCE_STATUS_UPDATE:          "RIC RESOURCE STATUS UPDATE",
+       RIC_ERROR_INDICATION:                "RIC ERROR INDICATION",
+       RIC_SGNB_ADDITION_REQ:               "RIC SGNB ADDITION REQ",
+       RIC_SGNB_ADDITION_ACK:               "RIC SGNB ADDITION ACK",
+       RIC_SGNB_ADDITION_REJECT:            "RIC SGNB ADDITION REJECT",
+       RIC_SGNB_MOD_REQUEST:                "RIC SGNB MOD REQUEST REQ",
+       RIC_SGNB_MOD_REQUEST_ACK:            "RIC SGNB MOD REQUEST ACK",
+       RIC_SGNB_MOD_REQUEST_REJECT:         "RIC SGNB MOD REQUEST REJ",
+       RIC_SGNB_MOD_REQUIRED:               "RIC SGNB MOD REQUIRED",
+       RIC_SGNB_MOD_CONFIRM:                "RIC SGNB MOD CONFIRM",
+       RIC_SGNB_MOD_REFUSE:                 "RIC SGNB MOD REFUSE",
+       RIC_SGNB_RELEASE_REQUEST:            "RIC SGNB RELEASE REQUEST",
+       RIC_SGNB_RELEASE_CONFIRM:            "RIC SGNB RELEASE CONFIRM",
+       RIC_SGNB_RELEASE_REQUIRED:           "RIC SGNB RELEASE REQUIRED",
+       RIC_SGNB_RELEASE_REQUEST_ACK:        "RIC SGNB RELEASE REQUEST ACK",
        RIC_SECONDARY_RAT_DATA_USAGE_REPORT: "RIC SECONDARY RAT DATA USAGE REPORT",
-       RIC_SN_STATUS_TRANSFER:       "RIC SN STATUS TRANSFER",
-       RIC_SGNB_RECONF_COMPLETE:     "RIC SGNB RECONF COMPLETE",
-       RIC_RRC_TRANSFER:             "RIC RRC TRANSFER",
-       RIC_UE_CONTEXT_RELEASE:       "RIC UE CONTEXT RELEASE",
-       DC_ADM_INT_CONTROL:           "DC ADMISSION INTERVAL CONTROL",
-       DC_ADM_INT_CONTROL_ACK:       "DC ADMISSION INTERVAL CONTROL ACK",
+       RIC_SN_STATUS_TRANSFER:              "RIC SN STATUS TRANSFER",
+       RIC_SGNB_RECONF_COMPLETE:            "RIC SGNB RECONF COMPLETE",
+       RIC_RRC_TRANSFER:                    "RIC RRC TRANSFER",
+       RIC_UE_CONTEXT_RELEASE:              "RIC UE CONTEXT RELEASE",
+       DC_ADM_INT_CONTROL:                  "DC ADMISSION INTERVAL CONTROL",
+       DC_ADM_INT_CONTROL_ACK:              "DC ADMISSION INTERVAL CONTROL ACK",
 }
index 40f47b2..9077792 100755 (executable)
@@ -177,24 +177,42 @@ func (m *RMRClient) Free(mbuf *C.rmr_mbuf_t) {
 }
 
 func (m *RMRClient) SendMsg(params *RMRParams) bool {
-       return m.Send(params, false)
+       return m.SendBuffer(params, false)
 }
 
 func (m *RMRClient) SendRts(params *RMRParams) bool {
-       return m.Send(params, true)
+       return m.SendBuffer(params, true)
 }
 
-func (m *RMRClient) Send(params *RMRParams, isRts bool) bool {
-       buf := params.Mbuf
-       if buf == nil {
-               buf = m.Allocate()
+func (m *RMRClient) SendBuffer(params *RMRParams, isRts bool) bool {
+       defer m.Free(params.Mbuf)
+       for i := 0; i < 10; i++ {
+               errCode := m.Send(params, isRts)
+               if errCode == C.RMR_OK {
+                       m.UpdateStatCounter("Transmitted")
+                       return true
+               }
+               if errCode != C.RMR_ERR_RETRY {
+                       Logger.Error("rmrClient: rmr_send returned hard error - %d", errCode)
+                       break
+               }
+
        }
+       m.UpdateStatCounter("TransmitError")
+       return false
+}
 
-       buf.mtype = C.int(params.Mtype)
-       buf.sub_id = C.int(params.SubId)
-       buf.len = C.int(len(params.Payload))
+func (m *RMRClient) Send(params *RMRParams, isRts bool) C.int {
+       txBuffer := params.Mbuf
+       if txBuffer == nil {
+               txBuffer = m.Allocate()
+       }
+
+       txBuffer.mtype = C.int(params.Mtype)
+       txBuffer.sub_id = C.int(params.SubId)
+       txBuffer.len = C.int(len(params.Payload))
        if params.PayloadLen != 0 {
-                buf.len = C.int(params.PayloadLen)
+               txBuffer.len = C.int(params.PayloadLen)
        }
        datap := C.CBytes(params.Payload)
        defer C.free(datap)
@@ -203,51 +221,29 @@ func (m *RMRClient) Send(params *RMRParams, isRts bool) bool {
                if params.Meid != nil {
                        b := make([]byte, int(C.RMR_MAX_MEID))
                        copy(b, []byte(params.Meid.RanName))
-                       C.rmr_bytes2meid(buf, (*C.uchar)(unsafe.Pointer(&b[0])), C.int(len(b)))
+                       C.rmr_bytes2meid(txBuffer, (*C.uchar)(unsafe.Pointer(&b[0])), C.int(len(b)))
                }
                xidLen := len(params.Xid)
                if xidLen > 0 && xidLen <= C.RMR_MAX_XID {
                        b := make([]byte, int(C.RMR_MAX_MEID))
                        copy(b, []byte(params.Xid))
-                       C.rmr_bytes2xact(buf, (*C.uchar)(unsafe.Pointer(&b[0])), C.int(len(b)))
+                       C.rmr_bytes2xact(txBuffer, (*C.uchar)(unsafe.Pointer(&b[0])), C.int(len(b)))
                }
        }
-       C.write_bytes_array(buf.payload, datap, buf.len)
-
-       return m.SendBuf(buf, isRts)
-}
-
-func (m *RMRClient) SendBuf(txBuffer *C.rmr_mbuf_t, isRts bool) bool {
-       defer C.rmr_free_msg(txBuffer)
-       var currBuffer *C.rmr_mbuf_t
-
-       for i := 0; i < 10; i++ {
-               txBuffer.state = 0
-               if isRts {
-                       currBuffer = C.rmr_rts_msg(m.context, txBuffer)
-               } else {
-                       currBuffer = C.rmr_send_msg(m.context, txBuffer)
-               }
-
-               if currBuffer == nil {
-                       break
-               } else if currBuffer.state != C.RMR_OK {
-                       if currBuffer.state != C.RMR_ERR_RETRY {
-                               time.Sleep(100 * time.Microsecond)
-                               m.UpdateStatCounter("TransmitError")
-                       }
-                       for j := 0; j < 100 && currBuffer.state == C.RMR_ERR_RETRY; j++ {
-                               currBuffer = C.rmr_send_msg(m.context, txBuffer)
-                       }
-               }
+       C.write_bytes_array(txBuffer.payload, datap, txBuffer.len)
+
+       txBuffer.state = 0
+       currBuffer := txBuffer
+       if isRts {
+               currBuffer = C.rmr_rts_msg(m.context, txBuffer)
+       } else {
+               currBuffer = C.rmr_send_msg(m.context, txBuffer)
+       }
 
-               if currBuffer.state == C.RMR_OK {
-                       m.UpdateStatCounter("Transmitted")
-                       return true
-               }
+       if currBuffer != nil {
+               return currBuffer.state
        }
-       m.UpdateStatCounter("TransmitError")
-       return false
+       return -1
 }
 
 func (m *RMRClient) UpdateStatCounter(name string) {