Deleted Added
full compact
dbus_old_handlers_wps.c (214501) dbus_old_handlers_wps.c (252190)
1/*
2 * WPA Supplicant / dbus-based control interface (WPS)
3 * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
4 *
1/*
2 * WPA Supplicant / dbus-based control interface (WPS)
3 * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
11 *
12 * See README and COPYING for more details.
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
13 */
14
15#include "includes.h"
16#include <dbus/dbus.h>
17
18#include "common.h"
19#include "../config.h"
20#include "../wpa_supplicant_i.h"

--- 17 unchanged lines hidden (view full) ---

38 u8 bssid[ETH_ALEN];
39 int ret = 0;
40
41 if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
42 DBUS_TYPE_INVALID))
43 return wpas_dbus_new_invalid_opts_error(message, NULL);
44
45 if (!os_strcmp(arg_bssid, "any"))
7 */
8
9#include "includes.h"
10#include <dbus/dbus.h>
11
12#include "common.h"
13#include "../config.h"
14#include "../wpa_supplicant_i.h"

--- 17 unchanged lines hidden (view full) ---

32 u8 bssid[ETH_ALEN];
33 int ret = 0;
34
35 if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
36 DBUS_TYPE_INVALID))
37 return wpas_dbus_new_invalid_opts_error(message, NULL);
38
39 if (!os_strcmp(arg_bssid, "any"))
46 ret = wpas_wps_start_pbc(wpa_s, NULL);
40 ret = wpas_wps_start_pbc(wpa_s, NULL, 0);
47 else if (!hwaddr_aton(arg_bssid, bssid))
41 else if (!hwaddr_aton(arg_bssid, bssid))
48 ret = wpas_wps_start_pbc(wpa_s, bssid);
42 ret = wpas_wps_start_pbc(wpa_s, bssid, 0);
49 else {
50 return wpas_dbus_new_invalid_opts_error(message,
51 "Invalid BSSID");
52 }
53
54 if (ret < 0) {
55 return dbus_message_new_error(message,
56 WPAS_ERROR_WPS_PBC_ERROR,

--- 32 unchanged lines hidden (view full) ---

89 else if (!hwaddr_aton(arg_bssid, bssid))
90 _bssid = bssid;
91 else {
92 return wpas_dbus_new_invalid_opts_error(message,
93 "Invalid BSSID");
94 }
95
96 if (os_strlen(pin) > 0)
43 else {
44 return wpas_dbus_new_invalid_opts_error(message,
45 "Invalid BSSID");
46 }
47
48 if (ret < 0) {
49 return dbus_message_new_error(message,
50 WPAS_ERROR_WPS_PBC_ERROR,

--- 32 unchanged lines hidden (view full) ---

83 else if (!hwaddr_aton(arg_bssid, bssid))
84 _bssid = bssid;
85 else {
86 return wpas_dbus_new_invalid_opts_error(message,
87 "Invalid BSSID");
88 }
89
90 if (os_strlen(pin) > 0)
97 ret = wpas_wps_start_pin(wpa_s, _bssid, pin);
91 ret = wpas_wps_start_pin(wpa_s, _bssid, pin, 0,
92 DEV_PW_DEFAULT);
98 else
93 else
99 ret = wpas_wps_start_pin(wpa_s, _bssid, NULL);
94 ret = wpas_wps_start_pin(wpa_s, _bssid, NULL, 0,
95 DEV_PW_DEFAULT);
100
101 if (ret < 0) {
102 return dbus_message_new_error(message,
103 WPAS_ERROR_WPS_PIN_ERROR,
104 "Could not init PIN");
105 }
106
107 reply = dbus_message_new_method_return(message);

--- 54 unchanged lines hidden ---
96
97 if (ret < 0) {
98 return dbus_message_new_error(message,
99 WPAS_ERROR_WPS_PIN_ERROR,
100 "Could not init PIN");
101 }
102
103 reply = dbus_message_new_method_return(message);

--- 54 unchanged lines hidden ---