This property is only valid for the WiFi technology,
and is then mapped to the WPA pre-shared key clients
will have to use in order to establish a connection.
+
+ boolean Hidden [readwrite]
+
+ This option allows to enable or disable the support
+ for the hidden Wi-Fi tethering.
G_SUPPLICANT_PEER_GROUP_FAILED,
} GSupplicantPeerState;
+enum GSupplicantAPHiddenSSID {
+ G_SUPPLICANT_AP_NO_SSID_HIDING,
+ G_SUPPLICANT_AP_HIDDEN_SSID_ZERO_LEN,
+ G_SUPPLICANT_AP_HIDDEN_SSID_ZERO_CONTENTS,
+};
+
struct _GSupplicantSSID {
const void *ssid;
unsigned int ssid_len;
dbus_bool_t use_wps;
const char *pin_wps;
const char *bgscan;
+ int ignore_broadcast_ssid;
};
typedef struct _GSupplicantSSID GSupplicantSSID;
DBUS_TYPE_BYTE, &ssid->ssid,
ssid->ssid_len);
+ supplicant_dbus_dict_append_basic(&dict, "ignore_broadcast_ssid",
+ DBUS_TYPE_INT32,
+ &ssid->ignore_broadcast_ssid);
+
supplicant_dbus_dict_close(iter, &dict);
}
int index);
int (*set_tethering) (struct connman_technology *technology,
const char *identifier, const char *passphrase,
- const char *bridge, bool enabled);
+ const char *bridge, bool enabled, bool hidden);
int (*set_regdom) (struct connman_technology *technology,
const char *alpha2);
};
static int bluetooth_tech_set_tethering(struct connman_technology *technology,
const char *identifier, const char *passphrase,
- const char *bridge, bool enabled)
+ const char *bridge, bool enabled, bool hidden)
{
GHashTableIter hash_iter;
gpointer key, value;
static int tech_set_tethering(struct connman_technology *technology,
const char *identifier, const char *passphrase,
- const char *bridge, bool enabled)
+ const char *bridge, bool enabled, bool hidden)
{
struct tethering_info info = {
.technology = technology,
static int eth_tech_set_tethering(struct connman_technology *technology,
const char *identifier, const char *passphrase,
- const char *bridge, bool enabled)
+ const char *bridge, bool enabled, bool hidden)
{
if (!connman_technology_is_tethering_allowed(
CONNMAN_SERVICE_TYPE_ETHERNET))
static int gadget_tech_set_tethering(struct connman_technology *technology,
const char *identifier, const char *passphrase,
- const char *bridge, bool enabled)
+ const char *bridge, bool enabled, bool hidden)
{
DBG("bridge %s enabled %d", bridge, enabled);
GSupplicantSSID *ssid;
};
-static GSupplicantSSID *ssid_ap_init(const char *ssid, const char *passphrase)
+static GSupplicantSSID *ssid_ap_init(const char *ssid,
+ const char *passphrase, bool hidden)
{
GSupplicantSSID *ap;
ap->passphrase = passphrase;
}
+ if (hidden)
+ ap->ignore_broadcast_ssid =
+ G_SUPPLICANT_AP_HIDDEN_SSID_ZERO_CONTENTS;
+ else
+ ap->ignore_broadcast_ssid = G_SUPPLICANT_AP_NO_SSID_HIDING;
+
return ap;
}
static int tech_set_tethering(struct connman_technology *technology,
const char *identifier, const char *passphrase,
- const char *bridge, bool enabled)
+ const char *bridge, bool enabled, bool hidden)
{
GList *list;
GSupplicantInterface *interface;
info->wifi = wifi;
info->technology = technology;
info->wifi->bridge = bridge;
- info->ssid = ssid_ap_init(identifier, passphrase);
+ info->ssid = ssid_ap_init(identifier, passphrase, hidden);
if (!info->ssid) {
g_free(info);
continue;
*/
char *tethering_ident;
char *tethering_passphrase;
+ bool tethering_hidden;
bool enable_persistent; /* Save the tech state */
g_key_file_set_boolean(keyfile, identifier, "Tethering",
technology->tethering_persistent);
+ g_key_file_set_boolean(keyfile, identifier, "Hidden",
+ technology->tethering_hidden);
+
if (technology->tethering_ident)
g_key_file_set_string(keyfile, identifier,
"Tethering.Identifier",
int err;
const char *ident, *passphrase, *bridge;
GSList *tech_drivers;
+ bool hidden;
ident = technology->tethering_ident;
passphrase = technology->tethering_passphrase;
+ hidden = technology->tethering_hidden;
__sync_synchronize();
if (!technology->enabled)
continue;
err = driver->set_tethering(technology, ident, passphrase,
- bridge, enabled);
+ bridge, enabled, hidden);
if (result == -EINPROGRESS)
continue;
DBUS_TYPE_STRING,
&technology->tethering_passphrase);
+ val = technology->tethering_hidden;
+ connman_dbus_dict_append_basic(&dict, "Hidden",
+ DBUS_TYPE_BOOLEAN,
+ &val);
+
connman_dbus_dict_close(iter, &dict);
}
&technology->tethering_passphrase);
}
}
+ } else if (g_str_equal(name, "Hidden")) {
+ dbus_bool_t hidden;
+
+ if (type != DBUS_TYPE_BOOLEAN)
+ return __connman_error_invalid_arguments(msg);
+
+ dbus_message_iter_get_basic(&value, &hidden);
+
+ if (technology->type != CONNMAN_SERVICE_TYPE_WIFI)
+ return __connman_error_not_supported(msg);
+
+ technology->tethering_hidden = hidden;
+ technology_save(technology);
+
+ connman_dbus_property_changed_basic(technology->path,
+ CONNMAN_TECHNOLOGY_INTERFACE,
+ "Hidden",
+ DBUS_TYPE_BOOLEAN,
+ &hidden);
} else if (g_str_equal(name, "Powered")) {
dbus_bool_t enable;
technology->refcount = 1;
technology->type = type;
+ technology->tethering_hidden = FALSE;
technology->path = g_strdup_printf("%s/technology/%s",
CONNMAN_PATH, str);
if (type == CONNMAN_SERVICE_TYPE_P2P) {