[VOL-5291] On demand statistics for ONU and OLT

Change-Id: I4850bb0f0d2235122cb0c1bcf835b3672bb34436
Signed-off-by: Akash Reddy Kankanala <akash.kankanala@radisys.com>
diff --git a/protos/voltha_protos/extensions.proto b/protos/voltha_protos/extensions.proto
index d372f93..9ac58cf 100755
--- a/protos/voltha_protos/extensions.proto
+++ b/protos/voltha_protos/extensions.proto
@@ -21,6 +21,7 @@
 
 import "voltha_protos/ext_config.proto";
 import "google/protobuf/empty.proto";
+import "voltha_protos/common.proto";
 
 message ValueSet {
     string id = 1;
@@ -162,6 +163,34 @@
      uint32 packets1024To1518octets = 14;
 }
 
+// GetOnuAllocGemHistoryRequest collects GEM and AllocId stats from ONU 
+message GetOnuAllocGemHistoryRequest {
+    google.protobuf.Empty empty = 1;
+}
+
+message OnuGemPortHistoryData {
+    uint32 gemId = 1;
+    uint32 transmittedGEMFrames= 2;
+    uint32 receivedGEMFrames = 3;
+    uint32 receivedPayloadBytes= 4;
+    uint32 transmittedPayloadBytes = 5;
+    uint32 encryptionKeyErrors = 6;
+}
+
+message OnuAllocHistoryData {
+    uint32 allocId = 1;
+    uint32 rxBytes = 2;
+}
+
+message OnuAllocGemHistoryData {
+    OnuAllocHistoryData onuAllocIdInfo = 1;
+    repeated OnuGemPortHistoryData gemPortInfo = 2;
+}
+
+message GetOnuAllocGemHistoryResponse {
+    repeated OnuAllocGemHistoryData onuAllocGemHistoryData = 1;
+}
+
 message GetOnuFecHistory {
     google.protobuf.Empty empty = 1;
 }
@@ -202,6 +231,58 @@
     string onu_sn = 2;
 }
 
+message GetPonStatsRequest {
+    oneof portInfo {
+        string portLabel = 1;
+        fixed32 portId = 2;
+    }
+}
+
+message GetPonStatsResponse {
+    uint32 ponPort = 1;
+    common.PortStatistics portStatistics = 2;
+}
+
+message GetNNIStatsRequest {
+    oneof portInfo {
+        string portLabel = 1;
+        fixed32 portId = 2;
+    }
+}
+
+message GetNNIStatsResponse {
+    uint32 nniPort = 1;
+    common.PortStatistics portStatistics = 2;
+}
+
+// GetOnuStatsFromOltRequest collects GEM and AllocId stats from the OLT for a particular ONU.
+message GetOnuStatsFromOltRequest {
+    fixed32 intfId = 1;
+    fixed32 onuId = 2;
+}
+
+message OnuGemPortInfoFromOlt {
+    uint32 gemId = 1;
+    uint64 rxPackets = 2;
+    uint64 rxBytes = 3;
+    uint64 txPackets = 4;
+    uint64 txBytes = 5;
+}
+
+message OnuAllocIdInfoFromOlt {
+    uint32 allocId = 1;
+    uint64 rxBytes = 2;
+}
+
+message OnuAllocGemStatsFromOltResponse {
+    OnuAllocIdInfoFromOlt allocIdInfo = 1;
+    repeated OnuGemPortInfoFromOlt gemPortInfo = 2;
+}
+
+message GetOnuStatsFromOltResponse {
+    repeated OnuAllocGemStatsFromOltResponse allocGemStatsInfo = 1;
+}
+
 message GetOnuCountersResponse {
     oneof is_intf_id {
         fixed32 intf_id = 1;
@@ -464,6 +545,10 @@
         GetOltRxPowerRequest oltRxPower = 11;
         GetOnuOmciActiveAlarmsRequest onuActiveAlarms  = 12;
         GetOffloadedAppsStatisticsRequest offloadedAppsStats = 13;
+        GetOnuAllocGemHistoryRequest onuAllocGemStats = 14;
+        GetOnuStatsFromOltRequest onuStatsFromOlt = 15;
+        GetPonStatsRequest oltPonStats = 16;
+        GetNNIStatsRequest oltNniStats = 17;
     }
 }
 
@@ -501,6 +586,10 @@
         GetOltRxPowerResponse oltRxPower = 13;
         GetOnuOmciActiveAlarmsResponse onuActiveAlarms = 14;
         GetOffloadedAppsStatisticsResponse offloadedAppsStats = 15;
+        GetOnuAllocGemHistoryResponse onuAllocGemStatsResponse = 16;
+        GetOnuStatsFromOltResponse onuStatsFromOltResponse = 17;
+        GetPonStatsResponse oltPonStatsResponse = 18;
+        GetNNIStatsResponse oltNniStatsResponse = 19;
     }
 }