Merge branch 'vendor/MDOCML'
[dragonfly.git] / contrib / wpa_supplicant / wpa_supplicant / main_none.c
1 /*
2  * WPA Supplicant / Example program entrypoint
3  * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #include "includes.h"
16
17 #include "common.h"
18 #include "wpa_supplicant_i.h"
19
20 int main(int argc, char *argv[])
21 {
22         struct wpa_interface iface;
23         int exitcode = 0;
24         struct wpa_params params;
25         struct wpa_global *global;
26
27         memset(&params, 0, sizeof(params));
28         params.wpa_debug_level = MSG_INFO;
29
30         global = wpa_supplicant_init(&params);
31         if (global == NULL)
32                 return -1;
33
34         memset(&iface, 0, sizeof(iface));
35         /* TODO: set interface parameters */
36
37         if (wpa_supplicant_add_iface(global, &iface) == NULL)
38                 exitcode = -1;
39
40         if (exitcode == 0)
41                 exitcode = wpa_supplicant_run(global);
42
43         wpa_supplicant_deinit(global);
44
45         return exitcode;
46 }