wps_er.h
00001 #ifndef WPS_ER_H
00002 #define WPS_ER_H
00003
00004 struct wps_er_sta {
00005 struct wps_er_sta *next;
00006 struct wps_er_ap *ap;
00007 u8 addr[ETH_ALEN];
00008 u16 config_methods;
00009 u8 uuid[WPS_UUID_LEN];
00010 u8 pri_dev_type[8];
00011 u16 dev_passwd_id;
00012 int m1_received;
00013 char *manufacturer;
00014 char *model_name;
00015 char *model_number;
00016 char *serial_number;
00017 char *dev_name;
00018 struct wps_data *wps;
00019 struct http_client *http;
00020 };
00021
00022 struct wps_er_ap {
00023 struct wps_er_ap *next;
00024 struct wps_er *er;
00025 struct wps_er_sta *sta;
00026 struct in_addr addr;
00027 char *location;
00028 struct http_client *http;
00029 struct wps_data *wps;
00030
00031 u8 uuid[WPS_UUID_LEN];
00032 u8 pri_dev_type[8];
00033 u8 wps_state;
00034 u8 mac_addr[ETH_ALEN];
00035 char *friendly_name;
00036 char *manufacturer;
00037 char *manufacturer_url;
00038 char *model_description;
00039 char *model_name;
00040 char *model_number;
00041 char *model_url;
00042 char *serial_number;
00043 char *udn;
00044 char *upc;
00045
00046 char *scpd_url;
00047 char *control_url;
00048 char *event_sub_url;
00049
00050 int subscribed;
00051 unsigned int id;
00052
00053 struct wps_credential *ap_settings;
00054
00055 void (*m1_handler)(struct wps_er_ap *ap, struct wpabuf *m1);
00056 };
00057
00058 struct wps_er {
00059 struct wps_context *wps;
00060 char ifname[17];
00061 char *mac_addr_text;
00062 u8 mac_addr[ETH_ALEN];
00063 char *ip_addr_text;
00064 unsigned ip_addr;
00065 int multicast_sd;
00066 int ssdp_sd;
00067 struct wps_er_ap *ap;
00068 struct http_server *http_srv;
00069 int http_port;
00070 unsigned int next_ap_id;
00071 unsigned int event_id;
00072 };
00073
00074
00075
00076 void wps_er_ap_add(struct wps_er *er, const u8 *uuid, struct in_addr *addr,
00077 const char *location, int max_age);
00078 void wps_er_ap_remove(struct wps_er *er, struct in_addr *addr);
00079
00080
00081 int wps_er_ssdp_init(struct wps_er *er);
00082 void wps_er_ssdp_deinit(struct wps_er *er);
00083 void wps_er_send_ssdp_msearch(struct wps_er *er);
00084
00085 #endif
00086