VOL-3419: Replicate voltha flows in openolt agent
- Use the flow_id, symmetric_flow_id, replication_flag and pbit_to_gemport_map
  coming in Flow proto messge to replicate the flow as needed
- Use the CreateQueues and RemoveQueues messages to setup and remove gem_ports
- Use latest gRPC version 1.31.1 which allows fine tuning of gRPC threadpools
  which allows for greating performance.
- Performance numbers when tested with openolt-scale-tester has been better with
  using latest gRPC and threadpool tuning when compared to earlier. It is to be
  noted that the performance is better even with openolt-agent replicating the flow
  now.
- Scale tests with 512 subscribers have been successfull with BAL3.4.7.5 version
- Use openolt proto version 4.0.0
- Use openolt-test (for unit test) image version 2.0.1 (which bundles latest gRPC version 1.31.1)
- These changes are NOT backward compatible and openolt-agent will have a major
  version bump to 3.0.0

Change-Id: I715c804bdf342e60d08cab6c59e1c21b8c5ac1f4
diff --git a/agent/src/core_utils.h b/agent/src/core_utils.h
index 4a4d73f..e4eec7f 100644
--- a/agent/src/core_utils.h
+++ b/agent/src/core_utils.h
@@ -67,6 +67,10 @@
                     uint32_t uni_id, int tm_qmp_id);
 int get_acl_id();
 void free_acl_id (int acl_id);
+uint16_t get_flow_id();
+bool get_flow_ids(int num_of_flow_ids, uint16_t *flow_ids);
+void free_flow_id (uint16_t flow_id);
+void free_flow_ids(uint8_t num_flows, uint16_t *flow_ids);
 std::string get_qos_type_as_string(bcmolt_egress_qos_type qos_type);
 bcmolt_egress_qos_type get_qos_type(uint32_t pon_intf_id, uint32_t onu_id, uint32_t uni_id, uint32_t queue_size=0);
 void clear_qos_type(uint32_t pon_intf_id, uint32_t onu_id, uint32_t uni_id);
@@ -94,15 +98,20 @@
 Status install_acl(const acl_classifier_key acl_key);
 Status remove_acl(int acl_id);
 void formulate_acl_classifier_key(acl_classifier_key *key, const ::openolt::Classifier& classifier);
-Status handle_acl_rule_install(int32_t onu_id, uint32_t flow_id,
+Status handle_acl_rule_install(int32_t onu_id, uint64_t flow_id,
                                const std::string flow_type, int32_t access_intf_id,
-                               int32_t network_intf_id, int32_t gemport_id,
+                               int32_t network_intf_id,
                                const ::openolt::Classifier& classifier);
 void clear_gem_port(int gemport_id, int access_intf_id);
-Status handle_acl_rule_cleanup(int16_t acl_id, int32_t gemport_id, int32_t intf_id, const std::string flow_type);
+Status handle_acl_rule_cleanup(int16_t acl_id, int32_t intf_id, const std::string flow_type);
 Status check_bal_ready();
 Status check_connection();
 std::string get_ip_address(const char* nw_intf);
 bcmos_errno getOnuMaxLogicalDistance(uint32_t intf_id, uint32_t *mld);
 char* get_intf_mac(const char* intf_name, char* mac_address, unsigned int max_size_of_mac_address);
+void update_voltha_flow_to_cache(uint64_t voltha_flow_id, device_flow dev_flow);
+void remove_voltha_flow_from_cache(uint64_t voltha_flow_id);
+bool is_voltha_flow_installed(uint64_t voltha_flow_id );
+const device_flow* get_device_flow(uint64_t voltha_flow_id);
+const device_flow_params* get_device_flow_params(uint64_t voltha_flow_id);
 #endif // OPENOLT_CORE_UTILS_H_