hostapd: Introduce hostapd_interfaces_get_hapd()
This function will be used in DUP_NETWORK command implementation. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
d71bdfbd83
commit
b328145296
1 changed files with 25 additions and 13 deletions
|
@ -2589,6 +2589,29 @@ hostapd_global_ctrl_iface_fst_detach(struct hapd_interfaces *interfaces,
|
||||||
|
|
||||||
#endif /* CONFIG_FST */
|
#endif /* CONFIG_FST */
|
||||||
|
|
||||||
|
|
||||||
|
static struct hostapd_data *
|
||||||
|
hostapd_interfaces_get_hapd(struct hapd_interfaces *interfaces,
|
||||||
|
const char *ifname)
|
||||||
|
{
|
||||||
|
size_t i, j;
|
||||||
|
|
||||||
|
for (i = 0; i < interfaces->count; i++) {
|
||||||
|
struct hostapd_iface *iface = interfaces->iface[i];
|
||||||
|
|
||||||
|
for (j = 0; j < iface->num_bss; j++) {
|
||||||
|
struct hostapd_data *hapd;
|
||||||
|
|
||||||
|
hapd = iface->bss[j];
|
||||||
|
if (os_strcmp(ifname, hapd->conf->iface) == 0)
|
||||||
|
return hapd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int hostapd_global_ctrl_iface_ifname(struct hapd_interfaces *interfaces,
|
static int hostapd_global_ctrl_iface_ifname(struct hapd_interfaces *interfaces,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
char *buf, char *reply,
|
char *buf, char *reply,
|
||||||
|
@ -2596,20 +2619,9 @@ static int hostapd_global_ctrl_iface_ifname(struct hapd_interfaces *interfaces,
|
||||||
struct sockaddr_un *from,
|
struct sockaddr_un *from,
|
||||||
socklen_t fromlen)
|
socklen_t fromlen)
|
||||||
{
|
{
|
||||||
size_t i, j;
|
struct hostapd_data *hapd;
|
||||||
struct hostapd_data *hapd = NULL;
|
|
||||||
|
|
||||||
for (i = 0; hapd == NULL && i < interfaces->count; i++) {
|
|
||||||
struct hostapd_iface *iface = interfaces->iface[i];
|
|
||||||
|
|
||||||
for (j = 0; j < iface->num_bss; j++) {
|
|
||||||
hapd = iface->bss[j];
|
|
||||||
if (os_strcmp(ifname, hapd->conf->iface) == 0)
|
|
||||||
break;
|
|
||||||
hapd = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
hapd = hostapd_interfaces_get_hapd(interfaces, ifname);
|
||||||
if (hapd == NULL) {
|
if (hapd == NULL) {
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue