SEBA-471 : Include ONU Key in BBSIM logs for OMCI lib, SEBA-472 : Reset Subsequent MibUpload Count in MibReset

Change-Id: Icb53d3baa3ced22b2c11067a65e6d769ad4ea939
diff --git a/omci_handlers.go b/omci_handlers.go
index 3354f2a..f4c955e 100644
--- a/omci_handlers.go
+++ b/omci_handlers.go
@@ -38,7 +38,11 @@
 func mibReset(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
 	var pkt []byte
 
-	log.Printf("Omci MibReset")
+	log.Printf("%v - Omci MibReset",key)
+	if state, ok := OnuOmciStateMap[key]; ok{
+		log.Printf("%v - Reseting OnuOmciState",key)       
+		state.ResetOnuOmciState()
+	}
 
 	pkt = []byte{
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
@@ -53,7 +57,7 @@
 func mibUpload(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
 	var pkt []byte
 
-	log.Printf("Omci MibUpload")
+	log.Printf("%v - Omci MibUpload",key)
 
 	pkt = []byte{
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
@@ -73,7 +77,7 @@
 
 	state := OnuOmciStateMap[key]
 
-	log.Printf("Omci MibUploadNext %d", state.mibUploadCtr)
+	log.Printf("%v - Omci MibUploadNext %d", key, state.mibUploadCtr)
 
 	switch state.mibUploadCtr {
 	case 0:
@@ -200,7 +204,8 @@
 		pkt[11] = state.uniGInstance // UNI-G ME Instance
 		state.uniGInstance++
 	default:
-		errstr := fmt.Sprintf("Invalid MibUpload request: %d", state.mibUploadCtr)
+		state.extraMibUploadCtr++
+		errstr := fmt.Sprintf("%v - Invalid MibUpload request: %d, extras: %d", key, state.mibUploadCtr, state.extraMibUploadCtr)
 		return nil, errors.New(errstr)
 	}
 
@@ -219,7 +224,7 @@
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 
-	log.Printf("Omci Set")
+	log.Printf("%v - Omci Set",key)
 
 	return pkt, nil
 }
@@ -229,11 +234,11 @@
 
 	if class == GEMPortNetworkCTP {
 		if onuOmciState, ok := OnuOmciStateMap[key]; !ok {
-			log.Printf("ONU Key Error - IntfId: %d, OnuId:", key.IntfId, key.OnuId)
+			log.Printf("%v - ONU Key Error",key)
 			return nil, errors.New("ONU Key Error")
 		} else {
 			onuOmciState.gemPortId = binary.BigEndian.Uint16(content[:2])
-			log.Printf("ONU Key {intfid:%d, onuid:%d} Gem Port Id %d", key.IntfId, key.OnuId, onuOmciState.gemPortId)
+			log.Printf("%v - Gem Port Id %d", key, onuOmciState.gemPortId)
 			// FIXME
 			OnuOmciStateMap[key].state = DONE
 		}
@@ -247,7 +252,7 @@
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 
-	log.Printf("Omci Create")
+	log.Printf("%v - Omci Create",key)
 
 	return pkt, nil
 }
@@ -263,7 +268,7 @@
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 
-	log.Printf("Omci Get")
+	log.Printf("%v - Omci Get",key)
 
 	return pkt, nil
 }
@@ -279,7 +284,7 @@
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 
-	log.Printf("Omci GetAllAlarms")
+	log.Printf("%v - Omci GetAllAlarms",key)
 
 	return pkt, nil
 }