blob: 182b06d1789e6c4ad9cc1b1024c70f218d2718c4 [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
25Status Enable_();
26Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id,
Shad Ansari06101952018-07-25 00:22:09 +000027 const char *vendor_id, const char *vendor_specific, uint32_t pir);
Jonathan Davis70c21812018-07-19 15:32:10 -040028Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id,
29 const char *vendor_id, const char *vendor_specific);
30Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id,
31 const char *vendor_id, const char *vendor_specific);
Shad Ansarib7b0ced2018-05-11 21:53:32 +000032Status EnablePonIf_(uint32_t intf_id);
Nicolas Palpacuer05ea0ea2018-07-06 11:47:21 -040033Status DisablePonIf_(uint32_t intf_id);
Nicolas Palpacuere3fc0d22018-08-02 16:51:05 -040034Status EnableUplinkIf_(uint32_t intf_id);
35Status DisableUplinkIf_(uint32_t intf_id);
Shad Ansarib7b0ced2018-05-11 21:53:32 +000036Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt);
37Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt);
Nicolas Palpacuerb78def42018-06-07 12:55:26 -040038Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt);
Shad Ansarib7b0ced2018-05-11 21:53:32 +000039Status FlowAdd_(uint32_t onu_id,
40 uint32_t flow_id, const std::string flow_type,
41 uint32_t access_intf_id, uint32_t network_intf_id,
Nicolas Palpacuerd6cf5aa2018-07-16 15:14:39 -040042 uint32_t gemport_id, uint32_t priority,
Shad Ansarib7b0ced2018-05-11 21:53:32 +000043 const ::openolt::Classifier& classifier,
44 const ::openolt::Action& action);
Nicolas Palpacuere3fc0d22018-08-02 16:51:05 -040045Status Disable_();
46Status Reenable_();
47
Shad Ansarib7b0ced2018-05-11 21:53:32 +000048
49static Status SchedAdd_(int intf_id, int onu_id, int agg_port_id);
Jonathan Davis70c21812018-07-19 15:32:10 -040050static Status SchedRemove_(int intf_id, int onu_id, int agg_port_id);
Shad Ansarib7b0ced2018-05-11 21:53:32 +000051
52static inline int mk_sched_id(int onu_id) {
53 return 1023 + onu_id;
54}
55
56static inline int mk_agg_port_id(int onu_id) {
57 return 1023 + onu_id;
58}
59
60#endif