Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 19 | #include "indications.h" |
| 20 | #include "server.h" |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 21 | #include "core.h" |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 22 | |
| 23 | extern "C" |
| 24 | { |
| 25 | #include <bal_api.h> |
| 26 | #include <bal_api_end.h> |
| 27 | } |
| 28 | |
| 29 | int main(int argc, char** argv) { |
| 30 | |
| 31 | if (argc < 5) { |
| 32 | std::cout << "Missing arguments" << std::endl; |
| 33 | exit(1); |
| 34 | } |
| 35 | |
| 36 | bcmbal_init(argc, argv, NULL); |
| 37 | |
| 38 | Status status = SubscribeIndication(); |
| 39 | if (!status.ok()) { |
| 40 | std::cout << "ERROR: SubscribeIndication failed - " |
| 41 | << status.error_code() << ": " << status.error_message() |
| 42 | << std::endl; |
| 43 | return 1; |
| 44 | } |
| 45 | |
| 46 | status = Enable_(); |
| 47 | if (!status.ok()) { |
| 48 | std::cout << "ERROR: Enable_ failed - " |
| 49 | << status.error_code() << ": " << status.error_message() |
| 50 | << std::endl; |
| 51 | return 1; |
| 52 | } |
| 53 | |
| 54 | RunServer(); |
| 55 | |
| 56 | return 0; |
| 57 | } |