xref: /freebsd/contrib/wpa/wpa_supplicant/README-P2P (revision 5b9c547c072b84410b50897cc53710c75b2f6b74)
1f05cddf9SRui Paulowpa_supplicant and Wi-Fi P2P
2f05cddf9SRui Paulo============================
3f05cddf9SRui Paulo
4f05cddf9SRui PauloThis document describes how the Wi-Fi P2P implementation in
5f05cddf9SRui Paulowpa_supplicant can be configured and how an external component on the
6f05cddf9SRui Pauloclient (e.g., management GUI) is used to enable WPS enrollment and
7f05cddf9SRui Pauloregistrar registration.
8f05cddf9SRui Paulo
9f05cddf9SRui Paulo
10f05cddf9SRui PauloIntroduction to Wi-Fi P2P
11f05cddf9SRui Paulo-------------------------
12f05cddf9SRui Paulo
13f05cddf9SRui PauloTODO
14f05cddf9SRui Paulo
15f05cddf9SRui PauloMore information about Wi-Fi P2P is available from Wi-Fi Alliance:
16f05cddf9SRui Paulohttp://www.wi-fi.org/Wi-Fi_Direct.php
17f05cddf9SRui Paulo
18f05cddf9SRui Paulo
19f05cddf9SRui Paulowpa_supplicant implementation
20f05cddf9SRui Paulo-----------------------------
21f05cddf9SRui Paulo
22f05cddf9SRui PauloTODO
23f05cddf9SRui Paulo
24f05cddf9SRui Paulo
25f05cddf9SRui Paulowpa_supplicant configuration
26f05cddf9SRui Paulo----------------------------
27f05cddf9SRui Paulo
28f05cddf9SRui PauloWi-Fi P2P is an optional component that needs to be enabled in the
29f05cddf9SRui Paulowpa_supplicant build configuration (.config). Here is an example
30f05cddf9SRui Pauloconfiguration that includes Wi-Fi P2P support and Linux nl80211
31f05cddf9SRui Paulo-based driver interface:
32f05cddf9SRui Paulo
33f05cddf9SRui PauloCONFIG_DRIVER_NL80211=y
34f05cddf9SRui PauloCONFIG_CTRL_IFACE=y
35f05cddf9SRui PauloCONFIG_P2P=y
36f05cddf9SRui PauloCONFIG_AP=y
37f05cddf9SRui PauloCONFIG_WPS=y
38f05cddf9SRui Paulo
39f05cddf9SRui Paulo
40f05cddf9SRui PauloIn run-time configuration file (wpa_supplicant.conf), some parameters
41f05cddf9SRui Paulofor P2P may be set. In order to make the devices easier to recognize,
42f05cddf9SRui Paulodevice_name and device_type should be specified. For example,
43f05cddf9SRui Paulosomething like this should be included:
44f05cddf9SRui Paulo
45f05cddf9SRui Pauloctrl_interface=/var/run/wpa_supplicant
46f05cddf9SRui Paulodevice_name=My P2P Device
47f05cddf9SRui Paulodevice_type=1-0050F204-1
48f05cddf9SRui Paulo
49f05cddf9SRui Paulo
50f05cddf9SRui Paulowpa_cli
51f05cddf9SRui Paulo-------
52f05cddf9SRui Paulo
53f05cddf9SRui PauloActual Wi-Fi P2P operations are requested during runtime. These can be
54f05cddf9SRui Paulodone for example using wpa_cli (which is described below) or a GUI
55f05cddf9SRui Paulolike wpa_gui-qt4.
56f05cddf9SRui Paulo
57f05cddf9SRui Paulo
58f05cddf9SRui Paulowpa_cli starts in interactive mode if no command string is included on
59f05cddf9SRui Paulothe command line. By default, it will select the first network interface
60f05cddf9SRui Paulothat it can find (and that wpa_supplicant controls). If more than one
61f05cddf9SRui Paulointerface is in use, it may be necessary to select one of the explicitly
62f05cddf9SRui Pauloby adding -i argument on the command line (e.g., 'wpa_cli -i wlan1').
63f05cddf9SRui Paulo
64f05cddf9SRui PauloMost of the P2P operations are done on the main interface (e.g., the
65f05cddf9SRui Paulointerface that is automatically added when the driver is loaded, e.g.,
66f05cddf9SRui Paulowlan0). When using a separate virtual interface for group operations
67f05cddf9SRui Paulo(e.g., wlan1), the control interface for that group interface may need
68f05cddf9SRui Pauloto be used for some operations (mainly WPS activation in GO). This may
69f05cddf9SRui Paulochange in the future so that all the needed operations could be done
70f05cddf9SRui Pauloover the main control interface.
71f05cddf9SRui Paulo
72f05cddf9SRui PauloDevice Discovery
73f05cddf9SRui Paulo
74f05cddf9SRui Paulop2p_find [timeout in seconds] [type=<social|progressive>] \
75*5b9c547cSRui Paulo	[dev_id=<addr>] [dev_type=<device type>] \
76*5b9c547cSRui Paulo	[delay=<search delay in ms>] [seek=<service name>] [freq=<MHz>]
77f05cddf9SRui Paulo
78f05cddf9SRui PauloThe default behavior is to run a single full scan in the beginning and
79f05cddf9SRui Paulothen scan only social channels. type=social will scan only social
80f05cddf9SRui Paulochannels, i.e., it skips the initial full scan. type=progressive is
81f05cddf9SRui Paulolike the default behavior, but it will scan through all the channels
82f05cddf9SRui Pauloprogressively one channel at the time in the Search state rounds. This
83f05cddf9SRui Paulowill help in finding new groups or groups missed during the initial
84*5b9c547cSRui Paulofull scan. When the type parameter is not included (i.e., full scan), the
85*5b9c547cSRui Paulooptional freq parameter can be used to override the first scan to use only
86*5b9c547cSRui Paulothe specified channel after which only social channels are scanned.
87f05cddf9SRui Paulo
88f05cddf9SRui PauloThe optional dev_id option can be used to specify a single P2P peer to
89f05cddf9SRui Paulosearch for. The optional delay parameter can be used to request an extra
90f05cddf9SRui Paulodelay to be used between search iterations (e.g., to free up radio
91f05cddf9SRui Pauloresources for concurrent operations).
92f05cddf9SRui Paulo
93*5b9c547cSRui PauloThe optional dev_type option can be used to specify a single device type
94*5b9c547cSRui Paulo(primary or secondary) to search for, e.g.,
95*5b9c547cSRui Paulo"p2p_find dev_type=1-0050F204-1".
96*5b9c547cSRui Paulo
97*5b9c547cSRui Paulo
98*5b9c547cSRui PauloWith one or more seek arguments, the command sends Probe Request frames
99*5b9c547cSRui Paulofor a P2PS service. For example,
100*5b9c547cSRui Paulop2p_find 5 dev_id=11:22:33:44:55:66 seek=alt.example.chat seek=alt.example.video
101*5b9c547cSRui Paulo
102*5b9c547cSRui PauloParameters description:
103*5b9c547cSRui Paulo    Timeout - Optional ASCII base-10-encoded u16. If missing, request will not
104*5b9c547cSRui Paulo	time out and must be canceled manually
105*5b9c547cSRui Paulo    dev_id - Optional to request responses from a single known remote device
106*5b9c547cSRui Paulo    Service Name - Mandatory UTF-8 string for ASP seeks
107*5b9c547cSRui Paulo	Service name must match the remote service being advertised exactly
108*5b9c547cSRui Paulo	(no prefix matching).
109*5b9c547cSRui Paulo	Service name may be empty, in which case all ASP services will be
110*5b9c547cSRui Paulo	returned, and may be filtered with p2p_serv_disc_req settings, and
111*5b9c547cSRui Paulo	p2p_serv_asp_resp results.
112*5b9c547cSRui Paulo	Multiple service names may be requested, but if it exceeds internal
113*5b9c547cSRui Paulo	limit, it will automatically revert to requesting all ASP services.
114*5b9c547cSRui Paulo
115f05cddf9SRui Paulop2p_listen [timeout in seconds]
116f05cddf9SRui Paulo
117f05cddf9SRui PauloStart Listen-only state (become discoverable without searching for
118f05cddf9SRui Pauloother devices). Optional parameter can be used to specify the duration
119f05cddf9SRui Paulofor the Listen operation in seconds. This command may not be of that
120f05cddf9SRui Paulomuch use during normal operations and is mainly designed for
121f05cddf9SRui Paulotesting. It can also be used to keep the device discoverable without
122f05cddf9SRui Paulohaving to maintain a group.
123f05cddf9SRui Paulo
124f05cddf9SRui Paulop2p_stop_find
125f05cddf9SRui Paulo
126f05cddf9SRui PauloStop ongoing P2P device discovery or other operation (connect, listen
127f05cddf9SRui Paulomode).
128f05cddf9SRui Paulo
129f05cddf9SRui Paulop2p_flush
130f05cddf9SRui Paulo
131f05cddf9SRui PauloFlush P2P peer table and state.
132f05cddf9SRui Paulo
133f05cddf9SRui PauloGroup Formation
134f05cddf9SRui Paulo
135f05cddf9SRui Paulop2p_prov_disc <peer device address> <display|keypad|pbc> [join|auto]
136f05cddf9SRui Paulo
137f05cddf9SRui PauloSend P2P provision discovery request to the specified peer. The
138f05cddf9SRui Pauloparameters for this command are the P2P device address of the peer and
139f05cddf9SRui Paulothe desired configuration method. For example, "p2p_prov_disc
140f05cddf9SRui Paulo02:01:02:03:04:05 display" would request the peer to display a PIN for
141f05cddf9SRui Paulous and "p2p_prov_disc 02:01:02:03:04:05 keypad" would request the peer
142f05cddf9SRui Pauloto enter a PIN that we display.
143f05cddf9SRui Paulo
144f05cddf9SRui PauloThe optional "join" parameter can be used to indicate that this command
145f05cddf9SRui Paulois requesting an already running GO to prepare for a new client. This is
146f05cddf9SRui Paulomainly used with "display" to request it to display a PIN. The "auto"
147f05cddf9SRui Pauloparameter can be used to request wpa_supplicant to automatically figure
148f05cddf9SRui Pauloout whether the peer device is operating as a GO and if so, use
149f05cddf9SRui Paulojoin-a-group style PD instead of GO Negotiation style PD.
150f05cddf9SRui Paulo
151*5b9c547cSRui Paulop2p_connect <peer device address> <pbc|pin|PIN#|p2ps> [display|keypad|p2ps]
152f05cddf9SRui Paulo	[persistent|persistent=<network id>] [join|auth]
153*5b9c547cSRui Paulo	[go_intent=<0..15>] [freq=<in MHz>] [ht40] [vht] [provdisc] [auto]
154f05cddf9SRui Paulo
155f05cddf9SRui PauloStart P2P group formation with a discovered P2P peer. This includes
156f05cddf9SRui Paulooptional group owner negotiation, group interface setup, provisioning,
157f05cddf9SRui Pauloand establishing data connection.
158f05cddf9SRui Paulo
159f05cddf9SRui PauloThe <pbc|pin|PIN#> parameter specifies the WPS provisioning
160f05cddf9SRui Paulomethod. "pbc" string starts pushbutton method, "pin" string start PIN
161f05cddf9SRui Paulomethod using an automatically generated PIN (which will be returned as
162f05cddf9SRui Paulothe command return code), PIN# means that a pre-selected PIN can be
163f05cddf9SRui Pauloused (e.g., 12345670). [display|keypad] is used with PIN method
164f05cddf9SRui Pauloto specify which PIN is used (display=dynamically generated random PIN
165f05cddf9SRui Paulofrom local display, keypad=PIN entered from peer display). "persistent"
166f05cddf9SRui Pauloparameter can be used to request a persistent group to be formed. The
167f05cddf9SRui Paulo"persistent=<network id>" alternative can be used to pre-populate
168f05cddf9SRui PauloSSID/passphrase configuration based on a previously used persistent
169f05cddf9SRui Paulogroup where this device was the GO. The previously used parameters will
170f05cddf9SRui Paulothen be used if the local end becomes the GO in GO Negotiation (which
171f05cddf9SRui Paulocan be forced with go_intent=15).
172f05cddf9SRui Paulo
173f05cddf9SRui Paulo"join" indicates that this is a command to join an existing group as a
174f05cddf9SRui Pauloclient. It skips the GO Negotiation part. This will send a Provision
175f05cddf9SRui PauloDiscovery Request message to the target GO before associating for WPS
176f05cddf9SRui Pauloprovisioning.
177f05cddf9SRui Paulo
178f05cddf9SRui Paulo"auth" indicates that the WPS parameters are authorized for the peer
179f05cddf9SRui Paulodevice without actually starting GO Negotiation (i.e., the peer is
180f05cddf9SRui Pauloexpected to initiate GO Negotiation). This is mainly for testing
181f05cddf9SRui Paulopurposes.
182f05cddf9SRui Paulo
183f05cddf9SRui Paulo"go_intent" can be used to override the default GO Intent for this GO
184f05cddf9SRui PauloNegotiation.
185f05cddf9SRui Paulo
186f05cddf9SRui Paulo"freq" can be used to set a forced operating channel (e.g., freq=2412
187f05cddf9SRui Pauloto select 2.4 GHz channel 1).
188f05cddf9SRui Paulo
189f05cddf9SRui Paulo"provdisc" can be used to request a Provision Discovery exchange to be
190f05cddf9SRui Pauloused prior to starting GO Negotiation as a workaround with some deployed
191f05cddf9SRui PauloP2P implementations that require this to allow the user to accept the
192f05cddf9SRui Pauloconnection.
193f05cddf9SRui Paulo
194*5b9c547cSRui Paulo"auto" can be used to request wpa_supplicant to automatically figure
195*5b9c547cSRui Pauloout whether the peer device is operating as a GO and if so, use
196*5b9c547cSRui Paulojoin-a-group operation rather than GO Negotiation.
197*5b9c547cSRui Paulo
198*5b9c547cSRui PauloP2PS attribute changes to p2p_connect command:
199*5b9c547cSRui Paulo
200*5b9c547cSRui PauloP2PS supports two WPS provisioning methods namely PIN method and P2PS default.
201*5b9c547cSRui PauloThe remaining paramters hold same role as in legacy P2P. In case of P2PS default
202*5b9c547cSRui Pauloconfig method "p2ps" keyword is added in p2p_connect command.
203*5b9c547cSRui Paulo
204*5b9c547cSRui PauloFor example:
205*5b9c547cSRui Paulop2p_connect 02:0a:f5:85:11:00 12345670 p2ps persistent join
206*5b9c547cSRui Paulo	(WPS Method = P2PS default)
207*5b9c547cSRui Paulo
208*5b9c547cSRui Paulop2p_connect 02:0a:f5:85:11:00 45629034 keypad persistent
209*5b9c547cSRui Paulo	(WPS Method = PIN)
210*5b9c547cSRui Paulo
211*5b9c547cSRui Paulop2p_asp_provision <peer MAC address> <adv_id=peer adv id>
212*5b9c547cSRui Paulo	<adv_mac=peer MAC address> [role=2|4|1] <session=session id>
213*5b9c547cSRui Paulo	<session_mac=initiator mac address>
214*5b9c547cSRui Paulo	[info='service info'] <method=Default|keypad|Display>
215*5b9c547cSRui Paulo
216*5b9c547cSRui PauloThis command starts provision discovery with the P2PS enabled peer device.
217*5b9c547cSRui Paulo
218*5b9c547cSRui PauloFor example,
219*5b9c547cSRui Paulop2p_asp_provision 00:11:22:33:44:55 adv_id=4d6fc7 adv_mac=00:55:44:33:22:11 role=1 session=12ab34 session_mac=00:11:22:33:44:55 info='name=john' method=1000
220*5b9c547cSRui Paulo
221*5b9c547cSRui PauloParameter description:
222*5b9c547cSRui Paulo    MAC address - Mandatory
223*5b9c547cSRui Paulo    adv_id - Mandatory remote Advertising ID of service connection is being
224*5b9c547cSRui Paulo	established for
225*5b9c547cSRui Paulo    adv_mac - Mandatory MAC address that owns/registered the service
226*5b9c547cSRui Paulo    role - Optional
227*5b9c547cSRui Paulo	2 (group client only) or 4 (group owner only)
228*5b9c547cSRui Paulo	if not present (or 1) role is negotiated by the two peers.
229*5b9c547cSRui Paulo    session - Mandatory Session ID of the first session to be established
230*5b9c547cSRui Paulo    session_mac - Mandatory MAC address that owns/initiated the session
231*5b9c547cSRui Paulo    method - Optional method to request for provisioning (1000 - P2PS Default,
232*5b9c547cSRui Paulo	100 - Keypad(PIN), 8 - Display(PIN))
233*5b9c547cSRui Paulo    info - Optional UTF-8 string. Hint for service to indicate possible usage
234*5b9c547cSRui Paulo	parameters - Escape single quote & backslash:
235*5b9c547cSRui Paulo	with a backslash 0x27 == ' == \', and 0x5c == \ == \\
236*5b9c547cSRui Paulo
237*5b9c547cSRui Paulop2p_asp_provision_resp <peer mac address> <adv_id= local adv id>
238*5b9c547cSRui Paulo	<adv_mac=local MAC address> <role=1|2|4> <status=0>
239*5b9c547cSRui Paulo	<session=session id> <session_mac=peer MAC address>
240*5b9c547cSRui Paulo
241*5b9c547cSRui PauloThis command sends a provision discovery response from responder side.
242*5b9c547cSRui Paulo
243*5b9c547cSRui PauloFor example,
244*5b9c547cSRui Paulop2p_asp_provision_resp 00:55:44:33:22:11 adv_id=4d6fc7 adv_mac=00:55:44:33:22:11 role=1 status=0 session=12ab34 session_mac=00:11:22:33:44:55
245*5b9c547cSRui Paulo
246*5b9c547cSRui PauloParameters definition:
247*5b9c547cSRui Paulo    MAC address - Mandatory
248*5b9c547cSRui Paulo    adv_id - Mandatory local Advertising ID of service connection is being
249*5b9c547cSRui Paulo	established for
250*5b9c547cSRui Paulo    adv_mac - Mandatory MAC address that owns/registered the service
251*5b9c547cSRui Paulo    role -  Optional 2 (group client only) or 4 (group owner only)
252*5b9c547cSRui Paulo	if not present (or 1) role is negotiated by the two peers.
253*5b9c547cSRui Paulo    status - Mandatory Acceptance/Rejection code of Provisioning
254*5b9c547cSRui Paulo    session - Mandatory Session ID of the first session to be established
255*5b9c547cSRui Paulo    session_mac - Mandatory MAC address that owns/initiated the session
256*5b9c547cSRui Paulo
257*5b9c547cSRui Paulop2p_group_add [persistent|persistent=<network id>] [freq=<freq in MHz>]
258*5b9c547cSRui Paulo	[ht40] [vht]
259f05cddf9SRui Paulo
260f05cddf9SRui PauloSet up a P2P group owner manually (i.e., without group owner
261f05cddf9SRui Paulonegotiation with a specific peer). This is also known as autonomous
262f05cddf9SRui PauloGO. Optional persistent=<network id> can be used to specify restart of
263f05cddf9SRui Pauloa persistent group. Optional freq=<freq in MHz> can be used to force
264f05cddf9SRui Paulothe GO to be started on a specific frequency. Special freq=2 or freq=5
265f05cddf9SRui Paulooptions can be used to request the best 2.4 GHz or 5 GHz band channel
266f05cddf9SRui Pauloto be selected automatically.
267f05cddf9SRui Paulo
268f05cddf9SRui Paulop2p_reject <peer device address>
269f05cddf9SRui Paulo
270f05cddf9SRui PauloReject connection attempt from a peer (specified with a device
271f05cddf9SRui Pauloaddress). This is a mechanism to reject a pending GO Negotiation with
272f05cddf9SRui Pauloa peer and request to automatically block any further connection or
273f05cddf9SRui Paulodiscovery of the peer.
274f05cddf9SRui Paulo
275f05cddf9SRui Paulop2p_group_remove <group interface>
276f05cddf9SRui Paulo
277f05cddf9SRui PauloTerminate a P2P group. If a new virtual network interface was used for
278f05cddf9SRui Paulothe group, it will also be removed. The network interface name of the
279f05cddf9SRui Paulogroup interface is used as a parameter for this command.
280f05cddf9SRui Paulo
281f05cddf9SRui Paulop2p_cancel
282f05cddf9SRui Paulo
283f05cddf9SRui PauloCancel an ongoing P2P group formation and joining-a-group related
284f05cddf9SRui Paulooperation. This operations unauthorizes the specific peer device (if any
285f05cddf9SRui Paulohad been authorized to start group formation), stops P2P find (if in
286f05cddf9SRui Pauloprogress), stops pending operations for join-a-group, and removes the
287f05cddf9SRui PauloP2P group interface (if one was used) that is in the WPS provisioning
288f05cddf9SRui Paulostep. If the WPS provisioning step has been completed, the group is not
289f05cddf9SRui Pauloterminated.
290f05cddf9SRui Paulo
291*5b9c547cSRui Paulop2p_remove_client <peer's P2P Device Address|iface=<interface address>>
292*5b9c547cSRui Paulo
293*5b9c547cSRui PauloThis command can be used to remove the specified client from all groups
294*5b9c547cSRui Paulo(operating and persistent) from the local GO. Note that the peer device
295*5b9c547cSRui Paulocan rejoin the group if it is in possession of a valid key. See p2p_set
296*5b9c547cSRui Pauloper_sta_psk command below for more details on how the peer can be
297*5b9c547cSRui Pauloremoved securely.
298*5b9c547cSRui Paulo
299f05cddf9SRui PauloService Discovery
300f05cddf9SRui Paulo
301*5b9c547cSRui Paulop2p_service_add asp <auto accept> <adv id> <status 0/1> <Config Methods>
302*5b9c547cSRui Paulo	<Service name> [Service Information] [Response Info]
303*5b9c547cSRui Paulo
304*5b9c547cSRui PauloThis command can be used to search for a P2PS service which includes
305*5b9c547cSRui PauloPlay, Send, Display, and Print service. The parameters for this command
306*5b9c547cSRui Pauloare "asp" to identify the command as P2PS one, auto accept value,
307*5b9c547cSRui Pauloadvertisement id which uniquely identifies the service requests, state
308*5b9c547cSRui Pauloof the service whether the service is available or not, config methods
309*5b9c547cSRui Paulowhich can be either P2PS method or PIN method, service name followed by
310*5b9c547cSRui Paulotwo optional parameters service information, and response info.
311*5b9c547cSRui Paulo
312*5b9c547cSRui PauloFor example,
313*5b9c547cSRui Paulop2p_service_add asp 1 4d6fc7 0 1108 alt.example.chat svc_info='name=john' rsp_info='enter PIN 1234'
314*5b9c547cSRui Paulo
315*5b9c547cSRui PauloParameters definition:
316*5b9c547cSRui Paulo    asp - Mandatory for ASP service registration
317*5b9c547cSRui Paulo    auto accept - Mandatory ASCII hex-encoded boolean (0 == no auto-accept,
318*5b9c547cSRui Paulo	1 == auto-accept ANY role, 2 == auto-accept CLIENT role,
319*5b9c547cSRui Paulo	4 == auto-accept GO role)
320*5b9c547cSRui Paulo    Advertisement ID - Mandatory non-zero ASCII hex-encoded u32
321*5b9c547cSRui Paulo	(Must be unique/not yet exist in svc db)
322*5b9c547cSRui Paulo    State - Mandatory ASCII hex-encoded u8 (0 -- Svc not available,
323*5b9c547cSRui Paulo	1 -- Svc available, 2-0xff  Application defined)
324*5b9c547cSRui Paulo    Config Methods - Mandatory ASCII hex-encoded u16 (bitmask of WSC config
325*5b9c547cSRui Paulo	methods)
326*5b9c547cSRui Paulo    Service Name - Mandatory UTF-8 string
327*5b9c547cSRui Paulo    Service Information - Optional UTF-8 string
328*5b9c547cSRui Paulo	Escape single quote & backslash with a backslash:
329*5b9c547cSRui Paulo	0x27 == ' == \', and 0x5c == \ == \\
330*5b9c547cSRui Paulo    Session response information -  Optional (used only if auto accept is TRUE)
331*5b9c547cSRui Paulo	UTF-8 string
332*5b9c547cSRui Paulo	Escape single quote & backslash with a backslash:
333*5b9c547cSRui Paulo	0x27 == ' == \', and 0x5c == \ == \\
334*5b9c547cSRui Paulo
335*5b9c547cSRui Paulop2p_service_rep asp <auto accept> <adv id> <status 0/1> <Config Methods>
336*5b9c547cSRui Paulo	<Service name> [Service Information] [Response Info]
337*5b9c547cSRui Paulo
338*5b9c547cSRui PauloThis command can be used to replace the existing service request
339*5b9c547cSRui Pauloattributes from the initiator side. The replacement is only allowed if
340*5b9c547cSRui Paulothe advertisement id issued in the command matches with any one entry in
341*5b9c547cSRui Paulothe list of existing SD queries. If advertisement id doesn't match the
342*5b9c547cSRui Paulocommand returns a failure.
343*5b9c547cSRui Paulo
344*5b9c547cSRui PauloFor example,
345*5b9c547cSRui Paulop2p_service_rep asp 1 4d6fc7 1 1108 alt.example.chat svc_info='name=john' rsp_info='enter PIN 1234'
346*5b9c547cSRui Paulo
347*5b9c547cSRui PauloParameters definition:
348*5b9c547cSRui Paulo    asp - Mandatory for ASP service registration
349*5b9c547cSRui Paulo    auto accept - Mandatory ASCII hex-encoded boolean (1 == true, 0 == false)
350*5b9c547cSRui Paulo    Advertisement ID - Mandatory non-zero ASCII hex-encoded u32
351*5b9c547cSRui Paulo	(Must already exist in svc db)
352*5b9c547cSRui Paulo    State - Mandatory ASCII hex-encoded u8 (can be used to indicate svc
353*5b9c547cSRui Paulo	available or not available for instance)
354*5b9c547cSRui Paulo    Config Methods - Mandatory ASCII hex-encoded u16 (bitmask of WSC config
355*5b9c547cSRui Paulo	methods)
356*5b9c547cSRui Paulo    Service Name - Mandatory UTF-8 string (Must match existing string in svc db)
357*5b9c547cSRui Paulo    Service Information - Optional UTF-8 string
358*5b9c547cSRui Paulo	Escape single quote & backslash with a backslash:
359*5b9c547cSRui Paulo	0x27 == ' == \', and 0x5c == \ == \\
360*5b9c547cSRui Paulo    Session response information -  Optional (used only if auto accept is TRUE)
361*5b9c547cSRui Paulo	UTF-8 string
362*5b9c547cSRui Paulo	Escape single quote & backslash with a backslash:
363*5b9c547cSRui Paulo	0x27 == ' == \', and 0x5c == \ == \\
364*5b9c547cSRui Paulo
365f05cddf9SRui Paulop2p_serv_disc_req
366f05cddf9SRui Paulo
367f05cddf9SRui PauloSchedule a P2P service discovery request. The parameters for this
368f05cddf9SRui Paulocommand are the device address of the peer device (or 00:00:00:00:00:00
369f05cddf9SRui Paulofor wildcard query that is sent to every discovered P2P peer that
370f05cddf9SRui Paulosupports service discovery) and P2P Service Query TLV(s) as hexdump. For
371f05cddf9SRui Pauloexample,
372f05cddf9SRui Paulo
373f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000001
374f05cddf9SRui Paulo
375f05cddf9SRui Pauloschedules a request for listing all available services of all service
376f05cddf9SRui Paulodiscovery protocols and requests this to be sent to all discovered
377f05cddf9SRui Paulopeers (note: this can result in long response frames). The pending
378f05cddf9SRui Paulorequests are sent during device discovery (see p2p_find).
379f05cddf9SRui Paulo
380*5b9c547cSRui PauloThere can be multiple pending peer device specific queries (each will be
381*5b9c547cSRui Paulosent in sequence whenever the peer is found).
382f05cddf9SRui Paulo
383f05cddf9SRui PauloThis command returns an identifier for the pending query (e.g.,
384f05cddf9SRui Paulo"1f77628") that can be used to cancel the request. Directed requests
385f05cddf9SRui Paulowill be automatically removed when the specified peer has replied to
386f05cddf9SRui Pauloit.
387f05cddf9SRui Paulo
388*5b9c547cSRui PauloService Query TLV has following format:
389*5b9c547cSRui PauloLength (2 octets, little endian) - length of following data
390*5b9c547cSRui PauloService Protocol Type (1 octet) - see the table below
391*5b9c547cSRui PauloService Transaction ID (1 octet) - nonzero identifier for the TLV
392*5b9c547cSRui PauloQuery Data (Length - 2 octets of data) - service protocol specific data
393*5b9c547cSRui Paulo
394*5b9c547cSRui PauloService Protocol Types:
395*5b9c547cSRui Paulo0 = All service protocols
396*5b9c547cSRui Paulo1 = Bonjour
397*5b9c547cSRui Paulo2 = UPnP
398*5b9c547cSRui Paulo3 = WS-Discovery
399*5b9c547cSRui Paulo4 = Wi-Fi Display
400*5b9c547cSRui Paulo
401f05cddf9SRui PauloFor UPnP, an alternative command format can be used to specify a
402f05cddf9SRui Paulosingle query TLV (i.e., a service discovery for a specific UPnP
403f05cddf9SRui Pauloservice):
404f05cddf9SRui Paulo
405f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp <version hex> <ST: from M-SEARCH>
406f05cddf9SRui Paulo
407f05cddf9SRui PauloFor example:
408f05cddf9SRui Paulo
409f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1
410f05cddf9SRui Paulo
411f05cddf9SRui PauloAdditional examples for queries:
412f05cddf9SRui Paulo
413f05cddf9SRui Paulo# list of all Bonjour services
414f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000101
415f05cddf9SRui Paulo
416f05cddf9SRui Paulo# list of all UPnP services
417f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000201
418f05cddf9SRui Paulo
419f05cddf9SRui Paulo# list of all WS-Discovery services
420f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000301
421f05cddf9SRui Paulo
422f05cddf9SRui Paulo# list of all Bonjour and UPnP services
423f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 0200010102000202
424f05cddf9SRui Paulo
425f05cddf9SRui Paulo# Apple File Sharing over TCP
426f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 130001010b5f6166706f766572746370c00c000c01
427f05cddf9SRui Paulo
428f05cddf9SRui Paulo# Bonjour SSTH (supported service type hash)
429f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 05000101000000
430f05cddf9SRui Paulo
431f05cddf9SRui Paulo# UPnP examples
432f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 ssdp:all
433f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 upnp:rootdevice
434f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:service:ContentDirectory:2
435f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 uuid:6859dede-8574-59ab-9332-123456789012
436f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1
437f05cddf9SRui Paulo
438f05cddf9SRui Paulo# Wi-Fi Display examples
439f05cddf9SRui Paulo# format: wifi-display <list of roles> <list of subelements>
440f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source] 2,3,4,5
441f05cddf9SRui Paulop2p_serv_disc_req 02:01:02:03:04:05 wifi-display [pri-sink] 3
442f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [sec-source] 2
443f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source+sink] 2,3,4,5
444f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source][pri-sink] 2,3,4,5
445f05cddf9SRui Paulo
446*5b9c547cSRui Paulop2p_serv_disc_req <Unicast|Broadcast mac address> asp <Transaction ID>
447*5b9c547cSRui Paulo	<Service Name> [Service Information]
448*5b9c547cSRui Paulo
449*5b9c547cSRui PauloThe command can be used for service discovery for P2PS enabled devices.
450*5b9c547cSRui Paulo
451*5b9c547cSRui PauloFor example: p2p_serv_disc_req 00:00:00:00:00:00 asp a1 alt.example 'john'
452*5b9c547cSRui Paulo
453*5b9c547cSRui PauloParameters definition:
454*5b9c547cSRui Paulo    MAC address - Mandatory Existing
455*5b9c547cSRui Paulo    asp - Mandatory for ASP queries
456*5b9c547cSRui Paulo    Transaction ID - Mandatory non-zero ASCII hex-encoded u8 for GAS
457*5b9c547cSRui Paulo    Service Name Prefix - Mandatory UTF-8 string.
458*5b9c547cSRui Paulo	Will match from beginning of remote Service Name
459*5b9c547cSRui Paulo    Service Information Substring - Optional UTF-8 string
460*5b9c547cSRui Paulo	If Service Information Substring is not included, all services matching
461*5b9c547cSRui Paulo	Service Name Prefix will be returned.
462*5b9c547cSRui Paulo	If Service Information Substring is included, both the Substring and the
463*5b9c547cSRui Paulo	Service Name Prefix must match for service to be returned.
464*5b9c547cSRui Paulo	If remote service has no Service Information, all Substring searches
465*5b9c547cSRui Paulo	will fail.
466*5b9c547cSRui Paulo
467f05cddf9SRui Paulop2p_serv_disc_cancel_req <query identifier>
468f05cddf9SRui Paulo
469f05cddf9SRui PauloCancel a pending P2P service discovery request. This command takes a
470f05cddf9SRui Paulosingle parameter: identifier for the pending query (the value returned
471f05cddf9SRui Pauloby p2p_serv_disc_req, e.g., "p2p_serv_disc_cancel_req 1f77628".
472f05cddf9SRui Paulo
473f05cddf9SRui Paulop2p_serv_disc_resp
474f05cddf9SRui Paulo
475f05cddf9SRui PauloReply to a service discovery query. This command takes following
476f05cddf9SRui Pauloparameters: frequency in MHz, destination address, dialog token,
477f05cddf9SRui Pauloresponse TLV(s). The first three parameters are copied from the
478f05cddf9SRui Paulorequest event. For example, "p2p_serv_disc_resp 2437 02:40:61:c2:f3:b7
479f05cddf9SRui Paulo1 0300000101". This command is used only if external program is used
480f05cddf9SRui Pauloto process the request (see p2p_serv_disc_external).
481f05cddf9SRui Paulo
482f05cddf9SRui Paulop2p_service_update
483f05cddf9SRui Paulo
484f05cddf9SRui PauloIndicate that local services have changed. This is used to increment
485f05cddf9SRui Paulothe P2P service indicator value so that peers know when previously
486f05cddf9SRui Paulocached information may have changed. This is only needed when external
487f05cddf9SRui Pauloservice discovery processing is enabled since the commands to
488f05cddf9SRui Paulopre-configure services for internal processing will increment the
489f05cddf9SRui Pauloindicator automatically.
490f05cddf9SRui Paulo
491f05cddf9SRui Paulop2p_serv_disc_external <0|1>
492f05cddf9SRui Paulo
493f05cddf9SRui PauloConfigure external processing of P2P service requests: 0 (default) =
494f05cddf9SRui Paulono external processing of requests (i.e., internal code will process
495f05cddf9SRui Pauloeach request based on pre-configured services), 1 = external
496f05cddf9SRui Pauloprocessing of requests (external program is responsible for replying
497f05cddf9SRui Pauloto service discovery requests with p2p_serv_disc_resp). Please note
498f05cddf9SRui Paulothat there is quite strict limit on how quickly the response needs to
499f05cddf9SRui Paulobe transmitted, so use of the internal processing is strongly
500f05cddf9SRui Paulorecommended.
501f05cddf9SRui Paulo
502f05cddf9SRui Paulop2p_service_add bonjour <query hexdump> <RDATA hexdump>
503f05cddf9SRui Paulo
504f05cddf9SRui PauloAdd a local Bonjour service for internal SD query processing.
505f05cddf9SRui Paulo
506f05cddf9SRui PauloExamples:
507f05cddf9SRui Paulo
508f05cddf9SRui Paulo# AFP Over TCP (PTR)
509f05cddf9SRui Paulop2p_service_add bonjour 0b5f6166706f766572746370c00c000c01 074578616d706c65c027
510f05cddf9SRui Paulo# AFP Over TCP (TXT) (RDATA=null)
511f05cddf9SRui Paulop2p_service_add bonjour 076578616d706c650b5f6166706f766572746370c00c001001 00
512f05cddf9SRui Paulo
513f05cddf9SRui Paulo# IP Printing over TCP (PTR) (RDATA=MyPrinter._ipp._tcp.local.)
514f05cddf9SRui Paulop2p_service_add bonjour 045f697070c00c000c01 094d795072696e746572c027
515f05cddf9SRui Paulo# IP Printing over TCP (TXT) (RDATA=txtvers=1,pdl=application/postscript)
516f05cddf9SRui Paulop2p_service_add bonjour 096d797072696e746572045f697070c00c001001 09747874766572733d311a70646c3d6170706c69636174696f6e2f706f7374736372797074
517f05cddf9SRui Paulo
518f05cddf9SRui Paulo# Supported Service Type Hash (SSTH)
519f05cddf9SRui Paulop2p_service_add bonjour 000000 <32-byte bitfield as hexdump>
520f05cddf9SRui Paulo(note: see P2P spec Annex E.4 for information on how to construct the bitfield)
521f05cddf9SRui Paulo
522f05cddf9SRui Paulop2p_service_del bonjour <query hexdump>
523f05cddf9SRui Paulo
524f05cddf9SRui PauloRemove a local Bonjour service from internal SD query processing.
525f05cddf9SRui Paulo
526f05cddf9SRui Paulop2p_service_add upnp <version hex> <service>
527f05cddf9SRui Paulo
528f05cddf9SRui PauloAdd a local UPnP service for internal SD query processing.
529f05cddf9SRui Paulo
530f05cddf9SRui PauloExamples:
531f05cddf9SRui Paulo
532f05cddf9SRui Paulop2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice
533f05cddf9SRui Paulop2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::upnp:rootdevice
534f05cddf9SRui Paulop2p_service_add upnp 10 uuid:1122de4e-8574-59ab-9322-333456789044::urn:schemas-upnp-org:service:ContentDirectory:2
535f05cddf9SRui Paulop2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::urn:schemas-upnp-org:service:ContentDirectory:2
536f05cddf9SRui Paulop2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:InternetGatewayDevice:1
537f05cddf9SRui Paulo
538f05cddf9SRui Paulop2p_service_del upnp <version hex> <service>
539f05cddf9SRui Paulo
540f05cddf9SRui PauloRemove a local UPnP service from internal SD query processing.
541f05cddf9SRui Paulo
542*5b9c547cSRui Paulop2p_service_del asp <adv id>
543*5b9c547cSRui Paulo
544*5b9c547cSRui PauloRemoves the local asp service from internal SD query list.
545*5b9c547cSRui PauloFor example: p2p_service_del asp 4d6fc7
546*5b9c547cSRui Paulo
547f05cddf9SRui Paulop2p_service_flush
548f05cddf9SRui Paulo
549f05cddf9SRui PauloRemove all local services from internal SD query processing.
550f05cddf9SRui Paulo
551f05cddf9SRui PauloInvitation
552f05cddf9SRui Paulo
553f05cddf9SRui Paulop2p_invite [persistent=<network id>|group=<group ifname>] [peer=address]
554*5b9c547cSRui Paulo	[go_dev_addr=address] [freq=<freq in MHz>] [ht40] [vht]
555*5b9c547cSRui Paulo	[pref=<MHz>]
556f05cddf9SRui Paulo
557f05cddf9SRui PauloInvite a peer to join a group (e.g., group=wlan1) or to reinvoke a
558f05cddf9SRui Paulopersistent group (e.g., persistent=4). If the peer device is the GO of
559f05cddf9SRui Paulothe persistent group, the peer parameter is not needed. Otherwise it is
560f05cddf9SRui Pauloused to specify which device to invite. go_dev_addr parameter can be
561f05cddf9SRui Pauloused to override the GO device address for Invitation Request should
562f05cddf9SRui Pauloit be not known for some reason (this should not be needed in most
563f05cddf9SRui Paulocases). When reinvoking a persistent group, the GO device can specify
564*5b9c547cSRui Paulothe frequency for the group with the freq parameter. When reinvoking a
565*5b9c547cSRui Paulopersistent group, the P2P client device can use freq parameter to force
566*5b9c547cSRui Pauloa specific operating channel (or invitation failure if GO rejects that)
567*5b9c547cSRui Pauloor pref parameter to request a specific channel (while allowing GO to
568*5b9c547cSRui Pauloselect to use another channel, if needed).
569f05cddf9SRui Paulo
570f05cddf9SRui PauloGroup Operations
571f05cddf9SRui Paulo
572f05cddf9SRui Paulo(These are used on the group interface.)
573f05cddf9SRui Paulo
574f05cddf9SRui Paulowps_pin <any|address> <PIN>
575f05cddf9SRui Paulo
576f05cddf9SRui PauloStart WPS PIN method. This allows a single WPS Enrollee to connect to
577f05cddf9SRui Paulothe AP/GO. This is used on the GO when a P2P client joins an existing
578f05cddf9SRui Paulogroup. The second parameter is the address of the Enrollee or a string
579f05cddf9SRui Paulo"any" to allow any station to use the entered PIN (which will restrict
580f05cddf9SRui Paulothe PIN for one-time-use). PIN is the Enrollee PIN read either from a
581f05cddf9SRui Paulolabel or display on the P2P Client/WPS Enrollee.
582f05cddf9SRui Paulo
583f05cddf9SRui Paulowps_pbc
584f05cddf9SRui Paulo
585f05cddf9SRui PauloStart WPS PBC method (i.e., push the button). This allows a single WPS
586f05cddf9SRui PauloEnrollee to connect to the AP/GO. This is used on the GO when a P2P
587f05cddf9SRui Pauloclient joins an existing group.
588f05cddf9SRui Paulo
589f05cddf9SRui Paulop2p_get_passphrase
590f05cddf9SRui Paulo
591f05cddf9SRui PauloGet the passphrase for a group (only available when acting as a GO).
592f05cddf9SRui Paulo
593f05cddf9SRui Paulop2p_presence_req [<duration> <interval>] [<duration> <interval>]
594f05cddf9SRui Paulo
595f05cddf9SRui PauloSend a P2P Presence Request to the GO (this is only available when
596f05cddf9SRui Pauloacting as a P2P client). If no duration/interval pairs are given, the
597f05cddf9SRui Paulorequest indicates that this client has no special needs for GO
598*5b9c547cSRui Paulopresence. The first parameter pair gives the preferred duration and
599f05cddf9SRui Paulointerval values in microseconds. If the second pair is included, that
600*5b9c547cSRui Pauloindicates which value would be acceptable. This command returns OK
601*5b9c547cSRui Pauloimmediately and the response from the GO is indicated in a
602*5b9c547cSRui PauloP2P-PRESENCE-RESPONSE event message.
603f05cddf9SRui Paulo
604f05cddf9SRui PauloParameters
605f05cddf9SRui Paulo
606f05cddf9SRui Paulop2p_ext_listen [<period> <interval>]
607f05cddf9SRui Paulo
608f05cddf9SRui PauloConfigure Extended Listen Timing. If the parameters are omitted, this
609f05cddf9SRui Paulofeature is disabled. If the parameters are included, Listen State will
610f05cddf9SRui Paulobe entered every interval msec for at least period msec. Both values
611f05cddf9SRui Paulohave acceptable range of 1-65535 (with interval obviously having to be
612f05cddf9SRui Paulolarger than or equal to duration). If the P2P module is not idle at
613f05cddf9SRui Paulothe time the Extended Listen Timing timeout occurs, the Listen State
614f05cddf9SRui Paulooperation will be skipped.
615f05cddf9SRui Paulo
616f05cddf9SRui PauloThe configured values will also be advertised to other P2P Devices. The
617f05cddf9SRui Pauloreceived values are available in the p2p_peer command output:
618f05cddf9SRui Paulo
619f05cddf9SRui Pauloext_listen_period=100 ext_listen_interval=5000
620f05cddf9SRui Paulo
621f05cddf9SRui Paulop2p_set <field> <value>
622f05cddf9SRui Paulo
623f05cddf9SRui PauloChange dynamic P2P parameters
624f05cddf9SRui Paulo
625f05cddf9SRui Paulop2p_set discoverability <0/1>
626f05cddf9SRui Paulo
627f05cddf9SRui PauloDisable/enable advertisement of client discoverability. This is
628f05cddf9SRui Pauloenabled by default and this parameter is mainly used to allow testing
629f05cddf9SRui Pauloof device discoverability.
630f05cddf9SRui Paulo
631f05cddf9SRui Paulop2p_set managed <0/1>
632f05cddf9SRui Paulo
633f05cddf9SRui PauloDisable/enable managed P2P Device operations. This is disabled by
634f05cddf9SRui Paulodefault.
635f05cddf9SRui Paulo
636f05cddf9SRui Paulop2p_set listen_channel <1/6/11>
637f05cddf9SRui Paulo
638f05cddf9SRui PauloSet P2P Listen channel. This is mainly meant for testing purposes and
639f05cddf9SRui Paulochanging the Listen channel during normal operations can result in
640f05cddf9SRui Pauloprotocol failures.
641f05cddf9SRui Paulo
642f05cddf9SRui Paulop2p_set ssid_postfix <postfix>
643f05cddf9SRui Paulo
644f05cddf9SRui PauloSet postfix string to be added to the automatically generated P2P SSID
645f05cddf9SRui Paulo(DIRECT-<two random characters>). For example, postfix of "-testing"
646f05cddf9SRui Paulocould result in the SSID becoming DIRECT-ab-testing.
647f05cddf9SRui Paulo
648*5b9c547cSRui Paulop2p_set per_sta_psk <0/1>
649*5b9c547cSRui Paulo
650*5b9c547cSRui PauloDisabled(default)/enables use of per-client PSK in the P2P groups. This
651*5b9c547cSRui Paulocan be used to request GO to assign a unique PSK for each client during
652*5b9c547cSRui PauloWPS provisioning. When enabled, this allow clients to be removed from
653*5b9c547cSRui Paulothe group securily with p2p_remove_client command since that client's
654*5b9c547cSRui PauloPSK is removed at the same time to prevent it from connecting back using
655*5b9c547cSRui Paulothe old PSK. When per-client PSK is not used, the client can still be
656*5b9c547cSRui Paulodisconnected, but it will be able to re-join the group since the PSK it
657*5b9c547cSRui Paulolearned previously is still valid. It should be noted that the default
658*5b9c547cSRui Paulopassphrase on the GO that is normally used to allow legacy stations to
659*5b9c547cSRui Pauloconnect through manual configuration does not change here, so if that is
660*5b9c547cSRui Pauloshared, devices with knowledge of that passphrase can still connect.
661*5b9c547cSRui Paulo
662f05cddf9SRui Pauloset <field> <value>
663f05cddf9SRui Paulo
664f05cddf9SRui PauloSet global configuration parameters which may also affect P2P
665f05cddf9SRui Paulooperations. The format on these parameters is same as is used in
666f05cddf9SRui Paulowpa_supplicant.conf. Only the parameters listen here should be
667f05cddf9SRui Paulochanged. Modifying other parameters may result in incorrect behavior
668f05cddf9SRui Paulosince not all existing users of the parameters are updated.
669f05cddf9SRui Paulo
670f05cddf9SRui Pauloset uuid <UUID>
671f05cddf9SRui Paulo
672f05cddf9SRui PauloSet WPS UUID (by default, this is generated based on the MAC address).
673f05cddf9SRui Paulo
674f05cddf9SRui Pauloset device_name <device name>
675f05cddf9SRui Paulo
676f05cddf9SRui PauloSet WPS Device Name (also included in some P2P messages).
677f05cddf9SRui Paulo
678f05cddf9SRui Pauloset manufacturer <manufacturer>
679f05cddf9SRui Paulo
680f05cddf9SRui PauloSet WPS Manufacturer.
681f05cddf9SRui Paulo
682f05cddf9SRui Pauloset model_name <model name>
683f05cddf9SRui Paulo
684f05cddf9SRui PauloSet WPS Model Name.
685f05cddf9SRui Paulo
686f05cddf9SRui Pauloset model_number <model number>
687f05cddf9SRui Paulo
688f05cddf9SRui PauloSet WPS Model Number.
689f05cddf9SRui Paulo
690f05cddf9SRui Pauloset serial_number <serial number>
691f05cddf9SRui Paulo
692f05cddf9SRui PauloSet WPS Serial Number.
693f05cddf9SRui Paulo
694f05cddf9SRui Pauloset device_type <device type>
695f05cddf9SRui Paulo
696f05cddf9SRui PauloSet WPS Device Type.
697f05cddf9SRui Paulo
698f05cddf9SRui Pauloset os_version <OS version>
699f05cddf9SRui Paulo
700f05cddf9SRui PauloSet WPS OS Version.
701f05cddf9SRui Paulo
702f05cddf9SRui Pauloset config_methods <config methods>
703f05cddf9SRui Paulo
704f05cddf9SRui PauloSet WPS Configuration Methods.
705f05cddf9SRui Paulo
706f05cddf9SRui Pauloset sec_device_type <device type>
707f05cddf9SRui Paulo
708f05cddf9SRui PauloAdd a new Secondary Device Type.
709f05cddf9SRui Paulo
710f05cddf9SRui Pauloset p2p_go_intent <GO intent>
711f05cddf9SRui Paulo
712f05cddf9SRui PauloSet the default P2P GO Intent. Note: This value can be overridden in
713f05cddf9SRui Paulop2p_connect command and as such, there should be no need to change the
714f05cddf9SRui Paulodefault value here during normal operations.
715f05cddf9SRui Paulo
716f05cddf9SRui Pauloset p2p_ssid_postfix <P2P SSID postfix>
717f05cddf9SRui Paulo
718f05cddf9SRui PauloSet P2P SSID postfix.
719f05cddf9SRui Paulo
720f05cddf9SRui Pauloset persistent_reconnect <0/1>
721f05cddf9SRui Paulo
722f05cddf9SRui PauloDisable/enabled persistent reconnect for reinvocation of persistent
723f05cddf9SRui Paulogroups. If enabled, invitations to reinvoke a persistent group will be
724f05cddf9SRui Pauloaccepted without separate authorization (e.g., user interaction).
725f05cddf9SRui Paulo
726f05cddf9SRui Pauloset country <two character country code>
727f05cddf9SRui Paulo
728f05cddf9SRui PauloSet country code (this is included in some P2P messages).
729f05cddf9SRui Paulo
730*5b9c547cSRui Pauloset p2p_search_delay <delay>
731*5b9c547cSRui Paulo
732*5b9c547cSRui PauloSet p2p_search_delay which adds extra delay in milliseconds between
733*5b9c547cSRui Pauloconcurrent search iterations to make p2p_find friendlier to concurrent
734*5b9c547cSRui Paulooperations by avoiding it from taking 100% of radio resources. The
735*5b9c547cSRui Paulodefault value is 500 ms.
736*5b9c547cSRui Paulo
737f05cddf9SRui PauloStatus
738f05cddf9SRui Paulo
739f05cddf9SRui Paulop2p_peers [discovered]
740f05cddf9SRui Paulo
741f05cddf9SRui PauloList P2P Device Addresses of all the P2P peers we know. The optional
742f05cddf9SRui Paulo"discovered" parameter filters out the peers that we have not fully
743f05cddf9SRui Paulodiscovered, i.e., which we have only seen in a received Probe Request
744f05cddf9SRui Pauloframe.
745f05cddf9SRui Paulo
746f05cddf9SRui Paulop2p_peer <P2P Device Address>
747f05cddf9SRui Paulo
748f05cddf9SRui PauloFetch information about a known P2P peer.
749f05cddf9SRui Paulo
750f05cddf9SRui PauloGroup Status
751f05cddf9SRui Paulo
752f05cddf9SRui Paulo(These are used on the group interface.)
753f05cddf9SRui Paulo
754f05cddf9SRui Paulostatus
755f05cddf9SRui Paulo
756f05cddf9SRui PauloShow status information (connection state, role, use encryption
757f05cddf9SRui Pauloparameters, IP address, etc.).
758f05cddf9SRui Paulo
759f05cddf9SRui Paulosta
760f05cddf9SRui Paulo
761f05cddf9SRui PauloShow information about an associated station (when acting in AP/GO role).
762f05cddf9SRui Paulo
763f05cddf9SRui Pauloall_sta
764f05cddf9SRui Paulo
765f05cddf9SRui PauloLists the currently associated stations.
766f05cddf9SRui Paulo
767f05cddf9SRui PauloConfiguration data
768f05cddf9SRui Paulo
769f05cddf9SRui Paulolist_networks
770f05cddf9SRui Paulo
771f05cddf9SRui PauloLists the configured networks, including stored information for
772f05cddf9SRui Paulopersistent groups. The identifier in this list is used with
773f05cddf9SRui Paulop2p_group_add and p2p_invite to indicate which persistent group is to
774f05cddf9SRui Paulobe reinvoked.
775f05cddf9SRui Paulo
776f05cddf9SRui Pauloremove_network <network id>
777f05cddf9SRui Paulo
778f05cddf9SRui PauloRemove a network entry from configuration.
779f05cddf9SRui Paulo
780f05cddf9SRui Paulo
781*5b9c547cSRui PauloP2PS Events/Responses:
782*5b9c547cSRui Paulo
783*5b9c547cSRui PauloP2PS-PROV-START: This events gets triggered when provisioning is issued for
784*5b9c547cSRui Pauloeither seeker or advertiser.
785*5b9c547cSRui Paulo
786*5b9c547cSRui PauloFor example,
787*5b9c547cSRui PauloP2PS-PROV-START 00:55:44:33:22:11 adv_id=111 adv_mac=00:55:44:33:22:11 conncap=1 session=1234567 session_mac=00:11:22:33:44:55 info='xxxx'
788*5b9c547cSRui Paulo
789*5b9c547cSRui PauloParameters definition:
790*5b9c547cSRui Paulo    MAC address - always
791*5b9c547cSRui Paulo    adv_id - always ASCII hex-encoded u32
792*5b9c547cSRui Paulo    adv_mac - always MAC address that owns/registered the service
793*5b9c547cSRui Paulo    conncap - always mask of 0x01 (new), 0x02 (group client), 0x04 (group owner)
794*5b9c547cSRui Paulo	bits
795*5b9c547cSRui Paulo    session - always Session ID of the first session to be established
796*5b9c547cSRui Paulo    session_mac - always MAC address that owns/initiated the session
797*5b9c547cSRui Paulo    info - if available, UTF-8 string
798*5b9c547cSRui Paulo	Escaped single quote & backslash with a backslash:
799*5b9c547cSRui Paulo	\' == 0x27 == ', and \\ == 0x5c == \
800*5b9c547cSRui Paulo
801*5b9c547cSRui PauloP2PS-PROV-DONE: When provisioning is completed then this event gets triggered.
802*5b9c547cSRui Paulo
803*5b9c547cSRui PauloFor example,
804*5b9c547cSRui PauloP2PS-PROV-DONE 00:11:22:33:44:55 status=0 adv_id=111 adv_mac=00:55:44:33:22:11 conncap=1 session=1234567 session_mac=00:11:22:33:44:55 [dev_passwd_id=8 | go=p2p-wlan0-0 | join=11:22:33:44:55:66 | persist=0]
805*5b9c547cSRui Paulo
806*5b9c547cSRui PauloParameters definition:
807*5b9c547cSRui Paulo    MAC address - always main device address of peer. May be different from MAC
808*5b9c547cSRui Paulo	ultimately connected to.
809*5b9c547cSRui Paulo    status - always ascii hex-encoded u8 (0 == success, 12 == deferred success)
810*5b9c547cSRui Paulo    adv_id - always ascii hex-encoded u32
811*5b9c547cSRui Paulo    adv_mac - always MAC address that owns/registered the service
812*5b9c547cSRui Paulo    conncap - always One of: 1 (new), 2 (group client), 4 (group owner) bits
813*5b9c547cSRui Paulo    session - always Session ID of the first session to be established
814*5b9c547cSRui Paulo    session_mac - always MAC address that owns/initiated the session
815*5b9c547cSRui Paulo    dev_passwd_id - only if conncap value == 1 (New GO negotiation)
816*5b9c547cSRui Paulo	8 - "p2ps" password must be passed in p2p_connect command
817*5b9c547cSRui Paulo	1 - "display" password must be passed in p2p_connect command
818*5b9c547cSRui Paulo	5 - "keypad" password must be passed in p2p_connect command
819*5b9c547cSRui Paulo    join only - if conncap value == 2 (Client Only). Display password and "join"
820*5b9c547cSRui Paulo	must be passed in p2p_connect and address must be the MAC specified
821*5b9c547cSRui Paulo    go only - if conncap value == 4 (GO Only). Interface name must be set with a
822*5b9c547cSRui Paulo	password
823*5b9c547cSRui Paulo    persist - only if previous persistent group existed between peers and shall
824*5b9c547cSRui Paulo	be re-used. Group is restarted by sending "p2p_group_add persistent=0"
825*5b9c547cSRui Paulo	where value is taken from P2P-PROV-DONE
826*5b9c547cSRui Paulo
827*5b9c547cSRui PauloExtended Events/Response
828*5b9c547cSRui Paulo
829*5b9c547cSRui PauloP2P-DEVICE-FOUND 00:11:22:33:44:55 p2p_dev_addr=00:11:22:33:44:55 pri_dev_type=0-00000000-0 name='' config_methods=0x108 dev_capab=0x21 group_capab=0x0 adv_id=111 asp_svc=alt.example.chat
830*5b9c547cSRui Paulo
831*5b9c547cSRui PauloParameters definition:
832*5b9c547cSRui Paulo    adv_id - if ASP ASCII hex-encoded u32. If it is reporting the
833*5b9c547cSRui Paulo	"wildcard service", this value will be 0
834*5b9c547cSRui Paulo    asp_svc - if ASP this is the service string. If it is reporting the
835*5b9c547cSRui Paulo	"wildcard service", this value will be org.wi-fi.wfds
836*5b9c547cSRui Paulo
837*5b9c547cSRui Paulo
838f05cddf9SRui Paulowpa_cli action script
839f05cddf9SRui Paulo---------------------
840f05cddf9SRui Paulo
841f05cddf9SRui PauloSee examples/p2p-action.sh
842f05cddf9SRui Paulo
843f05cddf9SRui PauloTODO: describe DHCP/DNS setup
844f05cddf9SRui PauloTODO: cross-connection
845