blob: 7781ef9ea3ae586480eead62e8fd5eae846c4a8e [file] [log] [blame]
Shad Ansari7193ae22018-08-08 22:23:18 +00001/*
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#include <iostream>
19#include <memory>
20#include <string>
Shad Ansari627b5782018-08-13 22:49:32 +000021#include <unistd.h>
Shad Ansari7193ae22018-08-08 22:23:18 +000022
23#include "Queue.h"
24#include <iostream>
25#include <sstream>
26
27#include "core.h"
Shad Ansari627b5782018-08-13 22:49:32 +000028#include "state.h"
Shad Ansari7193ae22018-08-08 22:23:18 +000029
Shad Ansari627b5782018-08-13 22:49:32 +000030State state;
31
32void* RunSim(void *) {
33 while (!state.is_connected()) {
34 sleep(5);
35 }
36
37 // Send Olt up indication
38 {
39 openolt::Indication ind;
40 openolt::OltIndication* olt_ind = new openolt::OltIndication;
41 olt_ind->set_oper_state("up");
42 ind.set_allocated_olt_ind(olt_ind);
43 std::cout << "olt indication, oper_state:" << ind.olt_ind().oper_state() << std::endl;
44 oltIndQ.push(ind);
45 }
46
47 // TODO - Add interface and onu indication events
48}
49
50Status Enable_(int argc, char *argv[]) {
51 pthread_t simThread;
52
53 pthread_create(&simThread, NULL, RunSim, NULL);
Shad Ansari7193ae22018-08-08 22:23:18 +000054 return Status::OK;
55}
56
57Status Disable_() {
58 return Status::OK;
59}
60
61Status Reenable_() {
62 return Status::OK;
63}
64
65Status EnablePonIf_(uint32_t intf_id) {
66 return Status::OK;
67}
68
69Status DisableUplinkIf_(uint32_t intf_id) {
70 return Status::OK;
71}
72
73Status EnableUplinkIf_(uint32_t intf_id) {
74 return Status::OK;
75}
76
77Status DisablePonIf_(uint32_t intf_id) {
78 return Status::OK;
79}
80
81Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id,
82 const char *vendor_id, const char *vendor_specific, uint32_t pir) {
83 return Status::OK;
84}
85
86Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id,
87 const char *vendor_id, const char *vendor_specific) {
88 return Status::OK;
89}
90
91Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id,
92 const char *vendor_id, const char *vendor_specific) {
93 return Status::OK;;
94}
95
96Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) {
97 return Status::OK;
98}
99
100Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) {
101 return Status::OK;
102}
103
104Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt) {
105 return Status::OK;
106}
107
108Status FlowAdd_(uint32_t onu_id,
109 uint32_t flow_id, const std::string flow_type,
110 uint32_t access_intf_id, uint32_t network_intf_id,
111 uint32_t gemport_id, uint32_t priority_value,
112 const ::openolt::Classifier& classifier,
113 const ::openolt::Action& action) {
114 return Status::OK;
115}
116
117Status SchedAdd_(int intf_id, int onu_id, int agg_port_id) {
118 return Status::OK;
119}
120
121Status SchedRemove_(int intf_id, int onu_id, int agg_port_id) {
122 return Status::OK;
123}
Shad Ansari627b5782018-08-13 22:49:32 +0000124
125Status FlowRemove_(uint32_t flow_id, const std::string flow_type) {
126 return Status::OK;
127}
128
Nicolas Palpacuer6a63ea92018-09-05 17:21:37 -0400129void stats_collection() {
Shad Ansari627b5782018-08-13 22:49:32 +0000130}
Nicolas Palpacuerdff96792018-09-06 14:59:32 -0400131
132Status GetDeviceInfo_(openolt::DeviceInfo* deviceInfo) {
133 return Status::OK;
134}