blob: 812a9b551f6b51833b8be5811833066e492f3d03 [file] [log] [blame]
Shad Ansarib7b0ced2018-05-11 21:53:32 +00001/*
Nicolas Palpacuerb78def42018-06-07 12:55:26 -04002 Copyright (C) 2018 Open Networking Foundation
Shad Ansarib7b0ced2018-05-11 21:53:32 +00003
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>
22using grpc::Status;
23#include <openolt.grpc.pb.h>
24
Shad Ansariedef2132018-08-10 22:14:50 +000025#include "state.h"
26
Shad Ansari627b5782018-08-13 22:49:32 +000027#define COLLECTION_PERIOD 15
28
Shad Ansariedef2132018-08-10 22:14:50 +000029extern State state;
30
Shad Ansari627b5782018-08-13 22:49:32 +000031Status Enable_(int argc, char *argv[]);
Shad Ansarib7b0ced2018-05-11 21:53:32 +000032Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id,
Girish Gowdru1cdf6ce2018-08-27 02:43:02 -070033 const char *vendor_id, const char *vendor_specific, uint32_t pir,
Girish Gowdru0ffa48b2018-09-26 01:55:29 -070034 uint32_t alloc_id);
Jonathan Davis70c21812018-07-19 15:32:10 -040035Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id,
36 const char *vendor_id, const char *vendor_specific);
37Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id,
Girish Gowdru1cdf6ce2018-08-27 02:43:02 -070038 const char *vendor_id, const char *vendor_specific,
Girish Gowdru0ffa48b2018-09-26 01:55:29 -070039 uint32_t alloc_id);
Shad Ansarib7b0ced2018-05-11 21:53:32 +000040Status EnablePonIf_(uint32_t intf_id);
Nicolas Palpacuer05ea0ea2018-07-06 11:47:21 -040041Status DisablePonIf_(uint32_t intf_id);
Nicolas Palpacuere3fc0d22018-08-02 16:51:05 -040042Status EnableUplinkIf_(uint32_t intf_id);
43Status DisableUplinkIf_(uint32_t intf_id);
Craig Lutgen88a22ad2018-10-04 12:30:46 -050044unsigned NumNniIf_();
45unsigned NumPonIf_();
Shad Ansarib7b0ced2018-05-11 21:53:32 +000046Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt);
47Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt);
Craig Lutgen88a22ad2018-10-04 12:30:46 -050048Status ProbeDeviceCapabilities_();
49Status ProbePonIfTechnology_();
Nicolas Palpacuerb78def42018-06-07 12:55:26 -040050Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt);
Shad Ansari39739bc2018-09-13 21:38:37 +000051Status FlowAdd_(int32_t onu_id,
Shad Ansarib7b0ced2018-05-11 21:53:32 +000052 uint32_t flow_id, const std::string flow_type,
Shad Ansari39739bc2018-09-13 21:38:37 +000053 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 Ansarib7b0ced2018-05-11 21:53:32 +000056 const ::openolt::Classifier& classifier,
57 const ::openolt::Action& action);
Nicolas Palpacueredfaa0c2018-07-05 15:05:27 -040058Status FlowRemove_(uint32_t flow_id, const std::string flow_type);
Nicolas Palpacuere3fc0d22018-08-02 16:51:05 -040059Status Disable_();
60Status Reenable_();
Nicolas Palpacuerdff96792018-09-06 14:59:32 -040061Status GetDeviceInfo_(openolt::DeviceInfo* device_info);
Nicolas Palpacuere3fc0d22018-08-02 16:51:05 -040062
Nicolas Palpacuer6a63ea92018-09-05 17:21:37 -040063void stats_collection();
Shad Ansarib7b0ced2018-05-11 21:53:32 +000064#endif