• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit MDMKit
19 */
20
21import type { AsyncCallback } from './@ohos.base';
22import type Want from './@ohos.app.ability.Want';
23import type connection from './@ohos.net.connection';
24
25/**
26 * This module offers set network policies on the devices.
27 *
28 * @namespace networkManager
29 * @syscap SystemCapability.Customization.EnterpriseDeviceManager
30 * @stagemodelonly
31 * @since 10
32 */
33declare namespace networkManager {
34  /**
35   * Iptables rule add method.
36   *
37   * @enum { number }
38   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
39   * @systemapi
40   * @stagemodelonly
41   * @since 10
42   */
43  enum AddMethod {
44    /**
45     * Append method
46     *
47     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
48     * @systemapi
49     * @stagemodelonly
50     * @since 10
51     */
52    APPEND = 0,
53
54    /**
55     * Insert method
56     *
57     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
58     * @systemapi
59     * @stagemodelonly
60     * @since 10
61     */
62    INSERT = 1
63  }
64
65  /**
66   * Iptables rule direction.
67   *
68   * @enum { number }
69   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
70   * @stagemodelonly
71   * @since 12
72   */
73  enum Direction {
74    /**
75     * Input direction
76     *
77     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
78     * @stagemodelonly
79     * @since 12
80     */
81    INPUT = 0,
82
83    /**
84     * Output direction
85     *
86     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
87     * @stagemodelonly
88     * @since 12
89     */
90    OUTPUT = 1,
91
92    /**
93     * Forward direction
94     *
95     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
96     * @stagemodelonly
97     * @since 15
98     */
99    FORWARD = 2
100  }
101
102  /**
103   * Iptables rule action.
104   *
105   * @enum { number }
106   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
107   * @stagemodelonly
108   * @since 12
109   */
110  enum Action {
111    /**
112     * Action allow
113     *
114     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
115     * @stagemodelonly
116     * @since 12
117     */
118    ALLOW = 0,
119
120    /**
121     * Action deny
122     *
123     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
124     * @stagemodelonly
125     * @since 12
126     */
127    DENY = 1,
128
129    /**
130     * Action reject
131     *
132     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
133     * @stagemodelonly
134     * @since 15
135     */
136    REJECT = 2
137  }
138
139  /**
140   * Iptables rule protocol
141   *
142   * @enum { number }
143   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
144   * @stagemodelonly
145   * @since 12
146   */
147  enum Protocol {
148    /**
149     * Protocol all
150     *
151     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
152     * @stagemodelonly
153     * @since 12
154     */
155    ALL = 0,
156
157    /**
158     * Protocol tcp
159     *
160     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
161     * @stagemodelonly
162     * @since 12
163     */
164    TCP = 1,
165
166    /**
167     * Protocol udp
168     *
169     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
170     * @stagemodelonly
171     * @since 12
172     */
173    UDP = 2,
174
175    /**
176     * Protocol icmp
177     *
178     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
179     * @stagemodelonly
180     * @since 12
181     */
182    ICMP = 3
183  }
184
185  /**
186   * Iptables add filter rule
187   *
188   * @typedef AddFilterRule
189   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
190   * @systemapi
191   * @stagemodelonly
192   * @since 10
193   */
194  interface AddFilterRule {
195    /**
196     * Iptables rule num
197     *
198     * @type { ?number }
199     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
200     * @systemapi
201     * @stagemodelonly
202     * @since 10
203     */
204    ruleNo?: number;
205
206    /**
207     * Iptables ip source address
208     *
209     * @type { ?string }
210     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
211     * @systemapi
212     * @stagemodelonly
213     * @since 10
214     */
215    srcAddr?: string;
216
217    /**
218     * Iptables ip destination address
219     *
220     * @type { ?string }
221     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
222     * @systemapi
223     * @stagemodelonly
224     * @since 10
225     */
226    destAddr?: string;
227
228    /**
229     * Iptables source port
230     *
231     * @type { ?string }
232     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
233     * @systemapi
234     * @stagemodelonly
235     * @since 10
236     */
237    srcPort?: string;
238
239    /**
240     * Iptables destination port
241     *
242     * @type { ?string }
243     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
244     * @systemapi
245     * @stagemodelonly
246     * @since 10
247     */
248    destPort?: string;
249
250    /**
251     * Application uid
252     *
253     * @type { ?string }
254     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
255     * @systemapi
256     * @stagemodelonly
257     * @since 10
258     */
259    uid?: string;
260
261    /**
262     * Add method
263     *
264     * @type { AddMethod }
265     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
266     * @systemapi
267     * @stagemodelonly
268     * @since 10
269     */
270    method: AddMethod;
271
272    /**
273     * Direction
274     *
275     * @type { Direction }
276     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
277     * @systemapi
278     * @stagemodelonly
279     * @since 10
280     */
281    direction: Direction;
282
283    /**
284     * Action
285     *
286     * @type { Action }
287     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
288     * @systemapi
289     * @stagemodelonly
290     * @since 10
291     */
292    action: Action;
293
294    /**
295     * Protocol
296     *
297     * @type { ?Protocol }
298     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
299     * @systemapi
300     * @stagemodelonly
301     * @since 10
302     */
303    protocol?: Protocol;
304  }
305
306  /**
307   * Iptables remove filter rule
308   *
309   * @typedef RemoveFilterRule
310   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
311   * @systemapi
312   * @stagemodelonly
313   * @since 10
314   */
315  interface RemoveFilterRule {
316    /**
317     * Iptables ip source address
318     *
319     * @type { ?string }
320     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
321     * @systemapi
322     * @stagemodelonly
323     * @since 10
324     */
325    srcAddr?: string;
326
327    /**
328     * Iptables ip destination address
329     *
330     * @type { ?string }
331     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
332     * @systemapi
333     * @stagemodelonly
334     * @since 10
335     */
336    destAddr?: string;
337
338    /**
339     * Iptables source port
340     *
341     * @type { ?string }
342     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
343     * @systemapi
344     * @stagemodelonly
345     * @since 10
346     */
347    srcPort?: string;
348
349    /**
350     * Iptables destination port
351     *
352     * @type { ?string }
353     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
354     * @systemapi
355     * @stagemodelonly
356     * @since 10
357     */
358    destPort?: string;
359
360    /**
361     * Application uid
362     *
363     * @type { ?string }
364     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
365     * @systemapi
366     * @stagemodelonly
367     * @since 10
368     */
369    uid?: string;
370
371    /**
372     * Direction
373     *
374     * @type { Direction }
375     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
376     * @systemapi
377     * @stagemodelonly
378     * @since 10
379     */
380    direction: Direction;
381
382    /**
383     * Action
384     *
385     * @type { ?Action }
386     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
387     * @systemapi
388     * @stagemodelonly
389     * @since 10
390     */
391    action?: Action;
392
393    /**
394     * Protocol
395     *
396     * @type { ?Protocol }
397     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
398     * @systemapi
399     * @stagemodelonly
400     * @since 10
401     */
402    protocol?: Protocol;
403  }
404
405  /**
406   * Firewall rule
407   *
408   * @typedef FirewallRule
409   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
410   * @stagemodelonly
411   * @since 12
412   */
413  interface FirewallRule {
414    /**
415     * Source IP
416     *
417     * @type { ?string }
418     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
419     * @stagemodelonly
420     * @since 12
421     */
422    srcAddr?: string;
423
424    /**
425     * Destination IP
426     *
427     * @type { ?string }
428     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
429     * @stagemodelonly
430     * @since 12
431     */
432    destAddr?: string;
433
434    /**
435     * Source Port
436     *
437     * @type { ?string }
438     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
439     * @stagemodelonly
440     * @since 12
441     */
442    srcPort?: string;
443
444    /**
445     * Destination Port
446     *
447     * @type { ?string }
448     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
449     * @stagemodelonly
450     * @since 12
451     */
452    destPort?: string;
453
454    /**
455     * Application uid
456     *
457     * @type { ?string }
458     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
459     * @stagemodelonly
460     * @since 12
461     */
462    appUid?: string;
463
464    /**
465     * Direction
466     *
467     * @type { ?Direction }
468     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
469     * @stagemodelonly
470     * @since 12
471     */
472    direction?: Direction;
473
474    /**
475     * Action
476     *
477     * @type { ?Action }
478     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
479     * @stagemodelonly
480     * @since 12
481     */
482    action?: Action;
483
484    /**
485     * Protocol
486     *
487     * @type { ?Protocol }
488     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
489     * @stagemodelonly
490     * @since 12
491     */
492    protocol?: Protocol;
493  }
494
495  /**
496   * Domain filter rule
497   *
498   * @typedef DomainFilterRule
499   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
500   * @stagemodelonly
501   * @since 12
502   */
503  interface DomainFilterRule {
504    /**
505     * Domain name
506     *
507     * @type { ?string }
508     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
509     * @stagemodelonly
510     * @since 12
511     */
512    domainName?: string;
513
514    /**
515     * Application uid
516     *
517     * @type { ?string }
518     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
519     * @stagemodelonly
520     * @since 12
521     */
522    appUid?: string;
523
524    /**
525     * action
526     *
527     * @type { ?Action }
528     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
529     * @stagemodelonly
530     * @since 12
531     */
532    action?: Action;
533
534    /**
535     * Direction
536     *
537     * @type { ?Direction }
538     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
539     * @stagemodelonly
540     * @since 15
541     */
542    direction?: Direction;
543  }
544
545  /**
546   * Gets all of the network interfaces of the device.
547   * This function can be called by a super administrator.
548   *
549   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
550   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
551   *                         The admin must have the corresponding permission.
552   * @param { AsyncCallback<Array<string>> } callback - the callback of getAllNetworkInterfaces.
553   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
554   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
555   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
556   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
557   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
558   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
559   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
560   * @systemapi
561   * @stagemodelonly
562   * @since 10
563   */
564  function getAllNetworkInterfaces(admin: Want, callback: AsyncCallback<Array<string>>): void;
565
566  /**
567   * Gets all of the network interfaces of the device.
568   * This function can be called by a super administrator.
569   *
570   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
571   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
572   *                         The admin must have the corresponding permission.
573   * @returns { Promise<Array<string>> } the promise returned by getAllNetworkInterfaces.
574   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
575   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
576   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
577   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
578   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
579   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
580   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
581   * @systemapi
582   * @stagemodelonly
583   * @since 10
584   */
585  function getAllNetworkInterfaces(admin: Want): Promise<Array<string>>;
586
587  /**
588   * Gets all the network interfaces of the device.
589   * This function can be called by a super administrator.
590   *
591   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
592   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
593   *                         The admin must have the corresponding permission.
594   * @returns { Array<string> } all the network interfaces of the device.
595   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
596   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
597   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
598   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
599   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
600   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
601   * @stagemodelonly
602   * @since 12
603   */
604  function getAllNetworkInterfacesSync(admin: Want): Array<string>;
605
606  /**
607   * Gets the ip address of the network interface.
608   * This function can be called by a super administrator.
609   *
610   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
611   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
612   *                         The admin must have the corresponding permission.
613   * @param { string } networkInterface - networkInterface indicates the network interface to get ip address.
614   * @param { AsyncCallback<string> } callback - the callback of getIpAddress.
615   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
616   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
617   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
618   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
619   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
620   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
621   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
622   * @systemapi
623   * @stagemodelonly
624   * @since 10
625   */
626  function getIpAddress(admin: Want, networkInterface: string, callback: AsyncCallback<string>): void;
627
628  /**
629   * Gets the ip address of the network interface.
630   * This function can be called by a super administrator.
631   *
632   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
633   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
634   *                         The admin must have the corresponding permission.
635   * @param { string } networkInterface - networkInterface indicates the network interface to get ip address.
636   * @returns { Promise<string> } the promise returned by getIpAddress.
637   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
638   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
639   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
640   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
641   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
642   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
643   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
644   * @systemapi
645   * @stagemodelonly
646   * @since 10
647   */
648  function getIpAddress(admin: Want, networkInterface: string): Promise<string>;
649
650  /**
651   * Gets the ip address of the network interface.
652   * This function can be called by a super administrator.
653   *
654   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
655   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
656   *                         The admin must have the corresponding permission.
657   * @param { string } networkInterface - the ip address of the network interface.
658   * @returns { string } the promise returned by getIpAddress.
659   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
660   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
661   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
662   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
663   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
664   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
665   * @stagemodelonly
666   * @since 12
667   */
668  function getIpAddressSync(admin: Want, networkInterface: string): string;
669
670  /**
671   * Gets the mac address of the network interface.
672   * This function can be called by a super administrator.
673   *
674   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
675   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
676   *                         The admin must have the corresponding permission.
677   * @param { string } networkInterface - networkInterface indicates the network interface to get mac address.
678   * @param { AsyncCallback<string> } callback - the callback of getMac.
679   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
680   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
681   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
682   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
683   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
684   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
685   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
686   * @systemapi
687   * @stagemodelonly
688   * @since 10
689   */
690  function getMac(admin: Want, networkInterface: string, callback: AsyncCallback<string>): void;
691
692  /**
693   * Gets the mac address of the network interface.
694   * This function can be called by a super administrator.
695   *
696   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
697   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
698   *                         The admin must have the corresponding permission.
699   * @param { string } networkInterface - networkInterface indicates the network interface to get mac address.
700   * @returns { Promise<string> } the promise returned by getMac.
701   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
702   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
703   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
704   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
705   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
706   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
707   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
708   * @systemapi
709   * @stagemodelonly
710   * @since 10
711   */
712  function getMac(admin: Want, networkInterface: string): Promise<string>;
713
714  /**
715   * Gets the mac address of the network interface.
716   * This function can be called by a super administrator.
717   *
718   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
719   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
720   *                         The admin must have the corresponding permission.
721   * @param { string } networkInterface - networkInterface indicates the network interface to get mac address.
722   * @returns { string } the mac address of the network interface.
723   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
724   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
725   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
726   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
727   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
728   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
729   * @stagemodelonly
730   * @since 12
731   */
732  function getMacSync(admin: Want, networkInterface: string): string;
733
734  /**
735   * Gets state of whether the network interface is disabled.
736   * This function can be called by a super administrator.
737   *
738   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
739   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
740   *                         The admin must have the corresponding permission.
741   * @param { string } networkInterface - networkInterface indicates the network interface to get status.
742   * @param { AsyncCallback<boolean> } callback - the callback of isNetworkInterfaceDisabled.
743   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
744   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
745   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
746   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
747   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
748   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
749   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
750   * @systemapi
751   * @stagemodelonly
752   * @since 10
753   */
754  function isNetworkInterfaceDisabled(admin: Want, networkInterface: string, callback: AsyncCallback<boolean>): void;
755
756  /**
757   * Gets state of whether the network interface is disabled.
758   * This function can be called by a super administrator.
759   *
760   * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO
761   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
762   *                         The admin must have the corresponding permission.
763   * @param { string } networkInterface - networkInterface indicates the network interface to get status.
764   * @returns { Promise<boolean> } the promise returned by isNetworkInterfaceDisabled.
765   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
766   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
767   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
768   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
769   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
770   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
771   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
772   * @systemapi
773   * @stagemodelonly
774   * @since 10
775   */
776  function isNetworkInterfaceDisabled(admin: Want, networkInterface: string): Promise<boolean>;
777
778  /**
779   * Gets state of whether the network interface is disabled.
780   * This function can be called by a super administrator.
781   *
782   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
783   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
784   *                         The admin must have the corresponding permission.
785   * @param { string } networkInterface - networkInterface indicates the network interface to get status.
786   * @returns { boolean } true if disable the network interfaces, otherwise false.
787   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
788   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
789   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
790   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
791   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
792   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
793   * @stagemodelonly
794   * @since 12
795   */
796  function isNetworkInterfaceDisabledSync(admin: Want, networkInterface: string): boolean;
797
798  /**
799   * Disables the network interfaces.
800   * This function can be called by a super administrator.
801   *
802   * @permission ohos.permission.ENTERPRISE_SET_NETWORK
803   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
804   *                         The admin must have the corresponding permission.
805   * @param { string } networkInterface - networkInterface indicates the network interface to set status.
806   * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false.
807   * @param { AsyncCallback<void> } callback - the callback of setNetworkInterfaceDisabled.
808   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
809   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
810   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
811   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
812   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
813   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
814   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
815   * @systemapi
816   * @stagemodelonly
817   * @since 10
818   */
819  function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean, callback: AsyncCallback<void>): void;
820
821  /**
822   * Disables the network interfaces.
823   * This function can be called by a super administrator.
824   *
825   * @permission ohos.permission.ENTERPRISE_SET_NETWORK
826   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
827   *                         The admin must have the corresponding permission.
828   * @param { string } networkInterface - networkInterface indicates the network interface to set status.
829   * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false.
830   * @returns { Promise<void> } the promise returned setNetworkInterfaceDisabled.
831   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
832   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
833   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
834   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
835   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
836   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
837   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
838   * @systemapi
839   * @stagemodelonly
840   * @since 10
841   */
842  function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean): Promise<void>;
843
844  /**
845   * Disables the network interfaces.
846   * This function can be called by a super administrator.
847   *
848   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
849   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
850   *                         The admin must have the corresponding permission.
851   * @param { string } networkInterface - networkInterface indicates the network interface to set status.
852   * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false.
853   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
854   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
855   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
856   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
857   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
858   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
859   * @stagemodelonly
860   * @since 12
861   */
862  function setNetworkInterfaceDisabledSync(admin: Want, networkInterface: string, isDisabled: boolean): void;
863
864  /**
865   * Set a network independent global {@link connection.HttpProxy} proxy.
866   * This function can be called by a super administrator.
867   *
868   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
869   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
870   *                         The admin must have the corresponding permission.
871   * @param { connection.HttpProxy } httpProxy - network global proxy configuration information.
872   * @param { AsyncCallback<void> } callback - the callback of setGlobalProxy.
873   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
874   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
875   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
876   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
877   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
878   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
879   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
880   * @systemapi
881   * @stagemodelonly
882   * @since 10
883   */
884  function setGlobalProxy(admin: Want, httpProxy: connection.HttpProxy, callback: AsyncCallback<void>): void;
885
886  /**
887   * Set a network independent global {@link connection.HttpProxy} proxy.
888   * This function can be called by a super administrator.
889   *
890   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
891   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
892   *                         The admin must have the corresponding permission.
893   * @param { connection.HttpProxy } httpProxy - network global proxy configuration information.
894   * @returns { Promise<void> } the promise returned by the setGlobalProxy.
895   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
896   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
897   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
898   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
899   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
900   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
901   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
902   * @systemapi
903   * @stagemodelonly
904   * @since 10
905   */
906  function setGlobalProxy(admin: Want, httpProxy: connection.HttpProxy): Promise<void>;
907
908  /**
909   * Set a network independent global {@link connection.HttpProxy} proxy.
910   * This function can be called by a super administrator.
911   *
912   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
913   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
914   *                         The admin must have the corresponding permission.
915   * @param { connection.HttpProxy } httpProxy - network global proxy configuration information.
916   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
917   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
918   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
919   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
920   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
921   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
922   * @stagemodelonly
923   * @since 12
924   */
925  function setGlobalProxySync(admin: Want, httpProxy: connection.HttpProxy): void;
926
927  /**
928   * Set a network independent global {@link connection.HttpProxy} proxy for a system account.
929   * This function can be called by a super administrator.
930   *
931   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
932   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
933   *                         The admin must have the corresponding permission.
934   * @param { connection.HttpProxy } httpProxy - network global proxy configuration information.
935   * @param { number } accountId - accountId indicates the account ID.
936   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
937   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
938   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
939   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
940   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
941   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
942   * @stagemodelonly
943   * @since 15
944   */
945  function setGlobalProxyForAccount(admin: Want, httpProxy: connection.HttpProxy, accountId: number): void;
946
947  /**
948   * Obtains the network independent global {@link connection.HttpProxy} proxy.
949   * This function can be called by a super administrator.
950   *
951   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
952   * @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must
953   *                         have the corresponding permission.
954   * @param { AsyncCallback<connection.HttpProxy> } callback - the callback carries the network global proxy configuration information.
955   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
956   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
957   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
958   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
959   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
960   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
961   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
962   * @systemapi
963   * @stagemodelonly
964   * @since 10
965   */
966  function getGlobalProxy(admin: Want, callback: AsyncCallback<connection.HttpProxy>): void;
967
968  /**
969   * Obtains the network independent global {@link connection.HttpProxy} proxy.
970   * This function can be called by a super administrator.
971   *
972   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
973   * @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must
974   *                         have the corresponding permission.
975   * @returns { Promise<connection.HttpProxy> } the promise carries the network global proxy configuration information.
976   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
977   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
978   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
979   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
980   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
981   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
982   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
983   * @systemapi
984   * @stagemodelonly
985   * @since 10
986   */
987  function getGlobalProxy(admin: Want): Promise<connection.HttpProxy>;
988
989  /**
990   * Obtains the network independent global {@link connection.HttpProxy} proxy.
991   * This function can be called by a super administrator.
992   *
993   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
994   * @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must
995   *                         have the corresponding permission.
996   * @returns { connection.HttpProxy } the network global proxy configuration information.
997   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
998   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
999   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1000   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1001   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1002   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1003   * @stagemodelonly
1004   * @since 12
1005   */
1006  function getGlobalProxySync(admin: Want): connection.HttpProxy;
1007
1008  /**
1009   * Obtains the network independent global {@link connection.HttpProxy} proxy for a system account.
1010   * This function can be called by a super administrator.
1011   *
1012   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1013   * @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must
1014   *                         have the corresponding permission.
1015   * @param { number } accountId - accountId indicates the account ID.
1016   * @returns { connection.HttpProxy } the network global proxy configuration information.
1017   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1018   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1019   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1020   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1021   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1022   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1023   * @stagemodelonly
1024   * @since 15
1025   */
1026  function getGlobalProxyForAccount(admin: Want, accountId: number): connection.HttpProxy;
1027
1028  /**
1029   * Add iptables filter rule by {@link AddFilterRule}.
1030   * This function can be called by a super administrator.
1031   *
1032   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1033   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1034   *                         The admin must have the corresponding permission.
1035   * @param { AddFilterRule } filterRule - iptables filter rule configuration information.
1036   * @param { AsyncCallback<void> } callback - the callback of addIptablesFilterRule.
1037   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1038   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1039   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1040   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1041   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1042   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1043   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1044   * @systemapi
1045   * @stagemodelonly
1046   * @since 10
1047   */
1048  function addIptablesFilterRule(admin: Want, filterRule: AddFilterRule, callback: AsyncCallback<void>): void;
1049
1050  /**
1051   * Add iptables filter rule by {@link AddFilterRule}.
1052   * This function can be called by a super administrator.
1053   *
1054   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1055   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1056   *                         The admin must have the corresponding permission.
1057   * @param { AddFilterRule } filterRule - iptables filter rule configuration information.
1058   * @returns { Promise<void> } the promise returned by the addIptablesFilterRule.
1059   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1060   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1061   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1062   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1063   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1064   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1065   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1066   * @systemapi
1067   * @stagemodelonly
1068   * @since 10
1069   */
1070  function addIptablesFilterRule(admin: Want, filterRule: AddFilterRule): Promise<void>;
1071
1072  /**
1073   * Remove iptables filter rule by {@link RemoveFilterRule}.
1074   * This function can be called by a super administrator.
1075   *
1076   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1077   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1078   *                         The admin must have the corresponding permission.
1079   * @param { RemoveFilterRule } filterRule - iptables filter rule configuration information.
1080   * @param { AsyncCallback<void> } callback - the callback of removeIptablesFilterRule.
1081   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1082   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1083   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1084   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1085   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1086   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1087   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1088   * @systemapi
1089   * @stagemodelonly
1090   * @since 10
1091   */
1092  function removeIptablesFilterRule(admin: Want, filterRule: RemoveFilterRule, callback: AsyncCallback<void>): void;
1093
1094  /**
1095   * Remove iptables filter rule by {@link RemoveFilterRule}.
1096   * This function can be called by a super administrator.
1097   *
1098   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1099   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1100   *                         The admin must have the corresponding permission.
1101   * @param { RemoveFilterRule } filterRule - iptables filter rule configuration information.
1102   * @returns { Promise<void> } the promise returned by the removeIptablesFilterRule.
1103   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1104   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1105   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1106   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1107   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1108   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1109   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1110   * @systemapi
1111   * @stagemodelonly
1112   * @since 10
1113   */
1114  function removeIptablesFilterRule(admin: Want, filterRule: RemoveFilterRule): Promise<void>;
1115
1116  /**
1117   * Query iptables rule and list the result.
1118   * This function can be called by a super administrator.
1119   *
1120   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1121   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1122   *                         The admin must have the corresponding permission.
1123   * @param { AsyncCallback<string> } callback - the callback carries the iptables rules in the table filter.
1124   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1125   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1126   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1127   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1128   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1129   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1130   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1131   * @systemapi
1132   * @stagemodelonly
1133   * @since 10
1134   */
1135  function listIptablesFilterRules(admin: Want, callback: AsyncCallback<string>): void;
1136
1137  /**
1138   * Query iptables rule and list the result.
1139   * This function can be called by a super administrator.
1140   *
1141   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1142   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1143   *                         The admin must have the corresponding permission.
1144   * @returns { Promise<string> } the promise carries the iptables rules in the table filter.
1145   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1146   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1147   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1148   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1149   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1150   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1151   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1152   * @systemapi
1153   * @stagemodelonly
1154   * @since 10
1155   */
1156  function listIptablesFilterRules(admin: Want): Promise<string>;
1157
1158  /**
1159   * Adds firewall rule by {@link Firewall}.
1160   * This function can be called by a super administrator.
1161   *
1162   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1163   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1164   *                         The admin must have the corresponding permission.
1165   * @param { FirewallRule } firewallRule - firewall rule that needs to be added.
1166   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1167   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1168   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1169   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1170   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1171   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1172   * @stagemodelonly
1173   * @since 12
1174   */
1175  function addFirewallRule(admin: Want, firewallRule: FirewallRule): void;
1176
1177  /**
1178   * Removes firewall rule by {@link Firewall}.
1179   * This function can be called by a super administrator.
1180   *
1181   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1182   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1183   *                         The admin must have the corresponding permission.
1184   * @param { FirewallRule } firewallRule - matching rule used to remove firewall rule.
1185   *    if firewallRule or firewallRule#direction,firewallRule#action is empty, multiple firewall rule can be removed.
1186   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1187   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1188   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1189   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1190   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1191   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1192   * @stagemodelonly
1193   * @since 12
1194   */
1195  function removeFirewallRule(admin: Want, firewallRule?: FirewallRule): void;
1196
1197  /**
1198   * Gets all firewall rules, Contains the rules added by {@link addFirewallRule} and {@link addIptablesFilterRule}.
1199   * This function can be called by a super administrator.
1200   *
1201   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1202   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1203   *                         The admin must have the corresponding permission.
1204   * @returns { Array<FirewallRule> } an array of added firewall rules.
1205   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1206   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1207   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1208   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1209   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1210   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1211   * @stagemodelonly
1212   * @since 12
1213   */
1214  function getFirewallRules(admin: Want): Array<FirewallRule>;
1215
1216  /**
1217   * Adds domain filter rule by {@link DomainFilterRule}.
1218   * This function can be called by a super administrator.
1219   *
1220   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1221   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1222   *                         The admin must have the corresponding permission.
1223   * @param { DomainFilterRule } domainFilterRule - domain filter rule that needs to be added.
1224   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1225   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1226   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1227   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1228   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1229   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1230   * @stagemodelonly
1231   * @since 12
1232   */
1233  function addDomainFilterRule(admin: Want, domainFilterRule: DomainFilterRule): void;
1234
1235  /**
1236   * Removes domain filter rule by {@link DomainFilterRule}.
1237   * This function can be called by a super administrator.
1238   *
1239   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1240   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1241   *                         The admin must have the corresponding permission.
1242   * @param { DomainFilterRule } domainFilterRule - matching rule used to remove domain filter rule.
1243   *    if domainFilterRule or domainFilterRule#action is empty, multiple domain filter rule can be removed.
1244   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1245   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1246   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1247   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1248   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1249   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1250   * @stagemodelonly
1251   * @since 12
1252   */
1253  function removeDomainFilterRule(admin: Want, domainFilterRule?: DomainFilterRule): void;
1254
1255  /**
1256   * Gets all domain filter rules, Contains the rules added by {@link addDomainFilterRule}.
1257   * This function can be called by a super administrator.
1258   *
1259   * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
1260   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1261   *                         The admin must have the corresponding permission.
1262   * @returns { Array<DomainFilterRule> } an array of added domain filter rules.
1263   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1264   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1265   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1266   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1267   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1268   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1269   * @stagemodelonly
1270   * @since 12
1271   */
1272  function getDomainFilterRules(admin: Want): Array<DomainFilterRule>;
1273}
1274
1275export default networkManager;
1276