• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NetManager Subsystem Changelog
2
3## cl.netmanager.1 Renaming of OHOS_NetConn_RegisterDnsResolver with the Deprecated Tag Added
4
5**Access Level**
6
7Public API
8
9**Reason for Change**
10
11Only the API name is changed.
12
13**Change Impact**
14
15This change is a non-compatible change.
16
17Before change: The API name is in the OHOS format.
18
19After change: The API name is in the OH format. A deprecated tag is added to the original API, and the function remains unchanged. You are advised to use **OH_NetConn_RegisterDnsResolver** instead.
20
21Incompatible scenarios:
22Only the deprecated tag is added. The API functions will remain available in three versions.
23
24**Start API Level**
25
26API 11
27
28**Change Since**
29
30OpenHarmony SDK 5.0.0.43
31
32**Key API/Component Changes**
33
34OH_NetConn_RegisterDnsResolver;
35
36**Adaptation Guide**
37
38```ts
39int main() {
40    OH_NetConn_CustomDnsResolver resolver;
41    // Register a custom DNS resolver.
42    int result = OH_NetConn_RegisterDnsResolver(resolver);
43    if (result == 0) {
44        printf("Custom DNS resolver registered successfully\n");
45    } else {
46        printf("Failed to register custom DNS resolver, error code: %d\n", result);
47    }
48
49    return0;
50}
51```
52
53## cl.netmanager.2 Renaming of OHOS_NetConn_UnregisterDnsResolver with the Deprecated Tag Added
54
55**Access Level**
56
57Public API
58
59**Reason for Change**
60
61Only the API name is changed.
62
63**Change Impact**
64
65This change is a non-compatible change.
66
67Before change: The API name is in the OHOS format.
68
69After change: The API name is in the OH format. A deprecated tag is added to the original API, and the function remains unchanged. You are advised to use **OH_NetConn_UnregisterDnsResolver** instead.
70
71Incompatible scenarios:
72Only the deprecated tag is added. The API functions will remain available in three versions.
73
74**Start API Level**
75
76API 11
77
78**Change Since**
79
80OpenHarmony SDK 5.0.0.43
81
82**Key API/Component Changes**
83
84OH_NetConn_UnregisterDnsResolver;
85
86**Adaptation Guide**
87
88```ts
89int main() {
90    OH_NetConn_CustomDnsResolver resolver;
91    // Register a custom DNS resolver.
92    int result = OH_NetConn_RegisterDnsResolver(resolver);
93    if (result == 0) {
94        printf("Custom DNS resolver registered successfully\n");
95    } else {
96        printf("Failed to register custom DNS resolver, error code: %d\n", result);
97    }
98
99    // Use the custom DNS resolver to resolve domain names.
100    // ......
101
102    // Unregister the custom DNS resolver.
103    result = OH_NetConn_RegisterDnsResolver();
104    if (result == 0) {
105        printf("Custom DNS resolver unregistered successfully\n");
106    } else {
107        printf("Failed to unregister custom DNS resolver, error code: %d\n", result);
108    }
109
110    return0;
111}
112```
113