[VOL-5492] populate missing feilds in pon and nni Periodic stats

Change-Id: Iec58373e6e65784708fc0397f6912aab64e102b4
Signed-off-by: Akash Reddy Kankanala <akash.kankanala@radisys.com>
diff --git a/VERSION b/VERSION
index b9befeb..30e4e0d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.5.22
+4.5.23
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 2664391..a72c011 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -177,12 +177,19 @@
 var pmNames = []string{
 	"rx_bytes",
 	"rx_packets",
+	"rx_ucast_packets",
 	"rx_mcast_packets",
 	"rx_bcast_packets",
+	"rx_error_packets",
+	"rx_crc_errors",
+	"rx_packets_dropped",
 	"tx_bytes",
 	"tx_packets",
+	"tx_ucast_packets",
 	"tx_mcast_packets",
 	"tx_bcast_packets",
+	"tx_error_packets",
+	"tx_dropped_total",
 }
 
 // NewOnuDevice creates a new Onu Device
diff --git a/internal/pkg/core/statsmanager.go b/internal/pkg/core/statsmanager.go
index 3e1db2e..447704b 100644
--- a/internal/pkg/core/statsmanager.go
+++ b/internal/pkg/core/statsmanager.go
@@ -116,20 +116,22 @@
 	DeviceID string
 	Label    string
 
