Bug Fix and Code Cleanup
[platform/core/connectivity/wifi-direct-manager.git] / include / wifi-direct-util.h
old mode 100755 (executable)
new mode 100644 (file)
index 5781809..d1286bc
 #ifndef __WIFI_DIRECT_UTIL_H__
 #define __WIFI_DIRECT_UTIL_H__
 
-#if defined TIZEN_MOBILE
-#      define DEFAULT_MAC_FILE_PATH "/opt/etc/.mac.info"
-#endif /* TIZEN_MOBILE */
-
-#if defined TIZEN_TV
-#      if defined TIZEN_WIFI_MODULE_BUNDLE
-#              define DEFAULT_MAC_FILE_PATH "/sys/class/net/wlan0/address"
-#      else /* TIZEN_WIFI_MODULE_BUNDLE */
-#              define DEFAULT_MAC_FILE_PATH "/sys/class/net/p2p0/address"
-#      endif /* TIZEN_WIFI_MODULE_BUNDLE */
-#endif /* TIZEN_TV */
-
-#ifndef DEFAULT_MAC_FILE_PATH
-#      define DEFAULT_MAC_FILE_PATH "/sys/class/net/p2p0/address"
-#endif
-
 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
 #define IP2STR(a) (a)[0], (a)[1], (a)[2], (a)[3]
 #define IPSTR "%d.%d.%d.%d"
 #define ZEROIP "0.0.0.0"
+#define ISZEROIP(a) !((a)[0] | (a)[1] | (a)[2] | (a)[3])
+#define ISZEROMACADDR(a) !((a)[0] | (a)[1] | (a)[2] | (a)[3] | (a)[4] | (a)[5])
 #define MAC2SECSTR(a) (a)[0], (a)[4], (a)[5]
 #define MACSECSTR "%02x:%02x:%02x"
 #define IP2SECSTR(a) (a)[0], (a)[3]
 #define IPSECSTR "%d..%d"
+#define MAX_SIZE_ERROR_BUFFER 256
 
-#define VCONFKEY_DHCPS_IP_LEASE "memory/private/wifi_direct_manager/dhcp_ip_lease"
-#define VCONFKEY_DHCPC_SERVER_IP "memory/private/wifi_direct_manager/dhcpc_server_ip"
-#define VCONFKEY_LOCAL_IP "memory/private/wifi_direct_manager/p2p_local_ip"
 #define DHCP_DUMP_FILE "/tmp/dhcp-client-table"
-#define COUNTRY_CODE_FILE "/usr/etc/wifi-direct/ccode.conf"
-#define MAX_DHCP_DUMP_SIZE 64    // Single lease format: [99:66:dd:00:11:aa 192.168.16.20 00:00:60]
+#define MAX_DHCP_DUMP_SIZE 64    /* Single lease format: [99:66:dd:00:11:aa 192.168.16.20 00:00:60] */
 
 #define SOCK_FD_MIN 3
 
@@ -88,15 +71,17 @@ int wfd_util_start_wifi_direct_popup();
 int wfd_util_stop_wifi_direct_popup();
 #endif /* TIZEN_FEATURE_DEFAULT_CONNECTION_AGENT */
 
-int wfd_util_dhcps_start();
+int wfd_util_dhcps_start(char *ifname);
 int wfd_util_dhcps_wait_ip_leased(wfd_device_s *peer);
-int wfd_util_dhcps_stop();
-int wfd_util_dhcpc_start(wfd_device_s *peer);
-int wfd_util_dhcpc_stop();
+int wfd_util_dhcps_stop(char *ifname);
+int wfd_util_dhcpc_start(char *ifname, wfd_device_s *peer);
+int wfd_util_dhcpc_stop(char *ifname);
 int wfd_util_local_get_ip(char *ifname, unsigned char *ip_addr, int is_IPv6);
 int wfd_util_dhcpc_get_server_ip(unsigned char* ip_addr);
 #ifdef TIZEN_FEATURE_IP_OVER_EAPOL
 int wfd_util_ip_over_eap_assign(wfd_device_s *peer, const char *ifname);
 #endif /* TIZEN_FEATURE_IP_OVER_EAPOL */
 int wfd_util_ip_unset(const char *ifname);
+gboolean wfd_util_is_remove_group_allowed(void);
+
 #endif /* __WIFI_DIRECT_UTIL_H__ */