00001 /* 00002 * EAP-WSC common routines for Wi-Fi Protected Setup 00003 * Copyright (c) 2007, Jouni Malinen <j@w1.fi> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation. 00008 * 00009 * Alternatively, this software may be distributed under the terms of BSD 00010 * license. 00011 * 00012 * See README and COPYING for more details. 00013 */ 00014 00015 #include "includes.h" 00016 00017 #include "common.h" 00018 #include "eap_defs.h" 00019 #include "eap_common.h" 00020 #include "wps/wps.h" 00021 #include "eap_wsc_common.h" 00022 00023 struct wpabuf * eap_wsc_build_frag_ack(u8 id, u8 code) 00024 { 00025 struct wpabuf *msg; 00026 00027 msg = eap_msg_alloc(EAP_VENDOR_WFA, EAP_VENDOR_TYPE_WSC, 2, code, id); 00028 if (msg == NULL) { 00029 wpa_printf(MSG_ERROR, "EAP-WSC: Failed to allocate memory for " 00030 "FRAG_ACK"); 00031 return NULL; 00032 } 00033 00034 wpa_printf(MSG_DEBUG, "EAP-WSC: Send WSC/FRAG_ACK"); 00035 wpabuf_put_u8(msg, WSC_FRAG_ACK); /* Op-Code */ 00036 wpabuf_put_u8(msg, 0); /* Flags */ 00037 00038 return msg; 00039 }