add validation for empty indication messages; run go fmt 12/12612/1
authortchyang <tzy5088@psu.edu>
Thu, 14 Mar 2024 14:58:54 +0000 (10:58 -0400)
committertchyang <tzy5088@psu.edu>
Thu, 14 Mar 2024 15:02:02 +0000 (11:02 -0400)
Change-Id: Ib5459048ad04e64e29781660d4084fcd6e86f657
Signed-off-by: tchyang <tzy5088@psu.edu>
control/control.go

index 555bce2..10e6e99 100644 (file)
@@ -1,29 +1,32 @@
 package control\r
+\r
 /*\r
 #include <e2sm/wrapper.h>\r
 #cgo LDFLAGS: -lm  -le2smwrapper\r
 #cgo CFLAGS:  -I/usr/local/include/e2sm\r
 */\r
 import "C"\r
-import (\r
-       "unsafe"\r
-)\r
 import (\r
        "context"\r
        "encoding/json"\r
+       "errors"\r
+       "fmt"\r
        "log"\r
        "net/http"\r
-       "time"\r
-//     "bytes"\r
-//     "encoding/binary"\r
-       "strconv"\r
-       //"encoding/base64"\r
-       //"strings"\r
-       "fmt"\r
        "reflect"\r
-       "errors"\r
+       "strconv"\r
+       "time"\r
+       "unsafe"\r
+\r
        "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"\r
        "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"\r
+\r
+       //      "bytes"\r
+       //      "encoding/binary"\r
+\r
+       //"encoding/base64"\r
+       //"strings"\r
+\r
        influxdb2 "github.com/influxdata/influxdb-client-go"\r
 )\r
 \r
@@ -47,7 +50,8 @@ var Glob_cell = make(map[string]bool)
 var Glob_Ran_cell = make(map[string][]string)\r
 var Glob_cell_Plmn = make(map[string]string)\r
 var ranUeKpi = make(map[string][]string)\r
-var ranCellKpi =  make(map[string][]string)\r
+var ranCellKpi = make(map[string][]string)\r
+\r
 func (c Control) Consume(msg *xapp.RMRParams) error {\r
        id := xapp.Rmr.GetRicMessageName(msg.Mtype)\r
        xapp.Logger.Info(\r
@@ -155,29 +159,29 @@ func encode_action_format1(plmn string, cellid string, meid string) clientmodel.
        var format1 []int64\r
        //format1=[]int64{0,1,1,8,0,19,32,0,3,1,32,0,0,32,0,4,1,32,0,0,32,0,78,1,32,0,0,32,0,79,1,32,0,0,32,0,8,1,32,0,0,32,0,7,1,32,0,0,32,0,11,1,32,0,0,32,0,12,1,32,0,0,32,0,80,1,32,0,0,32,0,81,1,32,0,0,32,0,13,1,32,0,0,32,0,14,1,32,0,0,32,0,40,1,32,0,0,32,0,41,1,32,0,0,32,0,42,1,32,0,0,32,0,82,1,32,0,0,32,0,83,1,32,0,0,32,0,84,1,32,0,0,32,0,85,1,32,0,0,32,0,86,1,32,0,0,64,39,15,0,0,31,1,18,52,92,0,16}\r
        //0(nr) 1(eutra)  0,31,1(plmn)18,52,92,0,16(cellid)\r
-       link:="http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
-       \r
-       link=link+meid\r
-       tmpr,err := http.Get(link)\r
+       link := "http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
+\r
+       link = link + meid\r
+       tmpr, err := http.Get(link)\r
        if err != nil {\r
-               log.Fatalln(err)\r
-               l:=[]int64{0}\r
-               return l\r
+               log.Fatalln(err)\r
+               l := []int64{0}\r
+               return l\r
        }\r
        defer tmpr.Body.Close()\r
        var resp E2mgrResponse\r
 \r
-       err=json.NewDecoder(tmpr.Body).Decode(&resp)\r
+       err = json.NewDecoder(tmpr.Body).Decode(&resp)\r
        if err != nil {\r
-                log.Fatalln(err)\r
-                l:=[]int64{0}\r
-                return l\r
+               log.Fatalln(err)\r
+               l := []int64{0}\r
+               return l\r
 \r
-        }\r
-       counter:=0\r
+       }\r
+       counter := 0\r
        //RanFunctionId=2 for kpm in viavi\r
        for i := 0; i < len(resp.Gnb.RanFunctions); i++ {\r
-               if resp.Gnb.RanFunctions[i].RanFunctionId  == 2 {\r
+               if resp.Gnb.RanFunctions[i].RanFunctionId == 2 {\r
                        counter = i\r
                        break\r
                }\r
@@ -186,18 +190,18 @@ func encode_action_format1(plmn string, cellid string, meid string) clientmodel.
        defer C.free(unsafe.Pointer(cString)) // Free the allocated C string when done\r
        // Call the C function\r
        determine := 2 //2 for format1 by name\r
-       result:=C.encode_action_Definition(cString, C.int(determine))\r
-       \r
+       result := C.encode_action_Definition(cString, C.int(determine))\r
+\r
        for i := 0; i < int(result.length); i++ {\r
                value := int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(result.array)) + uintptr(i*4))))\r
                format1 = append(format1, value)\r
-       }\r
+       }\r
        format1 = append(format1, lol1...) //appending plmn\r
-        format1 = append(format1, lol2...) //appending cellid\r
+       format1 = append(format1, lol2...) //appending cellid\r
        return format1\r
 }\r
 \r
-func encode_action_format2() clientmodel.ActionDefinition{\r
+func encode_action_format2() clientmodel.ActionDefinition {\r
        var format2 []int64\r
        format2 = []int64{0, 1, 0, 0, 0, 20, 0, 160, 68, 82, 66, 46, 85, 69, 84, 104, 112, 68, 108, 1, 0, 0, 0, 1, 64, 68, 82, 66, 46, 85, 69, 84, 104, 112, 85, 108, 1, 0, 0, 0, 1, 0, 71, 78, 66, 45, 68, 85, 45, 73, 68, 1, 0, 0, 0, 0, 160, 78, 82, 45, 67, 71, 73, 1, 0, 0, 0, 0, 160, 78, 82, 45, 80, 67, 73, 1, 0, 0, 0, 2, 192, 81, 111, 115, 70, 108, 111, 119, 46, 80, 100, 99, 112, 80, 100, 117, 86, 111, 108, 117, 109, 101, 68, 108, 1, 0, 0, 0, 2, 192, 81, 111, 115, 70, 108, 111, 119, 46, 80, 100, 99, 112, 80, 100, 117, 86, 111, 108, 117, 109, 101, 85, 108, 1, 0, 0, 0, 1, 64, 82, 82, 67, 46, 67, 111, 110, 110, 77, 97, 120, 1, 0, 0, 0, 1, 96, 82, 82, 67, 46, 67, 111, 110, 110, 77, 101, 97, 110, 1, 0, 0, 0, 1, 160, 82, 82, 85, 46, 80, 114, 98, 65, 118, 97, 105, 108, 68, 108, 1, 0, 0, 0, 1, 160, 82, 82, 85, 46, 80, 114, 98, 65, 118, 97, 105, 108, 85, 108, 1, 0, 0, 0, 1, 32, 82, 82, 85, 46, 80, 114, 98, 84, 111, 116, 1, 0, 0, 0, 1, 96, 82, 82, 85, 46, 80, 114, 98, 84, 111, 116, 68, 108, 1, 0, 0, 0, 1, 96, 82, 82, 85, 46, 80, 114, 98, 84, 111, 116, 85, 108, 1, 0, 0, 0, 1, 128, 82, 82, 85, 46, 80, 114, 98, 85, 115, 101, 100, 68, 108, 1, 0, 0, 0, 1, 128, 82, 82, 85, 46, 80, 114, 98, 85, 115, 101, 100, 85, 108, 1, 0, 0, 0, 1, 64, 86, 105, 97, 118, 105, 46, 71, 101, 111, 46, 120, 1, 0, 0, 0, 1, 64, 86, 105, 97, 118, 105, 46, 71, 101, 111, 46, 121, 1, 0, 0, 0, 1, 64, 86, 105, 97, 118, 105, 46, 71, 101, 111, 46, 122, 1, 0, 0, 0, 2, 0, 86, 105, 97, 118, 105, 46, 82, 97, 100, 105, 111, 46, 112, 111, 119, 101, 114, 1, 0, 0, 0, 2, 64, 86, 105, 97, 118, 105, 46, 82, 97, 100, 105, 111, 46, 115, 101, 99, 116, 111, 114, 115, 1, 0, 0, 0, 0, 0}\r
        //encode the variable part and append it to our array.\r
@@ -211,120 +215,119 @@ func encode_action_format3(meid string) clientmodel.ActionDefinition {
        //for simulation-by measId(not supported in Viavi 1.4)\r
        //format3=[]int64{0,1,3,64,0,29,32,0,90,0,0,16,0,0,16,0,91,0,0,16,0,0,16,0,3,0,0,16,0,0,16,0,4,0,0,16,0,0,16,0,80,0,0,16,0,0,16,0,13,0,0,16,0,0,16,0,14,0,0,16,0,0,16,0,92,0,0,16,0,0,16,0,93,0,0,16,0,0,16,0,44,0,0,16,0,0,16,0,40,0,0,16,0,0,16,0,41,0,0,16,0,0,16,0,42,0,0,16,0,0,16,0,94,0,0,16,0,0,16,0,95,0,0,16,0,0,16,0,96,0,0,16,0,0,16,0,97,0,0,16,0,0,16,0,45,0,0,16,0,0,16,0,98,0,0,16,0,0,16,0,99,0,0,16,0,0,16,0,100,0,0,16,0,0,16,0,101,0,0,16,0,0,16,0,102,0,0,16,0,0,16,0,103,0,0,16,0,0,16,0,104,0,0,16,0,0,16,0,43,0,0,16,0,0,16,0,105,0,0,16,0,0,16,0,106,0,0,16,0,0,16,0,107,0,0,16,0,0,16,0,108,0,0,16,0,0,32,39,15}\r
        //variable part is not presetnt in action def format 3\r
-       \r
-       link:="http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
-        link=link+meid\r
-        tmpr,err := http.Get(link)\r
-        if err != nil {\r
-                log.Fatalln(err)\r
-                l:=[]int64{0}\r
-                return l\r
-\r
-        }\r
-        defer tmpr.Body.Close()\r
-        var resp E2mgrResponse\r
-\r
-        err=json.NewDecoder(tmpr.Body).Decode(&resp)\r
-        if err != nil {\r
-                log.Fatalln(err)\r
-                l:=[]int64{0}\r
-                return l\r
-\r
-        }\r
-       counter:=0\r
-        //RanFunctionId=2 for kpm in viavi\r
-        for i := 0; i < len(resp.Gnb.RanFunctions); i++ {\r
-                if resp.Gnb.RanFunctions[i].RanFunctionId  == 2 {\r
-                        counter = i\r
-                        break\r
-                }\r
-        }\r
-        cString := C.CString(resp.Gnb.RanFunctions[counter].RanFunctionDefinition)\r
-        defer C.free(unsafe.Pointer(cString)) // Free the allocated C string when done\r
-        // Call the C function\r
-        determine := 4 //2 for format1 by name\r
-       \r
-       result:=C.encode_action_Definition(cString, C.int(determine))\r
-        for i := 0; i < int(result.length); i++ {\r
-               value := int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(result.array)) + uintptr(i*4))))\r
-               format3 = append(format3, value)\r
 \r
