Merge "[SEBA-342] Publishing logs to kafka"
diff --git a/core/grpc_service.go b/core/grpc_service.go
index b244818..75d8845 100644
--- a/core/grpc_service.go
+++ b/core/grpc_service.go
@@ -51,12 +51,63 @@
 }
 
 func (s *Server) GetDeviceInfo(c context.Context, empty *openolt.Empty) (*openolt.DeviceInfo, error) {
-	logger.Info("OLT receives GetDeviceInfo()\n")
-	devinfo := new(openolt.DeviceInfo)
-	devinfo.Vendor = "CORD"
-	devinfo.OnuIdStart = 0
-	devinfo.OnuIdEnd = 3
-	devinfo.PonPorts = 4
+    logger.Info("OLT receives GetDeviceInfo()\n")
+    devinfo := new(openolt.DeviceInfo)
+    devinfo.Vendor = "EdgeCore"
+    devinfo.Model = "asfvolt16"
+    devinfo.HardwareVersion = ""
+    devinfo.FirmwareVersion = ""
+    devinfo.Technology = "xgspon"
+    devinfo.PonPorts = 1
+    devinfo.OnuIdStart = 1
+    devinfo.OnuIdEnd = 255
+    devinfo.AllocIdStart = 1024
+    devinfo.AllocIdEnd = 16383
+    devinfo.GemportIdStart = 1024
+    devinfo.GemportIdEnd = 65535
+    devinfo.FlowIdStart = 1
+    devinfo.FlowIdEnd = 16383
+
+     /*
+     for intf_id := 0; intf_id < 16; intf_id++ {
+        r := new(openolt.DeviceInfo_DeviceResourceRanges)
+
+        r.IntfIds = append(r.IntfIds, uint32(intf_id))
+
+        r.Technology = "xgspon"
+
+        p := new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ONU_ID
+        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_DEDICATED_PER_INTF
+        p.Start = 1
+        p.End = 255
+        r.Pools = append(r.Pools, p)
+
+        p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ALLOC_ID
+        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_SAME_TECH
+        p.Start = 1024
+        p.End = 16383
+        r.Pools = append(r.Pools, p)
+
+        p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_GEMPORT_ID
+        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
+        p.Start = 1024
+        p.End = 65535
+        r.Pools = append(r.Pools, p)
+
+        p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_FLOW_ID
+        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
+        p.Start = 1
+        p.End = 16383
+        r.Pools = append(r.Pools, p)
+
+        devinfo.Ranges = append(devinfo.Ranges, r)
+    }
+    */
+
 	return devinfo, nil
 }
 
diff --git a/openolt.proto b/openolt.proto
index ed69539..60bab72 100644
--- a/openolt.proto
+++ b/openolt.proto
@@ -244,6 +244,11 @@
     string model = 2;
     string hardware_version = 3;
     string firmware_version = 4;
+
+    // Total number of pon intf ports on the device
+    fixed32 pon_ports = 12;
+
+    // If using global per-device technology profile. To be deprecated
     string technology = 5;
     fixed32 onu_id_start = 6;
     fixed32 onu_id_end = 7;
@@ -251,7 +256,40 @@
     fixed32 alloc_id_end = 9;
     fixed32 gemport_id_start = 10;
     fixed32 gemport_id_end = 11;
-    fixed32 pon_ports = 12;
+    fixed32 flow_id_start = 13;
+    fixed32 flow_id_end = 14;
+
+    message DeviceResourceRanges {
+
+        // List of 0 or more intf_ids that use the same technology and pools.
+        // If 0 intf_ids supplied, it implies ALL interfaces
+        repeated fixed32 intf_ids = 1;
+
+        // Technology profile for this pool
+        string technology = 2;
+
+        message Pool {
+            enum PoolType {
+                ONU_ID = 0;
+                ALLOC_ID = 1;
+                GEMPORT_ID = 2;
+                FLOW_ID = 3;
+            }
+
+            enum SharingType {
+                DEDICATED_PER_INTF = 0;
+                SHARED_BY_ALL_INTF_ALL_TECH = 1; // Shared across all interfaces in all technologiesi in all ranges
+                SHARED_BY_ALL_INTF_SAME_TECH = 2; // Shared across all interfaces of the same technology used in this range
+            }
+
+            PoolType type = 1;
+	    SharingType sharing = 2;
+	    fixed32 start = 3; // lower bound on IDs allocated from this pool
+	    fixed32 end = 4; // upper bound on IDs allocated from this pool
+	}
+        repeated Pool pools = 3;
+    }
+    repeated DeviceResourceRanges ranges = 15;
 }
 
 message Classifier {
@@ -406,4 +444,4 @@
 }
 
 
-message Empty {}
\ No newline at end of file
+message Empty {}