[VOL-2452] Using the latest omci-sim to enable MIB templating and
correctly report port status

Change-Id: I291c0fe01416c1541ef0f55779a77412a2271ea9
diff --git a/vendor/github.com/opencord/omci-sim/omci_handlers.go b/vendor/github.com/opencord/omci-sim/omci_handlers.go
index de62498..5ba28f9 100644
--- a/vendor/github.com/opencord/omci-sim/omci_handlers.go
+++ b/vendor/github.com/opencord/omci-sim/omci_handlers.go
@@ -475,9 +475,10 @@
 func getAllAlarms(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
 	var pkt []byte
 
+	// Report number of commands as 1, basically there is always one alarm to get, the ONU/PPTP locked, link down or up
 	pkt = []byte{
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
-		0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -513,13 +514,31 @@
 func getAllAlarmsNext(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
 	var pkt []byte
 
-	pkt = []byte{
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+	OnuOmciStateMapLock.Lock()
+	if OnuOmciState, ok := OnuOmciStateMap[key]; ok {
+		// if we are locked then admin down was sent and PPTP 257 is in alarm/locked state, this ensures get alarm
+		// shows that
+		if OnuOmciState.state == LOCKED {
+			// alarm set, alarm spot 0, LAN LOS
+			pkt = []byte{
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
+				0x00, 0x0b, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		} else {
+			// alarm clear
+			pkt = []byte{
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
+				0x00, 0x0b, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		}
+	}
+	OnuOmciStateMapLock.Unlock()
 
 	log.WithFields(log.Fields{
 		"IntfId": key.IntfId,