wps_er.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Wi-Fi Protected Setup - External Registrar
  3. * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef WPS_ER_H
  9. #define WPS_ER_H
  10. #include "utils/list.h"
  11. struct wps_er_sta {
  12. struct dl_list list;
  13. struct wps_er_ap *ap;
  14. u8 addr[ETH_ALEN];
  15. u16 config_methods;
  16. u8 uuid[WPS_UUID_LEN];
  17. u8 pri_dev_type[8];
  18. u16 dev_passwd_id;
  19. int m1_received;
  20. char *manufacturer;
  21. char *model_name;
  22. char *model_number;
  23. char *serial_number;
  24. char *dev_name;
  25. struct wps_data *wps;
  26. struct http_client *http;
  27. struct wps_credential *cred;
  28. };
  29. struct wps_er_ap {
  30. struct dl_list list;
  31. struct wps_er *er;
  32. struct dl_list sta; /* list of STAs/Enrollees using this AP */
  33. struct in_addr addr;
  34. char *location;
  35. struct http_client *http;
  36. struct wps_data *wps;
  37. u8 uuid[WPS_UUID_LEN];
  38. u8 pri_dev_type[8];
  39. u8 wps_state;
  40. u8 mac_addr[ETH_ALEN];
  41. char *friendly_name;
  42. char *manufacturer;
  43. char *manufacturer_url;
  44. char *model_description;
  45. char *model_name;
  46. char *model_number;
  47. char *model_url;
  48. char *serial_number;
  49. char *udn;
  50. char *upc;
  51. char *scpd_url;
  52. char *control_url;
  53. char *event_sub_url;
  54. int subscribed;
  55. u8 sid[WPS_UUID_LEN];
  56. unsigned int id;
  57. struct wps_credential *ap_settings;
  58. void (*m1_handler)(struct wps_er_ap *ap, struct wpabuf *m1);
  59. };
  60. struct wps_er_ap_settings {
  61. struct dl_list list;
  62. u8 uuid[WPS_UUID_LEN];
  63. struct wps_credential ap_settings;
  64. };
  65. struct wps_er {
  66. struct wps_context *wps;
  67. char ifname[17];
  68. int forced_ifname;
  69. u8 mac_addr[ETH_ALEN]; /* mac addr of network i.f. we use */
  70. char *ip_addr_text; /* IP address of network i.f. we use */
  71. unsigned ip_addr; /* IP address of network i.f. we use (host order) */
  72. int multicast_sd;
  73. int ssdp_sd;
  74. struct dl_list ap;
  75. struct dl_list ap_unsubscribing;
  76. struct dl_list ap_settings;
  77. struct http_server *http_srv;
  78. int http_port;
  79. unsigned int next_ap_id;
  80. unsigned int event_id;
  81. int deinitializing;
  82. void (*deinit_done_cb)(void *ctx);
  83. void *deinit_done_ctx;
  84. struct in_addr filter_addr;
  85. int skip_set_sel_reg;
  86. const u8 *set_sel_reg_uuid_filter;
  87. };
  88. /* wps_er.c */
  89. void wps_er_ap_add(struct wps_er *er, const u8 *uuid, struct in_addr *addr,
  90. const char *location, int max_age);
  91. void wps_er_ap_remove(struct wps_er *er, struct in_addr *addr);
  92. int wps_er_ap_cache_settings(struct wps_er *er, struct in_addr *addr);
  93. /* wps_er_ssdp.c */
  94. int wps_er_ssdp_init(struct wps_er *er);
  95. void wps_er_ssdp_deinit(struct wps_er *er);
  96. void wps_er_send_ssdp_msearch(struct wps_er *er);
  97. #endif /* WPS_ER_H */