2009-11-28 20:14:36 +01:00
|
|
|
/*
|
|
|
|
* Wi-Fi Protected Setup - External Registrar
|
|
|
|
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2009-11-28 20:14:36 +01:00
|
|
|
*/
|
|
|
|
|
2009-11-21 16:26:23 +01:00
|
|
|
#ifndef WPS_ER_H
|
|
|
|
#define WPS_ER_H
|
|
|
|
|
2009-12-19 21:14:06 +01:00
|
|
|
#include "utils/list.h"
|
|
|
|
|
2009-11-21 16:26:23 +01:00
|
|
|
struct wps_er_sta {
|
2009-12-19 21:14:06 +01:00
|
|
|
struct dl_list list;
|
2009-11-21 16:26:23 +01:00
|
|
|
struct wps_er_ap *ap;
|
|
|
|
u8 addr[ETH_ALEN];
|
|
|
|
u16 config_methods;
|
|
|
|
u8 uuid[WPS_UUID_LEN];
|
|
|
|
u8 pri_dev_type[8];
|
|
|
|
u16 dev_passwd_id;
|
|
|
|
int m1_received;
|
|
|
|
char *manufacturer;
|
|
|
|
char *model_name;
|
|
|
|
char *model_number;
|
|
|
|
char *serial_number;
|
|
|
|
char *dev_name;
|
|
|
|
struct wps_data *wps;
|
|
|
|
struct http_client *http;
|
2010-05-27 14:22:44 +02:00
|
|
|
struct wps_credential *cred;
|
2009-11-21 16:26:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wps_er_ap {
|
2009-12-19 21:14:06 +01:00
|
|
|
struct dl_list list;
|
2009-11-21 16:26:23 +01:00
|
|
|
struct wps_er *er;
|
2009-12-19 21:14:06 +01:00
|
|
|
struct dl_list sta; /* list of STAs/Enrollees using this AP */
|
2009-11-21 16:26:23 +01:00
|
|
|
struct in_addr addr;
|
|
|
|
char *location;
|
|
|
|
struct http_client *http;
|
|
|
|
struct wps_data *wps;
|
|
|
|
|
|
|
|
u8 uuid[WPS_UUID_LEN];
|
|
|
|
u8 pri_dev_type[8];
|
|
|
|
u8 wps_state;
|
|
|
|
u8 mac_addr[ETH_ALEN];
|
|
|
|
char *friendly_name;
|
|
|
|
char *manufacturer;
|
|
|
|
char *manufacturer_url;
|
|
|
|
char *model_description;
|
|
|
|
char *model_name;
|
|
|
|
char *model_number;
|
|
|
|
char *model_url;
|
|
|
|
char *serial_number;
|
|
|
|
char *udn;
|
|
|
|
char *upc;
|
|
|
|
|
|
|
|
char *scpd_url;
|
|
|
|
char *control_url;
|
|
|
|
char *event_sub_url;
|
|
|
|
|
|
|
|
int subscribed;
|
2009-12-19 22:20:22 +01:00
|
|
|
u8 sid[WPS_UUID_LEN];
|
2009-11-21 16:26:23 +01:00
|
|
|
unsigned int id;
|
|
|
|
|
|
|
|
struct wps_credential *ap_settings;
|
|
|
|
|
|
|
|
void (*m1_handler)(struct wps_er_ap *ap, struct wpabuf *m1);
|
|
|
|
};
|
|
|
|
|
2010-10-25 21:22:07 +02:00
|
|
|
struct wps_er_ap_settings {
|
|
|
|
struct dl_list list;
|
|
|
|
u8 uuid[WPS_UUID_LEN];
|
|
|
|
struct wps_credential ap_settings;
|
|
|
|
};
|
|
|
|
|
2009-11-21 16:26:23 +01:00
|
|
|
struct wps_er {
|
|
|
|
struct wps_context *wps;
|
|
|
|
char ifname[17];
|
|
|
|
u8 mac_addr[ETH_ALEN]; /* mac addr of network i.f. we use */
|
|
|
|
char *ip_addr_text; /* IP address of network i.f. we use */
|
|
|
|
unsigned ip_addr; /* IP address of network i.f. we use (host order) */
|
|
|
|
int multicast_sd;
|
|
|
|
int ssdp_sd;
|
2009-12-19 21:14:06 +01:00
|
|
|
struct dl_list ap;
|
2009-12-19 22:20:22 +01:00
|
|
|
struct dl_list ap_unsubscribing;
|
2010-10-25 21:22:07 +02:00
|
|
|
struct dl_list ap_settings;
|
2009-11-21 16:26:23 +01:00
|
|
|
struct http_server *http_srv;
|
|
|
|
int http_port;
|
|
|
|
unsigned int next_ap_id;
|
2009-11-21 17:15:37 +01:00
|
|
|
unsigned int event_id;
|
2009-12-19 22:20:22 +01:00
|
|
|
int deinitializing;
|
2009-12-19 22:47:54 +01:00
|
|
|
void (*deinit_done_cb)(void *ctx);
|
|
|
|
void *deinit_done_ctx;
|
2010-05-27 14:23:55 +02:00
|
|
|
struct in_addr filter_addr;
|
2010-07-21 07:06:28 +02:00
|
|
|
int skip_set_sel_reg;
|
2010-10-25 20:41:10 +02:00
|
|
|
const u8 *set_sel_reg_uuid_filter;
|
2009-11-21 16:26:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* wps_er.c */
|
|
|
|
void wps_er_ap_add(struct wps_er *er, const u8 *uuid, struct in_addr *addr,
|
|
|
|
const char *location, int max_age);
|
|
|
|
void wps_er_ap_remove(struct wps_er *er, struct in_addr *addr);
|
2010-10-25 21:22:07 +02:00
|
|
|
int wps_er_ap_cache_settings(struct wps_er *er, struct in_addr *addr);
|
2009-11-21 16:26:23 +01:00
|
|
|
|
|
|
|
/* wps_er_ssdp.c */
|
|
|
|
int wps_er_ssdp_init(struct wps_er *er);
|
|
|
|
void wps_er_ssdp_deinit(struct wps_er *er);
|
|
|
|
void wps_er_send_ssdp_msearch(struct wps_er *er);
|
|
|
|
|
|
|
|
#endif /* WPS_ER_H */
|