Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 1 | /* |
| 2 | Copyright (C) 2018 Open Networking Foundation |
| 3 | |
| 4 | This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 3 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #ifndef OPENOLT_CORE_H_ |
| 19 | #define OPENOLT_CORE_H_ |
| 20 | |
| 21 | #include <grpc++/grpc++.h> |
| 22 | using grpc::Status; |
| 23 | #include <openolt.grpc.pb.h> |
| 24 | #include "Queue.h" |
| 25 | |
| 26 | extern Queue<openolt::Indication> oltIndQ; |
| 27 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 28 | Status Enable_(int argc, char *argv[]); |
Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 29 | Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 30 | const char *vendor_id, const char *vendor_specific, uint32_t pir); |
| 31 | Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 32 | const char *vendor_id, const char *vendor_specific); |
| 33 | Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id, |
| 34 | const char *vendor_id, const char *vendor_specific); |
| 35 | Status EnablePonIf_(uint32_t intf_id); |
| 36 | Status DisablePonIf_(uint32_t intf_id); |
| 37 | Status EnableUplinkIf_(uint32_t intf_id); |
| 38 | Status DisableUplinkIf_(uint32_t intf_id); |
| 39 | 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] | 40 | Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, uint32_t port_no, const std::string pkt); |
Jason Huang | d33b4d8 | 2019-05-15 18:22:57 +0800 | [diff] [blame] | 41 | 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] | 42 | 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] | 43 | uint32_t flow_id, const std::string flow_type, |
Craig Lutgen | 967a1d0 | 2018-11-27 10:41:51 -0600 | [diff] [blame] | 44 | int32_t alloc_id, int32_t network_intf_id, |
| 45 | int32_t gemport_id, const ::openolt::Classifier& classifier, |
| 46 | const ::openolt::Action& action, int32_t priority_value, uint64_t cookie); |
Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 47 | Status Disable_(); |
| 48 | Status Reenable_(); |
| 49 | |
| 50 | |
| 51 | static Status SchedAdd_(int intf_id, int onu_id, int agg_port_id); |
| 52 | static Status SchedRemove_(int intf_id, int onu_id, int agg_port_id); |
| 53 | |
| 54 | static inline int mk_sched_id(int onu_id) { |
| 55 | return 1023 + onu_id; |
| 56 | } |
| 57 | |
| 58 | static inline int mk_agg_port_id(int onu_id) { |
| 59 | return 1023 + onu_id; |
| 60 | } |
| 61 | |
| 62 | #endif |