blob: ed0fb4d313fbf0c12bd08370c9d9c01cf1a9bb8e [file] [log] [blame]
Shad Ansari7193ae22018-08-08 22:23:18 +00001/*
Girish Gowdraa707e7c2019-11-07 11:36:13 +05302 * Copyright 2018-present Open Networking Foundation
Shad Ansari7193ae22018-08-08 22:23:18 +00003
Girish Gowdraa707e7c2019-11-07 11:36:13 +05304 * 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 Ansari7193ae22018-08-08 22:23:18 +00007
Girish Gowdraa707e7c2019-11-07 11:36:13 +05308 * http://www.apache.org/licenses/LICENSE-2.0
Shad Ansari7193ae22018-08-08 22:23:18 +00009
Girish Gowdraa707e7c2019-11-07 11:36:13 +053010 * 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 Ansari7193ae22018-08-08 22:23:18 +000016
17#ifndef OPENOLT_CORE_H_
18#define OPENOLT_CORE_H_
19
20#include <grpc++/grpc++.h>
21using grpc::Status;
22#include <openolt.grpc.pb.h>
23#include "Queue.h"
24
25extern Queue<openolt::Indication> oltIndQ;
26
Shad Ansari627b5782018-08-13 22:49:32 +000027Status Enable_(int argc, char *argv[]);
Shad Ansari7193ae22018-08-08 22:23:18 +000028Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id,
29 const char *vendor_id, const char *vendor_specific, uint32_t pir);
30Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id,
31 const char *vendor_id, const char *vendor_specific);
32Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id,
33 const char *vendor_id, const char *vendor_specific);
34Status EnablePonIf_(uint32_t intf_id);
35Status DisablePonIf_(uint32_t intf_id);
36Status EnableUplinkIf_(uint32_t intf_id);
37Status DisableUplinkIf_(uint32_t intf_id);
38Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt);
Craig Lutgenecd353a2018-12-12 22:33:17 -060039Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, uint32_t port_no, const std::string pkt);
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000040Status UplinkPacketOut_(bcmolt_flow_id flow_id, uint32_t intf_id, const std::string pkt);
Craig Lutgen967a1d02018-11-27 10:41:51 -060041Status FlowAdd_(int32_t access_intf_id, int32_t onu_id, int32_t uni_id, uint32_t port_no,
Shad Ansari7193ae22018-08-08 22:23:18 +000042 uint32_t flow_id, const std::string flow_type,
Craig Lutgen967a1d02018-11-27 10:41:51 -060043 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 Ansari7193ae22018-08-08 22:23:18 +000046Status Disable_();
47Status Reenable_();
48
49
50static Status SchedAdd_(int intf_id, int onu_id, int agg_port_id);
51static Status SchedRemove_(int intf_id, int onu_id, int agg_port_id);
52
53static inline int mk_sched_id(int onu_id) {
54 return 1023 + onu_id;
55}
56
57static inline int mk_agg_port_id(int onu_id) {
58 return 1023 + onu_id;
59}
60
61#endif