-static GHashTable *cdc_mac_hash = NULL;
-
-static void add_station(int index)
-{
- char *path, line[128] = {'\0'};
- char *ifname = connman_inet_ifname(index);
- char *mac;
- FILE *f;
-
- if (ifname == NULL)
- return;
-
- path = g_strdup_printf("/sys/class/usb_mode/%s/f_rndis/ethaddr",
- ifname);
-
- f = fopen(path, "re");
-
- g_free(ifname);
- g_free(path);
-
- if (f == NULL)
- return;
-
- if (fgets(line, sizeof(line), f) == NULL) {
- fclose(f);
- return;
- }
-
- fclose(f);
-
- mac = g_ascii_strdown(line, strlen(line) - 1);
- DBG("Add station %s in Technology %d", mac,
- CONNMAN_SERVICE_TYPE_GADGET);
-
- g_hash_table_insert(cdc_mac_hash, GINT_TO_POINTER(index),
- mac);
-
- connman_technology_tethering_add_station(CONNMAN_SERVICE_TYPE_GADGET,
- mac);
-}
-
-static void remove_station(int index)
-{
- char *mac;
- mac = g_hash_table_lookup(cdc_mac_hash, GINT_TO_POINTER(index));
- if (mac == NULL)
- return;
-
- connman_technology_tethering_remove_station(mac);
-
- g_hash_table_remove(cdc_mac_hash, GINT_TO_POINTER(index));
-}
-
-static gboolean remove_all_station(gpointer key, gpointer value, gpointer user_data)
-{
- char *mac;
- mac = value;
- if (mac == NULL)
- return TRUE;
-
- connman_technology_tethering_remove_station(mac);
-
- return TRUE;
-}
-