VOL-1156 Re-factor openolt driver
Allows re-use of common code among backends for multiple hardware
and simulators.
Change-Id: If5f0147d2eef7c1f9cbcda394d06a2070b4be275
diff --git a/common/main.cc b/common/main.cc
new file mode 100644
index 0000000..2898219
--- /dev/null
+++ b/common/main.cc
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <iostream>
+
+#include "server.h"
+#include "core.h"
+
+int main(int argc, char** argv) {
+
+ Status status = Enable_(argc, argv);
+ if (!status.ok()) {
+ std::cout << "ERROR: Enable_ failed - "
+ << status.error_code() << ": " << status.error_message()
+ << std::endl;
+ return 1;
+ }
+
+ RunServer();
+
+ return 0;
+}