blob: 652378e350393266fe1411c7b7165517e39c75eb [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#include <iostream>
18#include <unistd.h>
19#include <pthread.h>
20
21#include "server.h"
22#include "core.h"
23#include "state.h"
24
25void* RunSim(void *) {
26 while (!state::is_connected()) {
27 sleep(5);
28 }
29
30 // Send Olt up indication
31 {
32 openolt::Indication ind;
33 openolt::OltIndication* olt_ind = new openolt::OltIndication;
34 olt_ind->set_oper_state("up");
35 ind.set_allocated_olt_ind(olt_ind);
36 std::cout << "olt indication, oper_state:" << ind.olt_ind().oper_state() << std::endl;
37 oltIndQ.push(ind);
38 }
39
40 // TODO - Add interface and onu indication events
41}
42
43int main(int argc, char** argv) {
44 pthread_t simThread;
45
46 pthread_create(&simThread, NULL, RunSim, NULL);
47 RunServer();
48
49 return 0;
50}