hostapd: Update vendor branch to 0.6.10
[dragonfly.git] / contrib / hostapd / src / eap_common / eap_wsc_common.c
blob5d4e8cc1140cf16c1e87d765ae119f19be19c47f
1 /*
2 * EAP-WSC common routines for Wi-Fi Protected Setup
3 * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #include "includes.h"
17 #include "common.h"
18 #include "eap_defs.h"
19 #include "eap_common.h"
20 #include "wps/wps.h"
21 #include "eap_wsc_common.h"
23 struct wpabuf * eap_wsc_build_frag_ack(u8 id, u8 code)
25 struct wpabuf *msg;
27 msg = eap_msg_alloc(EAP_VENDOR_WFA, EAP_VENDOR_TYPE_WSC, 2, code, id);
28 if (msg == NULL) {
29 wpa_printf(MSG_ERROR, "EAP-WSC: Failed to allocate memory for "
30 "FRAG_ACK");
31 return NULL;
34 wpa_printf(MSG_DEBUG, "EAP-WSC: Send WSC/FRAG_ACK");
35 wpabuf_put_u8(msg, WSC_FRAG_ACK); /* Op-Code */
36 wpabuf_put_u8(msg, 0); /* Flags */
38 return msg;