contrib/hostapd/hostapd/wme.c
int hostapd_eid_wmm_valid(struct hostapd_data *hapd, u8 *eid, size_t len)
{
	struct wmm_information_element *wmm;

	wpa_hexdump(MSG_MSGDUMP, "WMM IE", eid, len);

	if (len < sizeof(struct wmm_information_element)) {
		wpa_printf(MSG_DEBUG, "Too short WMM IE (len=%lu)",
			   (unsigned long) len);
		return -1;
	}

	wmm = (struct wmm_information_element *) eid;
	wpa_printf(MSG_DEBUG, "Validating WMM IE: OUI %02x:%02x:%02x  "
		   "OUI type %d  OUI sub-type %d  version %d  QoS info 0x%x",
		   wmm->oui[0], wmm->oui[1], wmm->oui[2], wmm->oui_type,
		   wmm->oui_subtype, wmm->version, wmm->qos_info);
	if (wmm->oui_subtype != WMM_OUI_SUBTYPE_INFORMATION_ELEMENT ||
	    wmm->version != WMM_VERSION) {
		wpa_printf(MSG_DEBUG, "Unsupported WMM IE Subtype/Version");
		return -1;
	}

	return 0;
}
/* This function is called when a station sends an association request with
 * WMM info element. The function returns zero on success or non-zero on any
 * error in WMM element. eid does not include Element ID and Length octets. */
This function is called when a station sends an association request with
WMM info element. The function returns zero on success or non-zero on any
error in WMM element. eid does not include Element ID and Length octets.
This function is called when a station sends an association request with WMM info element . The function returns zero on success or non - zero on any error in WMM element . eid does not include Element ID and Length octets .
int hostapd_eid_wmm_valid(struct hostapd_data *hapd, u8 *eid, size_t len)
{
	struct wmm_information_element *wmm;
	wpa_hexdump(MSG_MSGDUMP, "WMM IE", eid, len);
	if (len < sizeof(struct wmm_information_element)) {
		wpa_printf(MSG_DEBUG, "Too short WMM IE (len=%lu)",
			   (unsigned long) len);
		return -1;
	}
	wmm = (struct wmm_information_element *) eid;
	wpa_printf(MSG_DEBUG, "Validating WMM IE: OUI %02x:%02x:%02x  "
		   "OUI type %d  OUI sub-type %d  version %d  QoS info 0x%x",
		   wmm->oui[0], wmm->oui[1], wmm->oui[2], wmm->oui_type,
		   wmm->oui_subtype, wmm->version, wmm->qos_info);
	if (wmm->oui_subtype != WMM_OUI_SUBTYPE_INFORMATION_ELEMENT ||
	    wmm->version != WMM_VERSION) {
		wpa_printf(MSG_DEBUG, "Unsupported WMM IE Subtype/Version");
		return -1;
	}
	return 0;
}
int hostapd_eid_wmm_valid ( struct hostapd_data * hapd , u8 * eid , size_t len ) { struct wmm_information_element * wmm ; wpa_hexdump ( MSG_MSGDUMP , " " , eid , len ) ; if ( len < sizeof ( struct wmm_information_element ) ) { wpa_printf ( MSG_DEBUG , " " , ( unsigned long ) len ) ; return -1 ; } wmm = ( struct wmm_information_element * ) eid ; wpa_printf ( MSG_DEBUG , " " " " , wmm -> oui [ 0 ] , wmm -> oui [ 1 ] , wmm -> oui [ 2 ] , wmm -> oui_type , wmm -> oui_subtype , wmm -> version , wmm -> qos_info ) ; if ( wmm -> oui_subtype != WMM_OUI_SUBTYPE_INFORMATION_ELEMENT || wmm -> version != WMM_VERSION ) { wpa_printf ( MSG_DEBUG , " " ) ; return -1 ; } return 0 ; }
This function is called when a station sends an association request with
 WMM info element.
This function is called when a station sends an association request with WMM info element .