projects
/
libeap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
14f7938
)
Use hostapd driver op wrapper for send_mgmt_frame
author
Jouni Malinen
<j@w1.fi>
Thu, 24 Dec 2009 18:13:44 +0000
(20:13 +0200)
committer
Jouni Malinen
<j@w1.fi>
Thu, 24 Dec 2009 18:13:44 +0000
(20:13 +0200)
hostapd/ap_drv_ops.c
patch
|
blob
|
history
hostapd/beacon.c
patch
|
blob
|
history
hostapd/driver_i.h
patch
|
blob
|
history
hostapd/hostapd.c
patch
|
blob
|
history
hostapd/hostapd.h
patch
|
blob
|
history
hostapd/ieee802_11.c
patch
|
blob
|
history
hostapd/sta_info.c
patch
|
blob
|
history
hostapd/wme.c
patch
|
blob
|
history
diff --git
a/hostapd/ap_drv_ops.c
b/hostapd/ap_drv_ops.c
index
2d31829
..
c560f1e
100644
(file)
--- a/
hostapd/ap_drv_ops.c
+++ b/
hostapd/ap_drv_ops.c
@@
-30,7
+30,17
@@
static int hostapd_set_ap_wps_ie(struct hostapd_data *hapd,
}
}
+static int hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg,
+ size_t len)
+{
+ if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
+ return 0;
+ return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
+}
+
+
void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
{
ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
{
ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
+ ops->send_mgmt_frame = hostapd_send_mgmt_frame;
}
}
diff --git
a/hostapd/beacon.c
b/hostapd/beacon.c
index
6e2afe8
..
41fa78f
100644
(file)
--- a/
hostapd/beacon.c
+++ b/
hostapd/beacon.c
@@
-315,7
+315,7
@@
void handle_probe_req(struct hostapd_data *hapd,
}
#endif /* CONFIG_WPS */
}
#endif /* CONFIG_WPS */
- if (h
ostapd_
send_mgmt_frame(hapd, resp, pos - (u8 *) resp) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, resp, pos - (u8 *) resp) < 0)
perror("handle_probe_req: send");
os_free(resp);
perror("handle_probe_req: send");
os_free(resp);
diff --git
a/hostapd/driver_i.h
b/hostapd/driver_i.h
index
f589efd
..
9a1d56d
100644
(file)
--- a/
hostapd/driver_i.h
+++ b/
hostapd/driver_i.h
@@
-185,14
+185,6
@@
hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
}
static inline int
}
static inline int
-hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg, size_t len)
-{
- if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
- return 0;
- return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
-}
-
-static inline int
hostapd_set_countermeasures(struct hostapd_data *hapd, int enabled)
{
if (hapd->driver == NULL ||
hostapd_set_countermeasures(struct hostapd_data *hapd, int enabled)
{
if (hapd->driver == NULL ||
diff --git
a/hostapd/hostapd.c
b/hostapd/hostapd.c
index
57154e0
..
824e70e
100644
(file)
--- a/
hostapd/hostapd.c
+++ b/
hostapd/hostapd.c
@@
-710,7
+710,7
@@
static int hostapd_wpa_auth_send_ft_action(void *ctx, const u8 *dst,
os_memcpy(m->bssid, hapd->own_addr, ETH_ALEN);
os_memcpy(&m->u, data, data_len);
os_memcpy(m->bssid, hapd->own_addr, ETH_ALEN);
os_memcpy(&m->u, data, data_len);
- res = h
ostapd_
send_mgmt_frame(hapd, (u8 *) m, mlen);
+ res = h
apd->drv.
send_mgmt_frame(hapd, (u8 *) m, mlen);
os_free(m);
return res;
}
os_free(m);
return res;
}
diff --git
a/hostapd/hostapd.h
b/hostapd/hostapd.h
index
3d188e0
..
bf50dfa
100644
(file)
--- a/
hostapd/hostapd.h
+++ b/
hostapd/hostapd.h
@@
-45,6
+45,8
@@
struct hostapd_driver_ops {
int (*set_ap_wps_ie)(struct hostapd_data *hapd,
const struct wpabuf *beacon,
const struct wpabuf *probe);
int (*set_ap_wps_ie)(struct hostapd_data *hapd,
const struct wpabuf *beacon,
const struct wpabuf *probe);
+ int (*send_mgmt_frame)(struct hostapd_data *hapd, const void *msg,
+ size_t len);
};
/**
};
/**
diff --git
a/hostapd/ieee802_11.c
b/hostapd/ieee802_11.c
index
df18a93
..
f3dc81a
100644
(file)
--- a/
hostapd/ieee802_11.c
+++ b/
hostapd/ieee802_11.c
@@
-211,8
+211,8
@@
void ieee802_11_send_deauth(struct hostapd_data *hapd, const u8 *addr,
os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN);
os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN);
mgmt.u.deauth.reason_code = host_to_le16(reason);
os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN);
os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN);
mgmt.u.deauth.reason_code = host_to_le16(reason);
- if (h
ostapd_
send_mgmt_frame(hapd, &mgmt, IEEE80211_HDRLEN +
- sizeof(mgmt.u.deauth)) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, &mgmt, IEEE80211_HDRLEN +
+
sizeof(mgmt.u.deauth)) < 0)
perror("ieee802_11_send_deauth: send");
}
perror("ieee802_11_send_deauth: send");
}
@@
-308,7
+308,7
@@
static void send_auth_reply(struct hostapd_data *hapd,
" auth_alg=%d auth_transaction=%d resp=%d (IE len=%lu)",
MAC2STR(dst), auth_alg, auth_transaction,
resp, (unsigned long) ies_len);
" auth_alg=%d auth_transaction=%d resp=%d (IE len=%lu)",
MAC2STR(dst), auth_alg, auth_transaction,
resp, (unsigned long) ies_len);
- if (h
ostapd_
send_mgmt_frame(hapd, reply, rlen) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, reply, rlen) < 0)
perror("send_auth_reply: send");
os_free(buf);
perror("send_auth_reply: send");
os_free(buf);
@@
-816,7
+816,7
@@
static void send_deauth(struct hostapd_data *hapd, const u8 *addr,
send_len = IEEE80211_HDRLEN + sizeof(reply.u.deauth);
reply.u.deauth.reason_code = host_to_le16(reason_code);
send_len = IEEE80211_HDRLEN + sizeof(reply.u.deauth);
reply.u.deauth.reason_code = host_to_le16(reason_code);
- if (h
ostapd_
send_mgmt_frame(hapd, &reply, send_len) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, &reply, send_len) < 0)
wpa_printf(MSG_INFO, "Failed to send deauth: %s",
strerror(errno));
}
wpa_printf(MSG_INFO, "Failed to send deauth: %s",
strerror(errno));
}
@@
-877,7
+877,7
@@
static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
send_len += p - reply->u.assoc_resp.variable;
send_len += p - reply->u.assoc_resp.variable;
- if (h
ostapd_
send_mgmt_frame(hapd, reply, send_len) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, reply, send_len) < 0)
wpa_printf(MSG_INFO, "Failed to send assoc resp: %s",
strerror(errno));
}
wpa_printf(MSG_INFO, "Failed to send assoc resp: %s",
strerror(errno));
}
@@
-1187,7
+1187,7
@@
void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,
os_memcpy(mgmt.u.action.u.sa_query_req.trans_id, trans_id,
WLAN_SA_QUERY_TR_ID_LEN);
end = mgmt.u.action.u.sa_query_req.trans_id + WLAN_SA_QUERY_TR_ID_LEN;
os_memcpy(mgmt.u.action.u.sa_query_req.trans_id, trans_id,
WLAN_SA_QUERY_TR_ID_LEN);
end = mgmt.u.action.u.sa_query_req.trans_id + WLAN_SA_QUERY_TR_ID_LEN;
- if (h
ostapd_
send_mgmt_frame(hapd, &mgmt, end - (u8 *) &mgmt) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, &mgmt, end - (u8 *) &mgmt) < 0)
perror("ieee802_11_send_sa_query_req: send");
}
perror("ieee802_11_send_sa_query_req: send");
}
@@
-1337,7
+1337,7
@@
static void handle_action(struct hostapd_data *hapd,
os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN);
resp->u.action.category |= 0x80;
os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN);
resp->u.action.category |= 0x80;
- h
ostapd_
send_mgmt_frame(hapd, resp, len);
+ h
apd->drv.
send_mgmt_frame(hapd, resp, len);
os_free(resp);
}
}
os_free(resp);
}
}
diff --git
a/hostapd/sta_info.c
b/hostapd/sta_info.c
index
4d9ba42
..
2c82cec
100644
(file)
--- a/
hostapd/sta_info.c
+++ b/
hostapd/sta_info.c
@@
-317,7
+317,7
@@
void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
ETH_ALEN);
os_memcpy(hdr.IEEE80211_SA_FROMDS, hapd->own_addr, ETH_ALEN);
ETH_ALEN);
os_memcpy(hdr.IEEE80211_SA_FROMDS, hapd->own_addr, ETH_ALEN);
- if (h
ostapd_
send_mgmt_frame(hapd, &hdr, sizeof(hdr)) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, &hdr, sizeof(hdr)) < 0)
perror("ap_handle_timer: send");
#endif /* CONFIG_NATIVE_WINDOWS */
} else if (sta->timeout_next != STA_REMOVE) {
perror("ap_handle_timer: send");
#endif /* CONFIG_NATIVE_WINDOWS */
} else if (sta->timeout_next != STA_REMOVE) {
diff --git
a/hostapd/wme.c
b/hostapd/wme.c
index
f539e98
..
a575fbc
100644
(file)
--- a/
hostapd/wme.c
+++ b/
hostapd/wme.c
@@
-20,7
+20,7
@@
#include "ieee802_11.h"
#include "wme.h"
#include "sta_info.h"
#include "ieee802_11.h"
#include "wme.h"
#include "sta_info.h"
-#include "
driver_i
.h"
+#include "
config
.h"
/* TODO: maintain separate sequence and fragment numbers for each AC
/* TODO: maintain separate sequence and fragment numbers for each AC
@@
-144,7
+144,7
@@
static void wmm_send_action(struct hostapd_data *hapd, const u8 *addr,
os_memcpy(t, tspec, sizeof(struct wmm_tspec_element));
len = ((u8 *) (t + 1)) - buf;
os_memcpy(t, tspec, sizeof(struct wmm_tspec_element));
len = ((u8 *) (t + 1)) - buf;
- if (h
ostapd_
send_mgmt_frame(hapd, m, len) < 0)
+ if (h
apd->drv.
send_mgmt_frame(hapd, m, len) < 0)
perror("wmm_send_action: send");
}
perror("wmm_send_action: send");
}