} wfd_oem_new_service_s;
#endif /* TIZEN_FEATURE_SERVICE_DISCOVERY */
+#define WFD_OEM_STR_PROTO_WPA "WPA"
+#define WFD_OEM_STR_PROTO_RSN "RSN"
+#define WFD_OEM_STR_KEY_MGMT_IEEE8021X "WPA-EAP"
+#define WFD_OEM_STR_KEY_MGMT_PSK "WPA-PSK"
+#define WFD_OEM_STR_KEY_MGMT_NONE "WPA-NONE"
+#define WFD_OEM_STR_CIPHER_NONE "NONE"
+#define WFD_OEM_STR_CIPHER_WEP40 "WEP40"
+#define WFD_OEM_STR_CIPHER_WEP104 "WEP104"
+#define WFD_OEM_STR_CIPHER_TKIP "TKIP"
+#define WFD_OEM_STR_CIPHER_CCMP "CCMP"
+#define WFD_OEM_STR_AUTH_ALG_OPEN "OPEN"
+#define WFD_OEM_STR_MODE_GC "0"
+#define WFD_OEM_STR_MODE_GO "3"
+
+typedef enum {
+ WFD_OEM_PROTO_WPA = 0x01, /* WPA */
+ WFD_OEM_PROTO_RSN = 0x02, /* RSN */
+} wfd_oem_proto_e;
+
+typedef enum {
+ WFD_OEM_KEY_MGMT_IEEE8021X = 0x01, /* WPA-EAP */
+ WFD_OEM_KEY_MGMT_PSK = 0x02, /* WPA-PSK */
+ WFD_OEM_KEY_MGMT_NONE = 0x04, /* WPA-NONE */
+} wfd_oem_key_mgmt_e;
+
+typedef enum {
+ WFD_OEM_CIPHER_NONE = 0x01, /* NONE */
+ WFD_OEM_CIPHER_WEP40 = 0x02, /* WEP40 */
+ WFD_OEM_CIPHER_WEP104 = 0x04, /* WEP104 */
+ WFD_OEM_CIPHER_TKIP = 0x08, /* TKIP */
+ WFD_OEM_CIPHER_CCMP = 0x10, /* CCMP */
+} wfd_oem_cipher_e;
+
+typedef enum {
+ WFD_OEM_AUTH_ALG_OPEN = 0x01, /* OPEN */
+}wfd_oem_auth_alg_e;
+
+typedef enum {
+ WFD_OEM_PERSISTENT_MODE_GC = 0x0,
+ WFD_OEM_PERSISTENT_MODE_GO = 0x3,
+} wfd_oem_persistent_mode_e;
+
typedef struct
{
int network_id;
char ssid[OEM_DEV_NAME_LEN + 1];
unsigned char go_mac_address[OEM_MACADDR_LEN];
+ char psk[OEM_PASS_PHRASE_LEN +1];
+ int proto;
+ int key_mgmt;
+ int pairwise;
+ int group;
+ int auth_alg;
+ int mode;
+ int p2p_client_num;
+ unsigned char p2p_client_list[OEM_MACADDR_LEN][OEM_MAX_PEER_NUM];
} wfd_oem_persistent_group_s;
typedef int (*wfd_oem_event_cb) (void *user_data, void *event);
return res;
}
-int _parsing_networks(char* buf, ws_network_info_s networks[], int *network_cnt)
-{
- __WDP_LOG_FUNC_ENTER__;
-
- __WDP_LOG_FUNC_EXIT__;
- return 0;
-}
-
void __parsing_networks (const char *key, GVariant *value, void *user_data)
{
__WDP_LOG_FUNC_ENTER__;
WDP_LOGD("bssid [%s]", bssid);
__ws_txt_to_mac(bssid, network->bssid);
+ } else if (g_strcmp0(key, "proto") == 0) {
+ const char *proto = NULL;
+ g_variant_get(value, "&s", &proto);
+ WDP_LOGD("proto [%s]", proto);
+
+ if (g_strrstr(proto, WFD_OEM_STR_PROTO_WPA) != NULL)
+ network->proto |= WFD_OEM_PROTO_WPA;
+ if (g_strrstr(proto, WFD_OEM_STR_PROTO_RSN) != NULL)
+ network->proto |= WFD_OEM_PROTO_RSN;
+
+ } else if (g_strcmp0(key, "key_mgmt") == 0) {
+ const char *key_mgmt = NULL;
+ g_variant_get(value, "&s", &key_mgmt);
+ WDP_LOGD("key_mgmt [%s]", key_mgmt);
+
+ if (g_strrstr(key_mgmt, WFD_OEM_STR_KEY_MGMT_IEEE8021X) != NULL)
+ network->key_mgmt |= WFD_OEM_KEY_MGMT_IEEE8021X;
+ if (g_strrstr(key_mgmt, WFD_OEM_STR_KEY_MGMT_PSK) != NULL)
+ network->key_mgmt |= WFD_OEM_KEY_MGMT_PSK;
+ if (g_strrstr(key_mgmt, WFD_OEM_STR_KEY_MGMT_NONE) != NULL)
+ network->key_mgmt |= WFD_OEM_KEY_MGMT_NONE;
+
+ } else if (g_strcmp0(key, "pairwise") == 0) {
+ const char *pairwise = NULL;
+ g_variant_get(value, "&s", &pairwise);
+ WDP_LOGD("pairwise [%s]", pairwise);
+
+ if (g_strrstr(pairwise, WFD_OEM_STR_CIPHER_NONE) != NULL)
+ network->pairwise |= WFD_OEM_CIPHER_NONE;
+ if (g_strrstr(pairwise, WFD_OEM_STR_CIPHER_TKIP) != NULL)
+ network->pairwise |= WFD_OEM_CIPHER_TKIP;
+ if (g_strrstr(pairwise, WFD_OEM_STR_CIPHER_CCMP) != NULL)
+ network->pairwise |= WFD_OEM_CIPHER_CCMP;
+
+ } else if (g_strcmp0(key, "group") == 0) {
+ const char *group = NULL;
+ g_variant_get(value, "&s", &group);
+ WDP_LOGD("group [%s]", group);
+
+ if (g_strrstr(group, WFD_OEM_STR_CIPHER_NONE) != NULL)
+ network->group |= WFD_OEM_CIPHER_NONE;
+ if (g_strrstr(group, WFD_OEM_STR_CIPHER_WEP40) != NULL)
+ network->group |= WFD_OEM_CIPHER_WEP40;
+ if (g_strrstr(group, WFD_OEM_STR_CIPHER_WEP104) != NULL)
+ network->group |= WFD_OEM_CIPHER_WEP104;
+ if (g_strrstr(group, WFD_OEM_STR_CIPHER_TKIP) != NULL)
+ network->group |= WFD_OEM_CIPHER_TKIP;
+ if (g_strrstr(group, WFD_OEM_STR_CIPHER_CCMP) != NULL)
+ network->group |= WFD_OEM_CIPHER_CCMP;
+
+ } else if (g_strcmp0(key, "auth_alg") == 0) {
+ const char *auth_alg = NULL;
+ g_variant_get(value, "&s", &auth_alg);
+ WDP_LOGD("auth_alg [%s]", auth_alg);
+
+ if (g_strrstr(auth_alg, WFD_OEM_STR_AUTH_ALG_OPEN) != NULL)
+ network->auth_alg |= WFD_OEM_AUTH_ALG_OPEN;
+
} else if (g_strcmp0(key, "mode") == 0) {
+ const char *mode = NULL;
+ g_variant_get(value, "&s", &mode);
+ WDP_LOGD("mode [%s]", mode);
+
+ if (g_strrstr(mode, WFD_OEM_STR_MODE_GC) != NULL)
+ network->mode |= WFD_OEM_PERSISTENT_MODE_GC;
+ if (g_strrstr(mode, WFD_OEM_STR_MODE_GO) != NULL)
+ network->mode |= WFD_OEM_PERSISTENT_MODE_GO;
+
+ } else if (g_strcmp0(key, "p2p_client_list") == 0) {
+ const char *p2p_client_list = NULL;
+ char *ptr = NULL;
+ int list_len = 0;
+ int num = 0;
+ g_variant_get(value, "&s", &p2p_client_list);
+ WDP_LOGD("p2p_client_list [%s]", p2p_client_list);
+ ptr = (char *)p2p_client_list;
+ while(ptr != NULL && list_len >= (OEM_MACSTR_LEN - 1)) {
+ __ws_txt_to_mac((unsigned char *)ptr, &(network->p2p_client_list[0][num]));
+ ptr += OEM_MACSTR_LEN;
+ list_len -= OEM_MACSTR_LEN;
+ num++;
+ }
+ network->p2p_client_num = num;
}
return;
}