Send connman mailing list submissions to connman@lists.01.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.01.org/mailman/listinfo/connman or, via email, send a message with subject or body 'help' to connman-requ...@lists.01.org
You can reach the person managing the list at connman-ow...@lists.01.org When replying, please edit your Subject line so it is more specific than "Re: Contents of connman digest..." Today's Topics: 1. hidden ssid connection when service path is unknow (Alexandre Leblanc) 2. Re: [PATCH] wifi: implemented feature of tracking tethering clients (Daniel Wagner) 3. Re: [PATCH] Force simple wifi scan over dbus Scan (Daniel Wagner) ---------------------------------------------------------------------- Message: 1 Date: Thu, 15 Nov 2018 16:10:29 -0500 (EST) From: Alexandre Leblanc <alexandre.lebl...@savoirfairelinux.com> To: connman@lists.01.org Cc: i...@alexandre-leblanc.com Subject: hidden ssid connection when service path is unknow Message-ID: <1976104013.20286951.1542316229218.javamail.zim...@savoirfairelinux.com> Content-Type: text/plain; charset=utf-8 Hello everyone I'm trying do develop a small wrapper around connmam mostly using dbus and python. Everything work fine yet. Managing hidden network is a bit of an issue. The wrapper will be use in an environment where there will be a lot of hidden network (not for security reason...) and only the ssid Name will be known. So how would one identity the right service to connect to ? Using my wrapper I can already see hidden network path. I already know that my agent will handle the ssid Name when a connection request is done. Should I simply try connect to all of them ? Thank you very much ! Alexandre Leblanc Free Software Consultant | Montreal, Qc Savoir-faire Linux Office: (+ 1) 514 276-5468 ext.377 Confidentiality Message: This communication (including any files transmitted with it) is intended solely for the person or entity to whom it is addressed, and may contain confidential or privileged information. The disclosure, distribution or copying of this message is strictly forbidden. Should you have received this communication in error, kindly contact the sender promptly, destroy any copies and delete this message from your computer system. ------------------------------ Message: 2 Date: Fri, 16 Nov 2018 00:54:44 +0100 From: Daniel Wagner <w...@monom.org> To: Vasyl Vavrychuk <vasyl.vavryc...@globallogic.com> Cc: connman@lists.01.org Subject: Re: [PATCH] wifi: implemented feature of tracking tethering clients Message-ID: <ddf630c2-2af7-b47e-89bc-d7b18bca5...@monom.org> Content-Type: text/plain; charset=utf-8 Hi Vasyl, I started to add it the repo but then the compiler started to complain. Fixing them myself wouldn't be a problem. Though there are a few copyright statements which are not correct and I should not change them for you. So you need to resend the patch anyway, sorry about that. On 28.10.18 23:37, Vasyl Vavrychuk wrote: > wpa_supplicant supports StaAuthorized StaDeauthorized D-Bus signal that > we handle and store information. Then stored information about connected > tethering clients is exposed via GetTetheringClients method and > TetheringClientsChanged signal of manager. > --- > Makefile.am | 3 +- > client/commands.c | 27 ++++++++ > client/tethering.c | 62 +++++++++++++++++++ > client/tethering.h | 38 ++++++++++++ > doc/manager-api.txt | 12 ++++ > gsupplicant/gsupplicant.h | 4 ++ > gsupplicant/supplicant.c | 64 +++++++++++++++++++ > include/tethering.h | 36 +++++++++++ > plugins/wifi.c | 29 +++++++++ > src/connman.h | 3 + > src/manager.c | 24 ++++++++ > src/tethering.c | 126 ++++++++++++++++++++++++++++++++++++++ > 12 files changed, 427 insertions(+), 1 deletion(-) > create mode 100644 client/tethering.c > create mode 100644 client/tethering.h > create mode 100644 include/tethering.h > Please split this patch into a few smaller junks, e.g. - gsupplicant - src/tethering - plugins/wifi - client - doc > diff --git a/Makefile.am b/Makefile.am > index d6dfbf1c..4614cb90 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -12,7 +12,7 @@ include_HEADERS = include/log.h include/plugin.h \ > include/storage.h include/provision.h \ > include/session.h include/ipaddress.h include/agent.h \ > include/inotify.h include/peer.h include/machine.h \ > - include/acd.h > + include/acd.h include/tethering.h > > nodist_include_HEADERS = include/version.h > > @@ -308,6 +308,7 @@ client_connmanctl_SOURCES = client/dbus_helpers.h > client/dbus_helpers.c \ > client/input.h client/input.c \ > client/agent.h client/agent.c \ > client/peers.h client/peers.c \ > + client/tethering.h client/tethering.c \ > client/vpnconnections.h client/vpnconnections.c \ > client/main.c > > diff --git a/client/commands.c b/client/commands.c > index bf3531fd..26d2c509 100644 > --- a/client/commands.c > +++ b/client/commands.c > @@ -318,6 +318,18 @@ static int peers_list(DBusMessageIter *iter, > return 0; > } > > +static int tethering_clients_list(DBusMessageIter *iter, > + const char *error, void *user_data) > +{ > + if (!error) { > + __connmanctl_tethering_clients_list(iter); > + fprintf(stdout, "\n"); Compiler complains about missing definition of __connmanctrl_tethering_clients_list(). You need to add the include. > + } else > + fprintf(stderr, "Error: %s\n", error); > + > + return 0; > +} > + > static int object_properties(DBusMessageIter *iter, > const char *error, void *user_data) > { > @@ -639,6 +651,19 @@ static int cmd_tether(char *args[], int num, struct > connman_option *options) > return tether_set(args[1], set_tethering); > } > > +static int cmd_tethering_clients(char *args[], int num, struct > connman_option *options) > +{ > + char *path; path is not used. > + > + if (num > 1) > + return -E2BIG; > + > + return __connmanctl_dbus_method_call(connection, > + CONNMAN_SERVICE, CONNMAN_PATH, > + "net.connman.Manager", "GetTetheringClients", > + tethering_clients_list, NULL, NULL, NULL); > +} > + > static int scan_return(DBusMessageIter *iter, const char *error, > void *user_data) > { > @@ -2730,6 +2755,8 @@ static const struct { > NULL, cmd_tether, > "Enable, disable tethering, set SSID and passphrase for wifi", > lookup_tether }, > + { "tethering_clients", NULL, NULL, > cmd_tethering_clients, > + "Display tethering clients", NULL }, > { "services", "[<service>]", service_options, cmd_services, > "Display services", lookup_service_arg }, > { "peers", "[peer]", NULL, cmd_peers, > diff --git a/client/tethering.c b/client/tethering.c > new file mode 100644 > index 00000000..ce3688a4 > --- /dev/null > +++ b/client/tethering.c > @@ -0,0 +1,62 @@ > +/* > + * > + * Connection Manager > + * > + * Copyright (C) 2014 Intel Corporation. All rights reserved. You need to add your own copyright statement here. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 > USA > + * > + */ > + > +#include <stdio.h> > + > +#include "tethering.h" > + > +void __connmanctl_tethering_clients_list(DBusMessageIter *iter) > +{ > + DBusMessageIter array; > + char *addr = NULL; > + > + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) > + return; > + > + dbus_message_iter_recurse(iter, &array); > + while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) { > + dbus_message_iter_get_basic(&array, &addr); > + > + fprintf(stdout, "%s", addr); > + > + if (dbus_message_iter_has_next(&array)) > + fprintf(stdout, "\n"); > + > + dbus_message_iter_next(&array); > + } > + > + dbus_message_iter_next(iter); > + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) > + return; > + > + dbus_message_iter_recurse(iter, &array); > + while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) { > + dbus_message_iter_get_basic(&array, &addr); > + > + fprintf(stdout, "\n%s %s", "removed", addr); > + > + if (dbus_message_iter_has_next(&array)) > + fprintf(stdout, "\n"); > + > + dbus_message_iter_next(&array); > + } > +} > diff --git a/client/tethering.h b/client/tethering.h > new file mode 100644 > index 00000000..c6b58de1 > --- /dev/null > +++ b/client/tethering.h > @@ -0,0 +1,38 @@ > +/* > + * > + * Connection Manager > + * > + * Copyright (C) 2014 Intel Corporation. All rights reserved. same here. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 > USA > + * > + */ > + > +#ifndef __CONNMANCTL_TETHERING_H > +#define __CONNMANCTL_TETHERING_H > + > +#include <dbus/dbus.h> > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +void __connmanctl_tethering_clients_list(DBusMessageIter *iter); > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* __CONNMANCTL_TETHERING_H */ > diff --git a/doc/manager-api.txt b/doc/manager-api.txt > index 2d2739ff..bfb07bd3 100644 > --- a/doc/manager-api.txt > +++ b/doc/manager-api.txt > @@ -46,6 +46,11 @@ Methods dict GetProperties() > > Possible Errors: [service].Error.InvalidArguments > > + array{string} GetTetheringClients() [experimental] > + > + Returns a sorted list of MAC addresses of clients > + connected to tethered technologies. > + > object ConnectProvider(dict provider) [deprecated] > > Connect to a VPN specified by the given provider > @@ -255,6 +260,13 @@ Signals TechnologyAdded(object path, dict > properties) > object changes. For that it is required to watch the > PropertyChanged signal of the peer object. > > + TetheringClientsChanged(array{string}, array{string}) > [experimental] > + > + This signal indicates a change in the tethering clients. > + List of all tethering clients currently registered > connman is > + passed via the first array. And a list of tethering > clients that > + have been removed via the second array. > + > PropertyChanged(string name, variant value) > > This signal indicates a changed value of the given > diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h > index db61595b..bfb52db7 100644 > --- a/gsupplicant/gsupplicant.h > +++ b/gsupplicant/gsupplicant.h > @@ -352,6 +352,10 @@ struct _GSupplicantCallbacks { > void (*network_changed) (GSupplicantNetwork *network, > const char *property); > void (*network_associated) (GSupplicantNetwork *network); > + void (*sta_authorized) (GSupplicantInterface *interface, > + const char *addr); > + void (*sta_deauthorized) (GSupplicantInterface *interface, > + const char *addr); > void (*peer_found) (GSupplicantPeer *peer); > void (*peer_lost) (GSupplicantPeer *peer); > void (*peer_changed) (GSupplicantPeer *peer, > diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c > index 0cb621b9..12391482 100644 > --- a/gsupplicant/supplicant.c > +++ b/gsupplicant/supplicant.c > @@ -614,6 +614,30 @@ static void > callback_network_associated(GSupplicantNetwork *network) > callbacks_pointer->network_associated(network); > } > > +static void callback_sta_authorized(GSupplicantInterface *interface, > + const char *addr) > +{ > + if (!callbacks_pointer) > + return; > + > + if (!callbacks_pointer->sta_authorized) > + return; > + > + callbacks_pointer->sta_authorized(interface, addr); > +} > + > +static void callback_sta_deauthorized(GSupplicantInterface *interface, > + const char *addr) > +{ > + if (!callbacks_pointer) > + return; > + > + if (!callbacks_pointer->sta_deauthorized) > + return; > + > + callbacks_pointer->sta_deauthorized(interface, addr); > +} > + > static void callback_peer_found(GSupplicantPeer *peer) > { > if (!callbacks_pointer) > @@ -2731,6 +2755,44 @@ static void signal_network_removed(const char *path, > DBusMessageIter *iter) > interface_network_removed(iter, interface); > } > > +static void signal_sta_authorized(const char *path, DBusMessageIter *iter) > +{ > + GSupplicantInterface *interface; > + DBusMessageIter array; array is not used, remove it. > + const char *addr = NULL; > + > + SUPPLICANT_DBG(""); > + > + interface = g_hash_table_lookup(interface_table, path); > + if (!interface) > + return; > + > + dbus_message_iter_get_basic(iter, &addr); > + if (!addr) > + return; > + > + callback_sta_authorized(interface, addr); > +} > + > +static void signal_sta_deauthorized(const char *path, DBusMessageIter *iter) > +{ > + GSupplicantInterface *interface; > + DBusMessageIter array; also this array is not used. > + const char *addr = NULL; > + > + SUPPLICANT_DBG(""); > + > + interface = g_hash_table_lookup(interface_table, path); > + if (!interface) > + return; > + > + dbus_message_iter_get_basic(iter, &addr); > + if (!addr) > + return; > + > + callback_sta_deauthorized(interface, addr); > +} > + > static void signal_bss_changed(const char *path, DBusMessageIter *iter) > { > GSupplicantInterface *interface; > @@ -3505,6 +3567,8 @@ static struct { > { SUPPLICANT_INTERFACE ".Interface", "BSSRemoved", > signal_bss_removed }, > { SUPPLICANT_INTERFACE ".Interface", "NetworkAdded", > signal_network_added }, > { SUPPLICANT_INTERFACE ".Interface", "NetworkRemoved", > signal_network_removed }, > + { SUPPLICANT_INTERFACE ".Interface", "StaAuthorized", > signal_sta_authorized }, > + { SUPPLICANT_INTERFACE ".Interface", "StaDeauthorized", > signal_sta_deauthorized }, > > { SUPPLICANT_INTERFACE ".BSS", "PropertiesChanged", signal_bss_changed > }, > > diff --git a/include/tethering.h b/include/tethering.h > new file mode 100644 > index 00000000..0d29b235 > --- /dev/null > +++ b/include/tethering.h > @@ -0,0 +1,36 @@ > +/* > + * > + * Connection Manager > + * > + * Copyright (C) 2007-2013 Intel Corporation. All rights reserved. Same as above > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 > USA > + * > + */ > + > +#ifndef __CONNMAN_TETHERING_H > +#define __CONNMAN_TETHERING_H > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +void __connman_tethering_client_register(const char *addr); > +void __connman_tethering_client_unregister(const char *addr); > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* __CONNMAN_TETHERING_H */ > diff --git a/plugins/wifi.c b/plugins/wifi.c > index e437daeb..6fa20312 100644 > --- a/plugins/wifi.c > +++ b/plugins/wifi.c > @@ -55,6 +55,7 @@ > #include <connman/provision.h> > #include <connman/utsname.h> > #include <connman/machine.h> > +#include <connman/tethering.h> > > #include <gsupplicant/gsupplicant.h> > > @@ -2985,6 +2986,32 @@ static void network_associated(GSupplicantNetwork > *network) > interface_state(interface); > } > > +static void sta_authorized(GSupplicantInterface *interface, > + const char *addr) > +{ > + struct wifi_data *wifi = g_supplicant_interface_get_data(interface); > + > + DBG("wifi %p station %s authorized", wifi, addr); > + > + if (!wifi || !wifi->tethering) > + return; > + > + __connman_tethering_client_register(addr); > +} > + > +static void sta_deauthorized(GSupplicantInterface *interface, > + const char *addr) > +{ > + struct wifi_data *wifi = g_supplicant_interface_get_data(interface); > + > + DBG("wifi %p station %s deauthorized", wifi, addr); > + > + if (!wifi || !wifi->tethering) > + return; > + > + __connman_tethering_client_unregister(addr); > +} > + > static void apply_peer_services(GSupplicantPeer *peer, > struct connman_peer *connman_peer) > { > @@ -3205,6 +3232,8 @@ static const GSupplicantCallbacks callbacks = { > .network_removed = network_removed, > .network_changed = network_changed, > .network_associated = network_associated, > + .sta_authorized = sta_authorized, > + .sta_deauthorized = sta_deauthorized, > .peer_found = peer_found, > .peer_lost = peer_lost, > .peer_changed = peer_changed, > diff --git a/src/connman.h b/src/connman.h > index 13553833..dfcacc62 100644 > --- a/src/connman.h > +++ b/src/connman.h > @@ -630,12 +630,15 @@ bool __connman_config_get_bool(GKeyFile *key_file, > bool __connman_config_address_provisioned(const char *address, > const char *netmask); > > +#include <connman/tethering.h> > + > int __connman_tethering_init(void); > void __connman_tethering_cleanup(void); > > const char *__connman_tethering_get_bridge(void); > int __connman_tethering_set_enabled(void); > void __connman_tethering_set_disabled(void); > +void __connman_tethering_list_clients(DBusMessageIter *array); > > int __connman_private_network_request(DBusMessage *msg, const char *owner); > int __connman_private_network_release(const char *path); > diff --git a/src/manager.c b/src/manager.c > index d15ce203..b2de863c 100644 > --- a/src/manager.c > +++ b/src/manager.c > @@ -214,6 +214,27 @@ static DBusMessage *get_peers(DBusConnection *conn, > return reply; > } > > +static DBusMessage *get_tethering_clients(DBusConnection *conn, > + DBusMessage *msg, void *data) > +{ > + DBusMessage *reply; > + DBusMessageIter iter, array; > + > + reply = dbus_message_new_method_return(msg); > + if (!reply) > + return NULL; > + > + dbus_message_iter_init_append(reply, &iter); > + > + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, > + DBUS_TYPE_STRING_AS_STRING, &array); > + > + __connman_tethering_list_clients(&array); > + > + dbus_message_iter_close_container(&iter, &array); > + return reply; > +} > + > static DBusMessage *connect_provider(DBusConnection *conn, > DBusMessage *msg, void *data) > { > @@ -519,6 +540,9 @@ static const GDBusMethodTable manager_methods[] = { > { GDBUS_METHOD("GetPeers", > NULL, GDBUS_ARGS({ "peers", "a(oa{sv})" }), > get_peers) }, > + { GDBUS_METHOD("GetTetheringClients", > + NULL, GDBUS_ARGS({ "tethering_clients", "as" }), > + get_tethering_clients) }, > { GDBUS_DEPRECATED_ASYNC_METHOD("ConnectProvider", > GDBUS_ARGS({ "provider", "a{sv}" }), > GDBUS_ARGS({ "path", "o" }), > diff --git a/src/tethering.c b/src/tethering.c > index d222afca..61951075 100644 > --- a/src/tethering.c > +++ b/src/tethering.c > @@ -61,6 +61,13 @@ static struct connman_ippool *dhcp_ippool = NULL; > static DBusConnection *connection; > static GHashTable *pn_hash; > > +static GHashTable *clients_table = NULL; drop the '= NULL' part as it is not needed. Thanks, Daniel ------------------------------ Message: 3 Date: Fri, 16 Nov 2018 01:38:03 +0100 From: Daniel Wagner <w...@monom.org> To: ????????? ????? <ostvolody...@gmail.com> Cc: connman@lists.01.org Subject: Re: [PATCH] Force simple wifi scan over dbus Scan Message-ID: <f904b756-7707-2378-3acf-e83159a40...@monom.org> Content-Type: text/plain; charset=utf-8 Hi, Please inline your patch next time. It makes reviewing simpler On 06.11.18 01:36, ????????? ????? wrote: > I am using connman for wifi connection and it is controlled over dbus. > The system supports many wifi connections. The user can remove and add a > connection. > > If there are saved connections and wifi is currently disconnected and > connman is asked over dbus to do a scan it falls into the scan on > channels retrieved from the saved services. > So user sees only APs on these channels. Argh not again wifi scanning troubles. Somehow this is really hard to get right with wpa_supplicant. Anyway thanks for the bug report including the patch. Though I have a few comments: diff --git a/include/device.h b/include/device.h > index 5a3ddc22..e444ea06 100644 > --- a/include/device.h > +++ b/include/device.h > @@ -124,7 +124,7 @@ struct connman_device_driver { > struct connman_device *device, > const char *ssid, unsigned int ssid_len, > const char *identity, const char* passphrase, > - const char *security, void *user_data); > + const char *security, bool force_full_scan, void > *user_data); > void (*stop_scan) (enum connman_service_type type, > struct connman_device *device); > int (*set_regdom) (struct connman_device *device, > diff --git a/plugins/wifi.c b/plugins/wifi.c > index dc08c6af..ef73e843 100644 > --- a/plugins/wifi.c > +++ b/plugins/wifi.c > @@ -1861,7 +1861,8 @@ static int wifi_scan(enum connman_service_type type, > struct connman_device *device, > const char *ssid, unsigned int ssid_len, > const char *identity, const char* passphrase, > - const char *security, void *user_data) > + const char *security, bool force_full_scan, > + void *user_data) I am not partucilar fan of adding a bool for this, because it is already hard to figure out which parameters is what. Adding a bool makes it even harder. Why not defining a enum for the forced scan? > { > struct wifi_data *wifi = connman_device_get_data(device); > GSupplicantScanParams *scan_params = NULL; > @@ -1884,7 +1885,8 @@ static int wifi_scan(enum connman_service_type type, > if (type == CONNMAN_SERVICE_TYPE_P2P) > return p2p_find(device); > > - DBG("device %p wifi %p hidden ssid %s", device, wifi->interface, ssid); > + DBG("device %p wifi %p hidden ssid %s forced full scan %d", device, > + wifi->interface, ssid, force_full_scan); and here I would change the text to 'scan type {forced|normal}' > > scanning = connman_device_get_scanning(device, > CONNMAN_SERVICE_TYPE_WIFI); > > @@ -1950,7 +1952,7 @@ static int wifi_scan(enum connman_service_type type, > > return 0; > } > - } else if (wifi->connected) { > + } else if (wifi->connected || force_full_scan) { If it is a forced scan, I guess we should do a active scan instead of a passive. So you need to drop the scan_param and fall through to the passive case. > g_supplicant_free_scan_params(scan_params); > return wifi_scan_simple(device); > } else { > diff --git a/src/config.c b/src/config.c > index 4178ea86..7d48267e 100644 > --- a/src/config.c > +++ b/src/config.c > @@ -1602,7 +1602,7 @@ int connman_config_provision_mutable_service(GKeyFile > *keyfile) > __connman_service_provision_changed(vfile); > > if (g_strcmp0(service_config->type, "wifi") == 0) > - __connman_device_request_scan(CONNMAN_SERVICE_TYPE_WIFI); > + __connman_device_request_scan(CONNMAN_SERVICE_TYPE_WIFI, false); Add a __connman_device_request_full_scan() function and then you don't have to modify this call side. > > g_free(group); > return 0; > diff --git a/src/connman.h b/src/connman.h > index 82e77d37..52c161ae 100644 > --- a/src/connman.h > +++ b/src/connman.h > @@ -561,7 +561,7 @@ void __connman_device_list(DBusMessageIter *iter, void > *user_data); > > enum connman_service_type __connman_device_get_service_type(struct > connman_device *device); > struct connman_device *__connman_device_find_device(enum > connman_service_type type); > -int __connman_device_request_scan(enum connman_service_type type); > +int __connman_device_request_scan(enum connman_service_type type, bool > force_full_scan); As mention above add a __connman_device_request_full_scan() function and leave the original scan() function as it is. > int __connman_device_request_hidden_scan(struct connman_device *device, > const char *ssid, unsigned int ssid_len, > const char *identity, const char *passphrase, > diff --git a/src/device.c b/src/device.c > index 5d343ae8..f50753cc 100644 > --- a/src/device.c > +++ b/src/device.c > @@ -615,7 +615,7 @@ int connman_device_set_powered(struct connman_device > *device, > > if (device->driver && device->driver->scan) > device->driver->scan(CONNMAN_SERVICE_TYPE_UNKNOWN, device, > - NULL, 0, NULL, NULL, NULL, NULL); > + NULL, 0, NULL, NULL, NULL, false, NULL); As said, the 'false' is kind of not telling what it does. Havig an enum for this makes it more readable. > > return 0; > } > @@ -626,7 +626,8 @@ bool connman_device_get_powered(struct connman_device > *device) > } > > static int device_scan(enum connman_service_type type, > - struct connman_device *device) > + struct connman_device *device, > + bool force_full_scan) > { > if (!device->driver || !device->driver->scan) > return -EOPNOTSUPP; > @@ -635,7 +636,7 @@ static int device_scan(enum connman_service_type type, > return -ENOLINK; > > return device->driver->scan(type, device, NULL, 0, > - NULL, NULL, NULL, NULL); > + NULL, NULL, NULL, force_full_scan, > NULL); > } > > int __connman_device_disconnect(struct connman_device *device) > @@ -1080,7 +1081,7 @@ void connman_device_regdom_notify(struct connman_device > *device, > __connman_technology_notify_regdom_by_device(device, result, alpha2); > } > > -int __connman_device_request_scan(enum connman_service_type type) > +int __connman_device_request_scan(enum connman_service_type type, bool > force_full_scan) You rename this function to device_requet_scan() and make it static and call let __connman_device_request_scan() and __connman_device_request_full_scan() call it. > { > bool success = false; > int last_err = -ENOSYS; > @@ -1108,7 +1109,7 @@ int __connman_device_request_scan(enum > connman_service_type type) > if (!device_has_service_type(device, type)) > continue; > > - err = device_scan(type, device); > + err = device_scan(type, device, force_full_scan); > if (err == 0 || err == -EALREADY || err == -EINPROGRESS) { > success = true; > } else { > @@ -1136,7 +1137,7 @@ int __connman_device_request_hidden_scan(struct > connman_device *device, > > return device->driver->scan(CONNMAN_SERVICE_TYPE_UNKNOWN, > device, ssid, ssid_len, identity, > - passphrase, security, user_data); > + passphrase, security, false, user_data); > } > > void __connman_device_stop_scan(enum connman_service_type type) > diff --git a/src/technology.c b/src/technology.c > index 4c1cbbbb..d7a6f1f6 100644 > --- a/src/technology.c > +++ b/src/technology.c > @@ -1083,7 +1083,7 @@ static DBusMessage *scan(DBusConnection *conn, > DBusMessage *msg, void *data) > technology->scan_pending = > g_slist_prepend(technology->scan_pending, msg); > > - err = __connman_device_request_scan(technology->type); > + err = __connman_device_request_scan(technology->type, true); > if (err < 0) > reply_scan_pending(technology, err); Thanks, Daniel ------------------------------ Subject: Digest Footer _______________________________________________ connman mailing list connman@lists.01.org https://lists.01.org/mailman/listinfo/connman ------------------------------ End of connman Digest, Vol 37, Issue 6 **************************************