main.cc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #include <config.h>
  15. #include <lfc/lfc.h>
  16. #include <exceptions/exceptions.h>
  17. #include <log/logger_support.h>
  18. #include <log/logger_manager.h>
  19. #include <iostream>
  20. using namespace isc::lfc;
  21. using namespace std;
  22. /// This file contains the entry point (main() function for the
  23. /// standard LFC process, kea-lfc, component of the Kea software suite.
  24. /// It fetches the lfccontroller singleton instance and invokes its launch
  25. /// method.
  26. /// The exit value of the program will be EXIT_SUCCESS if there were no
  27. /// errors, EXIT_FAILURE otherwise.
  28. int main(int argc, char* argv[]) {
  29. int ret = EXIT_SUCCESS;
  30. lfcController lfcController;
  31. // Launch the controller passing in command line arguments.
  32. // Exit program with the controller's return code.
  33. try {
  34. // 'false' value disables test mode.
  35. lfcController.launch(argc, argv, false);
  36. } catch (const isc::Exception& ex) {
  37. std::cerr << "Service failed:" << ex.what() << std::endl;
  38. ret = EXIT_FAILURE;
  39. }
  40. return (ret);
  41. }