Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 1 | /* |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame] | 2 | Copyright (C) 2018 Open Networking Foundation |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 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 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 25 | #include "state.h" |
| 26 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 27 | #define COLLECTION_PERIOD 15 |
| 28 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 29 | extern State state; |
| 30 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 31 | Status Enable_(int argc, char *argv[]); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 32 | Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id, |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 33 | const char *vendor_id, const char *vendor_specific, uint32_t pir, |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 34 | uint32_t alloc_id); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 35 | Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 36 | const char *vendor_id, const char *vendor_specific); |
| 37 | Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id, |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 38 | const char *vendor_id, const char *vendor_specific, |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 39 | uint32_t alloc_id); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 40 | Status EnablePonIf_(uint32_t intf_id); |
Nicolas Palpacuer | 05ea0ea | 2018-07-06 11:47:21 -0400 | [diff] [blame] | 41 | Status DisablePonIf_(uint32_t intf_id); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 42 | Status EnableUplinkIf_(uint32_t intf_id); |
| 43 | Status DisableUplinkIf_(uint32_t intf_id); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 44 | unsigned NumNniIf_(); |
| 45 | unsigned NumPonIf_(); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 46 | Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt); |
| 47 | Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 48 | Status ProbeDeviceCapabilities_(); |
| 49 | Status ProbePonIfTechnology_(); |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame] | 50 | Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt); |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 51 | Status FlowAdd_(int32_t onu_id, |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 52 | uint32_t flow_id, const std::string flow_type, |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 53 | int32_t access_intf_id, int32_t network_intf_id, |
| 54 | uint32_t gemport_id, uint32_t sched_id, |
| 55 | int32_t priority_value, |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 56 | const ::openolt::Classifier& classifier, |
| 57 | const ::openolt::Action& action); |
Nicolas Palpacuer | edfaa0c | 2018-07-05 15:05:27 -0400 | [diff] [blame] | 58 | Status FlowRemove_(uint32_t flow_id, const std::string flow_type); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 59 | Status Disable_(); |
| 60 | Status Reenable_(); |
Nicolas Palpacuer | dff9679 | 2018-09-06 14:59:32 -0400 | [diff] [blame] | 61 | Status GetDeviceInfo_(openolt::DeviceInfo* device_info); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 62 | |
Nicolas Palpacuer | 6a63ea9 | 2018-09-05 17:21:37 -0400 | [diff] [blame] | 63 | void stats_collection(); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 64 | #endif |