1189251Ssam/*
2189251Ssam * EAP-WSC common routines for Wi-Fi Protected Setup
3189251Ssam * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
4189251Ssam *
5252726Srpaulo * This software may be distributed under the terms of the BSD license.
6252726Srpaulo * See README for more details.
7189251Ssam */
8189251Ssam
9189251Ssam#include "includes.h"
10189251Ssam
11189251Ssam#include "common.h"
12189251Ssam#include "eap_defs.h"
13189251Ssam#include "eap_common.h"
14189251Ssam#include "wps/wps.h"
15189251Ssam#include "eap_wsc_common.h"
16189251Ssam
17189251Ssamstruct wpabuf * eap_wsc_build_frag_ack(u8 id, u8 code)
18189251Ssam{
19189251Ssam	struct wpabuf *msg;
20189251Ssam
21189251Ssam	msg = eap_msg_alloc(EAP_VENDOR_WFA, EAP_VENDOR_TYPE_WSC, 2, code, id);
22189251Ssam	if (msg == NULL) {
23189251Ssam		wpa_printf(MSG_ERROR, "EAP-WSC: Failed to allocate memory for "
24189251Ssam			   "FRAG_ACK");
25189251Ssam		return NULL;
26189251Ssam	}
27189251Ssam
28189251Ssam	wpa_printf(MSG_DEBUG, "EAP-WSC: Send WSC/FRAG_ACK");
29189251Ssam	wpabuf_put_u8(msg, WSC_FRAG_ACK); /* Op-Code */
30189251Ssam	wpabuf_put_u8(msg, 0); /* Flags */
31189251Ssam
32189251Ssam	return msg;
33189251Ssam}
34