p2p_i.h revision 8d520ff1dc2da35cdca849e982051b86468016d8
18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/*
28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * P2P - Internal definitions for P2P module
38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2009-2010, Atheros Communications
48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
58d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * This program is free software; you can redistribute it and/or modify
68d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * it under the terms of the GNU General Public License version 2 as
78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * published by the Free Software Foundation.
88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Alternatively, this software may be distributed under the terms of BSD
108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * license.
118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * See README and COPYING for more details.
138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef P2P_I_H
168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_I_H
178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "utils/list.h"
198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "p2p.h"
208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* TODO: add removal of expired P2P device entries */
228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtenum p2p_go_state {
248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	UNKNOWN_GO,
258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	LOCAL_GO,
268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	REMOTE_GO
278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * struct p2p_device - P2P Device data (internal to P2P module)
318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_device {
338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct dl_list list;
348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct os_time last_seen;
358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int listen_freq;
368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int level;
378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	enum p2p_wps_method wps_method;
388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_peer_info info;
408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/*
428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * If the peer was discovered based on an interface address (e.g., GO
438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * from Beacon/Probe Response), the interface address is stored here.
448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * p2p_device_addr must still be set in such a case to the unique
458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * identifier for the P2P Device.
468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 interface_addr[ETH_ALEN];
488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/*
508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * P2P Device Address of the GO in whose group this P2P Device is a
518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * client.
528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 member_in_go_dev[ETH_ALEN];
548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/*
568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * P2P Interface Address of the GO in whose group this P2P Device is a
578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * client.
588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 member_in_go_iface[ETH_ALEN];
608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int go_neg_req_sent;
628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	enum p2p_go_state go_state;
638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 dialog_token;
648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 intended_addr[ETH_ALEN];
658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	char country[3];
678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_channels channels;
688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int oper_freq;
698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 oper_ssid[32];
708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t oper_ssid_len;
718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * req_config_methods - Pending provisioning discovery methods
748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 req_config_methods;
768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_PROBE_REQ_ONLY BIT(0)
788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_REPORTED BIT(1)
798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_NOT_YET_READY BIT(2)
808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_SD_INFO BIT(3)
818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_SD_SCHEDULE BIT(4)
828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_PD_PEER_DISPLAY BIT(5)
838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_PD_PEER_KEYPAD BIT(6)
848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_USER_REJECTED BIT(7)
858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_PEER_WAITING_RESPONSE BIT(8)
868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_PREFER_PERSISTENT_GROUP BIT(9)
878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_WAIT_GO_NEG_RESPONSE BIT(10)
888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_WAIT_GO_NEG_CONFIRM BIT(11)
898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_GROUP_CLIENT_ONLY BIT(12)
908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_FORCE_FREQ BIT(13)
918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_PD_FOR_JOIN BIT(14)
928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_DEV_REPORTED_ONCE BIT(15)
938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int flags;
948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int status; /* enum p2p_status_code */
968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int wait_count;
978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int connect_reqs;
988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int invitation_reqs;
998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 ext_listen_period;
1018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 ext_listen_interval;
1028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 go_timeout;
1048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 client_timeout;
1058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
1068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_sd_query {
1088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_sd_query *next;
1098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 peer[ETH_ALEN];
1108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int for_all_peers;
1118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpabuf *tlvs;
1128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
1138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_pending_action_tx {
1158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int freq;
1168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 dst[ETH_ALEN];
1178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 src[ETH_ALEN];
1188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 bssid[ETH_ALEN];
1198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t len;
1208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int wait_time;
1218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* Followed by len octets of the frame */
1228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
1238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
1258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * struct p2p_data - P2P module data (internal to P2P module)
1268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
1278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_data {
1288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
1298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * cfg - P2P module configuration
1308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 *
1318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * This is included in the same memory allocation with the
1328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * struct p2p_data and as such, must not be freed separately.
1338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
1348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_config *cfg;
1358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
1378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * state - The current P2P state
1388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
1398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	enum p2p_state {
1408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_IDLE - Idle
1428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_IDLE,
1448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_SEARCH - Search (Device Discovery)
1478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_SEARCH,
1498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_CONNECT - Trying to start GO Negotiation
1528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_CONNECT,
1548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_CONNECT_LISTEN - Listen during GO Negotiation start
1578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_CONNECT_LISTEN,
1598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_GO_NEG - In GO Negotiation
1628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_GO_NEG,
1648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_LISTEN_ONLY - Listen only
1678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_LISTEN_ONLY,
1698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_WAIT_PEER_CONNECT - Waiting peer in List for GO Neg
1728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_WAIT_PEER_CONNECT,
1748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_WAIT_PEER_IDLE - Waiting peer idle for GO Neg
1778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_WAIT_PEER_IDLE,
1798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_SD_DURING_FIND - Service Discovery during find
1828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_SD_DURING_FIND,
1848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_PROVISIONING - Provisioning (during group formation)
1878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PROVISIONING,
1898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_PD_DURING_FIND - Provision Discovery during find
1928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PD_DURING_FIND,
1948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
1968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_INVITE - Trying to start Invite
1978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
1988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_INVITE,
1998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		/**
2018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 * P2P_INVITE_LISTEN - Listen during Invite
2028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		 */
2038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_INVITE_LISTEN,
2048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	} state;
2058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * min_disc_int - minDiscoverableInterval
2088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int min_disc_int;
2108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * max_disc_int - maxDiscoverableInterval
2138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int max_disc_int;
2158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * devices - List of known P2P Device peers
2188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct dl_list devices;
2208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * go_neg_peer - Pointer to GO Negotiation peer
2238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_device *go_neg_peer;
2258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * invite_peer - Pointer to Invite peer
2288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_device *invite_peer;
2308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *invite_go_dev_addr;
2328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 invite_go_dev_addr_buf[ETH_ALEN];
2338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * sd_peer - Pointer to Service Discovery peer
2368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_device *sd_peer;
2388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * sd_query - Pointer to Service Discovery query
2418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_sd_query *sd_query;
2438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* GO Negotiation data */
2458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * intended_addr - Local Intended P2P Interface Address
2488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 *
2498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * This address is used during group owner negotiation as the Intended
2508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * P2P Interface Address and the group interface will be created with
2518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * address as the local address in case of successfully completed
2528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * negotiation.
2538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 intended_addr[ETH_ALEN];
2558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * go_intent - Local GO Intent to be used during GO Negotiation
2588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 go_intent;
2608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * next_tie_breaker - Next tie-breaker value to use in GO Negotiation
2638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 next_tie_breaker;
2658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * ssid - Selected SSID for GO Negotiation (if local end will be GO)
2688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 ssid[32];
2708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * ssid_len - ssid length in octets
2738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t ssid_len;
2758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * Regulatory class for own operational channel
2788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 op_reg_class;
2808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * op_channel - Own operational channel
2838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 op_channel;
2858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
2878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * channels - Own supported regulatory classes and channels
2888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 *
2898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * List of supposerted channels per regulatory class. The regulatory
2908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * classes are defined in IEEE Std 802.11-2007 Annex J and the
2918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * numbering of the clases depends on the configured country code.
2928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
2938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_channels channels;
2948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	enum p2p_pending_action_state {
2968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_NO_PENDING_ACTION,
2978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_GO_NEG_REQUEST,
2988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_GO_NEG_RESPONSE,
2998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_GO_NEG_RESPONSE_FAILURE,
3008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_GO_NEG_CONFIRM,
3018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_SD,
3028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_PD,
3038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_INVITATION_REQUEST,
3048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_INVITATION_RESPONSE,
3058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_DEV_DISC_REQUEST,
3068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_DEV_DISC_RESPONSE,
3078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_PENDING_GO_DISC_REQ
3088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	} pending_action_state;
3098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int pending_listen_freq;
3118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int pending_listen_sec;
3128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int pending_listen_usec;
3138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 dev_capab;
3158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int in_listen;
3178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int drv_in_listen;
3188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
3208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * sd_queries - Pending service discovery queries
3218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
3228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_sd_query *sd_queries;
3238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
3258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * srv_update_indic - Service Update Indicator for local services
3268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
3278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 srv_update_indic;
3288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpabuf *sd_resp; /* Fragmented SD response */
3308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 sd_resp_addr[ETH_ALEN];
3318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 sd_resp_dialog_token;
3328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t sd_resp_pos; /* Offset in sd_resp */
3338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 sd_frag_id;
3348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpabuf *sd_rx_resp; /* Reassembled SD response */
3368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 sd_rx_update_indic;
3378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* P2P Invitation data */
3398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	enum p2p_invite_role inv_role;
3408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 inv_bssid[ETH_ALEN];
3418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int inv_bssid_set;
3428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 inv_ssid[32];
3438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t inv_ssid_len;
3448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 inv_sa[ETH_ALEN];
3458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 inv_group_bssid[ETH_ALEN];
3468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 *inv_group_bssid_ptr;
3478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 inv_go_dev_addr[ETH_ALEN];
3488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 inv_status;
3498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int inv_op_freq;
3508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int inv_persistent;
3518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	enum p2p_discovery_type find_type;
3538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 last_prog_scan_class;
3548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 last_prog_scan_chan;
3558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int p2p_scan_running;
3568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	enum p2p_after_scan {
3578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_AFTER_SCAN_NOTHING,
3588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_AFTER_SCAN_LISTEN,
3598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		P2P_AFTER_SCAN_CONNECT
3608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	} start_after_scan;
3618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 after_scan_peer[ETH_ALEN];
3628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_pending_action_tx *after_scan_tx;
3638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* Requested device types for find/search */
3658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int num_req_dev_types;
3668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 *req_dev_types;
3678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_group **groups;
3698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t num_groups;
3708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_device *pending_client_disc_go;
3728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 pending_client_disc_addr[ETH_ALEN];
3738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 pending_dev_disc_dialog_token;
3748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 pending_dev_disc_addr[ETH_ALEN];
3758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int pending_dev_disc_freq;
3768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int pending_client_disc_freq;
3778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int ext_listen_only;
3798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int ext_listen_period;
3808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int ext_listen_interval;
3818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int ext_listen_interval_sec;
3828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int ext_listen_interval_usec;
3838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 peer_filter[ETH_ALEN];
3858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int cross_connect;
3878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int best_freq_24;
3898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int best_freq_5;
3908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int best_freq_overall;
3918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/**
3938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 * wps_vendor_ext - WPS Vendor Extensions to add
3948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	 */
3958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpabuf *wps_vendor_ext[P2P_MAX_WPS_VENDOR_EXT];
3968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
3978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/**
3998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * struct p2p_message - Parsed P2P message (or P2P IE)
4008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
4018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_message {
4028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpabuf *p2p_attributes;
4038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpabuf *wps_attributes;
4048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 dialog_token;
4068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *capability;
4088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *go_intent;
4098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *status;
4108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *listen_channel;
4118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *operating_channel;
4128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *channel_list;
4138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 channel_list_len;
4148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *config_timeout;
4158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *intended_addr;
4168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *group_bssid;
4178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *invitation_flags;
4188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *group_info;
4208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t group_info_len;
4218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *group_id;
4238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t group_id_len;
4248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *device_id;
4268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *manageability;
4288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *noa;
4308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t noa_len;
4318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *ext_listen_timing;
4338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *minor_reason_code;
4358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* P2P Device Info */
4378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *p2p_device_info;
4388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t p2p_device_info_len;
4398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *p2p_device_addr;
4408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *pri_dev_type;
4418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 num_sec_dev_types;
4428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	char device_name[33];
4438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 config_methods;
4448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* WPS IE */
4468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 dev_password_id;
4478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u16 wps_config_methods;
4488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *wps_pri_dev_type;
4498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *wps_sec_dev_type_list;
4508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t wps_sec_dev_type_list_len;
4518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *wps_vendor_ext[P2P_MAX_WPS_VENDOR_EXT];
4528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t wps_vendor_ext_len[P2P_MAX_WPS_VENDOR_EXT];
4538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *manufacturer;
4548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t manufacturer_len;
4558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *model_name;
4568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t model_name_len;
4578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *model_number;
4588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t model_number_len;
4598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *serial_number;
4608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	size_t serial_number_len;
4618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* DS Parameter Set IE */
4638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *ds_params;
4648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* SSID IE */
4668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *ssid;
4678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
4688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_MAX_GROUP_ENTRIES 50
4718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_group_info {
4738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	unsigned int num_clients;
4748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct p2p_client_info {
4758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		const u8 *p2p_device_addr;
4768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		const u8 *p2p_interface_addr;
4778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		u8 dev_capab;
4788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		u16 config_methods;
4798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		const u8 *pri_dev_type;
4808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		u8 num_sec_dev_types;
4818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		const u8 *sec_dev_types;
4828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		const char *dev_name;
4838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		size_t dev_name_len;
4848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	} client[P2P_MAX_GROUP_ENTRIES];
4858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
4868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_utils.c */
4898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_random(char *buf, size_t len);
4908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_channel_to_freq(const char *country, int reg_class, int channel);
4918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_freq_to_channel(const char *country, unsigned int freq, u8 *reg_class,
4928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			u8 *channel);
4938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_channels_intersect(const struct p2p_channels *a,
4948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    const struct p2p_channels *b,
4958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    struct p2p_channels *res);
4968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_channels_includes(const struct p2p_channels *channels, u8 reg_class,
4978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			  u8 channel);
4988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_parse.c */
5008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_parse_p2p_ie(const struct wpabuf *buf, struct p2p_message *msg);
5018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_parse_ies(const u8 *data, size_t len, struct p2p_message *msg);
5028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_parse(const u8 *data, size_t len, struct p2p_message *msg);
5038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_parse_free(struct p2p_message *msg);
5048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_attr_text(struct wpabuf *data, char *buf, char *end);
5058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_group_info_parse(const u8 *gi, size_t gi_len,
5068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			 struct p2p_group_info *info);
5078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_build.c */
5098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_noa_desc {
5118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u8 count_type;
5128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u32 duration;
5138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u32 interval;
5148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	u32 start_time;
5158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt};
5168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_group.c */
5188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtconst u8 * p2p_group_get_interface_addr(struct p2p_group *group);
5198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtu8 p2p_group_presence_req(struct p2p_group *group,
5208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			  const u8 *client_interface_addr,
5218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			  const u8 *noa, size_t noa_len);
5228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_action_hdr(struct wpabuf *buf, u8 subtype, u8 dialog_token);
5258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_public_action_hdr(struct wpabuf *buf, u8 subtype,
5268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   u8 dialog_token);
5278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtu8 * p2p_buf_add_ie_hdr(struct wpabuf *buf);
5288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_status(struct wpabuf *buf, u8 status);
5298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_device_info(struct wpabuf *buf, struct p2p_data *p2p,
5308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     struct p2p_device *peer);
5318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_device_id(struct wpabuf *buf, const u8 *dev_addr);
5328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_update_ie_hdr(struct wpabuf *buf, u8 *len);
5338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_capability(struct wpabuf *buf, u8 dev_capab, u8 group_capab);
5348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_go_intent(struct wpabuf *buf, u8 go_intent);
5358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_listen_channel(struct wpabuf *buf, const char *country,
5368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				u8 reg_class, u8 channel);
5378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_operating_channel(struct wpabuf *buf, const char *country,
5388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   u8 reg_class, u8 channel);
5398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_channel_list(struct wpabuf *buf, const char *country,
5408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			      struct p2p_channels *chan);
5418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_config_timeout(struct wpabuf *buf, u8 go_timeout,
5428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				u8 client_timeout);
5438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_intended_addr(struct wpabuf *buf, const u8 *interface_addr);
5448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_group_bssid(struct wpabuf *buf, const u8 *bssid);
5458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_group_id(struct wpabuf *buf, const u8 *dev_addr,
5468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			  const u8 *ssid, size_t ssid_len);
5478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_invitation_flags(struct wpabuf *buf, u8 flags);
5488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_noa(struct wpabuf *buf, u8 noa_index, u8 opp_ps, u8 ctwindow,
5498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		     struct p2p_noa_desc *desc1, struct p2p_noa_desc *desc2);
5508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_ext_listen_timing(struct wpabuf *buf, u16 period,
5518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   u16 interval);
5528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_buf_add_p2p_interface(struct wpabuf *buf, struct p2p_data *p2p);
5538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_build_wps_ie(struct p2p_data *p2p, struct wpabuf *buf, u16 pw_id,
5548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		      int all_attr);
5558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_sd.c */
5578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_sd_query * p2p_pending_sd_req(struct p2p_data *p2p,
5588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					 struct p2p_device *dev);
5598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_free_sd_queries(struct p2p_data *p2p);
5608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_rx_gas_initial_req(struct p2p_data *p2p, const u8 *sa,
5618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    const u8 *data, size_t len, int rx_freq);
5628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_rx_gas_initial_resp(struct p2p_data *p2p, const u8 *sa,
5638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *data, size_t len, int rx_freq);
5648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_rx_gas_comeback_req(struct p2p_data *p2p, const u8 *sa,
5658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *data, size_t len, int rx_freq);
5668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_rx_gas_comeback_resp(struct p2p_data *p2p, const u8 *sa,
5678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			      const u8 *data, size_t len, int rx_freq);
5688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_start_sd(struct p2p_data *p2p, struct p2p_device *dev);
5698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_go_neg.c */
5718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_peer_channels_check(struct p2p_data *p2p, struct p2p_channels *own,
5728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    struct p2p_device *dev,
5738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    const u8 *channel_list, size_t channel_list_len);
5748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
5758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    const u8 *data, size_t len, int rx_freq);
5768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
5778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *data, size_t len, int rx_freq);
5788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_go_neg_conf(struct p2p_data *p2p, const u8 *sa,
5798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *data, size_t len);
5808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_connect_send(struct p2p_data *p2p, struct p2p_device *dev);
5818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_pd.c */
5838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
5848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			       const u8 *data, size_t len, int rx_freq);
5858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *sa,
5868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				const u8 *data, size_t len);
5878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_send_prov_disc_req(struct p2p_data *p2p, struct p2p_device *dev,
5888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			   int join);
5898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_invitation.c */
5918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa,
5928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				const u8 *data, size_t len, int rx_freq);
5938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_invitation_resp(struct p2p_data *p2p, const u8 *sa,
5948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				 const u8 *data, size_t len);
5958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_invite_send(struct p2p_data *p2p, struct p2p_device *dev,
5968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		    const u8 *go_dev_addr);
5978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_invitation_req_cb(struct p2p_data *p2p, int success);
5988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_invitation_resp_cb(struct p2p_data *p2p, int success);
5998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
6008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p_dev_disc.c */
6018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_dev_disc_req(struct p2p_data *p2p, const u8 *sa,
6028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			      const u8 *data, size_t len, int rx_freq);
6038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_dev_disc_req_cb(struct p2p_data *p2p, int success);
6048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_send_dev_disc_req(struct p2p_data *p2p, struct p2p_device *dev);
6058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_dev_disc_resp_cb(struct p2p_data *p2p, int success);
6068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_dev_disc_resp(struct p2p_data *p2p, const u8 *sa,
6078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			       const u8 *data, size_t len);
6088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_go_disc_req_cb(struct p2p_data *p2p, int success);
6098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_process_go_disc_req(struct p2p_data *p2p, const u8 *da, const u8 *sa,
6108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *data, size_t len, int rx_freq);
6118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
6128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* p2p.c */
6138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_set_state(struct p2p_data *p2p, int new_state);
6148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_set_timeout(struct p2p_data *p2p, unsigned int sec,
6158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		     unsigned int usec);
6168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_clear_timeout(struct p2p_data *p2p);
6178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_continue_find(struct p2p_data *p2p);
6188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_device * p2p_add_dev_from_go_neg_req(struct p2p_data *p2p,
6198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						const u8 *addr,
6208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						struct p2p_message *msg);
6218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_add_dev_info(struct p2p_data *p2p, const u8 *addr,
6228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		      struct p2p_device *dev, struct p2p_message *msg);
6238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_device * p2p_get_device(struct p2p_data *p2p, const u8 *addr);
6248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_device * p2p_get_device_interface(struct p2p_data *p2p,
6258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					     const u8 *addr);
6268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_go_neg_failed(struct p2p_data *p2p, struct p2p_device *peer,
6278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		       int status);
6288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_go_complete(struct p2p_data *p2p, struct p2p_device *peer);
6298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_match_dev_type(struct p2p_data *p2p, struct wpabuf *wps);
6308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint dev_type_list_match(const u8 *dev_type, const u8 *req_dev_type[],
6318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			size_t num_req_dev_type);
6328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct wpabuf * p2p_build_probe_resp_ies(struct p2p_data *p2p);
6338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid p2p_build_ssid(struct p2p_data *p2p, u8 *ssid, size_t *ssid_len);
6348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint p2p_send_action(struct p2p_data *p2p, unsigned int freq, const u8 *dst,
6358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		    const u8 *src, const u8 *bssid, const u8 *buf,
6368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		    size_t len, unsigned int wait_time);
6378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
6388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* P2P_I_H */
639