Remove src/drivers/scan_helpers.c
Most of this file was already moved into wpa_supplicant/scan.c and we can remove the file completely by having couple of small helper functions copied to the remaining users outside core wpa_supplicant code.master
parent
9ba9fa07cc
commit
d1f9c410c1
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant - Helper functions for scan result processing
|
||||
* Copyright (c) 2007-2008, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "drivers/driver.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
|
||||
|
||||
const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie)
|
||||
{
|
||||
const u8 *end, *pos;
|
||||
|
||||
pos = (const u8 *) (res + 1);
|
||||
end = pos + res->ie_len;
|
||||
|
||||
while (pos + 1 < end) {
|
||||
if (pos + 2 + pos[1] > end)
|
||||
break;
|
||||
if (pos[0] == ie)
|
||||
return pos;
|
||||
pos += 2 + pos[1];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void wpa_scan_results_free(struct wpa_scan_results *res)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (res == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < res->num; i++)
|
||||
os_free(res->res[i]);
|
||||
os_free(res->res);
|
||||
os_free(res);
|
||||
}
|
Loading…
Reference in New Issue