Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +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 | 7193ae2 | 2018-08-08 22:23:18 +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 | 7193ae2 | 2018-08-08 22:23:18 +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 | 7193ae2 | 2018-08-08 22:23:18 +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 | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 16 | |
| 17 | #ifndef OPENOLT_CORE_H_ |
| 18 | #define OPENOLT_CORE_H_ |
| 19 | |
| 20 | #include <grpc++/grpc++.h> |
| 21 | using grpc::Status; |
| 22 | #include <openolt.grpc.pb.h> |
| 23 | #include "Queue.h" |
| 24 | |
| 25 | extern Queue<openolt::Indication> oltIndQ; |
| 26 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 27 | Status Enable_(int argc, char *argv[]); |
Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 28 | Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 29 | const char *vendor_id, const char *vendor_specific, uint32_t pir); |
| 30 | Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 31 | const char *vendor_id, const char *vendor_specific); |
| 32 | Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id, |
| 33 | const char *vendor_id, const char *vendor_specific); |
| 34 | Status EnablePonIf_(uint32_t intf_id); |
| 35 | Status DisablePonIf_(uint32_t intf_id); |
| 36 | Status EnableUplinkIf_(uint32_t intf_id); |
| 37 | Status DisableUplinkIf_(uint32_t intf_id); |
| 38 | Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt); |
Craig Lutgen | ecd353a | 2018-12-12 22:33:17 -0600 | [diff] [blame] | 39 | Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, uint32_t port_no, const std::string pkt); |
Thiyagarajan Subramani | 89fffc0 | 2019-05-13 21:33:20 +0000 | [diff] [blame] | 40 | Status UplinkPacketOut_(bcmolt_flow_id flow_id, uint32_t intf_id, const std::string pkt); |
Craig Lutgen | 967a1d0 | 2018-11-27 10:41:51 -0600 | [diff] [blame] | 41 | Status FlowAdd_(int32_t access_intf_id, int32_t onu_id, int32_t uni_id, uint32_t port_no, |
Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 42 | uint32_t flow_id, const std::string flow_type, |
Craig Lutgen | 967a1d0 | 2018-11-27 10:41:51 -0600 | [diff] [blame] | 43 | int32_t alloc_id, int32_t network_intf_id, |
| 44 | int32_t gemport_id, const ::openolt::Classifier& classifier, |
| 45 | const ::openolt::Action& action, int32_t priority_value, uint64_t cookie); |
Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 46 | Status Disable_(); |
| 47 | Status Reenable_(); |
| 48 | |
| 49 | |
| 50 | static Status SchedAdd_(int intf_id, int onu_id, int agg_port_id); |
| 51 | static Status SchedRemove_(int intf_id, int onu_id, int agg_port_id); |
| 52 | |
| 53 | static inline int mk_sched_id(int onu_id) { |
| 54 | return 1023 + onu_id; |
| 55 | } |
| 56 | |
| 57 | static inline int mk_agg_port_id(int onu_id) { |
| 58 | return 1023 + onu_id; |
| 59 | } |
| 60 | |
| 61 | #endif |