[WiFi][Connection] Apply CAPIs for thread handling (#134)
[platform/core/csapi/tizenfx.git] / src / Tizen.Network.Connection / Interop / Interop.Connection.cs
index 5563025..d4db427 100755 (executable)
@@ -33,11 +33,11 @@ internal static partial class Interop
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         public delegate bool IPv6AddressCallback(IntPtr ipv6, IntPtr userData);
 
-        [DllImport(Libraries.Connection, EntryPoint = "connection_create")]
-        public static extern int Create(out IntPtr handle);
+        [DllImport(Libraries.Connection, EntryPoint = "connection_create_cs")]
+        public static extern int Create(int tid, out IntPtr handle);
 
-        [DllImport(Libraries.Connection, EntryPoint = "connection_destroy")]
-        public static extern int Destroy(IntPtr handle);
+        [DllImport(Libraries.Connection, EntryPoint = "connection_destroy_cs")]
+        public static extern int Destroy(int tid, IntPtr handle);
 
         [DllImport(Libraries.Connection, EntryPoint = "connection_get_type")]
         public static extern int GetType(IntPtr handle, out int type);
@@ -75,6 +75,12 @@ internal static partial class Interop
         [DllImport(Libraries.Connection, EntryPoint = "connection_reset_statistics")]
         public static extern int ResetStatistics(IntPtr handle, int connectionType, int statisticsType);
 
+        [DllImport(Libraries.Connection, EntryPoint = "connection_add_route_entry")]
+        public static extern int AddRoute(IntPtr handle, AddressFamily family, string interfaceName, string address, string gateway);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_remove_route_entry")]
+        public static extern int RemoveRoute(IntPtr handle, AddressFamily family, string interfaceName, string address, string gateway);
+
         [DllImport(Libraries.Connection, EntryPoint = "connection_set_type_changed_cb")]
         public static extern int SetTypeChangedCallback(IntPtr handle, ConnectionTypeChangedCallback callback, IntPtr userData);
 
@@ -198,6 +204,9 @@ internal static partial class Interop
         [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dns_config_type")]
         public static extern int GetDnsConfigType(IntPtr profileHandle, int family, out int type);
 
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dhcp_server_address")]
+        public static extern int GetDhcpServerAddress(IntPtr profileHandle, AddressFamily family, out string dhcpServerAddress);
+
         [DllImport(Libraries.Connection, EntryPoint = "connection_profile_refresh")]
         public static extern int Refresh(IntPtr profileHandle);
 
@@ -217,7 +226,7 @@ internal static partial class Interop
         public static extern int SetGatewayAddress(IntPtr profileHandle, int family, string address);
 
         [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_dns_address")]
-        public static extern int SetDnsAddress(IntPtr profileHandle, int family, string address);
+        public static extern int SetDnsAddress(IntPtr profileHandle, int order, int family, string address);
 
         [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_proxy_address")]
         public static extern int SetProxyAddress(IntPtr profileHandle, int family, string address);
@@ -244,7 +253,7 @@ internal static partial class Interop
         public static extern int GetApn(IntPtr profileHandle, out IntPtr apn);
 
         [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_auth_info")]
-        public static extern int GetAuthInfo(IntPtr profileHandle, out int authType, out IntPtr name, out IntPtr password);
+        public static extern int GetAuthInfo(IntPtr profileHandle, out int authType, out string name, out string password);
 
         [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_home_url")]
         public static extern int GetHomeUrl(IntPtr profileHandle, out IntPtr homeUrl);