-	RxBytes        uint64
-	RxPackets      uint64
-	RxUcastPackets uint64
-	RxMcastPackets uint64
-	RxBcastPackets uint64
-	RxErrorPackets uint64
-	TxBytes        uint64
-	TxPackets      uint64
-	TxUcastPackets uint64
-	TxMcastPackets uint64
-	TxBcastPackets uint64
-	TxErrorPackets uint64
-	RxCrcErrors    uint64
-	BipErrors      uint64
+	RxBytes          uint64
+	RxPackets        uint64
+	RxUcastPackets   uint64
+	RxMcastPackets   uint64
+	RxBcastPackets   uint64
+	RxErrorPackets   uint64
+	RxPacketsDropped uint64
+	TxBytes          uint64
+	TxPackets        uint64
+	TxUcastPackets   uint64
+	TxMcastPackets   uint64
+	TxBcastPackets   uint64
+	TxErrorPackets   uint64
+	TxDroppedTotal   uint64
+	RxCrcErrors      uint64
+	BipErrors        uint64
 	/*
 	   This is a highly reduced version taken from the adtran pon_port.
 	   TODO: Extend for use in the openolt adapter set.
@@ -205,20 +207,22 @@
 type NniPort struct {
 	Name string
 
-	RxBytes        uint64
-	RxPackets      uint64
-	RxUcastPackets uint64
-	RxMcastPackets uint64
-	RxBcastPackets uint64
-	RxErrorPackets uint64
-	TxBytes        uint64
-	TxPackets      uint64
-	TxUcastPackets uint64
-	TxMcastPackets uint64
-	TxBcastPackets uint64
-	TxErrorPackets uint64
-	RxCrcErrors    uint64
-	BipErrors      uint64
+	RxBytes          uint64
+	RxPackets        uint64
+	RxUcastPackets   uint64
+	RxMcastPackets   uint64
+	RxBcastPackets   uint64
+	RxErrorPackets   uint64
+	RxPacketsDropped uint64
+	TxBytes          uint64
+	TxPackets        uint64
+	TxUcastPackets   uint64
+	TxMcastPackets   uint64
+	TxBcastPackets   uint64
+	TxErrorPackets   uint64
+	TxDroppedTotal   uint64
+	RxCrcErrors      uint64
+	BipErrors        uint64
 	/*
 	   Northbound network port, often Ethernet-based
 
@@ -403,14 +407,24 @@
 				nnival["RxMcastPackets"] = float32(cm.RxMcastPackets)
 			case "rx_bcast_packets":
 				nnival["RxBcastPackets"] = float32(cm.RxBcastPackets)
+			case "rx_error_packets":
+				nnival["RxErrorPackets"] = float32(cm.RxErrorPackets)
+			case "rx_crc_errors":
+				nnival["RxCrcErrors"] = float32(cm.RxCrcErrors)
+			case "rx_packets_dropped":
+				nnival["RxPacketsDropped"] = float32(cm.RxPacketsDropped)
 			case "tx_bytes":
 				nnival["TxBytes"] = float32(cm.TxBytes)
 			case "tx_packets":
 				nnival["TxPackets"] = float32(cm.TxPackets)
+			case "tx_ucast_packets":
+				nnival["TxUcastPackets"] = float32(cm.TxUcastPackets)
 			case "tx_mcast_packets":
 				nnival["TxMcastPackets"] = float32(cm.TxMcastPackets)
 			case "tx_bcast_packets":
 				nnival["TxBcastPackets"] = float32(cm.TxBcastPackets)
+			case "tx_dropped_total":
+				nnival["TxDroppedTotal"] = float32(cm.TxDroppedTotal)
 			}
 		}
 	}
@@ -445,6 +459,10 @@
 				ponval["RxMcastPackets"] = float32(cm.RxMcastPackets)
 			case "rx_bcast_packets":
 				ponval["RxBcastPackets"] = float32(cm.RxBcastPackets)
+			case "rx_error_packets":
+				ponval["RxErrorPackets"] = float32(cm.RxErrorPackets)
+			case "rx_packets_dropped":
+				ponval["RxPacketsDropped"] = float32(cm.RxPacketsDropped)
 			case "tx_bytes":
 				ponval["TxBytes"] = float32(cm.TxBytes)
 			case "tx_packets":
@@ -453,10 +471,13 @@
 				ponval["TxMcastPackets"] = float32(cm.TxMcastPackets)
 			case "tx_bcast_packets":
 				ponval["TxBcastPackets"] = float32(cm.TxBcastPackets)
+			case "tx_error_packets":
+				ponval["TxErrorPackets"] = float32(cm.TxErrorPackets)
+			case "tx_dropped_total":
+				ponval["TxDroppedTotal"] = float32(cm.TxDroppedTotal)
 			}
 		}
 	}
-
 	return ponval
 }
 
@@ -664,11 +685,16 @@
 		portNNIStat.RxUcastPackets = PortStats.RxUcastPackets
 		portNNIStat.RxMcastPackets = PortStats.RxMcastPackets
 		portNNIStat.RxBcastPackets = PortStats.RxBcastPackets
+		portNNIStat.RxCrcErrors = PortStats.RxCrcErrors
+		portNNIStat.RxErrorPackets = PortStats.RxErrorPackets
+		portNNIStat.RxPacketsDropped = PortStats.RxPacketsDropped
 		portNNIStat.TxBytes = PortStats.TxBytes
 		portNNIStat.TxPackets = PortStats.TxPackets
 		portNNIStat.TxUcastPackets = PortStats.TxUcastPackets
 		portNNIStat.TxMcastPackets = PortStats.TxMcastPackets
 		portNNIStat.TxBcastPackets = PortStats.TxBcastPackets
+		portNNIStat.TxErrorPackets = PortStats.TxErrorPackets
+		portNNIStat.TxDroppedTotal = PortStats.TxDroppedTotal
 		mutex.Lock()
 		StatMgr.NorthBoundPort[0] = &portNNIStat
 		mutex.Unlock()
@@ -685,11 +711,15 @@
 			portPonStat.RxUcastPackets = PortStats.RxUcastPackets
 			portPonStat.RxMcastPackets = PortStats.RxMcastPackets
 			portPonStat.RxBcastPackets = PortStats.RxBcastPackets
+			portPonStat.RxErrorPackets = PortStats.RxErrorPackets
+			portPonStat.RxPacketsDropped = PortStats.RxPacketsDropped
 			portPonStat.TxBytes = PortStats.TxBytes
 			portPonStat.TxPackets = PortStats.TxPackets
 			portPonStat.TxUcastPackets = PortStats.TxUcastPackets
 			portPonStat.TxMcastPackets = PortStats.TxMcastPackets
 			portPonStat.TxBcastPackets = PortStats.TxBcastPackets
+			portPonStat.TxErrorPackets = PortStats.TxErrorPackets
+			portPonStat.TxDroppedTotal = PortStats.TxDroppedTotal
 			mutex.Lock()
 			StatMgr.SouthBoundPort[i] = &portPonStat
 			mutex.Unlock()