-        }\r
-\r
-\r
-       //variable part is not presetnt in action def format 3\r
-       return format3\r
-}\r
-func encode_actionsToBeSetup(meid string) clientmodel.ActionsToBeSetup {\r
-       var l clientmodel.ActionsToBeSetup\r
-       /*\r
-       link:="http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
-       link=link+meid\r
-       tmpr,err := http.Get(link)\r
+       link := "http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
+       link = link + meid\r
+       tmpr, err := http.Get(link)\r
        if err != nil {\r
-               log.Fatalln(err)\r
-               return l\r
+               log.Fatalln(err)\r
+               l := []int64{0}\r
+               return l\r
+\r
        }\r
        defer tmpr.Body.Close()\r
        var resp E2mgrResponse\r
-       \r
-       err=json.NewDecoder(tmpr.Body).Decode(&resp)\r
+\r
+       err = json.NewDecoder(tmpr.Body).Decode(&resp)\r
        if err != nil {\r
-                log.Fatalln(err)\r
-                return l\r
-        }\r
+               log.Fatalln(err)\r
+               l := []int64{0}\r
+               return l\r
 \r
-       \r
+       }\r
        counter := 0\r
-       for i := 0; i < len(resp.Gnb.NodeConfigs); i++ {\r
-               if resp.Gnb.NodeConfigs[i].E2nodeComponentInterfaceType == "f1" {\r
+       //RanFunctionId=2 for kpm in viavi\r
+       for i := 0; i < len(resp.Gnb.RanFunctions); i++ {\r
+               if resp.Gnb.RanFunctions[i].RanFunctionId == 2 {\r
                        counter = i\r
                        break\r
                }\r
        }\r
-       tm := resp.Gnb.NodeConfigs[counter].E2nodeComponentRequestPart\r
-       base64Text := make([]byte, base64.StdEncoding.DecodedLen(len(tm)))\r
-       nl, _ := base64.StdEncoding.Decode(base64Text, []byte(tm))\r
-       message := string(base64Text[:nl])\r
-       \r
-       counter = 0\r
-       for i := 0; i < len(meid); i++ {\r
-               if meid[i] == '_' {\r
-                       counter++\r
-               }\r
-               if counter == 3 {\r
-                       counter = i + 1\r
-                       break\r
-               }\r
-       }\r
-       \r
-       ans := strings.ToUpper(meid[counter:len(meid)])\r
-       l1 := int64(len(message))\r
-       l2 := int64(len(ans))\r
-       var cells []string\r
-       for i := int64(0); i <= l1-l2; i++ {\r
-               if strings.Contains(message[i:i+l2], ans) {\r
-                       Glob_cell[message[i:i+10]]=true\r
-                       cells = append(cells, message[i:i+10])\r
-                       fmt.Println(message[i : i+10])\r
-               }\r
+       cString := C.CString(resp.Gnb.RanFunctions[counter].RanFunctionDefinition)\r
+       defer C.free(unsafe.Pointer(cString)) // Free the allocated C string when done\r
+       // Call the C function\r
+       determine := 4 //2 for format1 by name\r
+\r
+       result := C.encode_action_Definition(cString, C.int(determine))\r
+       for i := 0; i < int(result.length); i++ {\r
+               value := int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(result.array)) + uintptr(i*4))))\r
+               format3 = append(format3, value)\r
+\r
        }\r
+\r
+       //variable part is not presetnt in action def format 3\r
+       return format3\r
+}\r
+func encode_actionsToBeSetup(meid string) clientmodel.ActionsToBeSetup {\r
+       var l clientmodel.ActionsToBeSetup\r
+       /*\r
+                       link:="http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
+                       link=link+meid\r
+                       tmpr,err := http.Get(link)\r
+                       if err != nil {\r
+                               log.Fatalln(err)\r
+                               return l\r
+                       }\r
+                       defer tmpr.Body.Close()\r
+                       var resp E2mgrResponse\r
+\r
+                       err=json.NewDecoder(tmpr.Body).Decode(&resp)\r
+                       if err != nil {\r
+                               log.Fatalln(err)\r
+                               return l\r
+                       }\r
+\r
+\r
+                       counter := 0\r
+                       for i := 0; i < len(resp.Gnb.NodeConfigs); i++ {\r
+                               if resp.Gnb.NodeConfigs[i].E2nodeComponentInterfaceType == "f1" {\r
+                                       counter = i\r
+                                       break\r
+                               }\r
+                       }\r
+                       tm := resp.Gnb.NodeConfigs[counter].E2nodeComponentRequestPart\r
+                       base64Text := make([]byte, base64.StdEncoding.DecodedLen(len(tm)))\r
+                       nl, _ := base64.StdEncoding.Decode(base64Text, []byte(tm))\r
+                       message := string(base64Text[:nl])\r
+\r
+                       counter = 0\r
+                       for i := 0; i < len(meid); i++ {\r
+                               if meid[i] == '_' {\r
+                                       counter++\r
+                               }\r
+                               if counter == 3 {\r
+                                       counter = i + 1\r
+                                       break\r
+                               }\r
+                       }\r
+\r
+                       ans := strings.ToUpper(meid[counter:len(meid)])\r
+                       l1 := int64(len(message))\r
+                       l2 := int64(len(ans))\r
+                       var cells []string\r
+                       for i := int64(0); i <= l1-l2; i++ {\r
+                               if strings.Contains(message[i:i+l2], ans) {\r
+                                       Glob_cell[message[i:i+10]]=true\r
+                                       cells = append(cells, message[i:i+10])\r
+                                       fmt.Println(message[i : i+10])\r
+                               }\r
+                       }\r
        */\r
 \r
        var n int64 = 1\r
-       cells:=Glob_Ran_cell[meid]\r
+       cells := Glob_Ran_cell[meid]\r
        //fmt.Println("len of Tonga cells= ",len(cells))\r
-        //fmt.Println("Tonga cells = ", cells)\r
+       //fmt.Println("Tonga cells = ", cells)\r
        //fmt.Println("Tonga  = ", Glob_Ran_cell)\r
 \r
        var tempCells []string\r
-       for _, ele:=range cells{\r
-               if ele!=""{\r
-                       tempCells =append(tempCells,ele)\r
+       for _, ele := range cells {\r
+               if ele != "" {\r
+                       tempCells = append(tempCells, ele)\r
                }\r
        }\r
        //fmt.Println("len of Tonga tmep cells= ",len(tempCells))\r
-        //fmt.Println("Tonga temp cells = ", tempCells)\r
+       //fmt.Println("Tonga temp cells = ", tempCells)\r
 \r
        //var ue int64 = 1 //get no of ue connected to du(if required)\r
 \r
@@ -336,8 +339,8 @@ func encode_actionsToBeSetup(meid string) clientmodel.ActionsToBeSetup {
                s := clientmodel.ActionToBeSetup{\r
                        ActionID:         lol,\r
                        ActionType:       &actionType,\r
-                       ActionDefinition: encode_action_format1(Glob_cell_Plmn[tempCells[n-1]], tempCells[n-1],meid),\r
-                       SubsequentAction:  &clientmodel.SubsequentAction{\r
+                       ActionDefinition: encode_action_format1(Glob_cell_Plmn[tempCells[n-1]], tempCells[n-1], meid),\r
+                       SubsequentAction: &clientmodel.SubsequentAction{\r
                                SubsequentActionType: &subsequentActionType,\r
                                TimeToWait:           &timeToWait,\r
                        },\r
@@ -348,24 +351,24 @@ func encode_actionsToBeSetup(meid string) clientmodel.ActionsToBeSetup {
        }\r
        var tmp_act_id int64 = n\r
        /*\r
-       n = 1\r
-       // for action def 2\r
-       for n <= ue {\r
-               var tmp int64 = tmp_act_id\r
-               var lol *int64 = &tmp\r
-               s := clientmodel.ActionToBeSetup{\r
-                       ActionID:         lol,\r
-                       ActionType:       &actionType,\r
-                       ActionDefinition: encode_action_format2(),\r
-                       SubsequentAction:  &clientmodel.SubsequentAction{\r
-                               SubsequentActionType: &subsequentActionType,\r
-                               TimeToWait:           &timeToWait,\r
-                       },\r
+               n = 1\r
+               // for action def 2\r
+               for n <= ue {\r
+                       var tmp int64 = tmp_act_id\r
+                       var lol *int64 = &tmp\r
+                       s := clientmodel.ActionToBeSetup{\r
+                               ActionID:         lol,\r
+                               ActionType:       &actionType,\r
+                               ActionDefinition: encode_action_format2(),\r
+                               SubsequentAction:  &clientmodel.SubsequentAction{\r
+                                       SubsequentActionType: &subsequentActionType,\r
+                                       TimeToWait:           &timeToWait,\r
+                               },\r
+                       }\r
+                       l = append(l, &s)\r
+                       tmp_act_id = tmp_act_id + 1\r
+                       n = n + 1\r
                }\r
-               l = append(l, &s)\r
-               tmp_act_id = tmp_act_id + 1\r
-               n = n + 1\r
-       }\r
        */\r
 \r
        //for action def 3\r
@@ -375,7 +378,7 @@ func encode_actionsToBeSetup(meid string) clientmodel.ActionsToBeSetup {
                ActionID:         lol,\r
                ActionType:       &actionType,\r
                ActionDefinition: encode_action_format3(meid),\r
-               SubsequentAction:  &clientmodel.SubsequentAction{\r
+               SubsequentAction: &clientmodel.SubsequentAction{\r
                        SubsequentActionType: &subsequentActionType,\r
                        TimeToWait:           &timeToWait,\r
                },\r
@@ -388,35 +391,35 @@ func encode_actionsToBeSetup(meid string) clientmodel.ActionsToBeSetup {
 func (c Control) sendSubscription(meid string) {\r
        //Create Subscription message and send it to RIC platform\r
        xapp.Logger.Info("Sending subscription request for MEID: %v", meid)\r
-/*\r
-       subscritionParams := clientmodel.SubscriptionParams{\r
-               ClientEndpoint: &clientEndpoint,\r
-               Meid:           &meid,\r
-               RANFunctionID:  &funcId,\r
-               SubscriptionDetails: clientmodel.SubscriptionDetailsList{\r
-                       &clientmodel.SubscriptionDetail{\r
-                               EventTriggers: clientmodel.EventTriggerDefinition{\r
-                                       8,39,15,\r
-                               },\r
-                               XappEventInstanceID: &seqId,\r
-                               ActionToBeSetupList: clientmodel.ActionsToBeSetup{\r
-                                       &clientmodel.ActionToBeSetup{\r
-                                               ActionID:   &actionId,\r
-                                               ActionType: &actionType,\r
-                                               ActionDefinition: clientmodel.ActionDefinition{\r
-                                                       5678,\r
-                                               },\r
-                                               SubsequentAction: &clientmodel.SubsequentAction{\r
-                                                       SubsequentActionType: &subsequentActionType,\r
-                                                       TimeToWait:           &timeToWait,\r
+       /*\r
+               subscritionParams := clientmodel.SubscriptionParams{\r
+                       ClientEndpoint: &clientEndpoint,\r
+                       Meid:           &meid,\r
+                       RANFunctionID:  &funcId,\r
+                       SubscriptionDetails: clientmodel.SubscriptionDetailsList{\r
+                               &clientmodel.SubscriptionDetail{\r
+                                       EventTriggers: clientmodel.EventTriggerDefinition{\r
+                                               8,39,15,\r
+                                       },\r
+                                       XappEventInstanceID: &seqId,\r
+                                       ActionToBeSetupList: clientmodel.ActionsToBeSetup{\r
+                                               &clientmodel.ActionToBeSetup{\r
+                                                       ActionID:   &actionId,\r
+                                                       ActionType: &actionType,\r
+                                                       ActionDefinition: clientmodel.ActionDefinition{\r
+                                                               5678,\r
+                                                       },\r
+                                                       SubsequentAction: &clientmodel.SubsequentAction{\r
+                                                               SubsequentActionType: &subsequentActionType,\r
+                                                               TimeToWait:           &timeToWait,\r
+                                                       },\r
                                                },\r
                                        },\r
                                },\r
                        },\r
-               },\r
-       }\r
+               }\r
        */\r
-       \r
+\r
        //8,39,15, for 10000 ms reporting period\r
        subscritionParams := clientmodel.SubscriptionParams{\r
                ClientEndpoint: &clientEndpoint,\r
@@ -425,7 +428,7 @@ func (c Control) sendSubscription(meid string) {
                SubscriptionDetails: clientmodel.SubscriptionDetailsList{\r
                        &clientmodel.SubscriptionDetail{\r
                                EventTriggers: clientmodel.EventTriggerDefinition{\r
-                                       8,39,15,\r
+                                       8, 39, 15,\r
                                },\r
                                XappEventInstanceID: &seqId,\r
                                ActionToBeSetupList: encode_actionsToBeSetup(meid),\r
@@ -448,192 +451,188 @@ func (c Control) sendSubscription(meid string) {
 }\r
 \r
 func Test() (err error) {\r
-        var e2ap *E2ap\r
-        //var e2sm *E2sm\r
+       var e2ap *E2ap\r
+       //var e2sm *E2sm\r
 \r
-        //indicationMsg, err := e2ap.GetIndicationMessage(params.Payload)\r
+       //indicationMsg, err := e2ap.GetIndicationMessage(params.Payload)\r
        indicationMsg, err := e2ap.GetIndicationM()\r
 \r
-        if err != nil {\r
-                xapp.Logger.Error("Failed to decode RIC Indication message: %v", err)\r
-                return\r
-        }\r
-\r
-        //log.Printf("RIC Indication message from {%s} received", params.Meid.RanName)\r
-        /*\r
-                indicationHdr, err := e2sm.GetIndicationHeader(indicationMsg.IndHeader)\r
-                if err != nil {\r
-                        xapp.Logger.Error("Failed to decode RIC Indication Header: %v", err)\r
-                        return\r
-                }\r
-        */\r
-\r
-        //Decoding message and put information into log\r
-        log.Printf("-----------RIC Indication Header-----------")\r
+       if err != nil {\r
+               xapp.Logger.Error("Failed to decode RIC Indication message: %v", err)\r
+               return\r
+       }\r
+\r
+       //log.Printf("RIC Indication message from {%s} received", params.Meid.RanName)\r
+       /*\r
+          indicationHdr, err := e2sm.GetIndicationHeader(indicationMsg.IndHeader)\r
+          if err != nil {\r
+                  xapp.Logger.Error("Failed to decode RIC Indication Header: %v", err)\r
+                  return\r
+          }\r
+       */\r
+\r
+       //Decoding message and put information into log\r
+       log.Printf("-----------RIC Indication Header-----------")\r
        log.Printf("indicationMsg.IndHeader= %x", indicationMsg.IndHeader)\r
-/*     \r
-       buf := new(bytes.Buffer) //create my buffer\r
-       binary.Write(buf, binary.LittleEndian, indicationMsg.IndHeader)\r
-       log.Printf("binary Write buf= %x",buf )\r
-       b := buf.Bytes()\r
-       //str := buf.String()\r
-       //log.Printf(" buf Strin()= %s",str )\r
-       //cptr1:= unsafe.Pointer(C.CString(str))\r
-       cptr1:= unsafe.Pointer(&b[0])\r
-       defer C.free(cptr1)\r
-*/     \r
-        cptr1 := unsafe.Pointer(&indicationMsg.IndHeader[0])\r
-        decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(len(indicationMsg.IndHeader)))\r
+       /*\r
+               buf := new(bytes.Buffer) //create my buffer\r
+               binary.Write(buf, binary.LittleEndian, indicationMsg.IndHeader)\r
+               log.Printf("binary Write buf= %x",buf )\r
+               b := buf.Bytes()\r
+               //str := buf.String()\r
+               //log.Printf(" buf Strin()= %s",str )\r
+               //cptr1:= unsafe.Pointer(C.CString(str))\r
+               cptr1:= unsafe.Pointer(&b[0])\r
+               defer C.free(cptr1)\r
+       */\r
+       cptr1 := unsafe.Pointer(&indicationMsg.IndHeader[0])\r
+       decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(len(indicationMsg.IndHeader)))\r
        //decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(len(str)))\r
        //decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(buf.Len()))\r
-        if decodedHdr == nil {\r
-                return errors.New("e2sm wrapper is unable to get IndicationHeader due to wrong or invalid input")\r
-        }\r
-        defer C.e2sm_free_ric_indication_header(decodedHdr)\r
-        IndHdrType := int32(decodedHdr.indicationHeader_formats.present)\r
-        if IndHdrType==0{\r
-                log.Printf("No Indication Header present")\r
-        }\r
-        if IndHdrType==1{\r
-                log.Printf("Indication Header format = %d",IndHdrType)\r
-                indHdrFormat1_C := *(**C.E2SM_KPM_IndicationHeader_Format1_t)(unsafe.Pointer(&decodedHdr.indicationHeader_formats.choice[0]))\r
-                //senderName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderName))\r
-               senderName_C:=indHdrFormat1_C.senderName\r
-                var senderName []byte\r
-                senderName = C.GoBytes(unsafe.Pointer(senderName_C.buf), C.int(senderName_C.size))\r
-                log.Printf("Sender Name = %x",senderName)\r
-\r
-                //senderType_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderType))\r
-               senderType_C :=indHdrFormat1_C.senderType\r
-                //senderType []byte\r
-                senderType := C.GoBytes(unsafe.Pointer(senderType_C.buf), C.int(senderType_C.size))\r
-                log.Printf("Sender Type = %x",senderType)\r
-\r
-                //vendorName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.vendorName))\r
-               vendorName_C :=indHdrFormat1_C.vendorName\r
-                //vendorName  []byte\r
-                vendorName := C.GoBytes(unsafe.Pointer(vendorName_C.buf), C.int(vendorName_C.size))\r
-                log.Printf("Vendor Name = %x",vendorName)\r
-\r
-\r
-        }\r
-\r
-        /*\r
-                indMsg, err := e2sm.GetIndicationMessage(indicationMsg.IndMessage)\r
-                if err != nil {\r
-                        xapp.Logger.Error("Failed to decode RIC Indication Message: %v", err)\r
-                        return\r
-                }\r
-        */\r
-        log.Printf("-----------RIC Indication Message-----------")\r
-       log.Printf("indicationMsg.IndMessage= %x",indicationMsg.IndMessage)\r
-        cptr2 := unsafe.Pointer(&indicationMsg.IndMessage[0])\r
-        indicationmessage := C.e2sm_decode_ric_indication_message(cptr2, C.size_t(len(indicationMsg.IndMessage)))\r
-        if  indicationmessage == nil {\r
-                return errors.New("e2sm wrapper is unable to get IndicationMessage due to wrong or invalid input")\r
-        }\r
-        defer C.e2sm_free_ric_indication_message(indicationmessage)\r
-        IndMsgType := int32(indicationmessage.indicationMessage_formats.present)\r
-        if IndMsgType==1  {//parsing cell metrics\r
-                fmt.Printf(" parsing for cell metrics\n" )\r
-                indMsgFormat1_C := *(**C.E2SM_KPM_IndicationMessage_Format1_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
-                no_of_cell:=int32(indMsgFormat1_C .measData.list.count)\r
-               fmt.Printf(" \n No of cell = %d\n",no_of_cell )\r
-               //fmt.Println(no_of_cell)\r
-                for n := int32(0); n < no_of_cell; n++ {\r
-                                var sizeof_MeasurementDataItem_t  *C.MeasurementDataItem_t\r
-                                MeasurementDataItem_C:=*(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat1_C.measData.list.array)) + (uintptr)(int(n))*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
-                                no_of_cell_metrics:=int32(MeasurementDataItem_C.measRecord.list.count)\r
-                                var CellM CellMetricsEntry\r
-                                v := reflect.ValueOf(CellM)\r
-                               fmt.Printf(" \n No of cell metrics = %d\n",no_of_cell_metrics)\r
-                                values := make(map[string]interface{}, v.NumField())\r
-                                //assert no_of_cell_metrics == v.NumField()   they both should be equal.\r
-                                for i := int32(0); i < no_of_cell_metrics; i++ {\r
-                                       //fmt.Println(i)\r
-                                        if v.Field(int(i)).CanInterface() {\r
-                                                        var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
-                                                        MeasurementRecordItem_C:=*(**C. MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(int(i))*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
-                                                        type_var:=int(MeasurementRecordItem_C.present)\r
-                                                        if type_var==1{\r
-                                                                var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                                                values[v.Type().Field(int(i)).Name]=int32(*cast_integer)\r
-                                                                }else if type_var==2{\r
-                                var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                values[v.Type().Field(int(i)).Name]=float64(*cast_float)\r
-                                                        }else{\r
-                                                        fmt.Printf("Wrong Data Type")\r
-                                                }\r
-\r
-                                                }else {\r
-                                                fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
-                                                }\r
-                                        }//end of inner for loop\r
-\r
-\r
-                               fmt.Println(values)\r
-                               fmt.Printf("Parsing Cell Metric Done")\r
-                               //c.writeCellMetrics_db(&values)//push cellmetrics map entry to database.\r
-                        }//end of outer for loop\r
-                        //end of if IndMsgType==1 , parsing cell metrics done\r
-\r
-        }  else if IndMsgType==2  { //parsing ue metrics\r
-\r
-                fmt.Printf(" parsing for UE metrics" )\r
-                indMsgFormat2_C := *(**C.E2SM_KPM_IndicationMessage_Format2_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
-                no_of_ue_metrics:=int32(indMsgFormat2_C .measData.list.count)\r
-               fmt.Printf(" \n No of ue metrics = %d\n",no_of_ue_metrics)\r
-\r
-                var sizeof_MeasurementDataItem_t  *C.MeasurementDataItem_t\r
-                MeasurementDataItem_C:=*(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(0)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
-\r
-                no_of_ue:=int32(MeasurementDataItem_C.measRecord.list.count)\r
-               fmt.Printf(" \n No of ue= %d\n",no_of_ue)\r
-                for n := int32(0); n < no_of_ue; n++ {\r
-                                var UeM UeMetricsEntry\r
-                                v := reflect.ValueOf(UeM)\r
-                                values := make(map[string]interface{}, v.NumField())\r
-                                //assert no_of_ue_metrics == v.NumField()   they both should be equal.\r
-                                for i := int32(0); i < no_of_ue_metrics; i++ {\r
-                               //fmt.Println(i)\r
-                                if v.Field(int(i)).CanInterface() {\r
-\r
-                                        var sizeof_MeasurementDataItem_t  *C.MeasurementDataItem_t\r
-                                        MeasurementDataItem_C:=*(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(i)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
-                                        var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
-                                        MeasurementRecordItem_C:=*(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(n)*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
+       if decodedHdr == nil {\r
+               return errors.New("e2sm wrapper is unable to get IndicationHeader due to wrong or invalid input")\r
+       }\r
+       defer C.e2sm_free_ric_indication_header(decodedHdr)\r
+       IndHdrType := int32(decodedHdr.indicationHeader_formats.present)\r
+       if IndHdrType == 0 {\r
+               log.Printf("No Indication Header present")\r
+       }\r
+       if IndHdrType == 1 {\r
+               log.Printf("Indication Header format = %d", IndHdrType)\r
+               indHdrFormat1_C := *(**C.E2SM_KPM_IndicationHeader_Format1_t)(unsafe.Pointer(&decodedHdr.indicationHeader_formats.choice[0]))\r
+               //senderName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderName))\r
+               senderName_C := indHdrFormat1_C.senderName\r
+               var senderName []byte\r
+               senderName = C.GoBytes(unsafe.Pointer(senderName_C.buf), C.int(senderName_C.size))\r
+               log.Printf("Sender Name = %x", senderName)\r
+\r
+               //senderType_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderType))\r
+               senderType_C := indHdrFormat1_C.senderType\r
+               //senderType []byte\r
+               senderType := C.GoBytes(unsafe.Pointer(senderType_C.buf), C.int(senderType_C.size))\r
+               log.Printf("Sender Type = %x", senderType)\r
+\r
+               //vendorName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.vendorName))\r
+               vendorName_C := indHdrFormat1_C.vendorName\r
+               //vendorName  []byte\r
+               vendorName := C.GoBytes(unsafe.Pointer(vendorName_C.buf), C.int(vendorName_C.size))\r
+               log.Printf("Vendor Name = %x", vendorName)\r
 \r
-                                        type_var:=int(MeasurementRecordItem_C.present)\r
-                                if type_var==1{\r
-                                        var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                        values[v.Type().Field(int(i)).Name]=int32(*cast_integer)\r
-                                }else if type_var==2{\r
-                                        var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                        values[v.Type().Field(int(i)).Name]=float64(*cast_float)\r
+       }\r
 \r
-                                        }else{\r
-                                        fmt.Printf("Wrong Data Type")\r
-                                }\r
+       /*\r
+          indMsg, err := e2sm.GetIndicationMessage(indicationMsg.IndMessage)\r
+          if err != nil {\r
+                  xapp.Logger.Error("Failed to decode RIC Indication Message: %v", err)\r
+                  return\r
+          }\r
+       */\r
+       log.Printf("-----------RIC Indication Message-----------")\r
+       log.Printf("indicationMsg.IndMessage= %x", indicationMsg.IndMessage)\r
+       cptr2 := unsafe.Pointer(&indicationMsg.IndMessage[0])\r
+       indicationmessage := C.e2sm_decode_ric_indication_message(cptr2, C.size_t(len(indicationMsg.IndMessage)))\r
+       if indicationmessage == nil {\r
+               return errors.New("e2sm wrapper is unable to get IndicationMessage due to wrong or invalid input")\r
+       }\r
+       defer C.e2sm_free_ric_indication_message(indicationmessage)\r
+       IndMsgType := int32(indicationmessage.indicationMessage_formats.present)\r
+       if IndMsgType == 1 { //parsing cell metrics\r
+               fmt.Printf(" parsing for cell metrics\n")\r
+               indMsgFormat1_C := *(**C.E2SM_KPM_IndicationMessage_Format1_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
+               no_of_cell := int32(indMsgFormat1_C.measData.list.count)\r
+               fmt.Printf(" \n No of cell = %d\n", no_of_cell)\r
+               //fmt.Println(no_of_cell)\r
+               for n := int32(0); n < no_of_cell; n++ {\r
+                       var sizeof_MeasurementDataItem_t *C.MeasurementDataItem_t\r
+                       MeasurementDataItem_C := *(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat1_C.measData.list.array)) + (uintptr)(int(n))*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
+                       no_of_cell_metrics := int32(MeasurementDataItem_C.measRecord.list.count)\r
+                       var CellM CellMetricsEntry\r
+                       v := reflect.ValueOf(CellM)\r
+                       fmt.Printf(" \n No of cell metrics = %d\n", no_of_cell_metrics)\r
+                       values := make(map[string]interface{}, v.NumField())\r
+                       //assert no_of_cell_metrics == v.NumField()   they both should be equal.\r
+                       for i := int32(0); i < no_of_cell_metrics; i++ {\r
+                               //fmt.Println(i)\r
+                               if v.Field(int(i)).CanInterface() {\r
+                                       var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
+                                       MeasurementRecordItem_C := *(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(int(i))*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
+                                       type_var := int(MeasurementRecordItem_C.present)\r
+                                       if type_var == 1 {\r
+                                               var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                               values[v.Type().Field(int(i)).Name] = int32(*cast_integer)\r
+                                       } else if type_var == 2 {\r
+                                               var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                               values[v.Type().Field(int(i)).Name] = float64(*cast_float)\r
+                                       } else {\r
+                                               fmt.Printf("Wrong Data Type")\r
+                                       }\r
+\r
+                               } else {\r
+                                       fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
+                               }\r
+                       } //end of inner for loop\r
 \r
-                        }else {\r
-                                fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
-                                }\r
+                       fmt.Println(values)\r
+                       fmt.Printf("Parsing Cell Metric Done")\r
+                       //c.writeCellMetrics_db(&values)//push cellmetrics map entry to database.\r
+               } //end of outer for loop\r
+               //end of if IndMsgType==1 , parsing cell metrics done\r
+\r
+       } else if IndMsgType == 2 { //parsing ue metrics\r
+\r
+               fmt.Printf(" parsing for UE metrics")\r
+               indMsgFormat2_C := *(**C.E2SM_KPM_IndicationMessage_Format2_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
+               no_of_ue_metrics := int32(indMsgFormat2_C.measData.list.count)\r
+               fmt.Printf(" \n No of ue metrics = %d\n", no_of_ue_metrics)\r
+\r
+               var sizeof_MeasurementDataItem_t *C.MeasurementDataItem_t\r
+               MeasurementDataItem_C := *(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(0)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
+\r
+               no_of_ue := int32(MeasurementDataItem_C.measRecord.list.count)\r
+               fmt.Printf(" \n No of ue= %d\n", no_of_ue)\r
+               for n := int32(0); n < no_of_ue; n++ {\r
+                       var UeM UeMetricsEntry\r
+                       v := reflect.ValueOf(UeM)\r
+                       values := make(map[string]interface{}, v.NumField())\r
+                       //assert no_of_ue_metrics == v.NumField()   they both should be equal.\r
+                       for i := int32(0); i < no_of_ue_metrics; i++ {\r
+                               //fmt.Println(i)\r
+                               if v.Field(int(i)).CanInterface() {\r
 \r
+                                       var sizeof_MeasurementDataItem_t *C.MeasurementDataItem_t\r
+                                       MeasurementDataItem_C := *(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(i)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
+                                       var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
+                                       MeasurementRecordItem_C := *(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(n)*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
+\r
+                                       type_var := int(MeasurementRecordItem_C.present)\r
+                                       if type_var == 1 {\r
+                                               var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                               values[v.Type().Field(int(i)).Name] = int32(*cast_integer)\r
+                                       } else if type_var == 2 {\r
+                                               var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                               values[v.Type().Field(int(i)).Name] = float64(*cast_float)\r
+\r
+                                       } else {\r
+                                               fmt.Printf("Wrong Data Type")\r
+                                       }\r
+\r
+                               } else {\r
+                                       fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
+                               }\r
 \r
-                                        }       //end of inner for loop\r
+                       } //end of inner for loop\r
                        fmt.Println(values)\r
-                        fmt.Printf("Parsing UE Metric Done")\r
-                        //c.writeUeMetrics_db(&values)//push UEmetrics map entry to database.\r
-\r
-                        }// end of outer for loop\r
-        //parsing ue metrics done\r
-        }else{\r
-                fmt.Printf(" Invalid Indication message format" )\r
+                       fmt.Printf("Parsing UE Metric Done")\r
+                       //c.writeUeMetrics_db(&values)//push UEmetrics map entry to database.\r
 \r
-        }\r
+               } // end of outer for loop\r
+               //parsing ue metrics done\r
+       } else {\r
+               fmt.Printf(" Invalid Indication message format")\r
 \r
+       }\r
 \r
-        return nil\r
+       return nil\r
 }\r
 \r
 func (c *Control) controlLoop() {\r
@@ -670,205 +669,206 @@ func (c *Control) handleIndication(params *xapp.RMRParams) (err error) {
 \r
        //Decoding message and put information into log\r
        //log.Printf("-----------RIC Indication Header-----------")\r
-        //log.Printf("indicationMsg.IndHeader= %x", indicationMsg.IndHeader)\r
-/*\r
-        buf := new(bytes.Buffer) //create my buffer\r
-        binary.Write(buf, binary.LittleEndian, indicationMsg.IndHeader)\r
-        log.Printf("binary Write buf= %x",buf )\r
-        b := buf.Bytes()\r
-        //str := buf.String()\r
-        //log.Printf(" buf Strin()= %s",str )\r
-        //cptr1:= unsafe.Pointer(C.CString(str))\r
-        cptr1:= unsafe.Pointer(&b[0])\r
-        defer C.free(cptr1)\r
-*/\r
-        cptr1 := unsafe.Pointer(&indicationMsg.IndHeader[0])\r
-        decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(len(indicationMsg.IndHeader)))\r
-        //decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(len(str)))\r
-        //decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(buf.Len()))\r
-        if decodedHdr == nil {\r
-                return errors.New("e2sm wrapper is unable to get IndicationHeader due to wrong or invalid input")\r
-        }\r
-        defer C.e2sm_free_ric_indication_header(decodedHdr)\r
-        IndHdrType := int32(decodedHdr.indicationHeader_formats.present)\r
-        if IndHdrType==0{\r
-                log.Printf("No Indication Header present")\r
-        }\r
-        if IndHdrType==1{\r
-                log.Printf("Indication Header format = %d",IndHdrType)\r
-               /*\r
-                indHdrFormat1_C := *(**C.E2SM_KPM_IndicationHeader_Format1_t)(unsafe.Pointer(&decodedHdr.indicationHeader_formats.choice[0]))\r
-                //senderName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderName))\r
-                senderName_C:=indHdrFormat1_C.senderName\r
-                var senderName []byte\r
-                senderName = C.GoBytes(unsafe.Pointer(senderName_C.buf), C.int(senderName_C.size))\r
-                //log.Printf("Sender Name = %x",senderName)\r
-\r
-                //senderType_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderType))\r
-                senderType_C :=indHdrFormat1_C.senderType\r
-                //senderType []byte\r
-                senderType := C.GoBytes(unsafe.Pointer(senderType_C.buf), C.int(senderType_C.size))\r
-                //log.Printf("Sender Type = %x",senderType)\r
-\r
-                //vendorName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.vendorName))\r
-                vendorName_C :=indHdrFormat1_C.vendorName\r
-                //vendorName  []byte\r
-                vendorName := C.GoBytes(unsafe.Pointer(vendorName_C.buf), C.int(vendorName_C.size))\r
-                //log.Printf("Vendor Name = %x",vendorName)\r
-               */\r
+       //log.Printf("indicationMsg.IndHeader= %x", indicationMsg.IndHeader)\r
+       /*\r
+          buf := new(bytes.Buffer) //create my buffer\r
+          binary.Write(buf, binary.LittleEndian, indicationMsg.IndHeader)\r
+          log.Printf("binary Write buf= %x",buf )\r
+          b := buf.Bytes()\r
+          //str := buf.String()\r
+          //log.Printf(" buf Strin()= %s",str )\r
+          //cptr1:= unsafe.Pointer(C.CString(str))\r
+          cptr1:= unsafe.Pointer(&b[0])\r
+          defer C.free(cptr1)\r
+       */\r
 \r
-        }\r
-\r
-        /*\r
-                indMsg, err := e2sm.GetIndicationMessage(indicationMsg.IndMessage)\r
-                if err != nil {\r
-                        xapp.Logger.Error("Failed to decode RIC Indication Message: %v", err)\r
-                        return\r
-                }\r
-        */\r
-        //log.Printf("-----------RIC Indication Message-----------")\r
-        //log.Printf("indicationMsg.IndMessage= %x",indicationMsg.IndMessage)\r
-        cptr2 := unsafe.Pointer(&indicationMsg.IndMessage[0])\r
-        indicationmessage := C.e2sm_decode_ric_indication_message(cptr2, C.size_t(len(indicationMsg.IndMessage)))\r
-        if  indicationmessage == nil {\r
-                return errors.New("e2sm wrapper is unable to get IndicationMessage due to wrong or invalid input")\r
-        }\r
-        defer C.e2sm_free_ric_indication_message(indicationmessage)\r
-        IndMsgType := int32(indicationmessage.indicationMessage_formats.present)\r
-        if IndMsgType==1  {//parsing cell metrics\r
-                fmt.Printf(" parsing for cell metrics\n" )\r
-                indMsgFormat1_C := *(**C.E2SM_KPM_IndicationMessage_Format1_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
-                no_of_cell:=int32(indMsgFormat1_C .measData.list.count)\r
-                fmt.Printf(" \n No of cell = %d\n",no_of_cell )\r
-                //fmt.Println(no_of_cell)\r
-                for n := int32(0); n < no_of_cell; n++ {\r
-                                var sizeof_MeasurementDataItem_t  *C.MeasurementDataItem_t\r
-                                MeasurementDataItem_C:=*(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat1_C.measData.list.array)) + (uintptr)(int(n))*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
-                                no_of_cell_metrics:=int32(MeasurementDataItem_C.measRecord.list.count)\r
-                                //var CellM CellMetricsEntry\r
-                                //v := reflect.ValueOf(CellM)\r
-                                fmt.Printf(" \n No of cell metrics = %d\n",no_of_cell_metrics)\r
-                                //values := make(map[string]interface{}, v.NumField())\r
-                               values := make(map[string]interface{})\r
-                               CellKpi:=ranCellKpi[params.Meid.RanName]\r
-                               var tmpCellKpi []string\r
-                               for _, ele:=range CellKpi{\r
-                               if ele!=""{\r
-                                               tmpCellKpi =append(tmpCellKpi,ele)\r
-                                       }\r
-                               }\r
-\r
-                                //assert no_of_cell_metrics == v.NumField()   they both should be equal.\r
-                               if (int(no_of_cell_metrics) != len(tmpCellKpi)){\r
-                        log.Printf("no_of_cell_metrics !=  len(tmpCellKpi)")\r
-                       return errors.New("no_of_cell_metrics  !=len(tmpCellKpi)")\r
-                               }\r
-                                for i := int32(0); i < no_of_cell_metrics; i++ {\r
-                                        //fmt.Println(i)\r
-                                        //if v.Field(int(i)).CanInterface() {\r
-                                                        var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
-                                                        MeasurementRecordItem_C:=*(**C. MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(int(i))*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
-                                                        type_var:=int(MeasurementRecordItem_C.present)\r
-                                                        if type_var==1{\r
-                                                                var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                                                //values[v.Type().Field(int(i)).Name]=int32(*cast_integer)\r
-                                                               values[tmpCellKpi[int(i)]]=int32(*cast_integer)\r
-                                                                }else if type_var==2{\r
-                                var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                //values[v.Type().Field(int(i)).Name]=float64(*cast_float)\r
-                               values[tmpCellKpi[int(i)]]=float64(*cast_float)\r
-                                                        }else{\r
-                                                        fmt.Printf("Wrong Data Type")\r
-                                                }\r
-\r
-                                               // }else {\r
-                                                //fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
-                                                //}\r
-                                        }//end of inner for loop\r
-\r
-\r
-                                fmt.Println(values)\r
-                                fmt.Printf("Parsing Cell Metric Done")\r
-                                c.writeCellMetrics_db(&values)//push cellmetrics map entry to database.\r
-                        }//end of outer for loop\r
-                        //end of if IndMsgType==1 , parsing cell metrics done\r
-\r
-        }  else if IndMsgType==2  { //parsing ue metrics\r
-\r
-                fmt.Printf(" parsing for UE metrics" )\r
-                indMsgFormat2_C := *(**C.E2SM_KPM_IndicationMessage_Format2_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
-                //no_of_ue_metrics:=int32(indMsgFormat2_C .measData.list.count)\r
-                //fmt.Printf(" \n No of ue metrics = %d\n",no_of_ue_metrics)\r
-\r
-                var sizeof_MeasurementDataItem_t  *C.MeasurementDataItem_t\r
-                MeasurementDataItem_C:=*(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(0)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
-               UeKpi:=ranUeKpi[params.Meid.RanName]\r
-                                var tmpUeKpi []string\r
-                                for _, ele:=range UeKpi{\r
-                                if ele!=""{\r
-                                                tmpUeKpi =append(tmpUeKpi,ele)\r
-                                        }\r
-                                }\r
-\r
-                \r
-               no_of_ue:=int32(MeasurementDataItem_C.measRecord.list.count)/int32(len(tmpUeKpi))\r
-                no_of_ue_metrics:=int32(len(tmpUeKpi))\r
-               fmt.Printf(" \n No of ue= %d\n",no_of_ue)\r
-\r
-                for n := int32(0); n < no_of_ue; n++ {\r
-                                //var UeM UeMetricsEntry\r
-                                //v := reflect.ValueOf(UeM)\r
-                                //values := make(map[string]interface{}, v.NumField())\r
-                               values := make(map[string]interface{})\r
-                                //assert no_of_ue_metrics == v.NumField()   they both should be equal.\r
-                               //if (int(no_of_ue_metrics) != v.NumField()){\r
-                        //log.Printf("no_of_ue_metrics != v.NumField()")\r
-                        //return errors.New("no_of_ue_metrics != v.NumField()")\r
-                               //}\r
-                                for i := int32(0); i < no_of_ue_metrics; i++ {\r
-                                //fmt.Println(i)\r
-                                //if v.Field(int(i)).CanInterface() {\r
+       if indicationMsg == nil || indicationMsg.IndHeader == nil || len(indicationMsg.IndHeader) == 0 ||\r
+               indicationMsg.IndMessage == nil || len(indicationMsg.IndMessage) == 0 {\r
+               return errors.New("Unable to get IndicationHeader or IndicationMessage due to invalid size")\r
+       }\r
 \r
-                                        //var sizeof_MeasurementDataItem_t  *C.MeasurementDataItem_t\r
-                                        //MeasurementDataItem_C:=*(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(i)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
+       cptr1 := unsafe.Pointer(&indicationMsg.IndHeader[0])\r
+       decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(len(indicationMsg.IndHeader)))\r
+       //decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(len(str)))\r
+       //decodedHdr := C.e2sm_decode_ric_indication_header(cptr1, C.size_t(buf.Len()))\r
+       if decodedHdr == nil {\r
+               return errors.New("e2sm wrapper is unable to get IndicationHeader due to wrong or invalid input")\r
+       }\r
+       defer C.e2sm_free_ric_indication_header(decodedHdr)\r
+       IndHdrType := int32(decodedHdr.indicationHeader_formats.present)\r
+       if IndHdrType == 0 {\r
+               log.Printf("No Indication Header present")\r
+       }\r
+       if IndHdrType == 1 {\r
+               log.Printf("Indication Header format = %d", IndHdrType)\r
+               /*\r
+                  indHdrFormat1_C := *(**C.E2SM_KPM_IndicationHeader_Format1_t)(unsafe.Pointer(&decodedHdr.indicationHeader_formats.choice[0]))\r
+                  //senderName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderName))\r
+                  senderName_C:=indHdrFormat1_C.senderName\r
+                  var senderName []byte\r
+                  senderName = C.GoBytes(unsafe.Pointer(senderName_C.buf), C.int(senderName_C.size))\r
+                  //log.Printf("Sender Name = %x",senderName)\r
+\r
+                  //senderType_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.senderType))\r
+                  senderType_C :=indHdrFormat1_C.senderType\r
+                  //senderType []byte\r
+                  senderType := C.GoBytes(unsafe.Pointer(senderType_C.buf), C.int(senderType_C.size))\r
+                  //log.Printf("Sender Type = %x",senderType)\r
+\r
+                  //vendorName_C := (*C.PrintableString_t)(unsafe.Pointer(indHdrFormat1_C.vendorName))\r
+                  vendorName_C :=indHdrFormat1_C.vendorName\r
+                  //vendorName  []byte\r
+                  vendorName := C.GoBytes(unsafe.Pointer(vendorName_C.buf), C.int(vendorName_C.size))\r
+                  //log.Printf("Vendor Name = %x",vendorName)\r
+               */\r
 \r
-                                       var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
-                                        MeasurementRecordItem_C:=*(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(n+(i*no_of_ue))*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
-                                        //var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
-                                        //MeasurementRecordItem_C:=*(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(n)*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
+       }\r
 \r
-                                        type_var:=int(MeasurementRecordItem_C.present)\r
-                                if type_var==1{\r
-                                        var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                        values[tmpUeKpi[int(i)]]=int32(*cast_integer)\r
-                                }else if type_var==2{\r
-                                        var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
-                                        values[tmpUeKpi[int(i)]]=float64(*cast_float)\r
+       /*\r
+          indMsg, err := e2sm.GetIndicationMessage(indicationMsg.IndMessage)\r
+          if err != nil {\r
+                  xapp.Logger.Error("Failed to decode RIC Indication Message: %v", err)\r
+                  return\r
+          }\r
+       */\r
+       //log.Printf("-----------RIC Indication Message-----------")\r
+       //log.Printf("indicationMsg.IndMessage= %x",indicationMsg.IndMessage)\r
+       cptr2 := unsafe.Pointer(&indicationMsg.IndMessage[0])\r
+       indicationmessage := C.e2sm_decode_ric_indication_message(cptr2, C.size_t(len(indicationMsg.IndMessage)))\r
+       if indicationmessage == nil {\r
+               return errors.New("e2sm wrapper is unable to get IndicationMessage due to wrong or invalid input")\r
+       }\r
+       defer C.e2sm_free_ric_indication_message(indicationmessage)\r
+       IndMsgType := int32(indicationmessage.indicationMessage_formats.present)\r
+       if IndMsgType == 1 { //parsing cell metrics\r
+               fmt.Printf(" parsing for cell metrics\n")\r
+               indMsgFormat1_C := *(**C.E2SM_KPM_IndicationMessage_Format1_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
+               no_of_cell := int32(indMsgFormat1_C.measData.list.count)\r
+               fmt.Printf(" \n No of cell = %d\n", no_of_cell)\r
+               //fmt.Println(no_of_cell)\r
+               for n := int32(0); n < no_of_cell; n++ {\r
+                       var sizeof_MeasurementDataItem_t *C.MeasurementDataItem_t\r
+                       MeasurementDataItem_C := *(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat1_C.measData.list.array)) + (uintptr)(int(n))*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
+                       no_of_cell_metrics := int32(MeasurementDataItem_C.measRecord.list.count)\r
+                       //var CellM CellMetricsEntry\r
+                       //v := reflect.ValueOf(CellM)\r
+                       fmt.Printf(" \n No of cell metrics = %d\n", no_of_cell_metrics)\r
+                       //values := make(map[string]interface{}, v.NumField())\r
+                       values := make(map[string]interface{})\r
+                       CellKpi := ranCellKpi[params.Meid.RanName]\r
+                       var tmpCellKpi []string\r
+                       for _, ele := range CellKpi {\r
+                               if ele != "" {\r
+                                       tmpCellKpi = append(tmpCellKpi, ele)\r
+                               }\r
+                       }\r
 \r
-                                        }else{\r
-                                        fmt.Printf("Wrong Data Type")\r
-                                }\r
+                       //assert no_of_cell_metrics == v.NumField()   they both should be equal.\r
+                       if int(no_of_cell_metrics) != len(tmpCellKpi) {\r
+                               log.Printf("no_of_cell_metrics !=  len(tmpCellKpi)")\r
+                               return errors.New("no_of_cell_metrics  !=len(tmpCellKpi)")\r
+                       }\r
+                       for i := int32(0); i < no_of_cell_metrics; i++ {\r
+                               //fmt.Println(i)\r
+                               //if v.Field(int(i)).CanInterface() {\r
+                               var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
+                               MeasurementRecordItem_C := *(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(int(i))*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
+                               type_var := int(MeasurementRecordItem_C.present)\r
+                               if type_var == 1 {\r
+                                       var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                       //values[v.Type().Field(int(i)).Name]=int32(*cast_integer)\r
+                                       values[tmpCellKpi[int(i)]] = int32(*cast_integer)\r
+                               } else if type_var == 2 {\r
+                                       var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                       //values[v.Type().Field(int(i)).Name]=float64(*cast_float)\r
+                                       values[tmpCellKpi[int(i)]] = float64(*cast_float)\r
+                               } else {\r
+                                       fmt.Printf("Wrong Data Type")\r
+                               }\r
 \r
-                       // }else {\r
-                               // fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
-                               // }\r
+                               // }else {\r
+                               //fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
+                               //}\r
+                       } //end of inner for loop\r
 \r
+                       fmt.Println(values)\r
+                       fmt.Printf("Parsing Cell Metric Done")\r
+                       c.writeCellMetrics_db(&values) //push cellmetrics map entry to database.\r
+               } //end of outer for loop\r
+               //end of if IndMsgType==1 , parsing cell metrics done\r
+\r
+       } else if IndMsgType == 2 { //parsing ue metrics\r
+\r
+               fmt.Printf(" parsing for UE metrics")\r
+               indMsgFormat2_C := *(**C.E2SM_KPM_IndicationMessage_Format2_t)(unsafe.Pointer(&indicationmessage.indicationMessage_formats.choice[0]))\r
+               //no_of_ue_metrics:=int32(indMsgFormat2_C .measData.list.count)\r
+               //fmt.Printf(" \n No of ue metrics = %d\n",no_of_ue_metrics)\r
+\r
+               var sizeof_MeasurementDataItem_t *C.MeasurementDataItem_t\r
+               MeasurementDataItem_C := *(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(0)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
+               UeKpi := ranUeKpi[params.Meid.RanName]\r
+               var tmpUeKpi []string\r
+               for _, ele := range UeKpi {\r
+                       if ele != "" {\r
+                               tmpUeKpi = append(tmpUeKpi, ele)\r
+                       }\r
+               }\r
 \r
-                                        }       //end of inner for loop\r
-                        fmt.Println(values)\r
-                         fmt.Printf("Parsing UE Metric Done")\r
-                         c.writeUeMetrics_db(&values)//push UEmetrics map entry to database.\r
+               no_of_ue := int32(MeasurementDataItem_C.measRecord.list.count) / int32(len(tmpUeKpi))\r
+               no_of_ue_metrics := int32(len(tmpUeKpi))\r
+               fmt.Printf(" \n No of ue= %d\n", no_of_ue)\r
+\r
+               for n := int32(0); n < no_of_ue; n++ {\r
+                       //var UeM UeMetricsEntry\r
+                       //v := reflect.ValueOf(UeM)\r
+                       //values := make(map[string]interface{}, v.NumField())\r
+                       values := make(map[string]interface{})\r
+                       //assert no_of_ue_metrics == v.NumField()   they both should be equal.\r
+                       //if (int(no_of_ue_metrics) != v.NumField()){\r
+                       //log.Printf("no_of_ue_metrics != v.NumField()")\r
+                       //return errors.New("no_of_ue_metrics != v.NumField()")\r
+                       //}\r
+                       for i := int32(0); i < no_of_ue_metrics; i++ {\r
+                               //fmt.Println(i)\r
+                               //if v.Field(int(i)).CanInterface() {\r
+\r
+                               //var sizeof_MeasurementDataItem_t  *C.MeasurementDataItem_t\r
+                               //MeasurementDataItem_C:=*(**C.MeasurementDataItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(indMsgFormat2_C.measData.list.array)) + (uintptr)(i)*unsafe.Sizeof(sizeof_MeasurementDataItem_t)))\r
+\r
+                               var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
+                               MeasurementRecordItem_C := *(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(n+(i*no_of_ue))*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
+                               //var sizeof_MeasurementRecordItem_t *C.MeasurementRecordItem_t\r
+                               //MeasurementRecordItem_C:=*(**C.MeasurementRecordItem_t)(unsafe.Pointer(uintptr(unsafe.Pointer(MeasurementDataItem_C.measRecord.list.array)) + (uintptr)(n)*unsafe.Sizeof(sizeof_MeasurementRecordItem_t)))\r
+\r
+                               type_var := int(MeasurementRecordItem_C.present)\r
+                               if type_var == 1 {\r
+                                       var cast_integer *C.long = (*C.long)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                       values[tmpUeKpi[int(i)]] = int32(*cast_integer)\r
+                               } else if type_var == 2 {\r
+                                       var cast_float *C.double = (*C.double)(unsafe.Pointer(&MeasurementRecordItem_C.choice[0]))\r
+                                       values[tmpUeKpi[int(i)]] = float64(*cast_float)\r
+\r
+                               } else {\r
+                                       fmt.Printf("Wrong Data Type")\r
+                               }\r
 \r
-                        }// end of outer for loop\r
-        //parsing ue metrics done\r
-        }else{\r
-                fmt.Printf(" Invalid Indication message format" )\r
+                               // }else {\r
+                               // fmt.Printf("sorry you have a unexported field (lower case) value you are trying to sneak past. Can not allow it: %v\n", v.Type().Field(int(i)).Name)\r
+                               // }\r
 \r
-        }\r
+                       } //end of inner for loop\r
+                       fmt.Println(values)\r
+                       fmt.Printf("Parsing UE Metric Done")\r
+                       c.writeUeMetrics_db(&values) //push UEmetrics map entry to database.\r
 \r
+               } // end of outer for loop\r
+               //parsing ue metrics done\r
+       } else {\r
+               fmt.Printf(" Invalid Indication message format")\r
 \r
-        return nil\r
+       }\r
 \r
+       return nil\r
 \r
 }\r
 \r
@@ -900,60 +900,60 @@ func (c *Control) handleIndication(params *xapp.RMRParams) (err error) {
 // }\r
 \r
 /*\r
-func (c *Control) queryUEReports() {\r
-       log.Printf("query UE")\r
-       resp, err := http.Get("http://10.244.0.68/sba/influx/query?db=RIC-Test-static&q=select+*+from+UEReports")\r
-       if err != nil {\r
-               log.Fatalln(err)\r
-       }\r
-       body, err := ioutil.ReadAll(resp.Body)\r
-       if err != nil {\r
-               log.Fatalln(err)\r
-       }\r
-       var results ViaviMessages\r
-       er := json.Unmarshal(body, &results)\r
-       if er != nil {\r
-               panic(er)\r
+       func (c *Control) queryUEReports() {\r
+               log.Printf("query UE")\r
+               resp, err := http.Get("http://10.244.0.68/sba/influx/query?db=RIC-Test-static&q=select+*+from+UEReports")\r
+               if err != nil {\r
+                       log.Fatalln(err)\r
+               }\r
+               body, err := ioutil.ReadAll(resp.Body)\r
+               if err != nil {\r
+                       log.Fatalln(err)\r
+               }\r
+               var results ViaviMessages\r
+               er := json.Unmarshal(body, &results)\r
+               if er != nil {\r
+                       panic(er)\r
+               }\r
+               //      sb := string(body)\r
+               //    log.Printf(sb)\r
+               c.writeUeMetrics_db(results.results.series)\r
        }\r
-       //      sb := string(body)\r
-       //    log.Printf(sb)\r
-       c.writeUeMetrics_db(results.results.series)\r
-}\r
 \r
-func (c *Control) queryCellReports() {\r
-       log.Printf("query cell")\r
-       resp, err := http.Get("http://10.244.0.68/sba/influx/query?db=RIC-Test-static&q=select+*+from+CellReports")\r
-       if err != nil {\r
-               log.Fatalln(err)\r
-       }\r
-       body, err := ioutil.ReadAll(resp.Body)\r
-       if err != nil {\r
-               log.Fatalln(err)\r
-       }\r
-       var results ViaviMessages\r
-       er := json.Unmarshal(body, &results)\r
-       if er != nil {\r
-               panic(er)\r
+       func (c *Control) queryCellReports() {\r
+               log.Printf("query cell")\r
+               resp, err := http.Get("http://10.244.0.68/sba/influx/query?db=RIC-Test-static&q=select+*+from+CellReports")\r
+               if err != nil {\r
+                       log.Fatalln(err)\r
+               }\r
+               body, err := ioutil.ReadAll(resp.Body)\r
+               if err != nil {\r
+                       log.Fatalln(err)\r
+               }\r
+               var results ViaviMessages\r
+               er := json.Unmarshal(body, &results)\r
+               if er != nil {\r
+                       panic(er)\r
+               }\r
+               c.writeCellMetrics_db(results.results.series)\r
        }\r
-       c.writeCellMetrics_db(results.results.series)\r
-}\r
 */\r
 func (c *Control) writeUeMetrics_db(ueMetrics *map[string]interface{}) {\r
        writeAPI := c.client.WriteAPIBlocking("my-org", "kpimon")\r
        /*\r
-       ueMetricsJSON, err := json.Marshal(ueMetrics)\r
-       if err != nil {\r
-               xapp.Logger.Error("Marshal UE Metrics failed!")\r
-       }\r
-       \r
-       p := influxdb2.NewPointWithMeasurement("UeMetrics").\r
-               AddField("UE Metrics", ueMetricsJSON).\r
-               SetTime(time.Now())\r
+               ueMetricsJSON, err := json.Marshal(ueMetrics)\r
+               if err != nil {\r
+                       xapp.Logger.Error("Marshal UE Metrics failed!")\r
+               }\r
+\r
+               p := influxdb2.NewPointWithMeasurement("UeMetrics").\r
+                       AddField("UE Metrics", ueMetricsJSON).\r
+                       SetTime(time.Now())\r
        */\r
        p := influxdb2.NewPointWithMeasurement("UeMetrics").SetTime(time.Now())\r
        for key, value := range *ueMetrics {\r
-                       p = p.AddField(key, value)\r
-       }\r
+               p = p.AddField(key, value)\r
+       }\r
 \r
        writeAPI.WritePoint(context.Background(), p)\r
        xapp.Logger.Info("Wrote UE Metrics to InfluxDB")\r
@@ -962,146 +962,143 @@ func (c *Control) writeUeMetrics_db(ueMetrics *map[string]interface{}) {
 func (c *Control) writeCellMetrics_db(cellMetrics *map[string]interface{}) {\r
        writeAPI := c.client.WriteAPIBlocking("my-org", "kpimon")\r
        /*\r
-       cellMetricsJSON, er := json.Marshal(cellMetrics)\r
-       if er != nil {\r
-               xapp.Logger.Error("Marshal Cell Metrics failed!")\r
-       }\r
-       \r
-       p := influxdb2.NewPointWithMeasurement("cellMetrics").\r
-               AddField("Cell Metrics", cellMetricsJSON).\r
-               SetTime(time.Now())\r
+               cellMetricsJSON, er := json.Marshal(cellMetrics)\r
+               if er != nil {\r
+                       xapp.Logger.Error("Marshal Cell Metrics failed!")\r
+               }\r
+\r
+               p := influxdb2.NewPointWithMeasurement("cellMetrics").\r
+                       AddField("Cell Metrics", cellMetricsJSON).\r
+                       SetTime(time.Now())\r
        */\r
        p := influxdb2.NewPointWithMeasurement("cellMetrics").SetTime(time.Now())\r
        for key, value := range *cellMetrics {\r
-                p = p.AddField(key, value)\r
-        }\r
+               p = p.AddField(key, value)\r
+       }\r
        writeAPI.WritePoint(context.Background(), p)\r
        xapp.Logger.Info("Wrote Cell Metrics to InfluxDB")\r
 }\r
 \r
 func (c Control) xAppStartCB(d interface{}) {\r
-               xapp.Logger.Info("In callback KPI monitor xApp ...")\r
+       xapp.Logger.Info("In callback KPI monitor xApp ...")\r
 \r
-               //ranUeKpi ranCellKpi   \r
-               // Get eNodeB list\r
-               nbList := c.getnbList()\r
+       //ranUeKpi ranCellKpi\r
+       // Get eNodeB list\r
+       nbList := c.getnbList()\r
 \r
-               for _, nb := range nbList {\r
-                if nb.ConnectionStatus == 1 {\r
-                        xapp.Logger.Info("Building ranCellKp for %v", nb.InventoryName)\r
-                        link:="http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
-                       link=link+nb.InventoryName\r
-                       tmpr,err := http.Get(link)\r
+       for _, nb := range nbList {\r
+               if nb.ConnectionStatus == 1 {\r
+                       xapp.Logger.Info("Building ranCellKp for %v", nb.InventoryName)\r
+                       link := "http://service-ricplt-e2mgr-http.ricplt.svc.cluster.local:3800/v1/nodeb/"\r
+                       link = link + nb.InventoryName\r
+                       tmpr, err := http.Get(link)\r
                        if err != nil {\r
-                               log.Fatalln(err)\r
-                               panic("Unable to build ranCellKpi")\r
+                               log.Fatalln(err)\r
+                               panic("Unable to build ranCellKpi")\r
                        }\r
                        defer tmpr.Body.Close()\r
-                       var resp E2mgrResponse\r
+                       var resp E2mgrResponse\r
 \r
-                       err=json.NewDecoder(tmpr.Body).Decode(&resp)\r
-                       if err != nil {\r
-                               log.Fatalln(err)\r
+                       err = json.NewDecoder(tmpr.Body).Decode(&resp)\r
+                       if err != nil {\r
+                               log.Fatalln(err)\r
                                panic("Unable to build ranCellKpi")\r
 \r
-                       }\r
-                       counter:=0\r
-                       //RanFunctionId=2 for kpm in viavi\r
-                       for i := 0; i < len(resp.Gnb.RanFunctions); i++ {\r
-                               if resp.Gnb.RanFunctions[i].RanFunctionId  == 2 {\r
-                                       counter = i\r
-                                       break\r
-                               }\r
-                       }\r
-                       cString := C.CString(resp.Gnb.RanFunctions[counter].RanFunctionDefinition)\r
-                       defer C.free(unsafe.Pointer(cString)) // Free the allocated C string when done\r
-                       result:=C.buildRanCellUeKpi(cString)\r
-                       \r
+                       }\r
+                       counter := 0\r
+                       //RanFunctionId=2 for kpm in viavi\r
+                       for i := 0; i < len(resp.Gnb.RanFunctions); i++ {\r
+                               if resp.Gnb.RanFunctions[i].RanFunctionId == 2 {\r
+                                       counter = i\r
+                                       break\r
+                               }\r
+                       }\r
+                       cString := C.CString(resp.Gnb.RanFunctions[counter].RanFunctionDefinition)\r
+                       defer C.free(unsafe.Pointer(cString)) // Free the allocated C string when done\r
+                       result := C.buildRanCellUeKpi(cString)\r
+\r
                        ueSlice := make([]string, result.ueKpiSize)\r
-                       \r
+\r
                        for _, v := range unsafe.Slice(result.ueKpi, result.ueKpiSize) {\r
-                               ueSlice = append(ueSlice, C.GoString(v))\r
+                               ueSlice = append(ueSlice, C.GoString(v))\r
                        }\r
-                       ranUeKpi[nb.InventoryName]=ueSlice\r
+                       ranUeKpi[nb.InventoryName] = ueSlice\r
                        //fmt.Println("len of ranUeKpi= ",len(ranUeKpi))\r
-                       //fmt.Println("ranUeKpi map = ", ranUeKpi)\r
-\r
+                       //fmt.Println("ranUeKpi map = ", ranUeKpi)\r
 \r
                        cellSlice := make([]string, result.cellKpiSize)\r
 \r
-                        for _, v := range unsafe.Slice(result.cellKpi, result.cellKpiSize) {\r
-                                cellSlice = append(cellSlice, C.GoString(v))\r
-                        }\r
-                       ranCellKpi[nb.InventoryName]=cellSlice\r
+                       for _, v := range unsafe.Slice(result.cellKpi, result.cellKpiSize) {\r
+                               cellSlice = append(cellSlice, C.GoString(v))\r
+                       }\r
+                       ranCellKpi[nb.InventoryName] = cellSlice\r
                        //fmt.Println("len of ranCellKpi= ",len(ranCellKpi))\r
-                        //fmt.Println("ranCellKpi map = ", ranCellKpi)\r
+                       //fmt.Println("ranCellKpi map = ", ranCellKpi)\r
                        /*\r
-                       counter = 0\r
-                       for i := 0; i < len(resp.Gnb.NodeConfigs); i++ {\r
-                               if resp.Gnb.NodeConfigs[i].E2nodeComponentInterfaceType == "f1" {\r
-                                       counter = i\r
-                                       break\r
-                               }\r
-                       }\r
-                       \r
-       \r
-                       tm := resp.Gnb.NodeConfigs[counter].E2nodeComponentRequestPart\r
-                               base64Text := make([]byte, base64.StdEncoding.DecodedLen(len(tm)))\r
-                       nl, _ := base64.StdEncoding.Decode(base64Text, []byte(tm))\r
-                       message := string(base64Text[:nl])\r
+                                                       counter = 0\r
+                                                       for i := 0; i < len(resp.Gnb.NodeConfigs); i++ {\r
+                                                               if resp.Gnb.NodeConfigs[i].E2nodeComponentInterfaceType == "f1" {\r
+                                                                       counter = i\r
+                                                                       break\r
+                                                               }\r
+                                                       }\r
+\r
+\r
+                                                       tm := resp.Gnb.NodeConfigs[counter].E2nodeComponentRequestPart\r
+                                                       base64Text := make([]byte, base64.StdEncoding.DecodedLen(len(tm)))\r
+                                                       nl, _ := base64.StdEncoding.Decode(base64Text, []byte(tm))\r
+                                                       message := string(base64Text[:nl])\r
                        */\r
                        /*\r
-                       cString2 := C.CString(message)\r
-                       fmt.Println("Ponga = ",tm)\r
-                       fmt.Println("Ponga = ",message)\r
-                       defer C.free(unsafe.Pointer(cString2)) // Free the allocated C string when done\r
-                       result2:=C.decodeF1apGetCellIds(cString2)\r
-                       cellList:=make([]string, result2.size)\r
-                       for _, v := range unsafe.Slice(result2.cellids, result2.size) {\r
-                                cellList = append(cellList, C.GoString(v))\r
-                        }\r
-                       plmnList:=make([]string, result2.size)\r
-                        for _, v := range unsafe.Slice(result2.plmn, result2.size) {\r
-                                plmnList = append(plmnList, C.GoString(v))\r
-                        }\r
+                                                       cString2 := C.CString(message)\r
+                                                       fmt.Println("Ponga = ",tm)\r
+                                                       fmt.Println("Ponga = ",message)\r
+                                                       defer C.free(unsafe.Pointer(cString2)) // Free the allocated C string when done\r
+                                                       result2:=C.decodeF1apGetCellIds(cString2)\r
+                                                       cellList:=make([]string, result2.size)\r
+                                                       for _, v := range unsafe.Slice(result2.cellids, result2.size) {\r
+                                                               cellList = append(cellList, C.GoString(v))\r
+                                                       }\r
+                                                       plmnList:=make([]string, result2.size)\r
+                                                       for _, v := range unsafe.Slice(result2.plmn, result2.size) {\r
+                                                               plmnList = append(plmnList, C.GoString(v))\r
+                                                       }\r
 \r
                        */\r
                        /*\r
-                       var f1ap *F1ap\r
-                       fmt.Println("Ponga = ",tm)\r
-                       cellList,plmnList:=f1ap.F1apGetCellIds(message)\r
-                       Glob_Ran_cell[nb.InventoryName]=cellList\r
-                       for i := 0; i < len(cellList); i++ {\r
-                               Glob_cell_Plmn[cellList[i]]=plmnList[i]\r
-                       }\r
+                               var f1ap *F1ap\r
+                               fmt.Println("Ponga = ",tm)\r
+                               cellList,plmnList:=f1ap.F1apGetCellIds(message)\r
+                               Glob_Ran_cell[nb.InventoryName]=cellList\r
+                               for i := 0; i < len(cellList); i++ {\r
+                                       Glob_cell_Plmn[cellList[i]]=plmnList[i]\r
+                               }\r
                        */\r
-                        response, err4 := http.Get("http://localhost:8090/getdata?gnbid="+nb.InventoryName)\r
-   if err4 != nil {\r
-       fmt.Println("Error:", err4)\r
-       panic(err4)\r
-   }\r
-   defer response.Body.Close()\r
-   \r
-   var response2 APIResponse\r
-   if err5 := json.NewDecoder(response.Body).Decode(&response2); err5 != nil {\r
-       fmt.Println("Error decoding response:", err5)\r
-        panic(err5)\r
-   }\r
-   \r
-   fmt.Printf("f1apSever Response: %+v\n", response2)\r
-   \r
-                       Glob_Ran_cell[nb.InventoryName]=response2.Cellids\r
-                       for i := 0; i < len(response2.Cellids); i++ {\r
-                                Glob_cell_Plmn[response2.Cellids[i]]=response2.PlmnIds[i]\r
-                        }\r
+                       response, err4 := http.Get("http://localhost:8090/getdata?gnbid=" + nb.InventoryName)\r
+                       if err4 != nil {\r
+                               fmt.Println("Error:", err4)\r
+                               panic(err4)\r
+                       }\r
+                       defer response.Body.Close()\r
 \r
+                       var response2 APIResponse\r
+                       if err5 := json.NewDecoder(response.Body).Decode(&response2); err5 != nil {\r
+                               fmt.Println("Error decoding response:", err5)\r
+                               panic(err5)\r
+                       }\r
 \r
-                       //C.freeMemorydRanCellUeKpi(result)\r
+                       fmt.Printf("f1apSever Response: %+v\n", response2)\r
 \r
+                       Glob_Ran_cell[nb.InventoryName] = response2.Cellids\r
+                       for i := 0; i < len(response2.Cellids); i++ {\r
+                               Glob_cell_Plmn[response2.Cellids[i]] = response2.PlmnIds[i]\r
+                       }\r
 \r
-                }\r
+                       //C.freeMemorydRanCellUeKpi(result)\r
 \r
-        }\r
+               }\r
+\r
+       }\r
 \r
        for {\r
                time.Sleep(5 * time.Second)\r
@@ -1121,15 +1118,14 @@ func (c Control) xAppStartCB(d interface{}) {
 \r
        }\r
 \r
-                       fmt.Println("len of ranUeKpi= ",len(ranUeKpi))\r
-                        fmt.Println("ranUeKpi map = ", ranUeKpi)\r
-\r
-                         fmt.Println("len of ranCellKpi= ",len(ranCellKpi))\r
-                        fmt.Println("ranCellKpi map = ", ranCellKpi)\r
+       fmt.Println("len of ranUeKpi= ", len(ranUeKpi))\r
+       fmt.Println("ranUeKpi map = ", ranUeKpi)\r
 \r
-                        fmt.Println("len of Glob_cell_Plmn= ",len(Glob_cell_Plmn))\r
-                        fmt.Println("Glob_cell_Plmn map = ", Glob_cell_Plmn)\r
+       fmt.Println("len of ranCellKpi= ", len(ranCellKpi))\r
+       fmt.Println("ranCellKpi map = ", ranCellKpi)\r
 \r
+       fmt.Println("len of Glob_cell_Plmn= ", len(Glob_cell_Plmn))\r
+       fmt.Println("Glob_cell_Plmn map = ", Glob_cell_Plmn)\r
 \r
        go c.controlLoop()\r
        //go c.queryUEReports()\r