6fba78beebaf8b4fee899512067ba7438e90e9c2
[libeap.git] / hostapd / ap_drv_ops.c
1 /*
2  * hostapd - Driver operations
3  * Copyright (c) 2009, 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 "hostapd.h"
19 #include "driver_i.h"
20
21
22 static int hostapd_set_ap_wps_ie(struct hostapd_data *hapd,
23                                  const u8 *beacon_ie, size_t beacon_ie_len,
24                                  const u8 *probe_resp_ie,
25                                  size_t probe_resp_ie_len)
26 {
27         if (hostapd_set_wps_beacon_ie(hapd, hapd->wps_beacon_ie,
28                                       hapd->wps_beacon_ie_len) < 0 ||
29             hostapd_set_wps_probe_resp_ie(hapd, hapd->wps_probe_resp_ie,
30                                           hapd->wps_probe_resp_ie_len) < 0)
31                 return -1;
32         return 0;
33 }
34
35
36 void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
37 {
38         ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
39 }