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" |
| 21 | |
| 22 | extern "C" |
| 23 | { |
| 24 | #include <bal_api.h> |
| 25 | #include <bal_api_end.h> |
| 26 | } |
| 27 | |
| 28 | int main(int argc, char** argv) { |
| 29 | |
| 30 | if (argc < 5) { |
| 31 | std::cout << "Missing arguments" << std::endl; |
| 32 | exit(1); |
| 33 | } |
| 34 | |
| 35 | bcmbal_init(argc, argv, NULL); |
| 36 | |
| 37 | Status status = SubscribeIndication(); |
| 38 | if (!status.ok()) { |
| 39 | std::cout << "ERROR: SubscribeIndication failed - " |
| 40 | << status.error_code() << ": " << status.error_message() |
| 41 | << std::endl; |
| 42 | return 1; |
| 43 | } |
| 44 | |
| 45 | status = Enable_(); |
| 46 | if (!status.ok()) { |
| 47 | std::cout << "ERROR: Enable_ failed - " |
| 48 | << status.error_code() << ": " << status.error_message() |
| 49 | << std::endl; |
| 50 | return 1; |
| 51 | } |
| 52 | |
| 53 | RunServer(); |
| 54 | |
| 55 | return 0; |
| 56 | } |