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