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>] \ 755b9c547cSRui Paulo [dev_id=<addr>] [dev_type=<device type>] \ 765b9c547cSRui 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 845b9c547cSRui Paulofull scan. When the type parameter is not included (i.e., full scan), the 855b9c547cSRui Paulooptional freq parameter can be used to override the first scan to use only 865b9c547cSRui 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 935b9c547cSRui PauloThe optional dev_type option can be used to specify a single device type 945b9c547cSRui Paulo(primary or secondary) to search for, e.g., 955b9c547cSRui Paulo"p2p_find dev_type=1-0050F204-1". 965b9c547cSRui Paulo 975b9c547cSRui Paulo 985b9c547cSRui PauloWith one or more seek arguments, the command sends Probe Request frames 995b9c547cSRui Paulofor a P2PS service. For example, 1005b9c547cSRui Paulop2p_find 5 dev_id=11:22:33:44:55:66 seek=alt.example.chat seek=alt.example.video 1015b9c547cSRui Paulo 1025b9c547cSRui PauloParameters description: 1035b9c547cSRui Paulo Timeout - Optional ASCII base-10-encoded u16. If missing, request will not 1045b9c547cSRui Paulo time out and must be canceled manually 1055b9c547cSRui Paulo dev_id - Optional to request responses from a single known remote device 1065b9c547cSRui Paulo Service Name - Mandatory UTF-8 string for ASP seeks 1075b9c547cSRui Paulo Service name must match the remote service being advertised exactly 1085b9c547cSRui Paulo (no prefix matching). 1095b9c547cSRui Paulo Service name may be empty, in which case all ASP services will be 1105b9c547cSRui Paulo returned, and may be filtered with p2p_serv_disc_req settings, and 1115b9c547cSRui Paulo p2p_serv_asp_resp results. 1125b9c547cSRui Paulo Multiple service names may be requested, but if it exceeds internal 1135b9c547cSRui Paulo limit, it will automatically revert to requesting all ASP services. 1145b9c547cSRui 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 1515b9c547cSRui Paulop2p_connect <peer device address> <pbc|pin|PIN#|p2ps> [display|keypad|p2ps] 152f05cddf9SRui Paulo [persistent|persistent=<network id>] [join|auth] 153*4bc52338SCy Schubert [go_intent=<0..15>] [freq=<in MHz>] [ht40] [vht] [he] [provdisc] [auto] 154780fb4a2SCy Schubert [ssid=<hexdump>] 155f05cddf9SRui Paulo 156f05cddf9SRui PauloStart P2P group formation with a discovered P2P peer. This includes 157f05cddf9SRui Paulooptional group owner negotiation, group interface setup, provisioning, 158f05cddf9SRui Pauloand establishing data connection. 159f05cddf9SRui Paulo 160f05cddf9SRui PauloThe <pbc|pin|PIN#> parameter specifies the WPS provisioning 161f05cddf9SRui Paulomethod. "pbc" string starts pushbutton method, "pin" string start PIN 162f05cddf9SRui Paulomethod using an automatically generated PIN (which will be returned as 163f05cddf9SRui Paulothe command return code), PIN# means that a pre-selected PIN can be 164f05cddf9SRui Pauloused (e.g., 12345670). [display|keypad] is used with PIN method 165f05cddf9SRui Pauloto specify which PIN is used (display=dynamically generated random PIN 166f05cddf9SRui Paulofrom local display, keypad=PIN entered from peer display). "persistent" 167f05cddf9SRui Pauloparameter can be used to request a persistent group to be formed. The 168f05cddf9SRui Paulo"persistent=<network id>" alternative can be used to pre-populate 169f05cddf9SRui PauloSSID/passphrase configuration based on a previously used persistent 170f05cddf9SRui Paulogroup where this device was the GO. The previously used parameters will 171f05cddf9SRui Paulothen be used if the local end becomes the GO in GO Negotiation (which 172f05cddf9SRui Paulocan be forced with go_intent=15). 173f05cddf9SRui Paulo 174f05cddf9SRui Paulo"join" indicates that this is a command to join an existing group as a 175f05cddf9SRui Pauloclient. It skips the GO Negotiation part. This will send a Provision 176f05cddf9SRui PauloDiscovery Request message to the target GO before associating for WPS 177f05cddf9SRui Pauloprovisioning. 178f05cddf9SRui Paulo 179f05cddf9SRui Paulo"auth" indicates that the WPS parameters are authorized for the peer 180f05cddf9SRui Paulodevice without actually starting GO Negotiation (i.e., the peer is 181f05cddf9SRui Pauloexpected to initiate GO Negotiation). This is mainly for testing 182f05cddf9SRui Paulopurposes. 183f05cddf9SRui Paulo 184f05cddf9SRui Paulo"go_intent" can be used to override the default GO Intent for this GO 185f05cddf9SRui PauloNegotiation. 186f05cddf9SRui Paulo 187f05cddf9SRui Paulo"freq" can be used to set a forced operating channel (e.g., freq=2412 188f05cddf9SRui Pauloto select 2.4 GHz channel 1). 189f05cddf9SRui Paulo 190f05cddf9SRui Paulo"provdisc" can be used to request a Provision Discovery exchange to be 191f05cddf9SRui Pauloused prior to starting GO Negotiation as a workaround with some deployed 192f05cddf9SRui PauloP2P implementations that require this to allow the user to accept the 193f05cddf9SRui Pauloconnection. 194f05cddf9SRui Paulo 1955b9c547cSRui Paulo"auto" can be used to request wpa_supplicant to automatically figure 1965b9c547cSRui Pauloout whether the peer device is operating as a GO and if so, use 1975b9c547cSRui Paulojoin-a-group operation rather than GO Negotiation. 1985b9c547cSRui Paulo 199780fb4a2SCy Schubert"ssid=<hexdump>" can be used to specify the Group SSID for join 200780fb4a2SCy Schubertoperations. This allows the P2P Client interface to filter scan results 201780fb4a2SCy Schubertbased on SSID to avoid selecting an incorrect BSS entry in case the same 202780fb4a2SCy SchubertP2P Device or Interface address have been used in multiple groups 203780fb4a2SCy Schubertrecently. 204780fb4a2SCy Schubert 2055b9c547cSRui PauloP2PS attribute changes to p2p_connect command: 2065b9c547cSRui Paulo 2075b9c547cSRui PauloP2PS supports two WPS provisioning methods namely PIN method and P2PS default. 208780fb4a2SCy SchubertThe remaining parameters hold same role as in legacy P2P. In case of P2PS 209780fb4a2SCy Schubertdefault config method "p2ps" keyword is added in p2p_connect command. 2105b9c547cSRui Paulo 2115b9c547cSRui PauloFor example: 2125b9c547cSRui Paulop2p_connect 02:0a:f5:85:11:00 12345670 p2ps persistent join 2135b9c547cSRui Paulo (WPS Method = P2PS default) 2145b9c547cSRui Paulo 2155b9c547cSRui Paulop2p_connect 02:0a:f5:85:11:00 45629034 keypad persistent 2165b9c547cSRui Paulo (WPS Method = PIN) 2175b9c547cSRui Paulo 2185b9c547cSRui Paulop2p_asp_provision <peer MAC address> <adv_id=peer adv id> 2195b9c547cSRui Paulo <adv_mac=peer MAC address> [role=2|4|1] <session=session id> 2205b9c547cSRui Paulo <session_mac=initiator mac address> 2215b9c547cSRui Paulo [info='service info'] <method=Default|keypad|Display> 2225b9c547cSRui Paulo 2235b9c547cSRui PauloThis command starts provision discovery with the P2PS enabled peer device. 2245b9c547cSRui Paulo 2255b9c547cSRui PauloFor example, 2265b9c547cSRui 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 2275b9c547cSRui Paulo 2285b9c547cSRui PauloParameter description: 2295b9c547cSRui Paulo MAC address - Mandatory 2305b9c547cSRui Paulo adv_id - Mandatory remote Advertising ID of service connection is being 2315b9c547cSRui Paulo established for 2325b9c547cSRui Paulo adv_mac - Mandatory MAC address that owns/registered the service 2335b9c547cSRui Paulo role - Optional 2345b9c547cSRui Paulo 2 (group client only) or 4 (group owner only) 2355b9c547cSRui Paulo if not present (or 1) role is negotiated by the two peers. 2365b9c547cSRui Paulo session - Mandatory Session ID of the first session to be established 2375b9c547cSRui Paulo session_mac - Mandatory MAC address that owns/initiated the session 2385b9c547cSRui Paulo method - Optional method to request for provisioning (1000 - P2PS Default, 2395b9c547cSRui Paulo 100 - Keypad(PIN), 8 - Display(PIN)) 2405b9c547cSRui Paulo info - Optional UTF-8 string. Hint for service to indicate possible usage 2415b9c547cSRui Paulo parameters - Escape single quote & backslash: 2425b9c547cSRui Paulo with a backslash 0x27 == ' == \', and 0x5c == \ == \\ 2435b9c547cSRui Paulo 2445b9c547cSRui Paulop2p_asp_provision_resp <peer mac address> <adv_id= local adv id> 2455b9c547cSRui Paulo <adv_mac=local MAC address> <role=1|2|4> <status=0> 2465b9c547cSRui Paulo <session=session id> <session_mac=peer MAC address> 2475b9c547cSRui Paulo 2485b9c547cSRui PauloThis command sends a provision discovery response from responder side. 2495b9c547cSRui Paulo 2505b9c547cSRui PauloFor example, 2515b9c547cSRui 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 2525b9c547cSRui Paulo 2535b9c547cSRui PauloParameters definition: 2545b9c547cSRui Paulo MAC address - Mandatory 2555b9c547cSRui Paulo adv_id - Mandatory local Advertising ID of service connection is being 2565b9c547cSRui Paulo established for 2575b9c547cSRui Paulo adv_mac - Mandatory MAC address that owns/registered the service 2585b9c547cSRui Paulo role - Optional 2 (group client only) or 4 (group owner only) 2595b9c547cSRui Paulo if not present (or 1) role is negotiated by the two peers. 2605b9c547cSRui Paulo status - Mandatory Acceptance/Rejection code of Provisioning 2615b9c547cSRui Paulo session - Mandatory Session ID of the first session to be established 2625b9c547cSRui Paulo session_mac - Mandatory MAC address that owns/initiated the session 2635b9c547cSRui Paulo 2645b9c547cSRui Paulop2p_group_add [persistent|persistent=<network id>] [freq=<freq in MHz>] 265*4bc52338SCy Schubert [ht40] [vht] [he] 266f05cddf9SRui Paulo 267f05cddf9SRui PauloSet up a P2P group owner manually (i.e., without group owner 268f05cddf9SRui Paulonegotiation with a specific peer). This is also known as autonomous 269f05cddf9SRui PauloGO. Optional persistent=<network id> can be used to specify restart of 270f05cddf9SRui Pauloa persistent group. Optional freq=<freq in MHz> can be used to force 271f05cddf9SRui Paulothe GO to be started on a specific frequency. Special freq=2 or freq=5 272f05cddf9SRui Paulooptions can be used to request the best 2.4 GHz or 5 GHz band channel 273f05cddf9SRui Pauloto be selected automatically. 274f05cddf9SRui Paulo 275f05cddf9SRui Paulop2p_reject <peer device address> 276f05cddf9SRui Paulo 277f05cddf9SRui PauloReject connection attempt from a peer (specified with a device 278f05cddf9SRui Pauloaddress). This is a mechanism to reject a pending GO Negotiation with 279f05cddf9SRui Pauloa peer and request to automatically block any further connection or 280f05cddf9SRui Paulodiscovery of the peer. 281f05cddf9SRui Paulo 282f05cddf9SRui Paulop2p_group_remove <group interface> 283f05cddf9SRui Paulo 284f05cddf9SRui PauloTerminate a P2P group. If a new virtual network interface was used for 285f05cddf9SRui Paulothe group, it will also be removed. The network interface name of the 286f05cddf9SRui Paulogroup interface is used as a parameter for this command. 287f05cddf9SRui Paulo 288f05cddf9SRui Paulop2p_cancel 289f05cddf9SRui Paulo 290f05cddf9SRui PauloCancel an ongoing P2P group formation and joining-a-group related 291780fb4a2SCy Schubertoperation. This operation unauthorizes the specific peer device (if any 292f05cddf9SRui Paulohad been authorized to start group formation), stops P2P find (if in 293f05cddf9SRui Pauloprogress), stops pending operations for join-a-group, and removes the 294f05cddf9SRui PauloP2P group interface (if one was used) that is in the WPS provisioning 295f05cddf9SRui Paulostep. If the WPS provisioning step has been completed, the group is not 296f05cddf9SRui Pauloterminated. 297f05cddf9SRui Paulo 2985b9c547cSRui Paulop2p_remove_client <peer's P2P Device Address|iface=<interface address>> 2995b9c547cSRui Paulo 3005b9c547cSRui PauloThis command can be used to remove the specified client from all groups 3015b9c547cSRui Paulo(operating and persistent) from the local GO. Note that the peer device 3025b9c547cSRui Paulocan rejoin the group if it is in possession of a valid key. See p2p_set 3035b9c547cSRui Pauloper_sta_psk command below for more details on how the peer can be 3045b9c547cSRui Pauloremoved securely. 3055b9c547cSRui Paulo 306f05cddf9SRui PauloService Discovery 307f05cddf9SRui Paulo 3085b9c547cSRui Paulop2p_service_add asp <auto accept> <adv id> <status 0/1> <Config Methods> 3095b9c547cSRui Paulo <Service name> [Service Information] [Response Info] 3105b9c547cSRui Paulo 3115b9c547cSRui PauloThis command can be used to search for a P2PS service which includes 3125b9c547cSRui PauloPlay, Send, Display, and Print service. The parameters for this command 3135b9c547cSRui Pauloare "asp" to identify the command as P2PS one, auto accept value, 3145b9c547cSRui Pauloadvertisement id which uniquely identifies the service requests, state 3155b9c547cSRui Pauloof the service whether the service is available or not, config methods 3165b9c547cSRui Paulowhich can be either P2PS method or PIN method, service name followed by 3175b9c547cSRui Paulotwo optional parameters service information, and response info. 3185b9c547cSRui Paulo 3195b9c547cSRui PauloFor example, 3205b9c547cSRui Paulop2p_service_add asp 1 4d6fc7 0 1108 alt.example.chat svc_info='name=john' rsp_info='enter PIN 1234' 3215b9c547cSRui Paulo 3225b9c547cSRui PauloParameters definition: 3235b9c547cSRui Paulo asp - Mandatory for ASP service registration 3245b9c547cSRui Paulo auto accept - Mandatory ASCII hex-encoded boolean (0 == no auto-accept, 3255b9c547cSRui Paulo 1 == auto-accept ANY role, 2 == auto-accept CLIENT role, 3265b9c547cSRui Paulo 4 == auto-accept GO role) 3275b9c547cSRui Paulo Advertisement ID - Mandatory non-zero ASCII hex-encoded u32 3285b9c547cSRui Paulo (Must be unique/not yet exist in svc db) 3295b9c547cSRui Paulo State - Mandatory ASCII hex-encoded u8 (0 -- Svc not available, 3305b9c547cSRui Paulo 1 -- Svc available, 2-0xff Application defined) 3315b9c547cSRui Paulo Config Methods - Mandatory ASCII hex-encoded u16 (bitmask of WSC config 3325b9c547cSRui Paulo methods) 3335b9c547cSRui Paulo Service Name - Mandatory UTF-8 string 3345b9c547cSRui Paulo Service Information - Optional UTF-8 string 3355b9c547cSRui Paulo Escape single quote & backslash with a backslash: 3365b9c547cSRui Paulo 0x27 == ' == \', and 0x5c == \ == \\ 3375b9c547cSRui Paulo Session response information - Optional (used only if auto accept is TRUE) 3385b9c547cSRui Paulo UTF-8 string 3395b9c547cSRui Paulo Escape single quote & backslash with a backslash: 3405b9c547cSRui Paulo 0x27 == ' == \', and 0x5c == \ == \\ 3415b9c547cSRui Paulo 3425b9c547cSRui Paulop2p_service_rep asp <auto accept> <adv id> <status 0/1> <Config Methods> 3435b9c547cSRui Paulo <Service name> [Service Information] [Response Info] 3445b9c547cSRui Paulo 3455b9c547cSRui PauloThis command can be used to replace the existing service request 3465b9c547cSRui Pauloattributes from the initiator side. The replacement is only allowed if 3475b9c547cSRui Paulothe advertisement id issued in the command matches with any one entry in 3485b9c547cSRui Paulothe list of existing SD queries. If advertisement id doesn't match the 3495b9c547cSRui Paulocommand returns a failure. 3505b9c547cSRui Paulo 3515b9c547cSRui PauloFor example, 3525b9c547cSRui Paulop2p_service_rep asp 1 4d6fc7 1 1108 alt.example.chat svc_info='name=john' rsp_info='enter PIN 1234' 3535b9c547cSRui Paulo 3545b9c547cSRui PauloParameters definition: 3555b9c547cSRui Paulo asp - Mandatory for ASP service registration 3565b9c547cSRui Paulo auto accept - Mandatory ASCII hex-encoded boolean (1 == true, 0 == false) 3575b9c547cSRui Paulo Advertisement ID - Mandatory non-zero ASCII hex-encoded u32 3585b9c547cSRui Paulo (Must already exist in svc db) 3595b9c547cSRui Paulo State - Mandatory ASCII hex-encoded u8 (can be used to indicate svc 3605b9c547cSRui Paulo available or not available for instance) 3615b9c547cSRui Paulo Config Methods - Mandatory ASCII hex-encoded u16 (bitmask of WSC config 3625b9c547cSRui Paulo methods) 3635b9c547cSRui Paulo Service Name - Mandatory UTF-8 string (Must match existing string in svc db) 3645b9c547cSRui Paulo Service Information - Optional UTF-8 string 3655b9c547cSRui Paulo Escape single quote & backslash with a backslash: 3665b9c547cSRui Paulo 0x27 == ' == \', and 0x5c == \ == \\ 3675b9c547cSRui Paulo Session response information - Optional (used only if auto accept is TRUE) 3685b9c547cSRui Paulo UTF-8 string 3695b9c547cSRui Paulo Escape single quote & backslash with a backslash: 3705b9c547cSRui Paulo 0x27 == ' == \', and 0x5c == \ == \\ 3715b9c547cSRui Paulo 372f05cddf9SRui Paulop2p_serv_disc_req 373f05cddf9SRui Paulo 374f05cddf9SRui PauloSchedule a P2P service discovery request. The parameters for this 375f05cddf9SRui Paulocommand are the device address of the peer device (or 00:00:00:00:00:00 376f05cddf9SRui Paulofor wildcard query that is sent to every discovered P2P peer that 377f05cddf9SRui Paulosupports service discovery) and P2P Service Query TLV(s) as hexdump. For 378f05cddf9SRui Pauloexample, 379f05cddf9SRui Paulo 380f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000001 381f05cddf9SRui Paulo 382f05cddf9SRui Pauloschedules a request for listing all available services of all service 383f05cddf9SRui Paulodiscovery protocols and requests this to be sent to all discovered 384f05cddf9SRui Paulopeers (note: this can result in long response frames). The pending 385f05cddf9SRui Paulorequests are sent during device discovery (see p2p_find). 386f05cddf9SRui Paulo 3875b9c547cSRui PauloThere can be multiple pending peer device specific queries (each will be 3885b9c547cSRui Paulosent in sequence whenever the peer is found). 389f05cddf9SRui Paulo 390f05cddf9SRui PauloThis command returns an identifier for the pending query (e.g., 391f05cddf9SRui Paulo"1f77628") that can be used to cancel the request. Directed requests 392f05cddf9SRui Paulowill be automatically removed when the specified peer has replied to 393f05cddf9SRui Pauloit. 394f05cddf9SRui Paulo 3955b9c547cSRui PauloService Query TLV has following format: 3965b9c547cSRui PauloLength (2 octets, little endian) - length of following data 3975b9c547cSRui PauloService Protocol Type (1 octet) - see the table below 3985b9c547cSRui PauloService Transaction ID (1 octet) - nonzero identifier for the TLV 3995b9c547cSRui PauloQuery Data (Length - 2 octets of data) - service protocol specific data 4005b9c547cSRui Paulo 4015b9c547cSRui PauloService Protocol Types: 4025b9c547cSRui Paulo0 = All service protocols 4035b9c547cSRui Paulo1 = Bonjour 4045b9c547cSRui Paulo2 = UPnP 4055b9c547cSRui Paulo3 = WS-Discovery 4065b9c547cSRui Paulo4 = Wi-Fi Display 4075b9c547cSRui Paulo 408f05cddf9SRui PauloFor UPnP, an alternative command format can be used to specify a 409f05cddf9SRui Paulosingle query TLV (i.e., a service discovery for a specific UPnP 410f05cddf9SRui Pauloservice): 411f05cddf9SRui Paulo 412f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp <version hex> <ST: from M-SEARCH> 413f05cddf9SRui Paulo 414f05cddf9SRui PauloFor example: 415f05cddf9SRui Paulo 416f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1 417f05cddf9SRui Paulo 418f05cddf9SRui PauloAdditional examples for queries: 419f05cddf9SRui Paulo 420f05cddf9SRui Paulo# list of all Bonjour services 421f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000101 422f05cddf9SRui Paulo 423f05cddf9SRui Paulo# list of all UPnP services 424f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000201 425f05cddf9SRui Paulo 426f05cddf9SRui Paulo# list of all WS-Discovery services 427f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 02000301 428f05cddf9SRui Paulo 429f05cddf9SRui Paulo# list of all Bonjour and UPnP services 430f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 0200010102000202 431f05cddf9SRui Paulo 432f05cddf9SRui Paulo# Apple File Sharing over TCP 433f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 130001010b5f6166706f766572746370c00c000c01 434f05cddf9SRui Paulo 435f05cddf9SRui Paulo# Bonjour SSTH (supported service type hash) 436f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 05000101000000 437f05cddf9SRui Paulo 438f05cddf9SRui Paulo# UPnP examples 439f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 ssdp:all 440f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 upnp:rootdevice 441f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:service:ContentDirectory:2 442f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 uuid:6859dede-8574-59ab-9332-123456789012 443f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1 444f05cddf9SRui Paulo 445f05cddf9SRui Paulo# Wi-Fi Display examples 446f05cddf9SRui Paulo# format: wifi-display <list of roles> <list of subelements> 447f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source] 2,3,4,5 448f05cddf9SRui Paulop2p_serv_disc_req 02:01:02:03:04:05 wifi-display [pri-sink] 3 449f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [sec-source] 2 450f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source+sink] 2,3,4,5 451f05cddf9SRui Paulop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source][pri-sink] 2,3,4,5 452f05cddf9SRui Paulo 4535b9c547cSRui Paulop2p_serv_disc_req <Unicast|Broadcast mac address> asp <Transaction ID> 4545b9c547cSRui Paulo <Service Name> [Service Information] 4555b9c547cSRui Paulo 4565b9c547cSRui PauloThe command can be used for service discovery for P2PS enabled devices. 4575b9c547cSRui Paulo 4585b9c547cSRui PauloFor example: p2p_serv_disc_req 00:00:00:00:00:00 asp a1 alt.example 'john' 4595b9c547cSRui Paulo 4605b9c547cSRui PauloParameters definition: 4615b9c547cSRui Paulo MAC address - Mandatory Existing 4625b9c547cSRui Paulo asp - Mandatory for ASP queries 4635b9c547cSRui Paulo Transaction ID - Mandatory non-zero ASCII hex-encoded u8 for GAS 4645b9c547cSRui Paulo Service Name Prefix - Mandatory UTF-8 string. 4655b9c547cSRui Paulo Will match from beginning of remote Service Name 4665b9c547cSRui Paulo Service Information Substring - Optional UTF-8 string 4675b9c547cSRui Paulo If Service Information Substring is not included, all services matching 4685b9c547cSRui Paulo Service Name Prefix will be returned. 4695b9c547cSRui Paulo If Service Information Substring is included, both the Substring and the 4705b9c547cSRui Paulo Service Name Prefix must match for service to be returned. 4715b9c547cSRui Paulo If remote service has no Service Information, all Substring searches 4725b9c547cSRui Paulo will fail. 4735b9c547cSRui Paulo 474f05cddf9SRui Paulop2p_serv_disc_cancel_req <query identifier> 475f05cddf9SRui Paulo 476f05cddf9SRui PauloCancel a pending P2P service discovery request. This command takes a 477f05cddf9SRui Paulosingle parameter: identifier for the pending query (the value returned 478f05cddf9SRui Pauloby p2p_serv_disc_req, e.g., "p2p_serv_disc_cancel_req 1f77628". 479f05cddf9SRui Paulo 480f05cddf9SRui Paulop2p_serv_disc_resp 481f05cddf9SRui Paulo 482f05cddf9SRui PauloReply to a service discovery query. This command takes following 483f05cddf9SRui Pauloparameters: frequency in MHz, destination address, dialog token, 484f05cddf9SRui Pauloresponse TLV(s). The first three parameters are copied from the 485f05cddf9SRui Paulorequest event. For example, "p2p_serv_disc_resp 2437 02:40:61:c2:f3:b7 486f05cddf9SRui Paulo1 0300000101". This command is used only if external program is used 487f05cddf9SRui Pauloto process the request (see p2p_serv_disc_external). 488f05cddf9SRui Paulo 489f05cddf9SRui Paulop2p_service_update 490f05cddf9SRui Paulo 491f05cddf9SRui PauloIndicate that local services have changed. This is used to increment 492f05cddf9SRui Paulothe P2P service indicator value so that peers know when previously 493f05cddf9SRui Paulocached information may have changed. This is only needed when external 494f05cddf9SRui Pauloservice discovery processing is enabled since the commands to 495f05cddf9SRui Paulopre-configure services for internal processing will increment the 496f05cddf9SRui Pauloindicator automatically. 497f05cddf9SRui Paulo 498f05cddf9SRui Paulop2p_serv_disc_external <0|1> 499f05cddf9SRui Paulo 500f05cddf9SRui PauloConfigure external processing of P2P service requests: 0 (default) = 501f05cddf9SRui Paulono external processing of requests (i.e., internal code will process 502f05cddf9SRui Pauloeach request based on pre-configured services), 1 = external 503f05cddf9SRui Pauloprocessing of requests (external program is responsible for replying 504f05cddf9SRui Pauloto service discovery requests with p2p_serv_disc_resp). Please note 505f05cddf9SRui Paulothat there is quite strict limit on how quickly the response needs to 506f05cddf9SRui Paulobe transmitted, so use of the internal processing is strongly 507f05cddf9SRui Paulorecommended. 508f05cddf9SRui Paulo 509f05cddf9SRui Paulop2p_service_add bonjour <query hexdump> <RDATA hexdump> 510f05cddf9SRui Paulo 511f05cddf9SRui PauloAdd a local Bonjour service for internal SD query processing. 512f05cddf9SRui Paulo 513f05cddf9SRui PauloExamples: 514f05cddf9SRui Paulo 515f05cddf9SRui Paulo# AFP Over TCP (PTR) 516f05cddf9SRui Paulop2p_service_add bonjour 0b5f6166706f766572746370c00c000c01 074578616d706c65c027 517f05cddf9SRui Paulo# AFP Over TCP (TXT) (RDATA=null) 518f05cddf9SRui Paulop2p_service_add bonjour 076578616d706c650b5f6166706f766572746370c00c001001 00 519f05cddf9SRui Paulo 520f05cddf9SRui Paulo# IP Printing over TCP (PTR) (RDATA=MyPrinter._ipp._tcp.local.) 521f05cddf9SRui Paulop2p_service_add bonjour 045f697070c00c000c01 094d795072696e746572c027 522f05cddf9SRui Paulo# IP Printing over TCP (TXT) (RDATA=txtvers=1,pdl=application/postscript) 523f05cddf9SRui Paulop2p_service_add bonjour 096d797072696e746572045f697070c00c001001 09747874766572733d311a70646c3d6170706c69636174696f6e2f706f7374736372797074 524f05cddf9SRui Paulo 525f05cddf9SRui Paulo# Supported Service Type Hash (SSTH) 526f05cddf9SRui Paulop2p_service_add bonjour 000000 <32-byte bitfield as hexdump> 527f05cddf9SRui Paulo(note: see P2P spec Annex E.4 for information on how to construct the bitfield) 528f05cddf9SRui Paulo 529f05cddf9SRui Paulop2p_service_del bonjour <query hexdump> 530f05cddf9SRui Paulo 531f05cddf9SRui PauloRemove a local Bonjour service from internal SD query processing. 532f05cddf9SRui Paulo 533f05cddf9SRui Paulop2p_service_add upnp <version hex> <service> 534f05cddf9SRui Paulo 535f05cddf9SRui PauloAdd a local UPnP service for internal SD query processing. 536f05cddf9SRui Paulo 537f05cddf9SRui PauloExamples: 538f05cddf9SRui Paulo 539f05cddf9SRui Paulop2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice 540f05cddf9SRui Paulop2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::upnp:rootdevice 541f05cddf9SRui Paulop2p_service_add upnp 10 uuid:1122de4e-8574-59ab-9322-333456789044::urn:schemas-upnp-org:service:ContentDirectory:2 542f05cddf9SRui Paulop2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::urn:schemas-upnp-org:service:ContentDirectory:2 543f05cddf9SRui Paulop2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:InternetGatewayDevice:1 544f05cddf9SRui Paulo 545f05cddf9SRui Paulop2p_service_del upnp <version hex> <service> 546f05cddf9SRui Paulo 547f05cddf9SRui PauloRemove a local UPnP service from internal SD query processing. 548f05cddf9SRui Paulo 5495b9c547cSRui Paulop2p_service_del asp <adv id> 5505b9c547cSRui Paulo 5515b9c547cSRui PauloRemoves the local asp service from internal SD query list. 5525b9c547cSRui PauloFor example: p2p_service_del asp 4d6fc7 5535b9c547cSRui Paulo 554f05cddf9SRui Paulop2p_service_flush 555f05cddf9SRui Paulo 556f05cddf9SRui PauloRemove all local services from internal SD query processing. 557f05cddf9SRui Paulo 558f05cddf9SRui PauloInvitation 559f05cddf9SRui Paulo 560f05cddf9SRui Paulop2p_invite [persistent=<network id>|group=<group ifname>] [peer=address] 561*4bc52338SCy Schubert [go_dev_addr=address] [freq=<freq in MHz>] [ht40] [vht] [he] 5625b9c547cSRui Paulo [pref=<MHz>] 563f05cddf9SRui Paulo 564f05cddf9SRui PauloInvite a peer to join a group (e.g., group=wlan1) or to reinvoke a 565f05cddf9SRui Paulopersistent group (e.g., persistent=4). If the peer device is the GO of 566f05cddf9SRui Paulothe persistent group, the peer parameter is not needed. Otherwise it is 567f05cddf9SRui Pauloused to specify which device to invite. go_dev_addr parameter can be 568f05cddf9SRui Pauloused to override the GO device address for Invitation Request should 569f05cddf9SRui Pauloit be not known for some reason (this should not be needed in most 570f05cddf9SRui Paulocases). When reinvoking a persistent group, the GO device can specify 5715b9c547cSRui Paulothe frequency for the group with the freq parameter. When reinvoking a 5725b9c547cSRui Paulopersistent group, the P2P client device can use freq parameter to force 5735b9c547cSRui Pauloa specific operating channel (or invitation failure if GO rejects that) 5745b9c547cSRui Pauloor pref parameter to request a specific channel (while allowing GO to 5755b9c547cSRui Pauloselect to use another channel, if needed). 576f05cddf9SRui Paulo 577f05cddf9SRui PauloGroup Operations 578f05cddf9SRui Paulo 579f05cddf9SRui Paulo(These are used on the group interface.) 580f05cddf9SRui Paulo 581f05cddf9SRui Paulowps_pin <any|address> <PIN> 582f05cddf9SRui Paulo 583f05cddf9SRui PauloStart WPS PIN method. This allows a single WPS Enrollee to connect to 584f05cddf9SRui Paulothe AP/GO. This is used on the GO when a P2P client joins an existing 585f05cddf9SRui Paulogroup. The second parameter is the address of the Enrollee or a string 586f05cddf9SRui Paulo"any" to allow any station to use the entered PIN (which will restrict 587f05cddf9SRui Paulothe PIN for one-time-use). PIN is the Enrollee PIN read either from a 588f05cddf9SRui Paulolabel or display on the P2P Client/WPS Enrollee. 589f05cddf9SRui Paulo 590f05cddf9SRui Paulowps_pbc 591f05cddf9SRui Paulo 592f05cddf9SRui PauloStart WPS PBC method (i.e., push the button). This allows a single WPS 593f05cddf9SRui PauloEnrollee to connect to the AP/GO. This is used on the GO when a P2P 594f05cddf9SRui Pauloclient joins an existing group. 595f05cddf9SRui Paulo 596f05cddf9SRui Paulop2p_get_passphrase 597f05cddf9SRui Paulo 598f05cddf9SRui PauloGet the passphrase for a group (only available when acting as a GO). 599f05cddf9SRui Paulo 600f05cddf9SRui Paulop2p_presence_req [<duration> <interval>] [<duration> <interval>] 601f05cddf9SRui Paulo 602f05cddf9SRui PauloSend a P2P Presence Request to the GO (this is only available when 603f05cddf9SRui Pauloacting as a P2P client). If no duration/interval pairs are given, the 604f05cddf9SRui Paulorequest indicates that this client has no special needs for GO 6055b9c547cSRui Paulopresence. The first parameter pair gives the preferred duration and 606f05cddf9SRui Paulointerval values in microseconds. If the second pair is included, that 6075b9c547cSRui Pauloindicates which value would be acceptable. This command returns OK 6085b9c547cSRui Pauloimmediately and the response from the GO is indicated in a 6095b9c547cSRui PauloP2P-PRESENCE-RESPONSE event message. 610f05cddf9SRui Paulo 611f05cddf9SRui PauloParameters 612f05cddf9SRui Paulo 613f05cddf9SRui Paulop2p_ext_listen [<period> <interval>] 614f05cddf9SRui Paulo 615f05cddf9SRui PauloConfigure Extended Listen Timing. If the parameters are omitted, this 616f05cddf9SRui Paulofeature is disabled. If the parameters are included, Listen State will 617f05cddf9SRui Paulobe entered every interval msec for at least period msec. Both values 618f05cddf9SRui Paulohave acceptable range of 1-65535 (with interval obviously having to be 619f05cddf9SRui Paulolarger than or equal to duration). If the P2P module is not idle at 620f05cddf9SRui Paulothe time the Extended Listen Timing timeout occurs, the Listen State 621f05cddf9SRui Paulooperation will be skipped. 622f05cddf9SRui Paulo 623f05cddf9SRui PauloThe configured values will also be advertised to other P2P Devices. The 624f05cddf9SRui Pauloreceived values are available in the p2p_peer command output: 625f05cddf9SRui Paulo 626f05cddf9SRui Pauloext_listen_period=100 ext_listen_interval=5000 627f05cddf9SRui Paulo 628f05cddf9SRui Paulop2p_set <field> <value> 629f05cddf9SRui Paulo 630f05cddf9SRui PauloChange dynamic P2P parameters 631f05cddf9SRui Paulo 632f05cddf9SRui Paulop2p_set discoverability <0/1> 633f05cddf9SRui Paulo 634f05cddf9SRui PauloDisable/enable advertisement of client discoverability. This is 635f05cddf9SRui Pauloenabled by default and this parameter is mainly used to allow testing 636f05cddf9SRui Pauloof device discoverability. 637f05cddf9SRui Paulo 638f05cddf9SRui Paulop2p_set managed <0/1> 639f05cddf9SRui Paulo 640f05cddf9SRui PauloDisable/enable managed P2P Device operations. This is disabled by 641f05cddf9SRui Paulodefault. 642f05cddf9SRui Paulo 643780fb4a2SCy Schubertp2p_set listen_channel <channel> [<op_class>] 644f05cddf9SRui Paulo 645f05cddf9SRui PauloSet P2P Listen channel. This is mainly meant for testing purposes and 646f05cddf9SRui Paulochanging the Listen channel during normal operations can result in 647f05cddf9SRui Pauloprotocol failures. 648f05cddf9SRui Paulo 649780fb4a2SCy SchubertWhen specifying a social channel on the 2.4 GHz band (1/6/11) there is 650780fb4a2SCy Schubertno need to specify the operating class since it defaults to 81. When 651780fb4a2SCy Schubertspecifying a social channel on the 60 GHz band (2), specify the 60 GHz 652780fb4a2SCy Schubertoperating class (180). 653780fb4a2SCy Schubert 654f05cddf9SRui Paulop2p_set ssid_postfix <postfix> 655f05cddf9SRui Paulo 656f05cddf9SRui PauloSet postfix string to be added to the automatically generated P2P SSID 657f05cddf9SRui Paulo(DIRECT-<two random characters>). For example, postfix of "-testing" 658f05cddf9SRui Paulocould result in the SSID becoming DIRECT-ab-testing. 659f05cddf9SRui Paulo 6605b9c547cSRui Paulop2p_set per_sta_psk <0/1> 6615b9c547cSRui Paulo 6625b9c547cSRui PauloDisabled(default)/enables use of per-client PSK in the P2P groups. This 6635b9c547cSRui Paulocan be used to request GO to assign a unique PSK for each client during 6645b9c547cSRui PauloWPS provisioning. When enabled, this allow clients to be removed from 665780fb4a2SCy Schubertthe group securely with p2p_remove_client command since that client's 6665b9c547cSRui PauloPSK is removed at the same time to prevent it from connecting back using 6675b9c547cSRui Paulothe old PSK. When per-client PSK is not used, the client can still be 6685b9c547cSRui Paulodisconnected, but it will be able to re-join the group since the PSK it 6695b9c547cSRui Paulolearned previously is still valid. It should be noted that the default 6705b9c547cSRui Paulopassphrase on the GO that is normally used to allow legacy stations to 6715b9c547cSRui Pauloconnect through manual configuration does not change here, so if that is 6725b9c547cSRui Pauloshared, devices with knowledge of that passphrase can still connect. 6735b9c547cSRui Paulo 674f05cddf9SRui Pauloset <field> <value> 675f05cddf9SRui Paulo 676f05cddf9SRui PauloSet global configuration parameters which may also affect P2P 677f05cddf9SRui Paulooperations. The format on these parameters is same as is used in 678f05cddf9SRui Paulowpa_supplicant.conf. Only the parameters listen here should be 679f05cddf9SRui Paulochanged. Modifying other parameters may result in incorrect behavior 680f05cddf9SRui Paulosince not all existing users of the parameters are updated. 681f05cddf9SRui Paulo 682f05cddf9SRui Pauloset uuid <UUID> 683f05cddf9SRui Paulo 684f05cddf9SRui PauloSet WPS UUID (by default, this is generated based on the MAC address). 685f05cddf9SRui Paulo 686f05cddf9SRui Pauloset device_name <device name> 687f05cddf9SRui Paulo 688f05cddf9SRui PauloSet WPS Device Name (also included in some P2P messages). 689f05cddf9SRui Paulo 690f05cddf9SRui Pauloset manufacturer <manufacturer> 691f05cddf9SRui Paulo 692f05cddf9SRui PauloSet WPS Manufacturer. 693f05cddf9SRui Paulo 694f05cddf9SRui Pauloset model_name <model name> 695f05cddf9SRui Paulo 696f05cddf9SRui PauloSet WPS Model Name. 697f05cddf9SRui Paulo 698f05cddf9SRui Pauloset model_number <model number> 699f05cddf9SRui Paulo 700f05cddf9SRui PauloSet WPS Model Number. 701f05cddf9SRui Paulo 702f05cddf9SRui Pauloset serial_number <serial number> 703f05cddf9SRui Paulo 704f05cddf9SRui PauloSet WPS Serial Number. 705f05cddf9SRui Paulo 706f05cddf9SRui Pauloset device_type <device type> 707f05cddf9SRui Paulo 708f05cddf9SRui PauloSet WPS Device Type. 709f05cddf9SRui Paulo 710f05cddf9SRui Pauloset os_version <OS version> 711f05cddf9SRui Paulo 712f05cddf9SRui PauloSet WPS OS Version. 713f05cddf9SRui Paulo 714f05cddf9SRui Pauloset config_methods <config methods> 715f05cddf9SRui Paulo 716f05cddf9SRui PauloSet WPS Configuration Methods. 717f05cddf9SRui Paulo 718f05cddf9SRui Pauloset sec_device_type <device type> 719f05cddf9SRui Paulo 720f05cddf9SRui PauloAdd a new Secondary Device Type. 721f05cddf9SRui Paulo 722f05cddf9SRui Pauloset p2p_go_intent <GO intent> 723f05cddf9SRui Paulo 724f05cddf9SRui PauloSet the default P2P GO Intent. Note: This value can be overridden in 725f05cddf9SRui Paulop2p_connect command and as such, there should be no need to change the 726f05cddf9SRui Paulodefault value here during normal operations. 727f05cddf9SRui Paulo 728f05cddf9SRui Pauloset p2p_ssid_postfix <P2P SSID postfix> 729f05cddf9SRui Paulo 730f05cddf9SRui PauloSet P2P SSID postfix. 731f05cddf9SRui Paulo 732f05cddf9SRui Pauloset persistent_reconnect <0/1> 733f05cddf9SRui Paulo 734f05cddf9SRui PauloDisable/enabled persistent reconnect for reinvocation of persistent 735f05cddf9SRui Paulogroups. If enabled, invitations to reinvoke a persistent group will be 736f05cddf9SRui Pauloaccepted without separate authorization (e.g., user interaction). 737f05cddf9SRui Paulo 738f05cddf9SRui Pauloset country <two character country code> 739f05cddf9SRui Paulo 740f05cddf9SRui PauloSet country code (this is included in some P2P messages). 741f05cddf9SRui Paulo 7425b9c547cSRui Pauloset p2p_search_delay <delay> 7435b9c547cSRui Paulo 7445b9c547cSRui PauloSet p2p_search_delay which adds extra delay in milliseconds between 7455b9c547cSRui Pauloconcurrent search iterations to make p2p_find friendlier to concurrent 7465b9c547cSRui Paulooperations by avoiding it from taking 100% of radio resources. The 7475b9c547cSRui Paulodefault value is 500 ms. 7485b9c547cSRui Paulo 749f05cddf9SRui PauloStatus 750f05cddf9SRui Paulo 751f05cddf9SRui Paulop2p_peers [discovered] 752f05cddf9SRui Paulo 753f05cddf9SRui PauloList P2P Device Addresses of all the P2P peers we know. The optional 754f05cddf9SRui Paulo"discovered" parameter filters out the peers that we have not fully 755f05cddf9SRui Paulodiscovered, i.e., which we have only seen in a received Probe Request 756f05cddf9SRui Pauloframe. 757f05cddf9SRui Paulo 758f05cddf9SRui Paulop2p_peer <P2P Device Address> 759f05cddf9SRui Paulo 760f05cddf9SRui PauloFetch information about a known P2P peer. 761f05cddf9SRui Paulo 762f05cddf9SRui PauloGroup Status 763f05cddf9SRui Paulo 764f05cddf9SRui Paulo(These are used on the group interface.) 765f05cddf9SRui Paulo 766f05cddf9SRui Paulostatus 767f05cddf9SRui Paulo 768f05cddf9SRui PauloShow status information (connection state, role, use encryption 769f05cddf9SRui Pauloparameters, IP address, etc.). 770f05cddf9SRui Paulo 771f05cddf9SRui Paulosta 772f05cddf9SRui Paulo 773f05cddf9SRui PauloShow information about an associated station (when acting in AP/GO role). 774f05cddf9SRui Paulo 775f05cddf9SRui Pauloall_sta 776f05cddf9SRui Paulo 777f05cddf9SRui PauloLists the currently associated stations. 778f05cddf9SRui Paulo 779f05cddf9SRui PauloConfiguration data 780f05cddf9SRui Paulo 781f05cddf9SRui Paulolist_networks 782f05cddf9SRui Paulo 783f05cddf9SRui PauloLists the configured networks, including stored information for 784f05cddf9SRui Paulopersistent groups. The identifier in this list is used with 785f05cddf9SRui Paulop2p_group_add and p2p_invite to indicate which persistent group is to 786f05cddf9SRui Paulobe reinvoked. 787f05cddf9SRui Paulo 788f05cddf9SRui Pauloremove_network <network id> 789f05cddf9SRui Paulo 790f05cddf9SRui PauloRemove a network entry from configuration. 791f05cddf9SRui Paulo 792f05cddf9SRui Paulo 7935b9c547cSRui PauloP2PS Events/Responses: 7945b9c547cSRui Paulo 7955b9c547cSRui PauloP2PS-PROV-START: This events gets triggered when provisioning is issued for 7965b9c547cSRui Pauloeither seeker or advertiser. 7975b9c547cSRui Paulo 7985b9c547cSRui PauloFor example, 7995b9c547cSRui 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' 8005b9c547cSRui Paulo 8015b9c547cSRui PauloParameters definition: 8025b9c547cSRui Paulo MAC address - always 8035b9c547cSRui Paulo adv_id - always ASCII hex-encoded u32 8045b9c547cSRui Paulo adv_mac - always MAC address that owns/registered the service 8055b9c547cSRui Paulo conncap - always mask of 0x01 (new), 0x02 (group client), 0x04 (group owner) 8065b9c547cSRui Paulo bits 8075b9c547cSRui Paulo session - always Session ID of the first session to be established 8085b9c547cSRui Paulo session_mac - always MAC address that owns/initiated the session 8095b9c547cSRui Paulo info - if available, UTF-8 string 8105b9c547cSRui Paulo Escaped single quote & backslash with a backslash: 8115b9c547cSRui Paulo \' == 0x27 == ', and \\ == 0x5c == \ 8125b9c547cSRui Paulo 8135b9c547cSRui PauloP2PS-PROV-DONE: When provisioning is completed then this event gets triggered. 8145b9c547cSRui Paulo 8155b9c547cSRui PauloFor example, 8165b9c547cSRui 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] 8175b9c547cSRui Paulo 8185b9c547cSRui PauloParameters definition: 8195b9c547cSRui Paulo MAC address - always main device address of peer. May be different from MAC 8205b9c547cSRui Paulo ultimately connected to. 8215b9c547cSRui Paulo status - always ascii hex-encoded u8 (0 == success, 12 == deferred success) 8225b9c547cSRui Paulo adv_id - always ascii hex-encoded u32 8235b9c547cSRui Paulo adv_mac - always MAC address that owns/registered the service 8245b9c547cSRui Paulo conncap - always One of: 1 (new), 2 (group client), 4 (group owner) bits 8255b9c547cSRui Paulo session - always Session ID of the first session to be established 8265b9c547cSRui Paulo session_mac - always MAC address that owns/initiated the session 8275b9c547cSRui Paulo dev_passwd_id - only if conncap value == 1 (New GO negotiation) 8285b9c547cSRui Paulo 8 - "p2ps" password must be passed in p2p_connect command 8295b9c547cSRui Paulo 1 - "display" password must be passed in p2p_connect command 8305b9c547cSRui Paulo 5 - "keypad" password must be passed in p2p_connect command 8315b9c547cSRui Paulo join only - if conncap value == 2 (Client Only). Display password and "join" 8325b9c547cSRui Paulo must be passed in p2p_connect and address must be the MAC specified 8335b9c547cSRui Paulo go only - if conncap value == 4 (GO Only). Interface name must be set with a 8345b9c547cSRui Paulo password 8355b9c547cSRui Paulo persist - only if previous persistent group existed between peers and shall 8365b9c547cSRui Paulo be re-used. Group is restarted by sending "p2p_group_add persistent=0" 8375b9c547cSRui Paulo where value is taken from P2P-PROV-DONE 8385b9c547cSRui Paulo 8395b9c547cSRui PauloExtended Events/Response 8405b9c547cSRui Paulo 8415b9c547cSRui 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 8425b9c547cSRui Paulo 8435b9c547cSRui PauloParameters definition: 8445b9c547cSRui Paulo adv_id - if ASP ASCII hex-encoded u32. If it is reporting the 8455b9c547cSRui Paulo "wildcard service", this value will be 0 8465b9c547cSRui Paulo asp_svc - if ASP this is the service string. If it is reporting the 8475b9c547cSRui Paulo "wildcard service", this value will be org.wi-fi.wfds 8485b9c547cSRui Paulo 8495b9c547cSRui Paulo 850f05cddf9SRui Paulowpa_cli action script 851f05cddf9SRui Paulo--------------------- 852f05cddf9SRui Paulo 853f05cddf9SRui PauloSee examples/p2p-action.sh 854f05cddf9SRui Paulo 855f05cddf9SRui PauloTODO: describe DHCP/DNS setup 856f05cddf9SRui PauloTODO: cross-connection 857