Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 1 | /* |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 2 | * Copyright 2018-present Open Networking Foundation |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 3 | |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 7 | |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 9 | |
Girish Gowdra | a707e7c | 2019-11-07 11:36:13 +0530 | [diff] [blame] | 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 16 | |
| 17 | #ifndef OPENOLT_CORE_H_ |
| 18 | #define OPENOLT_CORE_H_ |
| 19 | |
| 20 | #include <grpc++/grpc++.h> |
| 21 | using grpc::Status; |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 22 | #include <voltha_protos/openolt.grpc.pb.h> |
kesavand | c1f2db9 | 2020-08-31 15:32:06 +0530 | [diff] [blame] | 23 | #include <voltha_protos/ext_config.grpc.pb.h> |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 24 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 25 | #include "state.h" |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 26 | #include "vendor.h" |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 27 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 28 | extern "C" |
| 29 | { |
| 30 | #include <bcmolt_api.h> |
| 31 | #include <bcmolt_api_model_supporting_enums.h> |
| 32 | |
| 33 | #include <bcmolt_api_conn_mgr.h> |
| 34 | //CLI header files |
| 35 | #include <bcmcli_session.h> |
| 36 | #include <bcmcli.h> |
| 37 | #include <bcm_api_cli.h> |
| 38 | |
| 39 | #include <bcmos_common.h> |
| 40 | #include <bcm_config.h> |
| 41 | // FIXME : dependency problem |
| 42 | // #include <bcm_common_gpon.h> |
| 43 | // #include <bcm_dev_log_task.h> |
| 44 | } |
| 45 | // ************************// |
| 46 | // Macros used by the core // |
| 47 | // ************************// |
| 48 | |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 49 | #define NONE "\033[m" |
| 50 | #define LIGHT_RED "\033[1;31m" |
| 51 | #define BROWN "\033[0;33m" |
| 52 | #define LIGHT_GREEN "\033[1;32m" |
| 53 | #define OPENOLT_LOG(level, id, fmt, ...) \ |
| 54 | if (DEV_LOG_LEVEL_##level == DEV_LOG_LEVEL_ERROR) \ |
| 55 | BCM_LOG(level, id, "%s" fmt "%s", LIGHT_RED, ##__VA_ARGS__, NONE); \ |
| 56 | else if (DEV_LOG_LEVEL_##level == DEV_LOG_LEVEL_INFO) \ |
| 57 | BCM_LOG(level, id, "%s" fmt "%s", NONE, ##__VA_ARGS__, NONE); \ |
| 58 | else if (DEV_LOG_LEVEL_##level == DEV_LOG_LEVEL_WARNING) \ |
| 59 | BCM_LOG(level, id, "%s" fmt "%s", BROWN, ##__VA_ARGS__, NONE); \ |
| 60 | else if (DEV_LOG_LEVEL_##level == DEV_LOG_LEVEL_DEBUG) \ |
| 61 | BCM_LOG(level, id, "%s" fmt "%s", LIGHT_GREEN, ##__VA_ARGS__, NONE); \ |
| 62 | else \ |
| 63 | BCM_LOG(INFO, id, fmt, ##__VA_ARGS__); |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 64 | |
| 65 | |
| 66 | #define ACL_LOG(level,msg,err) \ |
| 67 | do { \ |
| 68 | OPENOLT_LOG(level, openolt_log_id, "--------> %s (acl_id %d) err: %d <--------\n", msg, key.id, err); \ |
| 69 | OPENOLT_LOG(level, openolt_log_id, "action_type %s\n", \ |
| 70 | GET_ACL_ACTION_TYPE(action_type)); \ |
| 71 | OPENOLT_LOG(level, openolt_log_id, "classifier(ether type %d), ip_proto %d, src_port %d, dst_port %d\n", \ |
| 72 | acl_key.ether_type, acl_key.ip_proto, acl_key.src_port, acl_key.dst_port); \ |
| 73 | } while(0) |
| 74 | |
| 75 | #define FLOW_LOG(level,msg,err) \ |
| 76 | do { \ |
| 77 | OPENOLT_LOG(level, openolt_log_id, "--------> %s (flow_id %d) err: %d <--------\n", msg, key.flow_id, err); \ |
| 78 | OPENOLT_LOG(level, openolt_log_id, "intf_id %d, onu_id %d, uni_id %d, port_no %u, cookie %"PRIu64"\n", \ |
| 79 | access_intf_id, onu_id, uni_id, port_no, cookie); \ |
| 80 | OPENOLT_LOG(level, openolt_log_id, "flow_type %s, queue_id %d, sched_id %d\n", flow_type.c_str(), \ |
| 81 | cfg.data.egress_qos.u.fixed_queue.queue_id, cfg.data.egress_qos.tm_sched.id); \ |
| 82 | OPENOLT_LOG(level, openolt_log_id, "Ingress(intfd_type %s, intf_id %d), Egress(intf_type %s, intf_id %d)\n", \ |
| 83 | GET_FLOW_INTERFACE_TYPE(cfg.data.ingress_intf.intf_type), cfg.data.ingress_intf.intf_id, \ |
| 84 | GET_FLOW_INTERFACE_TYPE(cfg.data.egress_intf.intf_type), cfg.data.egress_intf.intf_id); \ |
| 85 | OPENOLT_LOG(level, openolt_log_id, "classifier(o_vid %d, o_pbits %d, i_vid %d, i_pbits %d, ether type 0x%x)\n", \ |
| 86 | c_val.o_vid, c_val.o_pbits, c_val.i_vid, c_val.i_pbits, classifier.eth_type()); \ |
| 87 | OPENOLT_LOG(level, openolt_log_id, "classifier(ip_proto 0x%x, gemport_id %d, src_port %d, dst_port %d, pkt_tag_type %s)\n", \ |
| 88 | c_val.ip_proto, gemport_id, c_val.src_port, c_val.dst_port, GET_PKT_TAG_TYPE(c_val.pkt_tag_type)); \ |
| 89 | OPENOLT_LOG(level, openolt_log_id, "action(cmds_bitmask %s, o_vid %d, o_pbits %d, i_vid %d, i_pbits %d)\n\n", \ |
| 90 | get_flow_acton_command(a_val.cmds_bitmask), a_val.o_vid, a_val.o_pbits, a_val.i_vid, a_val.i_pbits); \ |
| 91 | } while(0) |
| 92 | |
| 93 | #define FLOW_PARAM_LOG() \ |
| 94 | do { \ |
| 95 | OPENOLT_LOG(INFO, openolt_log_id, "--------> flow comparison (now before) <--------\n"); \ |
| 96 | OPENOLT_LOG(INFO, openolt_log_id, "flow_id (%d %d)\n", \ |
| 97 | key.flow_id, it->first.first); \ |
| 98 | OPENOLT_LOG(INFO, openolt_log_id, "onu_id (%d %lu)\n", \ |
| 99 | cfg.data.onu_id , get_flow_status(it->first.first, it->first.second, ONU_ID)); \ |
| 100 | OPENOLT_LOG(INFO, openolt_log_id, "type (%d %lu)\n", \ |
| 101 | key.flow_type, get_flow_status(it->first.first, it->first.second, FLOW_TYPE)); \ |
| 102 | OPENOLT_LOG(INFO, openolt_log_id, "svc_port_id (%d %lu)\n", \ |
| 103 | cfg.data.svc_port_id, get_flow_status(it->first.first, it->first.second, SVC_PORT_ID)); \ |
| 104 | OPENOLT_LOG(INFO, openolt_log_id, "priority (%d %lu)\n", \ |
| 105 | cfg.data.priority, get_flow_status(it->first.first, it->first.second, PRIORITY)); \ |
| 106 | OPENOLT_LOG(INFO, openolt_log_id, "cookie (%lu %lu)\n", \ |
| 107 | cfg.data.cookie, get_flow_status(it->first.first, it->first.second, COOKIE)); \ |
| 108 | OPENOLT_LOG(INFO, openolt_log_id, "ingress intf_type (%s %s)\n", \ |
| 109 | GET_FLOW_INTERFACE_TYPE(cfg.data.ingress_intf.intf_type), \ |
| 110 | GET_FLOW_INTERFACE_TYPE(get_flow_status(it->first.first, it->first.second, INGRESS_INTF_TYPE))); \ |
| 111 | OPENOLT_LOG(INFO, openolt_log_id, "ingress intf id (%d %lu)\n", \ |
| 112 | cfg.data.ingress_intf.intf_id , get_flow_status(it->first.first, it->first.second, INGRESS_INTF_ID)); \ |
| 113 | OPENOLT_LOG(INFO, openolt_log_id, "egress intf_type (%d %lu)\n", \ |
| 114 | cfg.data.egress_intf.intf_type , get_flow_status(it->first.first, it->first.second, EGRESS_INTF_TYPE)); \ |
| 115 | OPENOLT_LOG(INFO, openolt_log_id, "egress intf_id (%d %lu)\n", \ |
| 116 | cfg.data.egress_intf.intf_id , get_flow_status(it->first.first, it->first.second, EGRESS_INTF_ID)); \ |
| 117 | OPENOLT_LOG(INFO, openolt_log_id, "classifier o_vid (%d %lu)\n", \ |
| 118 | c_val.o_vid , get_flow_status(it->first.first, it->first.second, CLASSIFIER_O_VID)); \ |
| 119 | OPENOLT_LOG(INFO, openolt_log_id, "classifier o_pbits (%d %lu)\n", \ |
| 120 | c_val.o_pbits , get_flow_status(it->first.first, it->first.second, CLASSIFIER_O_PBITS)); \ |
| 121 | OPENOLT_LOG(INFO, openolt_log_id, "classifier i_vid (%d %lu)\n", \ |
| 122 | c_val.i_vid , get_flow_status(it->first.first, it->first.second, CLASSIFIER_I_VID)); \ |
| 123 | OPENOLT_LOG(INFO, openolt_log_id, "classifier i_pbits (%d %lu)\n", \ |
| 124 | c_val.i_pbits , get_flow_status(it->first.first, it->first.second, CLASSIFIER_I_PBITS)); \ |
| 125 | OPENOLT_LOG(INFO, openolt_log_id, "classifier ether_type (0x%x 0x%lx)\n", \ |
| 126 | c_val.ether_type , get_flow_status(it->first.first, it->first.second, CLASSIFIER_ETHER_TYPE)); \ |
| 127 | OPENOLT_LOG(INFO, openolt_log_id, "classifier ip_proto (%d %lu)\n", \ |
| 128 | c_val.ip_proto , get_flow_status(it->first.first, it->first.second, CLASSIFIER_IP_PROTO)); \ |
| 129 | OPENOLT_LOG(INFO, openolt_log_id, "classifier src_port (%d %lu)\n", \ |
| 130 | c_val.src_port , get_flow_status(it->first.first, it->first.second, CLASSIFIER_SRC_PORT)); \ |
| 131 | OPENOLT_LOG(INFO, openolt_log_id, "classifier dst_port (%d %lu)\n", \ |
| 132 | c_val.dst_port , get_flow_status(it->first.first, it->first.second, CLASSIFIER_DST_PORT)); \ |
| 133 | OPENOLT_LOG(INFO, openolt_log_id, "classifier pkt_tag_type (%s %s)\n", \ |
| 134 | GET_PKT_TAG_TYPE(c_val.pkt_tag_type), \ |
| 135 | GET_PKT_TAG_TYPE(get_flow_status(it->first.first, it->first.second, CLASSIFIER_PKT_TAG_TYPE))); \ |
| 136 | OPENOLT_LOG(INFO, openolt_log_id, "classifier egress_qos type (%d %lu)\n", \ |
| 137 | cfg.data.egress_qos.type , get_flow_status(it->first.first, it->first.second, EGRESS_QOS_TYPE)); \ |
| 138 | OPENOLT_LOG(INFO, openolt_log_id, "classifier egress_qos queue_id (%d %lu)\n", \ |
| 139 | cfg.data.egress_qos.u.fixed_queue.queue_id, \ |
| 140 | get_flow_status(it->first.first, it->first.second, EGRESS_QOS_QUEUE_ID)); \ |
| 141 | OPENOLT_LOG(INFO, openolt_log_id, "classifier egress_qos sched_id (%d %lu)\n", \ |
| 142 | cfg.data.egress_qos.tm_sched.id, \ |
| 143 | get_flow_status(it->first.first, it->first.second, EGRESS_QOS_TM_SCHED_ID)); \ |
| 144 | OPENOLT_LOG(INFO, openolt_log_id, "classifier cmds_bitmask (%s %s)\n", \ |
| 145 | get_flow_acton_command(a_val.cmds_bitmask), \ |
| 146 | get_flow_acton_command(get_flow_status(it->first.first, it->first.second, ACTION_CMDS_BITMASK))); \ |
| 147 | OPENOLT_LOG(INFO, openolt_log_id, "action o_vid (%d %lu)\n", \ |
| 148 | a_val.o_vid , get_flow_status(it->first.first, it->first.second, ACTION_O_VID)); \ |
| 149 | OPENOLT_LOG(INFO, openolt_log_id, "action i_vid (%d %lu)\n", \ |
| 150 | a_val.i_vid , get_flow_status(it->first.first, it->first.second, ACTION_I_VID)); \ |
| 151 | OPENOLT_LOG(INFO, openolt_log_id, "action o_pbits (%d %lu)\n", \ |
| 152 | a_val.o_pbits , get_flow_status(it->first.first, it->first.second, ACTION_O_PBITS)); \ |
| 153 | OPENOLT_LOG(INFO, openolt_log_id, "action i_pbits (%d %lu)\n\n", \ |
| 154 | a_val.i_pbits, get_flow_status(it->first.first, it->first.second, ACTION_I_PBITS)); \ |
| 155 | OPENOLT_LOG(INFO, openolt_log_id, "group_id (%d %lu)\n\n", \ |
| 156 | a_val.group_id, get_flow_status(it->first.first, it->first.second, GROUP_ID)); \ |
| 157 | } while(0) |
| 158 | |
Girish Gowdra | 9646105 | 2019-11-22 20:13:59 +0530 | [diff] [blame] | 159 | #define COLLECTION_PERIOD 15 // in seconds |
Girish Gowdru | 376b33c | 2019-05-06 21:46:31 -0700 | [diff] [blame] | 160 | #define BAL_DYNAMIC_LIST_BUFFER_SIZE (32 * 1024) |
| 161 | #define MAX_REGID_LENGTH 36 |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 162 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 163 | #define BAL_RSC_MANAGER_BASE_TM_SCHED_ID 16384 |
| 164 | #define MAX_TM_QMP_ID 16 |
| 165 | #define TMQ_MAP_PROFILE_SIZE 8 |
| 166 | #define MAX_TM_SCHED_ID 1023 |
| 167 | #define MAX_SUBS_TM_SCHED_ID (MAX_SUPPORTED_PON == 16 ? MAX_TM_SCHED_ID-4-16 : MAX_TM_SCHED_ID-10-64) |
| 168 | #define EAP_ETHER_TYPE 34958 |
| 169 | #define XGS_BANDWIDTH_GRANULARITY 16000 |
| 170 | #define GPON_BANDWIDTH_GRANULARITY 32000 |
| 171 | #define NUM_OF_PRIORITIES 8 |
| 172 | #define NUMBER_OF_DEFAULT_INTERFACE_QUEUES 4 // <= NUM_OF_PRIORITIES |
| 173 | #define FILL_ARRAY(ARRAY,START,END,VALUE) for(int i=START;i<END;ARRAY[i++]=VALUE); |
Arthur Syu | 094df16 | 2022-04-21 17:50:06 +0800 | [diff] [blame] | 174 | #define FILL_ARRAY2(ARRAY,START,END,VALUE) for(int i=START;i<END;ARRAY[i]=VALUE,i+=2); |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 175 | #define COUNT_OF(array) (sizeof(array) / sizeof(array[0])) |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 176 | #define NUMBER_OF_PBITS 8 |
Girish Gowdra | 52997cc | 2022-06-02 20:58:50 -0700 | [diff] [blame] | 177 | #define MAX_NUMBER_OF_REPLICATED_FLOWS NUMBER_OF_PBITS |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 178 | #define GRPC_THREAD_POOL_SIZE 150 |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 179 | |
| 180 | #define GET_FLOW_INTERFACE_TYPE(type) \ |
| 181 | (type == BCMOLT_FLOW_INTERFACE_TYPE_PON) ? "PON" : \ |
| 182 | (type == BCMOLT_FLOW_INTERFACE_TYPE_NNI) ? "NNI" : \ |
| 183 | (type == BCMOLT_FLOW_INTERFACE_TYPE_HOST) ? "HOST" : "unknown" |
| 184 | #define GET_PKT_TAG_TYPE(type) \ |
| 185 | (type == BCMOLT_PKT_TAG_TYPE_UNTAGGED) ? "UNTAG" : \ |
| 186 | (type == BCMOLT_PKT_TAG_TYPE_SINGLE_TAG) ? "SINGLE_TAG" : \ |
| 187 | (type == BCMOLT_PKT_TAG_TYPE_DOUBLE_TAG) ? "DOUBLE_TAG" : "unknown" |
| 188 | #define GET_ACL_ACTION_TYPE(type) \ |
| 189 | (type == BCMOLT_ACCESS_CONTROL_FWD_ACTION_TYPE_TRAP_TO_HOST) ? "trap_to_host" : \ |
| 190 | (type == BCMOLT_ACCESS_CONTROL_FWD_ACTION_TYPE_DROP) ? "drop" : \ |
| 191 | (type == BCMOLT_ACCESS_CONTROL_FWD_ACTION_TYPE_REDIRECT) ? "redirction" : "unknown" |
| 192 | #define GET_ACL_MEMBERS_UPDATE_COMMAND(command) \ |
| 193 | (command == BCMOLT_MEMBERS_UPDATE_COMMAND_ADD) ? "add" : \ |
| 194 | (command == BCMOLT_MEMBERS_UPDATE_COMMAND_REMOVE) ? "remove" : \ |
| 195 | (command == BCMOLT_MEMBERS_UPDATE_COMMAND_SET) ? "set" : "unknown" |
| 196 | #define GET_INTERFACE_TYPE(type) \ |
| 197 | (type == BCMOLT_INTERFACE_TYPE_PON) ? "PON" : \ |
| 198 | (type == BCMOLT_INTERFACE_TYPE_NNI) ? "NNI" : \ |
| 199 | (type == BCMOLT_INTERFACE_TYPE_HOST) ? "HOST" : "unknown" |
| 200 | |
Jason Huang | 1d9cfce | 2020-05-20 22:58:47 +0800 | [diff] [blame] | 201 | #define LOGICAL_DISTANCE(MLD,EQD,TD) (MLD-(EQD*TD)*102) /* Round-trip time of 102 meters is 1us */ |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 202 | extern State state; |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 203 | extern PonTrx ponTrx; |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 204 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 205 | //***************************************// |
| 206 | // Function declations used by the core. // |
| 207 | //***************************************// |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 208 | Status Enable_(int argc, char *argv[]); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 209 | Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id, |
kesavand | c1f2db9 | 2020-08-31 15:32:06 +0530 | [diff] [blame] | 210 | const char *vendor_id, const char *vendor_specific, uint32_t pir, bool omcc_encryption_mode); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 211 | Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 212 | const char *vendor_id, const char *vendor_specific); |
| 213 | Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id, |
Girish Gowdru | 7c4ec2d | 2018-10-25 00:29:54 -0700 | [diff] [blame] | 214 | const char *vendor_id, const char *vendor_specific); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 215 | Status EnablePonIf_(uint32_t intf_id); |
Nicolas Palpacuer | 05ea0ea | 2018-07-06 11:47:21 -0400 | [diff] [blame] | 216 | Status DisablePonIf_(uint32_t intf_id); |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 217 | Status SetStateUplinkIf_(uint32_t intf_id, bool set_state); |
Elia Battiston | 869a5de | 2022-02-08 11:40:58 +0100 | [diff] [blame] | 218 | uint32_t GetNniSpeed_(uint32_t intf_id); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 219 | unsigned NumNniIf_(); |
| 220 | unsigned NumPonIf_(); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 221 | Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt); |
Girish Gowdru | c8ed2ef | 2019-02-13 08:18:44 -0800 | [diff] [blame] | 222 | Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, uint32_t port_no, uint32_t gemport_id, const std::string pkt); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 223 | Status ProbeDeviceCapabilities_(); |
| 224 | Status ProbePonIfTechnology_(); |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame] | 225 | Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt); |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 226 | Status FlowAddWrapper_(const openolt::Flow* request); |
Craig Lutgen | 967a1d0 | 2018-11-27 10:41:51 -0600 | [diff] [blame] | 227 | Status FlowAdd_(int32_t access_intf_id, int32_t onu_id, int32_t uni_id, uint32_t port_no, |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 228 | uint32_t flow_id, const std::string flow_type, |
Girish Gowdru | 7c4ec2d | 2018-10-25 00:29:54 -0700 | [diff] [blame] | 229 | int32_t alloc_id, int32_t network_intf_id, |
| 230 | int32_t gemport_id, const ::openolt::Classifier& classifier, |
Burak Gurdag | c78b9e1 | 2019-11-29 11:14:51 +0000 | [diff] [blame] | 231 | const ::openolt::Action& action, int32_t priority_value, |
Burak Gurdag | a052359 | 2021-02-24 15:17:47 +0000 | [diff] [blame] | 232 | uint64_t cookie, int32_t group_id, uint32_t tech_profile_id, bool enable_encryption = false); |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 233 | Status FlowRemoveWrapper_(const openolt::Flow* request); |
Nicolas Palpacuer | edfaa0c | 2018-07-05 15:05:27 -0400 | [diff] [blame] | 234 | Status FlowRemove_(uint32_t flow_id, const std::string flow_type); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 235 | Status Disable_(); |
| 236 | Status Reenable_(); |
Nicolas Palpacuer | dff9679 | 2018-09-06 14:59:32 -0400 | [diff] [blame] | 237 | Status GetDeviceInfo_(openolt::DeviceInfo* device_info); |
Girish Gowdru | c8ed2ef | 2019-02-13 08:18:44 -0800 | [diff] [blame] | 238 | Status CreateTrafficSchedulers_(const tech_profile::TrafficSchedulers *traffic_scheds); |
| 239 | Status RemoveTrafficSchedulers_(const tech_profile::TrafficSchedulers *traffic_scheds); |
| 240 | Status CreateTrafficQueues_(const tech_profile::TrafficQueues *traffic_queues); |
| 241 | Status RemoveTrafficQueues_(const tech_profile::TrafficQueues *traffic_queues); |
Burak Gurdag | c78b9e1 | 2019-11-29 11:14:51 +0000 | [diff] [blame] | 242 | Status PerformGroupOperation_(const openolt::Group *group_cfg); |
Burak Gurdag | eb4ca2e | 2020-06-15 07:48:26 +0000 | [diff] [blame] | 243 | Status DeleteGroup_(uint32_t group_id); |
kesavand | c1f2db9 | 2020-08-31 15:32:06 +0530 | [diff] [blame] | 244 | Status OnuItuPonAlarmSet_(const config::OnuItuPonAlarm* request); |
Craig Lutgen | 967a1d0 | 2018-11-27 10:41:51 -0600 | [diff] [blame] | 245 | uint32_t GetPortNum_(uint32_t flow_id); |
Jason Huang | 1d9cfce | 2020-05-20 22:58:47 +0800 | [diff] [blame] | 246 | Status GetLogicalOnuDistanceZero_(uint32_t intf_id, openolt::OnuLogicalDistance* response); |
| 247 | Status GetLogicalOnuDistance_(uint32_t intf_id, uint32_t onu_id, openolt::OnuLogicalDistance* response); |
Burak Gurdag | 74e3ab8 | 2020-12-17 13:35:06 +0000 | [diff] [blame] | 248 | Status GetOnuStatistics_(uint32_t intf_id, uint32_t onu_id, openolt::OnuStatistics *onu_stats); |
| 249 | Status GetGemPortStatistics_(uint32_t intf_id, uint32_t gemport_id, openolt::GemPortStatistics* gemport_stats); |
Orhan Kupusoglu | ec57af0 | 2021-05-12 12:38:17 +0000 | [diff] [blame] | 250 | Status GetPonRxPower_(uint32_t intf_id, uint32_t onu_id, openolt::PonRxPowerData* response); |
nikesh.krishnan | 331d38c | 2023-04-06 03:24:53 +0530 | [diff] [blame] | 251 | Status GetOnuInfo_(uint32_t intf_id, uint32_t onu_id, openolt::OnuInfo *response); |
| 252 | Status GetPonInterfaceInfo_(uint32_t intf_id, openolt::PonIntfInfo *response); |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 253 | int get_status_bcm_cli_quit(void); |
Jason Huang | bf45ffb | 2019-10-30 17:29:02 +0800 | [diff] [blame] | 254 | uint16_t get_dev_id(void); |
Elia Battiston | 869a5de | 2022-02-08 11:40:58 +0100 | [diff] [blame] | 255 | Status pushOltOperInd(uint32_t intf_id, const char *type, const char *state, uint32_t speed); |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 256 | uint64_t get_flow_status(uint16_t flow_id, uint16_t flow_type, uint16_t data_id); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 257 | |
Nicolas Palpacuer | 6a63ea9 | 2018-09-05 17:21:37 -0400 | [diff] [blame] | 258 | void stats_collection(); |
Jason Huang | bf45ffb | 2019-10-30 17:29:02 +0800 | [diff] [blame] | 259 | Status check_connection(); |
| 260 | Status check_bal_ready(); |
Thiyagarajan Subramani | 03bc66f | 2020-04-01 15:58:53 +0530 | [diff] [blame] | 261 | std::string get_ip_address(const char* nw_intf); |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 262 | |
| 263 | // Stubbed defntions of bcmolt_cfg_get required for unit-test |
| 264 | #ifdef TEST_MODE |
| 265 | extern bcmos_errno bcmolt_cfg_get__bal_state_stub(bcmolt_oltid olt_id, void* ptr); |
| 266 | extern bcmos_errno bcmolt_cfg_get__onu_state_stub(bcmolt_oltid olt_id, void* ptr); |
| 267 | extern bcmos_errno bcmolt_cfg_get__tm_sched_stub(bcmolt_oltid olt_id, void* ptr); |
| 268 | extern bcmos_errno bcmolt_cfg_get__pon_intf_stub(bcmolt_oltid olt_id, void* ptr); |
| 269 | extern bcmos_errno bcmolt_cfg_get__nni_intf_stub(bcmolt_oltid olt_id, void* ptr); |
| 270 | extern bcmos_errno bcmolt_cfg_get__olt_topology_stub(bcmolt_oltid olt_id, void* ptr); |
| 271 | extern bcmos_errno bcmolt_cfg_get__flow_stub(bcmolt_oltid olt_id, void* ptr); |
| 272 | #endif //TEST_MODE |
| 273 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 274 | #endif |