xref: /freebsd/contrib/wpa/src/wps/wps_upnp.h (revision b9f654b163bce26de79705e77b872427c9f2afa1)
1 /*
2  * UPnP WPS Device
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>
7  *
8  * See wps_upnp.c for more details on licensing and code history.
9  */
10 
11 #ifndef WPS_UPNP_H
12 #define WPS_UPNP_H
13 
14 #include "utils/list.h"
15 
16 struct upnp_wps_device_sm;
17 struct wps_context;
18 struct wps_data;
19 
20 struct upnp_wps_peer {
21 	struct dl_list list;
22 	struct wps_data *wps;
23 };
24 
25 enum upnp_wps_wlanevent_type {
26 	UPNP_WPS_WLANEVENT_TYPE_PROBE = 1,
27 	UPNP_WPS_WLANEVENT_TYPE_EAP = 2
28 };
29 
30 struct upnp_wps_device_ctx {
31 	int (*rx_req_put_wlan_response)(
32 		void *priv, enum upnp_wps_wlanevent_type ev_type,
33 		const u8 *mac_addr, const struct wpabuf *msg,
34 		enum wps_msg_type msg_type);
35 
36 	char *ap_pin;
37 };
38 
39 struct upnp_wps_device_sm *
40 upnp_wps_device_init(struct upnp_wps_device_ctx *ctx, struct wps_context *wps,
41 		     void *priv, char *net_if);
42 void upnp_wps_device_deinit(struct upnp_wps_device_sm *sm, void *priv);
43 
44 int upnp_wps_device_send_wlan_event(struct upnp_wps_device_sm *sm,
45 				    const u8 from_mac_addr[ETH_ALEN],
46 				    enum upnp_wps_wlanevent_type ev_type,
47 				    const struct wpabuf *msg);
48 int upnp_wps_subscribers(struct upnp_wps_device_sm *sm);
49 int upnp_wps_set_ap_pin(struct upnp_wps_device_sm *sm, const char *ap_pin);
50 
51 #endif /* WPS_UPNP_H */
52