3 * Copyright (c) 2000-2003 Intel Corporation
4 * Copyright (c) 2006-2007 Sony Corporation
5 * Copyright (c) 2008-2009 Atheros Communications
6 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
8 * See wps_upnp.c for more details on licensing and code history.
14 struct upnp_wps_device_sm;
18 struct upnp_wps_peer {
22 enum upnp_wps_wlanevent_type {
23 UPNP_WPS_WLANEVENT_TYPE_PROBE = 1,
24 UPNP_WPS_WLANEVENT_TYPE_EAP = 2
27 struct upnp_wps_device_ctx {
28 struct wpabuf * (*rx_req_get_device_info)(
29 void *priv, struct upnp_wps_peer *peer);
30 struct wpabuf * (*rx_req_put_message)(
31 void *priv, struct upnp_wps_peer *peer,
32 const struct wpabuf *msg);
33 struct wpabuf * (*rx_req_get_ap_settings)(void *priv,
34 const struct wpabuf *msg);
35 int (*rx_req_set_ap_settings)(void *priv, const struct wpabuf *msg);
36 int (*rx_req_del_ap_settings)(void *priv, const struct wpabuf *msg);
37 struct wpabuf * (*rx_req_get_sta_settings)(void *priv,
38 const struct wpabuf *msg);
39 int (*rx_req_set_sta_settings)(void *priv, const struct wpabuf *msg);
40 int (*rx_req_del_sta_settings)(void *priv, const struct wpabuf *msg);
41 int (*rx_req_put_wlan_response)(
42 void *priv, enum upnp_wps_wlanevent_type ev_type,
43 const u8 *mac_addr, const struct wpabuf *msg,
44 enum wps_msg_type msg_type);
45 int (*rx_req_set_selected_registrar)(void *priv,
46 const struct wpabuf *msg);
47 int (*rx_req_reboot_ap)(void *priv, const struct wpabuf *msg);
48 int (*rx_req_reset_ap)(void *priv, const struct wpabuf *msg);
49 int (*rx_req_reboot_sta)(void *priv, const struct wpabuf *msg);
50 int (*rx_req_reset_sta)(void *priv, const struct wpabuf *msg);
53 struct upnp_wps_device_sm *
54 upnp_wps_device_init(struct upnp_wps_device_ctx *ctx, struct wps_context *wps,
56 void upnp_wps_device_deinit(struct upnp_wps_device_sm *sm);
58 int upnp_wps_device_start(struct upnp_wps_device_sm *sm, char *net_if);
59 void upnp_wps_device_stop(struct upnp_wps_device_sm *sm);
61 int upnp_wps_device_send_wlan_event(struct upnp_wps_device_sm *sm,
62 const u8 from_mac_addr[ETH_ALEN],
63 enum upnp_wps_wlanevent_type ev_type,
64 const struct wpabuf *msg);
65 int upnp_wps_subscribers(struct upnp_wps_device_sm *sm);
67 #endif /* WPS_UPNP_H */