VOL-5354: Create extension protos to be able to offload PPPoEIA, DHCP RA apps onto the OLT

Change-Id: I36029d15e5ee57ae391d29b28d7eca1f3dd74a8c
Signed-off-by: amit.ghosh <amit.ghosh@radisys.com>
diff --git a/protos/voltha_protos/extensions.proto b/protos/voltha_protos/extensions.proto
index 1f232ec..d372f93 100755
--- a/protos/voltha_protos/extensions.proto
+++ b/protos/voltha_protos/extensions.proto
@@ -378,12 +378,78 @@
     repeated AlarmData active_alarms = 1;
 }
 
+message GetOffloadedAppsStatisticsRequest {
+    enum OffloadedApp {
+        UNDEFINED = 0;
+        PPPoeIA = 1;
+        DHCPv4RA = 2;
+        DHCPv6RA = 3;
+    }
+    // The offloaded application whose statistics are requested
+    OffloadedApp statsFor = 1;
+}
+
+message GetOffloadedAppsStatisticsResponse {
+    message DHCPv4RAStats {
+        // From https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-l2-dhcpv4-relay.yang
+        uint32 in_bad_packets_from_client = 1;
+        uint32 in_bad_packets_from_server = 2;
+        uint32 in_packets_from_client = 3;
+        uint32 in_packets_from_server = 4;
+        uint32 out_packets_to_server = 5;
+        uint32 out_packets_to_client = 6;
+        uint32 option_82_inserted_packets_to_server = 7;
+        uint32 option_82_removed_packets_to_client = 8;
+        uint32 option_82_not_inserted_to_server = 9;
+
+        // Name value pairs that gives the flexibility to report different statistics that implementations may choose
+        map<string, string> additional_stats = 10; 
+    }
+
+    message DHCPv6RAStats {
+        // From https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-ldra.yang
+        uint32 in_bad_packets_from_client = 1;
+        uint32 in_bad_packets_from_server = 2;
+        uint32 option_17_inserted_packets_to_server = 3;
+        uint32 option_17_removed_packets_to_client = 4;
+        uint32 option_18_inserted_packets_to_server = 5;
+        uint32 option_18_removed_packets_to_client = 6;
+        uint32 option_37_inserted_packets_to_server = 7;
+        uint32 option_37_removed_packets_to_client = 8;
+        uint32 outgoing_mtu_exceeded_packets_from_client = 9;
+
+        // Name value pairs that gives the flexibility to report different statistics that implementations may choose
+        map<string, string> additional_stats = 10; 
+    }
+
+    message PPPoeIAStats {
+        // From https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-pppoe-intermediate-agent.yang
+        uint32 in_error_packets_from_client = 1;
+        uint32 in_error_packets_from_server = 2;
+        uint32 in_packets_from_client = 3;
+        uint32 in_packets_from_server = 4;
+        uint32 out_packets_to_server = 5;
+        uint32 out_packets_to_client = 6;
+        uint32 vendor_specific_tag_inserted_packets_to_server = 7;
+        uint32 vendor_specific_tag_removed_packets_to_client = 8;
+        uint32 outgoing_mtu_exceeded_packets_from_client = 9;
+
+        // Name value pairs that gives the flexibility to report different statistics that implementations may choose
+        map<string, string> additional_stats = 10; 
+    }
+    
+    oneof stats {
+        DHCPv4RAStats dhcpv4RaStats = 1;
+        DHCPv6RAStats dhcpv6RaStats = 2;
+        PPPoeIAStats pppoeIaStats = 3;
+    }
+}
 
 message GetValueRequest {
     oneof request {
         GetDistanceRequest distance = 1;
         GetOnuUniInfoRequest uniInfo = 2;
-        // Corresponds to PmMetricId.PON_PORT_COUNTERS, PmMetricId.NNI_PORT_COUNTERS 
+        // Corresponds to PmMetricId.PON_PORT_COUNTERS, PmMetricId.NNI_PORT_COUNTERS
         GetOltPortCounters oltPortInfo = 3;
         // Corresponds to PmMetricId.PON_OPTICAL
         GetOnuPonOpticalInfo onuOpticalInfo = 4;
@@ -397,6 +463,7 @@
         GetOnuOmciTxRxStatsRequest onuOmciStats = 10;
         GetOltRxPowerRequest oltRxPower = 11;
         GetOnuOmciActiveAlarmsRequest onuActiveAlarms  = 12;
+        GetOffloadedAppsStatisticsRequest offloadedAppsStats = 13;
     }
 }
 
@@ -433,12 +500,41 @@
         GetOnuOmciTxRxStatsResponse onuOmciStats = 12;
         GetOltRxPowerResponse oltRxPower = 13;
         GetOnuOmciActiveAlarmsResponse onuActiveAlarms = 14;
+        GetOffloadedAppsStatisticsResponse offloadedAppsStats = 15;
     }
 }
 
+// AppOffloadConfig is the configuration for offloading applications to the OLT and has OLT wide configuration.
+message AppOffloadConfig {
+    bool enableDHCPv4RA = 1;
+    bool enableDHCPv6RA = 2;
+    bool enablePPPoEIA = 3;
+    // Follows the same as the BBF Access Node Id defined in https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-subscriber-profiles.yang
+    string accessNodeID = 4;
+}
+
+// AppOffloadOnuConfig has Onu specfic configuration which the OLT runs applications which have been offloaded.
+message AppOffloadOnuConfig {
+    string onuDeviceId = 1;
+
+    message PerUniConfig {
+        // As per the BBF Agent Remote Id defined in https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-pppoe-intermediate-agent-profile-common.yang
+        string agentRemoteID = 2;
+        // As per the BBF Agent Circuit Id defined in https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-pppoe-intermediate-agent-profile-common.yang
+        string agentCircuitID = 3;
+        // The id of the UNI on the Onu for which this configuration is relevant. The UNI ids are numbered from 0 to n depending on the number of UNI ports on the ONU.
+        uint32 onuUniId = 4;
+    }
+
+    repeated PerUniConfig perUniInfo = 5;
+
+}
+
 message SetValueRequest {
     oneof request {
         config.AlarmConfig alarm_config = 1;
+        AppOffloadConfig app_offload_config = 2;
+        AppOffloadOnuConfig app_offload_onu_config = 3;
     }
 }
 
@@ -452,6 +548,9 @@
     enum ErrorReason {
         REASON_UNDEFINED = 0;
         UNSUPPORTED = 1;
+        INVALID_DEVICE_ID = 2;
+        INVALID_ONU_DEVICE_ID = 3;
+        INVALID_UNI_ID = 4;
     }
     Status status = 1;
     ErrorReason errReason = 2;