main_none.c 844 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * WPA Supplicant / Example program entrypoint
  3. * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #include "includes.h"
  9. #include "common.h"
  10. #include "wpa_supplicant_i.h"
  11. int main(int argc, char *argv[])
  12. {
  13. struct wpa_interface iface;
  14. int exitcode = 0;
  15. struct wpa_params params;
  16. struct wpa_global *global;
  17. memset(&params, 0, sizeof(params));
  18. params.wpa_debug_level = MSG_INFO;
  19. global = wpa_supplicant_init(&params);
  20. if (global == NULL)
  21. return -1;
  22. memset(&iface, 0, sizeof(iface));
  23. /* TODO: set interface parameters */
  24. if (wpa_supplicant_add_iface(global, &iface, NULL) == NULL)
  25. exitcode = -1;
  26. if (exitcode == 0)
  27. exitcode = wpa_supplicant_run(global);
  28. wpa_supplicant_deinit(global);
  29. return exitcode;
  30. }