typedef struct {
int hide_mode;
+ int mac_filter;
char *ssid;
char *key;
char *mode;
int _get_wifi_name_from_lease_info(const char *mac, char **name_buf);
mobile_ap_error_code_e _enable_wifi_tethering(Tethering *obj, gchar *ssid,
- gchar *passphrase, gchar* mode, gint channel, int hide_mode, softap_security_type_e security_type);
+ gchar *passphrase, gchar* mode, gint channel, int hide_mode, int mac_filter, softap_security_type_e security_type);
mobile_ap_error_code_e _disable_wifi_tethering(Tethering *obj);
gboolean _is_trying_wifi_operation(void);
mobile_ap_error_code_e _reload_softap_settings(Tethering *obj,
- gchar *ssid, gchar *key, gchar* mode, gint channel, gint hide_mode, gint security_type);
+ gchar *ssid, gchar *key, gchar* mode, gint channel, gint hide_mode, gint mac_filter, gint security_type);
mobile_ap_error_code_e _reload_softap_settings_for_ap(Tethering *obj,
gchar *ssid, gchar *key, gint hide_mode, gint security_type);
mobile_ap_error_code_e _disable_wifi_ap(Tethering *obj);
gboolean tethering_enable_wifi_tethering(Tethering *obj,
GDBusMethodInvocation *context, gchar *ssid,
- gchar *key, gchar* mode, gint channel, gint visibility, gint security_type);
+ gchar *key, gchar* mode, gint channel, gint visibility, gint mac_filter, gint security_type);
softap_settings_t *_get_softap_settings();
gboolean tethering_reload_wifi_settings(Tethering *obj,
GDBusMethodInvocation *context,
- gchar *ssid, gchar *key, gchar* mode, gint channel, gint visibility, gint security_type);
+ gchar *ssid, gchar *key, gchar* mode, gint channel, gint visibility, gint mac_filter, gint security_type);
gboolean tethering_reload_wifi_ap_settings(Tethering *obj,
GDBusMethodInvocation *context, gchar *ssid, gchar *key,
#define MOBILE_AP_WIFI_PASSPHRASE_STORE_KEY "tethering_wifi_passphrase"
static mobile_ap_error_code_e __update_softap_settings(softap_settings_t *st,
- gchar *ssid, gchar *passphrase, gchar* mode, gint channel, int hide_mode, softap_security_type_e security_type);
+ gchar *ssid, gchar *passphrase, gchar* mode, gint channel, int hide_mode, int mac_filter, softap_security_type_e security_type);
static mobile_ap_error_code_e __get_passphrase(char *passphrase,
unsigned int passphrase_size, unsigned int *passphrase_len);
static mobile_ap_error_code_e __set_passphrase(const char *passphrase, const unsigned int size);
}
ret = _enable_wifi_tethering(obj, wifi_settings.ssid, wifi_settings.key,
- wifi_settings.mode, wifi_settings.channel, wifi_settings.hide_mode, wifi_settings.security_type);
+ wifi_settings.mode, wifi_settings.channel, wifi_settings.hide_mode, wifi_settings.mac_filter, wifi_settings.security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed\n");
} else {
DBG("Wi-Fi is turned off\n");
ret = _enable_wifi_tethering(obj, wifi_settings.ssid, wifi_settings.key,
- wifi_settings.mode, wifi_settings.channel, wifi_settings.hide_mode, wifi_settings.security_type);
+ wifi_settings.mode, wifi_settings.channel, wifi_settings.hide_mode, wifi_settings.mac_filter, wifi_settings.security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed\n");
} else {
}
static mobile_ap_error_code_e __update_softap_settings(softap_settings_t *st,
- gchar *ssid, gchar *passphrase, gchar* mode, gint channel, int hide_mode, softap_security_type_e security_type)
+ gchar *ssid, gchar *passphrase, gchar* mode, gint channel, int hide_mode, int mac_filter, softap_security_type_e security_type)
{
if (st == NULL) {
ERR("Invalid param\n");
st->channel = channel;
st->hide_mode = hide_mode;
+ st->mac_filter = mac_filter;
- SDBG("ssid : %s security type : %s hide mode : %d\n",
- st->ssid, st->security_type, st->hide_mode);
+ SDBG("ssid : %s security type : %s hide mode : %d mac filter : %d\n",
+ st->ssid, st->security_type, st->hide_mode, st->mac_filter);
return MOBILE_AP_ERROR_NONE;
}
if (a->hide_mode != b->hide_mode)
return FALSE;
+ if (a->mac_filter != b->mac_filter)
+ return FALSE;
+
if (strcmp(a->ssid, b->ssid) != 0)
return FALSE;
}
mobile_ap_error_code_e _reload_softap_settings(Tethering *obj,
- gchar *ssid, gchar *key, gchar* mode, gint channel, gint hide_mode, gint security_type)
+ gchar *ssid, gchar *key, gchar* mode, gint channel, gint hide_mode, gint mac_filter, gint security_type)
{
gboolean backup_prev_wifi_on = prev_wifi_on;
mobile_ap_error_code_e ret;
return MOBILE_AP_ERROR_NONE;
ret = __update_softap_settings(&new_settings, ssid, key, mode, channel, hide_mode,
- (softap_security_type_e)security_type);
+ mac_filter, (softap_security_type_e)security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("__update_softap_settings is failed\n");
return ret;
}
ret = _enable_wifi_tethering(obj, ssid, key, mode, channel, hide_mode,
- (softap_security_type_e)security_type);
+ mac_filter, (softap_security_type_e)security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed : %d\n", ret);
return ret;
}
ret = __update_softap_settings(&new_settings, ssid, key, NULL, MOBILE_AP_WIFI_CHANNEL, hide_mode,
- (softap_security_type_e)security_type);
+ false, (softap_security_type_e)security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("__update_softap_settings is failed\n");
return ret;
}
mobile_ap_error_code_e _enable_wifi_tethering(Tethering *obj, gchar *ssid,
- gchar *passphrase, gchar* mode, gint channel, int hide_mode, softap_security_type_e security_type)
+ gchar *passphrase, gchar* mode, gint channel, int hide_mode, int mac_filter, softap_security_type_e security_type)
{
mobile_ap_error_code_e ret;
/* Update Wi-Fi hotspot data to global settings pointer */
ret = __update_softap_settings(&obj_softap_settings, ssid, passphrase,
- mode, channel, hide_mode, security_type);
+ mode, channel, hide_mode, mac_filter, security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
_mobileap_clear_state(MOBILE_AP_STATE_WIFI);
return ret;
obj_softap_settings.key,
obj_softap_settings.mode,
obj_softap_settings.channel,
- obj_softap_settings.hide_mode);
+ obj_softap_settings.hide_mode,
+ obj_softap_settings.mac_filter);
if (ret != MOBILE_AP_ERROR_NONE) {
_deinit_tethering();
_mobileap_clear_state(MOBILE_AP_STATE_WIFI);
return MOBILE_AP_ERROR_RESOURCE;
}
ret = __update_softap_settings(&obj_softap_settings, ssid, passphrase,
- NULL, MOBILE_AP_WIFI_CHANNEL, hide_mode, security_type);
+ NULL, MOBILE_AP_WIFI_CHANNEL, hide_mode, false, security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
_mobileap_clear_state(MOBILE_AP_STATE_WIFI_AP);
return ret;
obj_softap_settings.key,
NULL,
obj_softap_settings.channel,
- obj_softap_settings.hide_mode);
+ obj_softap_settings.hide_mode,
+ obj_softap_settings.mac_filter);
if (ret != MOBILE_AP_ERROR_NONE) {
_deinit_tethering();
_mobileap_clear_state(MOBILE_AP_STATE_WIFI_AP);
gboolean tethering_enable_wifi_tethering(Tethering *obj,
GDBusMethodInvocation *context, gchar *ssid,
- gchar *key, gchar *mode, gint channel, gint visibility, gint security_type)
+ gchar *key, gchar *mode, gint channel, gint visibility, gint mac_filter, gint security_type)
{
DBG("+\n");
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
}
ret = _enable_wifi_tethering(obj, ssid, key, mode, channel, !visibility,
- (softap_security_type_e)security_type);
+ mac_filter, (softap_security_type_e)security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed\n");
} else {
gboolean tethering_reload_wifi_settings(Tethering *obj,
GDBusMethodInvocation *context, gchar *ssid,
- gchar *key, gchar *mode, gint channel, gint visibility, gint security_type)
+ gchar *key, gchar *mode, gint channel, gint visibility, gint mac_filter, gint security_type)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
gboolean ret_val = TRUE;
g_assert(obj != NULL);
g_assert(context != NULL);
- ret = _reload_softap_settings(obj, ssid, key, mode, channel, !visibility, security_type);
+ ret = _reload_softap_settings(obj, ssid, key, mode, channel, !visibility, mac_filter, security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_reload_softap_settings is failed\n");
ret_val = FALSE;