wps_upnp.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef WPS_UPNP_H
  11. #define WPS_UPNP_H
  12. #include "utils/list.h"
  13. struct upnp_wps_device_sm;
  14. struct wps_context;
  15. struct wps_data;
  16. struct upnp_wps_peer {
  17. struct dl_list list;
  18. struct wps_data *wps;
  19. };
  20. enum upnp_wps_wlanevent_type {
  21. UPNP_WPS_WLANEVENT_TYPE_PROBE = 1,
  22. UPNP_WPS_WLANEVENT_TYPE_EAP = 2
  23. };
  24. struct upnp_wps_device_ctx {
  25. int (*rx_req_put_wlan_response)(
  26. void *priv, enum upnp_wps_wlanevent_type ev_type,
  27. const u8 *mac_addr, const struct wpabuf *msg,
  28. enum wps_msg_type msg_type);
  29. char *ap_pin;
  30. };
  31. struct upnp_wps_device_sm *
  32. upnp_wps_device_init(struct upnp_wps_device_ctx *ctx, struct wps_context *wps,
  33. void *priv, char *net_if);
  34. void upnp_wps_device_deinit(struct upnp_wps_device_sm *sm, void *priv);
  35. int upnp_wps_device_send_wlan_event(struct upnp_wps_device_sm *sm,
  36. const u8 from_mac_addr[ETH_ALEN],
  37. enum upnp_wps_wlanevent_type ev_type,
  38. const struct wpabuf *msg);
  39. int upnp_wps_subscribers(struct upnp_wps_device_sm *sm);
  40. int upnp_wps_set_ap_pin(struct upnp_wps_device_sm *sm, const char *ap_pin);
  41. #endif /* WPS_UPNP_H */