]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PR: wpa_cli support for PR discovery and PR secure negotiation
authorPeddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
Sat, 26 Apr 2025 21:53:47 +0000 (03:23 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 17 Oct 2025 10:22:52 +0000 (13:22 +0300)
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
wpa_supplicant/wpa_cli.c

index 03180a316ffed15e27b3c29a85bc17c6a1fcd931..8d899c8d0d912a585619a7a0db9241cdc9fe4ce2 100644 (file)
@@ -3286,6 +3286,31 @@ static int wpa_cli_cmd_pasn_deauth(struct wpa_ctrl *ctrl, int argc,
        return wpa_cli_cmd(ctrl, "PASN_DEAUTH", 1, argc, argv);
 }
 
+
+#ifdef CONFIG_PR
+
+static int wpa_cli_cmd_pr_pasn_start(struct wpa_ctrl *ctrl, int argc,
+                                    char *argv[])
+{
+       return wpa_cli_cmd(ctrl, "PR_PASN_START", 4, argc, argv);
+}
+
+
+static int wpa_cli_cmd_pr_set_dik_context(struct wpa_ctrl *ctrl, int argc,
+                                         char *argv[])
+{
+       return wpa_cli_cmd(ctrl, "PR_SET_DIK_CONTEXT", 1, argc, argv);
+}
+
+
+static int wpa_cli_cmd_pr_clear_dik_context(struct wpa_ctrl *ctrl, int argc,
+                                           char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "PR_CLEAR_DIK_CONTEXT");
+}
+
+#endif /* CONFIG_PR */
+
 #endif /* CONFIG_PASN */
 
 
@@ -4088,6 +4113,16 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = {
        { "pasn_deauth", wpa_cli_cmd_pasn_deauth, NULL,
          cli_cmd_flag_none,
          "bssid=<BSSID> = Remove PASN PTKSA state" },
+#ifdef CONFIG_PR
+       { "pr_pasn_start", wpa_cli_cmd_pr_pasn_start, NULL,
+         cli_cmd_flag_none,
+         "bssid=<BSSID> role=<ISTA/RSTA> ranging_type=<edca/ntb/ntb-open/ntb-secure>" },
+       { "pr_set_dik_context", wpa_cli_cmd_pr_set_dik_context, NULL,
+         cli_cmd_flag_sensitive,
+         "self dik=<own_dik/peerdik> password=<global_pw/unique_pw> pmk=<pmk>" },
+       { "pr_clear_dik_context", wpa_cli_cmd_pr_clear_dik_context, NULL,
+         cli_cmd_flag_none, "= Clear all DIK contexts" },
+#endif /* CONFIG_PR */
 #endif /* CONFIG_PASN */
        { "mscs", wpa_cli_cmd_mscs, NULL,
          cli_cmd_flag_none,
@@ -4113,14 +4148,14 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = {
 #ifdef CONFIG_NAN_USD
        { "nan_publish", wpa_cli_cmd_nan_publish, NULL,
          cli_cmd_flag_none,
-         "service_name=<name> [ttl=<time-to-live-in-sec>] [freq=<in MHz>] [freq_list=<comma separate list of MHz>] [srv_proto_type=<type>] [ssi=<service specific information (hexdump)>] [solicited=0] [unsolicited=0] [fsd=0] [p2p=1] = Publish NAN service" },
+         "service_name=<name> [ttl=<time-to-live-in-sec>] [freq=<in MHz>] [freq_list=<comma separate list of MHz>] [srv_proto_type=<type>] [ssi=<service specific information (hexdump)>] [solicited=0] [unsolicited=0] [fsd=0] [p2p=1] [pr=1] = Publish NAN service" },
        { "nan_cancel_publish", wpa_cli_cmd_nan_cancel_publish, NULL,
          cli_cmd_flag_none, "publish_id=<id from NAN_PUBLISH> = Cancel NAN USD publish instance" },
        { "nan_update_publish", wpa_cli_cmd_nan_update_publish, NULL,
          cli_cmd_flag_none, "publish_id=<id from NAN_PUBLISH> [ssi=<service specific information (hexdump)> = Update publish" },
        { "nan_subscribe", wpa_cli_cmd_nan_subscribe, NULL,
          cli_cmd_flag_none,
-         "service_name=<name> [active=1] [ttl=<time-to-live-in-sec>] [freq=<in MHz>] [srv_proto_type=<type>] [ssi=<service specific information (hexdump)>] [p2p=1] = Subscribe to NAN service" },
+         "service_name=<name> [active=1] [ttl=<time-to-live-in-sec>] [freq=<in MHz>] [srv_proto_type=<type>] [ssi=<service specific information (hexdump)>] [p2p=1] [pr=1] = Subscribe to NAN service" },
        { "nan_cancel_subscribe", wpa_cli_cmd_nan_cancel_subscribe, NULL,
          cli_cmd_flag_none, "subscribe_id=<id from NAN_PUBLISH> = Cancel NAN USD subscribe instance" },
        { "nan_transmit", wpa_cli_cmd_nan_transmit, NULL,