161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit MDMKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport type { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport type Want from './@ohos.app.ability.Want'; 2361847f8eSopenharmony_ciimport type connection from './@ohos.net.connection'; 2461847f8eSopenharmony_ci 2561847f8eSopenharmony_ci/** 2661847f8eSopenharmony_ci * This module offers set network policies on the devices. 2761847f8eSopenharmony_ci * 2861847f8eSopenharmony_ci * @namespace networkManager 2961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 3061847f8eSopenharmony_ci * @stagemodelonly 3161847f8eSopenharmony_ci * @since 10 3261847f8eSopenharmony_ci */ 3361847f8eSopenharmony_cideclare namespace networkManager { 3461847f8eSopenharmony_ci /** 3561847f8eSopenharmony_ci * Iptables rule add method. 3661847f8eSopenharmony_ci * 3761847f8eSopenharmony_ci * @enum { number } 3861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 3961847f8eSopenharmony_ci * @systemapi 4061847f8eSopenharmony_ci * @stagemodelonly 4161847f8eSopenharmony_ci * @since 10 4261847f8eSopenharmony_ci */ 4361847f8eSopenharmony_ci enum AddMethod { 4461847f8eSopenharmony_ci /** 4561847f8eSopenharmony_ci * Append method 4661847f8eSopenharmony_ci * 4761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 4861847f8eSopenharmony_ci * @systemapi 4961847f8eSopenharmony_ci * @stagemodelonly 5061847f8eSopenharmony_ci * @since 10 5161847f8eSopenharmony_ci */ 5261847f8eSopenharmony_ci APPEND = 0, 5361847f8eSopenharmony_ci 5461847f8eSopenharmony_ci /** 5561847f8eSopenharmony_ci * Insert method 5661847f8eSopenharmony_ci * 5761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 5861847f8eSopenharmony_ci * @systemapi 5961847f8eSopenharmony_ci * @stagemodelonly 6061847f8eSopenharmony_ci * @since 10 6161847f8eSopenharmony_ci */ 6261847f8eSopenharmony_ci INSERT = 1 6361847f8eSopenharmony_ci } 6461847f8eSopenharmony_ci 6561847f8eSopenharmony_ci /** 6661847f8eSopenharmony_ci * Iptables rule direction. 6761847f8eSopenharmony_ci * 6861847f8eSopenharmony_ci * @enum { number } 6961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 7061847f8eSopenharmony_ci * @stagemodelonly 7161847f8eSopenharmony_ci * @since 12 7261847f8eSopenharmony_ci */ 7361847f8eSopenharmony_ci enum Direction { 7461847f8eSopenharmony_ci /** 7561847f8eSopenharmony_ci * Input direction 7661847f8eSopenharmony_ci * 7761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 7861847f8eSopenharmony_ci * @stagemodelonly 7961847f8eSopenharmony_ci * @since 12 8061847f8eSopenharmony_ci */ 8161847f8eSopenharmony_ci INPUT = 0, 8261847f8eSopenharmony_ci 8361847f8eSopenharmony_ci /** 8461847f8eSopenharmony_ci * Output direction 8561847f8eSopenharmony_ci * 8661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 8761847f8eSopenharmony_ci * @stagemodelonly 8861847f8eSopenharmony_ci * @since 12 8961847f8eSopenharmony_ci */ 9061847f8eSopenharmony_ci OUTPUT = 1 9161847f8eSopenharmony_ci } 9261847f8eSopenharmony_ci 9361847f8eSopenharmony_ci /** 9461847f8eSopenharmony_ci * Iptables rule action. 9561847f8eSopenharmony_ci * 9661847f8eSopenharmony_ci * @enum { number } 9761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 9861847f8eSopenharmony_ci * @stagemodelonly 9961847f8eSopenharmony_ci * @since 12 10061847f8eSopenharmony_ci */ 10161847f8eSopenharmony_ci enum Action { 10261847f8eSopenharmony_ci /** 10361847f8eSopenharmony_ci * Action allow 10461847f8eSopenharmony_ci * 10561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 10661847f8eSopenharmony_ci * @stagemodelonly 10761847f8eSopenharmony_ci * @since 12 10861847f8eSopenharmony_ci */ 10961847f8eSopenharmony_ci ALLOW = 0, 11061847f8eSopenharmony_ci 11161847f8eSopenharmony_ci /** 11261847f8eSopenharmony_ci * Action deny 11361847f8eSopenharmony_ci * 11461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 11561847f8eSopenharmony_ci * @stagemodelonly 11661847f8eSopenharmony_ci * @since 12 11761847f8eSopenharmony_ci */ 11861847f8eSopenharmony_ci DENY = 1 11961847f8eSopenharmony_ci } 12061847f8eSopenharmony_ci 12161847f8eSopenharmony_ci /** 12261847f8eSopenharmony_ci * Iptables rule protocol 12361847f8eSopenharmony_ci * 12461847f8eSopenharmony_ci * @enum { number } 12561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 12661847f8eSopenharmony_ci * @stagemodelonly 12761847f8eSopenharmony_ci * @since 12 12861847f8eSopenharmony_ci */ 12961847f8eSopenharmony_ci enum Protocol { 13061847f8eSopenharmony_ci /** 13161847f8eSopenharmony_ci * Protocol all 13261847f8eSopenharmony_ci * 13361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 13461847f8eSopenharmony_ci * @stagemodelonly 13561847f8eSopenharmony_ci * @since 12 13661847f8eSopenharmony_ci */ 13761847f8eSopenharmony_ci ALL = 0, 13861847f8eSopenharmony_ci 13961847f8eSopenharmony_ci /** 14061847f8eSopenharmony_ci * Protocol tcp 14161847f8eSopenharmony_ci * 14261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 14361847f8eSopenharmony_ci * @stagemodelonly 14461847f8eSopenharmony_ci * @since 12 14561847f8eSopenharmony_ci */ 14661847f8eSopenharmony_ci TCP = 1, 14761847f8eSopenharmony_ci 14861847f8eSopenharmony_ci /** 14961847f8eSopenharmony_ci * Protocol udp 15061847f8eSopenharmony_ci * 15161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 15261847f8eSopenharmony_ci * @stagemodelonly 15361847f8eSopenharmony_ci * @since 12 15461847f8eSopenharmony_ci */ 15561847f8eSopenharmony_ci UDP = 2, 15661847f8eSopenharmony_ci 15761847f8eSopenharmony_ci /** 15861847f8eSopenharmony_ci * Protocol icmp 15961847f8eSopenharmony_ci * 16061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 16161847f8eSopenharmony_ci * @stagemodelonly 16261847f8eSopenharmony_ci * @since 12 16361847f8eSopenharmony_ci */ 16461847f8eSopenharmony_ci ICMP = 3 16561847f8eSopenharmony_ci } 16661847f8eSopenharmony_ci 16761847f8eSopenharmony_ci /** 16861847f8eSopenharmony_ci * Iptables add filter rule 16961847f8eSopenharmony_ci * 17061847f8eSopenharmony_ci * @typedef AddFilterRule 17161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 17261847f8eSopenharmony_ci * @systemapi 17361847f8eSopenharmony_ci * @stagemodelonly 17461847f8eSopenharmony_ci * @since 10 17561847f8eSopenharmony_ci */ 17661847f8eSopenharmony_ci interface AddFilterRule { 17761847f8eSopenharmony_ci /** 17861847f8eSopenharmony_ci * Iptables rule num 17961847f8eSopenharmony_ci * 18061847f8eSopenharmony_ci * @type { ?number } 18161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 18261847f8eSopenharmony_ci * @systemapi 18361847f8eSopenharmony_ci * @stagemodelonly 18461847f8eSopenharmony_ci * @since 10 18561847f8eSopenharmony_ci */ 18661847f8eSopenharmony_ci ruleNo?: number; 18761847f8eSopenharmony_ci 18861847f8eSopenharmony_ci /** 18961847f8eSopenharmony_ci * Iptables ip source address 19061847f8eSopenharmony_ci * 19161847f8eSopenharmony_ci * @type { ?string } 19261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 19361847f8eSopenharmony_ci * @systemapi 19461847f8eSopenharmony_ci * @stagemodelonly 19561847f8eSopenharmony_ci * @since 10 19661847f8eSopenharmony_ci */ 19761847f8eSopenharmony_ci srcAddr?: string; 19861847f8eSopenharmony_ci 19961847f8eSopenharmony_ci /** 20061847f8eSopenharmony_ci * Iptables ip destination address 20161847f8eSopenharmony_ci * 20261847f8eSopenharmony_ci * @type { ?string } 20361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 20461847f8eSopenharmony_ci * @systemapi 20561847f8eSopenharmony_ci * @stagemodelonly 20661847f8eSopenharmony_ci * @since 10 20761847f8eSopenharmony_ci */ 20861847f8eSopenharmony_ci destAddr?: string; 20961847f8eSopenharmony_ci 21061847f8eSopenharmony_ci /** 21161847f8eSopenharmony_ci * Iptables source port 21261847f8eSopenharmony_ci * 21361847f8eSopenharmony_ci * @type { ?string } 21461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 21561847f8eSopenharmony_ci * @systemapi 21661847f8eSopenharmony_ci * @stagemodelonly 21761847f8eSopenharmony_ci * @since 10 21861847f8eSopenharmony_ci */ 21961847f8eSopenharmony_ci srcPort?: string; 22061847f8eSopenharmony_ci 22161847f8eSopenharmony_ci /** 22261847f8eSopenharmony_ci * Iptables destination port 22361847f8eSopenharmony_ci * 22461847f8eSopenharmony_ci * @type { ?string } 22561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 22661847f8eSopenharmony_ci * @systemapi 22761847f8eSopenharmony_ci * @stagemodelonly 22861847f8eSopenharmony_ci * @since 10 22961847f8eSopenharmony_ci */ 23061847f8eSopenharmony_ci destPort?: string; 23161847f8eSopenharmony_ci 23261847f8eSopenharmony_ci /** 23361847f8eSopenharmony_ci * Application uid 23461847f8eSopenharmony_ci * 23561847f8eSopenharmony_ci * @type { ?string } 23661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 23761847f8eSopenharmony_ci * @systemapi 23861847f8eSopenharmony_ci * @stagemodelonly 23961847f8eSopenharmony_ci * @since 10 24061847f8eSopenharmony_ci */ 24161847f8eSopenharmony_ci uid?: string; 24261847f8eSopenharmony_ci 24361847f8eSopenharmony_ci /** 24461847f8eSopenharmony_ci * Add method 24561847f8eSopenharmony_ci * 24661847f8eSopenharmony_ci * @type { AddMethod } 24761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 24861847f8eSopenharmony_ci * @systemapi 24961847f8eSopenharmony_ci * @stagemodelonly 25061847f8eSopenharmony_ci * @since 10 25161847f8eSopenharmony_ci */ 25261847f8eSopenharmony_ci method: AddMethod; 25361847f8eSopenharmony_ci 25461847f8eSopenharmony_ci /** 25561847f8eSopenharmony_ci * Direction 25661847f8eSopenharmony_ci * 25761847f8eSopenharmony_ci * @type { Direction } 25861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 25961847f8eSopenharmony_ci * @systemapi 26061847f8eSopenharmony_ci * @stagemodelonly 26161847f8eSopenharmony_ci * @since 10 26261847f8eSopenharmony_ci */ 26361847f8eSopenharmony_ci direction: Direction; 26461847f8eSopenharmony_ci 26561847f8eSopenharmony_ci /** 26661847f8eSopenharmony_ci * Action 26761847f8eSopenharmony_ci * 26861847f8eSopenharmony_ci * @type { Action } 26961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 27061847f8eSopenharmony_ci * @systemapi 27161847f8eSopenharmony_ci * @stagemodelonly 27261847f8eSopenharmony_ci * @since 10 27361847f8eSopenharmony_ci */ 27461847f8eSopenharmony_ci action: Action; 27561847f8eSopenharmony_ci 27661847f8eSopenharmony_ci /** 27761847f8eSopenharmony_ci * Protocol 27861847f8eSopenharmony_ci * 27961847f8eSopenharmony_ci * @type { ?Protocol } 28061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 28161847f8eSopenharmony_ci * @systemapi 28261847f8eSopenharmony_ci * @stagemodelonly 28361847f8eSopenharmony_ci * @since 10 28461847f8eSopenharmony_ci */ 28561847f8eSopenharmony_ci protocol?: Protocol; 28661847f8eSopenharmony_ci } 28761847f8eSopenharmony_ci 28861847f8eSopenharmony_ci /** 28961847f8eSopenharmony_ci * Iptables remove filter rule 29061847f8eSopenharmony_ci * 29161847f8eSopenharmony_ci * @typedef RemoveFilterRule 29261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 29361847f8eSopenharmony_ci * @systemapi 29461847f8eSopenharmony_ci * @stagemodelonly 29561847f8eSopenharmony_ci * @since 10 29661847f8eSopenharmony_ci */ 29761847f8eSopenharmony_ci interface RemoveFilterRule { 29861847f8eSopenharmony_ci /** 29961847f8eSopenharmony_ci * Iptables ip source address 30061847f8eSopenharmony_ci * 30161847f8eSopenharmony_ci * @type { ?string } 30261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 30361847f8eSopenharmony_ci * @systemapi 30461847f8eSopenharmony_ci * @stagemodelonly 30561847f8eSopenharmony_ci * @since 10 30661847f8eSopenharmony_ci */ 30761847f8eSopenharmony_ci srcAddr?: string; 30861847f8eSopenharmony_ci 30961847f8eSopenharmony_ci /** 31061847f8eSopenharmony_ci * Iptables ip destination address 31161847f8eSopenharmony_ci * 31261847f8eSopenharmony_ci * @type { ?string } 31361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 31461847f8eSopenharmony_ci * @systemapi 31561847f8eSopenharmony_ci * @stagemodelonly 31661847f8eSopenharmony_ci * @since 10 31761847f8eSopenharmony_ci */ 31861847f8eSopenharmony_ci destAddr?: string; 31961847f8eSopenharmony_ci 32061847f8eSopenharmony_ci /** 32161847f8eSopenharmony_ci * Iptables source port 32261847f8eSopenharmony_ci * 32361847f8eSopenharmony_ci * @type { ?string } 32461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 32561847f8eSopenharmony_ci * @systemapi 32661847f8eSopenharmony_ci * @stagemodelonly 32761847f8eSopenharmony_ci * @since 10 32861847f8eSopenharmony_ci */ 32961847f8eSopenharmony_ci srcPort?: string; 33061847f8eSopenharmony_ci 33161847f8eSopenharmony_ci /** 33261847f8eSopenharmony_ci * Iptables destination port 33361847f8eSopenharmony_ci * 33461847f8eSopenharmony_ci * @type { ?string } 33561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 33661847f8eSopenharmony_ci * @systemapi 33761847f8eSopenharmony_ci * @stagemodelonly 33861847f8eSopenharmony_ci * @since 10 33961847f8eSopenharmony_ci */ 34061847f8eSopenharmony_ci destPort?: string; 34161847f8eSopenharmony_ci 34261847f8eSopenharmony_ci /** 34361847f8eSopenharmony_ci * Application uid 34461847f8eSopenharmony_ci * 34561847f8eSopenharmony_ci * @type { ?string } 34661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 34761847f8eSopenharmony_ci * @systemapi 34861847f8eSopenharmony_ci * @stagemodelonly 34961847f8eSopenharmony_ci * @since 10 35061847f8eSopenharmony_ci */ 35161847f8eSopenharmony_ci uid?: string; 35261847f8eSopenharmony_ci 35361847f8eSopenharmony_ci /** 35461847f8eSopenharmony_ci * Direction 35561847f8eSopenharmony_ci * 35661847f8eSopenharmony_ci * @type { Direction } 35761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 35861847f8eSopenharmony_ci * @systemapi 35961847f8eSopenharmony_ci * @stagemodelonly 36061847f8eSopenharmony_ci * @since 10 36161847f8eSopenharmony_ci */ 36261847f8eSopenharmony_ci direction: Direction; 36361847f8eSopenharmony_ci 36461847f8eSopenharmony_ci /** 36561847f8eSopenharmony_ci * Action 36661847f8eSopenharmony_ci * 36761847f8eSopenharmony_ci * @type { ?Action } 36861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 36961847f8eSopenharmony_ci * @systemapi 37061847f8eSopenharmony_ci * @stagemodelonly 37161847f8eSopenharmony_ci * @since 10 37261847f8eSopenharmony_ci */ 37361847f8eSopenharmony_ci action?: Action; 37461847f8eSopenharmony_ci 37561847f8eSopenharmony_ci /** 37661847f8eSopenharmony_ci * Protocol 37761847f8eSopenharmony_ci * 37861847f8eSopenharmony_ci * @type { ?Protocol } 37961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 38061847f8eSopenharmony_ci * @systemapi 38161847f8eSopenharmony_ci * @stagemodelonly 38261847f8eSopenharmony_ci * @since 10 38361847f8eSopenharmony_ci */ 38461847f8eSopenharmony_ci protocol?: Protocol; 38561847f8eSopenharmony_ci } 38661847f8eSopenharmony_ci 38761847f8eSopenharmony_ci /** 38861847f8eSopenharmony_ci * Firewall rule 38961847f8eSopenharmony_ci * 39061847f8eSopenharmony_ci * @typedef FirewallRule 39161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 39261847f8eSopenharmony_ci * @stagemodelonly 39361847f8eSopenharmony_ci * @since 12 39461847f8eSopenharmony_ci */ 39561847f8eSopenharmony_ci interface FirewallRule { 39661847f8eSopenharmony_ci /** 39761847f8eSopenharmony_ci * Source IP 39861847f8eSopenharmony_ci * 39961847f8eSopenharmony_ci * @type { ?string } 40061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 40161847f8eSopenharmony_ci * @stagemodelonly 40261847f8eSopenharmony_ci * @since 12 40361847f8eSopenharmony_ci */ 40461847f8eSopenharmony_ci srcAddr?: string; 40561847f8eSopenharmony_ci 40661847f8eSopenharmony_ci /** 40761847f8eSopenharmony_ci * Destination IP 40861847f8eSopenharmony_ci * 40961847f8eSopenharmony_ci * @type { ?string } 41061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 41161847f8eSopenharmony_ci * @stagemodelonly 41261847f8eSopenharmony_ci * @since 12 41361847f8eSopenharmony_ci */ 41461847f8eSopenharmony_ci destAddr?: string; 41561847f8eSopenharmony_ci 41661847f8eSopenharmony_ci /** 41761847f8eSopenharmony_ci * Source Port 41861847f8eSopenharmony_ci * 41961847f8eSopenharmony_ci * @type { ?string } 42061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 42161847f8eSopenharmony_ci * @stagemodelonly 42261847f8eSopenharmony_ci * @since 12 42361847f8eSopenharmony_ci */ 42461847f8eSopenharmony_ci srcPort?: string; 42561847f8eSopenharmony_ci 42661847f8eSopenharmony_ci /** 42761847f8eSopenharmony_ci * Destination Port 42861847f8eSopenharmony_ci * 42961847f8eSopenharmony_ci * @type { ?string } 43061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 43161847f8eSopenharmony_ci * @stagemodelonly 43261847f8eSopenharmony_ci * @since 12 43361847f8eSopenharmony_ci */ 43461847f8eSopenharmony_ci destPort?: string; 43561847f8eSopenharmony_ci 43661847f8eSopenharmony_ci /** 43761847f8eSopenharmony_ci * Application uid 43861847f8eSopenharmony_ci * 43961847f8eSopenharmony_ci * @type { ?string } 44061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 44161847f8eSopenharmony_ci * @stagemodelonly 44261847f8eSopenharmony_ci * @since 12 44361847f8eSopenharmony_ci */ 44461847f8eSopenharmony_ci appUid?: string; 44561847f8eSopenharmony_ci 44661847f8eSopenharmony_ci /** 44761847f8eSopenharmony_ci * Direction 44861847f8eSopenharmony_ci * 44961847f8eSopenharmony_ci * @type { ?Direction } 45061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 45161847f8eSopenharmony_ci * @stagemodelonly 45261847f8eSopenharmony_ci * @since 12 45361847f8eSopenharmony_ci */ 45461847f8eSopenharmony_ci direction?: Direction; 45561847f8eSopenharmony_ci 45661847f8eSopenharmony_ci /** 45761847f8eSopenharmony_ci * Action 45861847f8eSopenharmony_ci * 45961847f8eSopenharmony_ci * @type { ?Action } 46061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 46161847f8eSopenharmony_ci * @stagemodelonly 46261847f8eSopenharmony_ci * @since 12 46361847f8eSopenharmony_ci */ 46461847f8eSopenharmony_ci action?: Action; 46561847f8eSopenharmony_ci 46661847f8eSopenharmony_ci /** 46761847f8eSopenharmony_ci * Protocol 46861847f8eSopenharmony_ci * 46961847f8eSopenharmony_ci * @type { ?Protocol } 47061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 47161847f8eSopenharmony_ci * @stagemodelonly 47261847f8eSopenharmony_ci * @since 12 47361847f8eSopenharmony_ci */ 47461847f8eSopenharmony_ci protocol?: Protocol; 47561847f8eSopenharmony_ci } 47661847f8eSopenharmony_ci 47761847f8eSopenharmony_ci /** 47861847f8eSopenharmony_ci * Domain filter rule 47961847f8eSopenharmony_ci * 48061847f8eSopenharmony_ci * @typedef DomainFilterRule 48161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 48261847f8eSopenharmony_ci * @stagemodelonly 48361847f8eSopenharmony_ci * @since 12 48461847f8eSopenharmony_ci */ 48561847f8eSopenharmony_ci interface DomainFilterRule { 48661847f8eSopenharmony_ci /** 48761847f8eSopenharmony_ci * Domain name 48861847f8eSopenharmony_ci * 48961847f8eSopenharmony_ci * @type { ?string } 49061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 49161847f8eSopenharmony_ci * @stagemodelonly 49261847f8eSopenharmony_ci * @since 12 49361847f8eSopenharmony_ci */ 49461847f8eSopenharmony_ci domainName?: string; 49561847f8eSopenharmony_ci 49661847f8eSopenharmony_ci /** 49761847f8eSopenharmony_ci * Application uid 49861847f8eSopenharmony_ci * 49961847f8eSopenharmony_ci * @type { ?string } 50061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 50161847f8eSopenharmony_ci * @stagemodelonly 50261847f8eSopenharmony_ci * @since 12 50361847f8eSopenharmony_ci */ 50461847f8eSopenharmony_ci appUid?: string; 50561847f8eSopenharmony_ci 50661847f8eSopenharmony_ci /** 50761847f8eSopenharmony_ci * action 50861847f8eSopenharmony_ci * 50961847f8eSopenharmony_ci * @type { ?Action } 51061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 51161847f8eSopenharmony_ci * @stagemodelonly 51261847f8eSopenharmony_ci * @since 12 51361847f8eSopenharmony_ci */ 51461847f8eSopenharmony_ci action?: Action; 51561847f8eSopenharmony_ci } 51661847f8eSopenharmony_ci 51761847f8eSopenharmony_ci /** 51861847f8eSopenharmony_ci * Gets all of the network interfaces of the device. 51961847f8eSopenharmony_ci * This function can be called by a super administrator. 52061847f8eSopenharmony_ci * 52161847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 52261847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 52361847f8eSopenharmony_ci * The admin must have the corresponding permission. 52461847f8eSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - the callback of getAllNetworkInterfaces. 52561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 52661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 52761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 52861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 52961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 53061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 53161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 53261847f8eSopenharmony_ci * @systemapi 53361847f8eSopenharmony_ci * @stagemodelonly 53461847f8eSopenharmony_ci * @since 10 53561847f8eSopenharmony_ci */ 53661847f8eSopenharmony_ci function getAllNetworkInterfaces(admin: Want, callback: AsyncCallback<Array<string>>): void; 53761847f8eSopenharmony_ci 53861847f8eSopenharmony_ci /** 53961847f8eSopenharmony_ci * Gets all of the network interfaces of the device. 54061847f8eSopenharmony_ci * This function can be called by a super administrator. 54161847f8eSopenharmony_ci * 54261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 54361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 54461847f8eSopenharmony_ci * The admin must have the corresponding permission. 54561847f8eSopenharmony_ci * @returns { Promise<Array<string>> } the promise returned by getAllNetworkInterfaces. 54661847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 54761847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 54861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 54961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 55061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 55161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 55261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 55361847f8eSopenharmony_ci * @systemapi 55461847f8eSopenharmony_ci * @stagemodelonly 55561847f8eSopenharmony_ci * @since 10 55661847f8eSopenharmony_ci */ 55761847f8eSopenharmony_ci function getAllNetworkInterfaces(admin: Want): Promise<Array<string>>; 55861847f8eSopenharmony_ci 55961847f8eSopenharmony_ci /** 56061847f8eSopenharmony_ci * Gets all the network interfaces of the device. 56161847f8eSopenharmony_ci * This function can be called by a super administrator. 56261847f8eSopenharmony_ci * 56361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 56461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 56561847f8eSopenharmony_ci * The admin must have the corresponding permission. 56661847f8eSopenharmony_ci * @returns { Array<string> } all the network interfaces of the device. 56761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 56861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 56961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 57061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 57161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 57261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 57361847f8eSopenharmony_ci * @stagemodelonly 57461847f8eSopenharmony_ci * @since 12 57561847f8eSopenharmony_ci */ 57661847f8eSopenharmony_ci function getAllNetworkInterfacesSync(admin: Want): Array<string>; 57761847f8eSopenharmony_ci 57861847f8eSopenharmony_ci /** 57961847f8eSopenharmony_ci * Gets the ip address of the network interface. 58061847f8eSopenharmony_ci * This function can be called by a super administrator. 58161847f8eSopenharmony_ci * 58261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 58361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 58461847f8eSopenharmony_ci * The admin must have the corresponding permission. 58561847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get ip address. 58661847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback of getIpAddress. 58761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 58861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 58961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 59061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 59161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 59261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 59361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 59461847f8eSopenharmony_ci * @systemapi 59561847f8eSopenharmony_ci * @stagemodelonly 59661847f8eSopenharmony_ci * @since 10 59761847f8eSopenharmony_ci */ 59861847f8eSopenharmony_ci function getIpAddress(admin: Want, networkInterface: string, callback: AsyncCallback<string>): void; 59961847f8eSopenharmony_ci 60061847f8eSopenharmony_ci /** 60161847f8eSopenharmony_ci * Gets the ip address of the network interface. 60261847f8eSopenharmony_ci * This function can be called by a super administrator. 60361847f8eSopenharmony_ci * 60461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 60561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 60661847f8eSopenharmony_ci * The admin must have the corresponding permission. 60761847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get ip address. 60861847f8eSopenharmony_ci * @returns { Promise<string> } the promise returned by getIpAddress. 60961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 61061847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 61161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 61261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 61361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 61461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 61561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 61661847f8eSopenharmony_ci * @systemapi 61761847f8eSopenharmony_ci * @stagemodelonly 61861847f8eSopenharmony_ci * @since 10 61961847f8eSopenharmony_ci */ 62061847f8eSopenharmony_ci function getIpAddress(admin: Want, networkInterface: string): Promise<string>; 62161847f8eSopenharmony_ci 62261847f8eSopenharmony_ci /** 62361847f8eSopenharmony_ci * Gets the ip address of the network interface. 62461847f8eSopenharmony_ci * This function can be called by a super administrator. 62561847f8eSopenharmony_ci * 62661847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 62761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 62861847f8eSopenharmony_ci * The admin must have the corresponding permission. 62961847f8eSopenharmony_ci * @param { string } networkInterface - the ip address of the network interface. 63061847f8eSopenharmony_ci * @returns { string } the promise returned by getIpAddress. 63161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 63261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 63361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 63461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 63561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 63661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 63761847f8eSopenharmony_ci * @stagemodelonly 63861847f8eSopenharmony_ci * @since 12 63961847f8eSopenharmony_ci */ 64061847f8eSopenharmony_ci function getIpAddressSync(admin: Want, networkInterface: string): string; 64161847f8eSopenharmony_ci 64261847f8eSopenharmony_ci /** 64361847f8eSopenharmony_ci * Gets the mac address of the network interface. 64461847f8eSopenharmony_ci * This function can be called by a super administrator. 64561847f8eSopenharmony_ci * 64661847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 64761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 64861847f8eSopenharmony_ci * The admin must have the corresponding permission. 64961847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. 65061847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback of getMac. 65161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 65261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 65361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 65461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 65561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 65661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 65761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 65861847f8eSopenharmony_ci * @systemapi 65961847f8eSopenharmony_ci * @stagemodelonly 66061847f8eSopenharmony_ci * @since 10 66161847f8eSopenharmony_ci */ 66261847f8eSopenharmony_ci function getMac(admin: Want, networkInterface: string, callback: AsyncCallback<string>): void; 66361847f8eSopenharmony_ci 66461847f8eSopenharmony_ci /** 66561847f8eSopenharmony_ci * Gets the mac address of the network interface. 66661847f8eSopenharmony_ci * This function can be called by a super administrator. 66761847f8eSopenharmony_ci * 66861847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 66961847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 67061847f8eSopenharmony_ci * The admin must have the corresponding permission. 67161847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. 67261847f8eSopenharmony_ci * @returns { Promise<string> } the promise returned by getMac. 67361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 67461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 67561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 67661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 67761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 67861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 67961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 68061847f8eSopenharmony_ci * @systemapi 68161847f8eSopenharmony_ci * @stagemodelonly 68261847f8eSopenharmony_ci * @since 10 68361847f8eSopenharmony_ci */ 68461847f8eSopenharmony_ci function getMac(admin: Want, networkInterface: string): Promise<string>; 68561847f8eSopenharmony_ci 68661847f8eSopenharmony_ci /** 68761847f8eSopenharmony_ci * Gets the mac address of the network interface. 68861847f8eSopenharmony_ci * This function can be called by a super administrator. 68961847f8eSopenharmony_ci * 69061847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 69161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 69261847f8eSopenharmony_ci * The admin must have the corresponding permission. 69361847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. 69461847f8eSopenharmony_ci * @returns { string } the mac address of the network interface. 69561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 69661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 69761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 69861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 69961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 70061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 70161847f8eSopenharmony_ci * @stagemodelonly 70261847f8eSopenharmony_ci * @since 12 70361847f8eSopenharmony_ci */ 70461847f8eSopenharmony_ci function getMacSync(admin: Want, networkInterface: string): string; 70561847f8eSopenharmony_ci 70661847f8eSopenharmony_ci /** 70761847f8eSopenharmony_ci * Gets state of whether the network interface is disabled. 70861847f8eSopenharmony_ci * This function can be called by a super administrator. 70961847f8eSopenharmony_ci * 71061847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 71161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 71261847f8eSopenharmony_ci * The admin must have the corresponding permission. 71361847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get status. 71461847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of isNetworkInterfaceDisabled. 71561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 71661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 71761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 71861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 71961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 72061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 72161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 72261847f8eSopenharmony_ci * @systemapi 72361847f8eSopenharmony_ci * @stagemodelonly 72461847f8eSopenharmony_ci * @since 10 72561847f8eSopenharmony_ci */ 72661847f8eSopenharmony_ci function isNetworkInterfaceDisabled(admin: Want, networkInterface: string, callback: AsyncCallback<boolean>): void; 72761847f8eSopenharmony_ci 72861847f8eSopenharmony_ci /** 72961847f8eSopenharmony_ci * Gets state of whether the network interface is disabled. 73061847f8eSopenharmony_ci * This function can be called by a super administrator. 73161847f8eSopenharmony_ci * 73261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO 73361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 73461847f8eSopenharmony_ci * The admin must have the corresponding permission. 73561847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get status. 73661847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by isNetworkInterfaceDisabled. 73761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 73861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 73961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 74061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 74161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 74261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 74361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 74461847f8eSopenharmony_ci * @systemapi 74561847f8eSopenharmony_ci * @stagemodelonly 74661847f8eSopenharmony_ci * @since 10 74761847f8eSopenharmony_ci */ 74861847f8eSopenharmony_ci function isNetworkInterfaceDisabled(admin: Want, networkInterface: string): Promise<boolean>; 74961847f8eSopenharmony_ci 75061847f8eSopenharmony_ci /** 75161847f8eSopenharmony_ci * Gets state of whether the network interface is disabled. 75261847f8eSopenharmony_ci * This function can be called by a super administrator. 75361847f8eSopenharmony_ci * 75461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 75561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 75661847f8eSopenharmony_ci * The admin must have the corresponding permission. 75761847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to get status. 75861847f8eSopenharmony_ci * @returns { boolean } true if disable the network interfaces, otherwise false. 75961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 76061847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 76161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 76261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 76361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 76461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 76561847f8eSopenharmony_ci * @stagemodelonly 76661847f8eSopenharmony_ci * @since 12 76761847f8eSopenharmony_ci */ 76861847f8eSopenharmony_ci function isNetworkInterfaceDisabledSync(admin: Want, networkInterface: string): boolean; 76961847f8eSopenharmony_ci 77061847f8eSopenharmony_ci /** 77161847f8eSopenharmony_ci * Disables the network interfaces. 77261847f8eSopenharmony_ci * This function can be called by a super administrator. 77361847f8eSopenharmony_ci * 77461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SET_NETWORK 77561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 77661847f8eSopenharmony_ci * The admin must have the corresponding permission. 77761847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to set status. 77861847f8eSopenharmony_ci * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false. 77961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setNetworkInterfaceDisabled. 78061847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 78161847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 78261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 78361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 78461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 78561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 78661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 78761847f8eSopenharmony_ci * @systemapi 78861847f8eSopenharmony_ci * @stagemodelonly 78961847f8eSopenharmony_ci * @since 10 79061847f8eSopenharmony_ci */ 79161847f8eSopenharmony_ci function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean, callback: AsyncCallback<void>): void; 79261847f8eSopenharmony_ci 79361847f8eSopenharmony_ci /** 79461847f8eSopenharmony_ci * Disables the network interfaces. 79561847f8eSopenharmony_ci * This function can be called by a super administrator. 79661847f8eSopenharmony_ci * 79761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SET_NETWORK 79861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 79961847f8eSopenharmony_ci * The admin must have the corresponding permission. 80061847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to set status. 80161847f8eSopenharmony_ci * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false. 80261847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned setNetworkInterfaceDisabled. 80361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 80461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 80561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 80661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 80761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 80861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 80961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 81061847f8eSopenharmony_ci * @systemapi 81161847f8eSopenharmony_ci * @stagemodelonly 81261847f8eSopenharmony_ci * @since 10 81361847f8eSopenharmony_ci */ 81461847f8eSopenharmony_ci function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean): Promise<void>; 81561847f8eSopenharmony_ci 81661847f8eSopenharmony_ci /** 81761847f8eSopenharmony_ci * Disables the network interfaces. 81861847f8eSopenharmony_ci * This function can be called by a super administrator. 81961847f8eSopenharmony_ci * 82061847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 82161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 82261847f8eSopenharmony_ci * The admin must have the corresponding permission. 82361847f8eSopenharmony_ci * @param { string } networkInterface - networkInterface indicates the network interface to set status. 82461847f8eSopenharmony_ci * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false. 82561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 82661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 82761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 82861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 82961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 83061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 83161847f8eSopenharmony_ci * @stagemodelonly 83261847f8eSopenharmony_ci * @since 12 83361847f8eSopenharmony_ci */ 83461847f8eSopenharmony_ci function setNetworkInterfaceDisabledSync(admin: Want, networkInterface: string, isDisabled: boolean): void; 83561847f8eSopenharmony_ci 83661847f8eSopenharmony_ci /** 83761847f8eSopenharmony_ci * Set a network independent global {@link connection.HttpProxy} proxy. 83861847f8eSopenharmony_ci * This function can be called by a super administrator. 83961847f8eSopenharmony_ci * 84061847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 84161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 84261847f8eSopenharmony_ci * The admin must have the corresponding permission. 84361847f8eSopenharmony_ci * @param { connection.HttpProxy } httpProxy - network global proxy configuration information. 84461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setGlobalProxy. 84561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 84661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 84761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 84861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 84961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 85061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 85161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 85261847f8eSopenharmony_ci * @systemapi 85361847f8eSopenharmony_ci * @stagemodelonly 85461847f8eSopenharmony_ci * @since 10 85561847f8eSopenharmony_ci */ 85661847f8eSopenharmony_ci function setGlobalProxy(admin: Want, httpProxy: connection.HttpProxy, callback: AsyncCallback<void>): void; 85761847f8eSopenharmony_ci 85861847f8eSopenharmony_ci /** 85961847f8eSopenharmony_ci * Set a network independent global {@link connection.HttpProxy} proxy. 86061847f8eSopenharmony_ci * This function can be called by a super administrator. 86161847f8eSopenharmony_ci * 86261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 86361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 86461847f8eSopenharmony_ci * The admin must have the corresponding permission. 86561847f8eSopenharmony_ci * @param { connection.HttpProxy } httpProxy - network global proxy configuration information. 86661847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the setGlobalProxy. 86761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 86861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 86961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 87061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 87161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 87261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 87361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 87461847f8eSopenharmony_ci * @systemapi 87561847f8eSopenharmony_ci * @stagemodelonly 87661847f8eSopenharmony_ci * @since 10 87761847f8eSopenharmony_ci */ 87861847f8eSopenharmony_ci function setGlobalProxy(admin: Want, httpProxy: connection.HttpProxy): Promise<void>; 87961847f8eSopenharmony_ci 88061847f8eSopenharmony_ci /** 88161847f8eSopenharmony_ci * Set a network independent global {@link connection.HttpProxy} proxy. 88261847f8eSopenharmony_ci * This function can be called by a super administrator. 88361847f8eSopenharmony_ci * 88461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 88561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 88661847f8eSopenharmony_ci * The admin must have the corresponding permission. 88761847f8eSopenharmony_ci * @param { connection.HttpProxy } httpProxy - network global proxy configuration information. 88861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 88961847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 89061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 89161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 89261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 89361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 89461847f8eSopenharmony_ci * @stagemodelonly 89561847f8eSopenharmony_ci * @since 12 89661847f8eSopenharmony_ci */ 89761847f8eSopenharmony_ci function setGlobalProxySync(admin: Want, httpProxy: connection.HttpProxy): void; 89861847f8eSopenharmony_ci 89961847f8eSopenharmony_ci /** 90061847f8eSopenharmony_ci * Obtains the network independent global {@link connection.HttpProxy} proxy. 90161847f8eSopenharmony_ci * This function can be called by a super administrator. 90261847f8eSopenharmony_ci * 90361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 90461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must 90561847f8eSopenharmony_ci * have the corresponding permission. 90661847f8eSopenharmony_ci * @param { AsyncCallback<connection.HttpProxy> } callback - the callback carries the network global proxy configuration information. 90761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 90861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 90961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 91061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 91161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 91261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 91361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 91461847f8eSopenharmony_ci * @systemapi 91561847f8eSopenharmony_ci * @stagemodelonly 91661847f8eSopenharmony_ci * @since 10 91761847f8eSopenharmony_ci */ 91861847f8eSopenharmony_ci function getGlobalProxy(admin: Want, callback: AsyncCallback<connection.HttpProxy>): void; 91961847f8eSopenharmony_ci 92061847f8eSopenharmony_ci /** 92161847f8eSopenharmony_ci * Obtains the network independent global {@link connection.HttpProxy} proxy. 92261847f8eSopenharmony_ci * This function can be called by a super administrator. 92361847f8eSopenharmony_ci * 92461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 92561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must 92661847f8eSopenharmony_ci * have the corresponding permission. 92761847f8eSopenharmony_ci * @returns { Promise<connection.HttpProxy> } the promise carries the network global proxy configuration information. 92861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 92961847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 93061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 93161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 93261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 93361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 93461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 93561847f8eSopenharmony_ci * @systemapi 93661847f8eSopenharmony_ci * @stagemodelonly 93761847f8eSopenharmony_ci * @since 10 93861847f8eSopenharmony_ci */ 93961847f8eSopenharmony_ci function getGlobalProxy(admin: Want): Promise<connection.HttpProxy>; 94061847f8eSopenharmony_ci 94161847f8eSopenharmony_ci /** 94261847f8eSopenharmony_ci * Obtains the network independent global {@link connection.HttpProxy} proxy. 94361847f8eSopenharmony_ci * This function can be called by a super administrator. 94461847f8eSopenharmony_ci * 94561847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 94661847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must 94761847f8eSopenharmony_ci * have the corresponding permission. 94861847f8eSopenharmony_ci * @returns { connection.HttpProxy } the network global proxy configuration information. 94961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 95061847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 95161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 95261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 95361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 95461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 95561847f8eSopenharmony_ci * @stagemodelonly 95661847f8eSopenharmony_ci * @since 12 95761847f8eSopenharmony_ci */ 95861847f8eSopenharmony_ci function getGlobalProxySync(admin: Want): connection.HttpProxy; 95961847f8eSopenharmony_ci 96061847f8eSopenharmony_ci /** 96161847f8eSopenharmony_ci * Add iptables filter rule by {@link AddFilterRule}. 96261847f8eSopenharmony_ci * This function can be called by a super administrator. 96361847f8eSopenharmony_ci * 96461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 96561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 96661847f8eSopenharmony_ci * The admin must have the corresponding permission. 96761847f8eSopenharmony_ci * @param { AddFilterRule } filterRule - iptables filter rule configuration information. 96861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of addIptablesFilterRule. 96961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 97061847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 97161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 97261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 97361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 97461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 97561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 97661847f8eSopenharmony_ci * @systemapi 97761847f8eSopenharmony_ci * @stagemodelonly 97861847f8eSopenharmony_ci * @since 10 97961847f8eSopenharmony_ci */ 98061847f8eSopenharmony_ci function addIptablesFilterRule(admin: Want, filterRule: AddFilterRule, callback: AsyncCallback<void>): void; 98161847f8eSopenharmony_ci 98261847f8eSopenharmony_ci /** 98361847f8eSopenharmony_ci * Add iptables filter rule by {@link AddFilterRule}. 98461847f8eSopenharmony_ci * This function can be called by a super administrator. 98561847f8eSopenharmony_ci * 98661847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 98761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 98861847f8eSopenharmony_ci * The admin must have the corresponding permission. 98961847f8eSopenharmony_ci * @param { AddFilterRule } filterRule - iptables filter rule configuration information. 99061847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the addIptablesFilterRule. 99161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 99261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 99361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 99461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 99561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 99661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 99761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 99861847f8eSopenharmony_ci * @systemapi 99961847f8eSopenharmony_ci * @stagemodelonly 100061847f8eSopenharmony_ci * @since 10 100161847f8eSopenharmony_ci */ 100261847f8eSopenharmony_ci function addIptablesFilterRule(admin: Want, filterRule: AddFilterRule): Promise<void>; 100361847f8eSopenharmony_ci 100461847f8eSopenharmony_ci /** 100561847f8eSopenharmony_ci * Remove iptables filter rule by {@link RemoveFilterRule}. 100661847f8eSopenharmony_ci * This function can be called by a super administrator. 100761847f8eSopenharmony_ci * 100861847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 100961847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 101061847f8eSopenharmony_ci * The admin must have the corresponding permission. 101161847f8eSopenharmony_ci * @param { RemoveFilterRule } filterRule - iptables filter rule configuration information. 101261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of removeIptablesFilterRule. 101361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 101461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 101561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 101661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 101761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 101861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 101961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 102061847f8eSopenharmony_ci * @systemapi 102161847f8eSopenharmony_ci * @stagemodelonly 102261847f8eSopenharmony_ci * @since 10 102361847f8eSopenharmony_ci */ 102461847f8eSopenharmony_ci function removeIptablesFilterRule(admin: Want, filterRule: RemoveFilterRule, callback: AsyncCallback<void>): void; 102561847f8eSopenharmony_ci 102661847f8eSopenharmony_ci /** 102761847f8eSopenharmony_ci * Remove iptables filter rule by {@link RemoveFilterRule}. 102861847f8eSopenharmony_ci * This function can be called by a super administrator. 102961847f8eSopenharmony_ci * 103061847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 103161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 103261847f8eSopenharmony_ci * The admin must have the corresponding permission. 103361847f8eSopenharmony_ci * @param { RemoveFilterRule } filterRule - iptables filter rule configuration information. 103461847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the removeIptablesFilterRule. 103561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 103661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 103761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 103861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 103961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 104061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 104161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 104261847f8eSopenharmony_ci * @systemapi 104361847f8eSopenharmony_ci * @stagemodelonly 104461847f8eSopenharmony_ci * @since 10 104561847f8eSopenharmony_ci */ 104661847f8eSopenharmony_ci function removeIptablesFilterRule(admin: Want, filterRule: RemoveFilterRule): Promise<void>; 104761847f8eSopenharmony_ci 104861847f8eSopenharmony_ci /** 104961847f8eSopenharmony_ci * Query iptables rule and list the result. 105061847f8eSopenharmony_ci * This function can be called by a super administrator. 105161847f8eSopenharmony_ci * 105261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 105361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 105461847f8eSopenharmony_ci * The admin must have the corresponding permission. 105561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback carries the iptables rules in the table filter. 105661847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 105761847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 105861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 105961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 106061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 106161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 106261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 106361847f8eSopenharmony_ci * @systemapi 106461847f8eSopenharmony_ci * @stagemodelonly 106561847f8eSopenharmony_ci * @since 10 106661847f8eSopenharmony_ci */ 106761847f8eSopenharmony_ci function listIptablesFilterRules(admin: Want, callback: AsyncCallback<string>): void; 106861847f8eSopenharmony_ci 106961847f8eSopenharmony_ci /** 107061847f8eSopenharmony_ci * Query iptables rule and list the result. 107161847f8eSopenharmony_ci * This function can be called by a super administrator. 107261847f8eSopenharmony_ci * 107361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 107461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 107561847f8eSopenharmony_ci * The admin must have the corresponding permission. 107661847f8eSopenharmony_ci * @returns { Promise<string> } the promise carries the iptables rules in the table filter. 107761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 107861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 107961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 108061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 108161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 108261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 108361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 108461847f8eSopenharmony_ci * @systemapi 108561847f8eSopenharmony_ci * @stagemodelonly 108661847f8eSopenharmony_ci * @since 10 108761847f8eSopenharmony_ci */ 108861847f8eSopenharmony_ci function listIptablesFilterRules(admin: Want): Promise<string>; 108961847f8eSopenharmony_ci 109061847f8eSopenharmony_ci /** 109161847f8eSopenharmony_ci * Adds firewall rule by {@link Firewall}. 109261847f8eSopenharmony_ci * This function can be called by a super administrator. 109361847f8eSopenharmony_ci * 109461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 109561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 109661847f8eSopenharmony_ci * The admin must have the corresponding permission. 109761847f8eSopenharmony_ci * @param { FirewallRule } firewallRule - firewall rule that needs to be added. 109861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 109961847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 110061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 110161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 110261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 110361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 110461847f8eSopenharmony_ci * @stagemodelonly 110561847f8eSopenharmony_ci * @since 12 110661847f8eSopenharmony_ci */ 110761847f8eSopenharmony_ci function addFirewallRule(admin: Want, firewallRule: FirewallRule): void; 110861847f8eSopenharmony_ci 110961847f8eSopenharmony_ci /** 111061847f8eSopenharmony_ci * Removes firewall rule by {@link Firewall}. 111161847f8eSopenharmony_ci * This function can be called by a super administrator. 111261847f8eSopenharmony_ci * 111361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 111461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 111561847f8eSopenharmony_ci * The admin must have the corresponding permission. 111661847f8eSopenharmony_ci * @param { FirewallRule } firewallRule - matching rule used to remove firewall rule. 111761847f8eSopenharmony_ci * if firewallRule or firewallRule#direction,firewallRule#action is empty, multiple firewall rule can be removed. 111861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 111961847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 112061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 112161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 112261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 112361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 112461847f8eSopenharmony_ci * @stagemodelonly 112561847f8eSopenharmony_ci * @since 12 112661847f8eSopenharmony_ci */ 112761847f8eSopenharmony_ci function removeFirewallRule(admin: Want, firewallRule?: FirewallRule): void; 112861847f8eSopenharmony_ci 112961847f8eSopenharmony_ci /** 113061847f8eSopenharmony_ci * Gets all firewall rules, Contains the rules added by {@link addFirewallRule} and {@link addIptablesFilterRule}. 113161847f8eSopenharmony_ci * This function can be called by a super administrator. 113261847f8eSopenharmony_ci * 113361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 113461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 113561847f8eSopenharmony_ci * The admin must have the corresponding permission. 113661847f8eSopenharmony_ci * @returns { Array<FirewallRule> } an array of added firewall rules. 113761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 113861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 113961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 114061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 114161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 114261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 114361847f8eSopenharmony_ci * @stagemodelonly 114461847f8eSopenharmony_ci * @since 12 114561847f8eSopenharmony_ci */ 114661847f8eSopenharmony_ci function getFirewallRules(admin: Want): Array<FirewallRule>; 114761847f8eSopenharmony_ci 114861847f8eSopenharmony_ci /** 114961847f8eSopenharmony_ci * Adds domain filter rule by {@link DomainFilterRule}. 115061847f8eSopenharmony_ci * This function can be called by a super administrator. 115161847f8eSopenharmony_ci * 115261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 115361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 115461847f8eSopenharmony_ci * The admin must have the corresponding permission. 115561847f8eSopenharmony_ci * @param { DomainFilterRule } domainFilterRule - domain filter rule that needs to be added. 115661847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 115761847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 115861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 115961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 116061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 116161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 116261847f8eSopenharmony_ci * @stagemodelonly 116361847f8eSopenharmony_ci * @since 12 116461847f8eSopenharmony_ci */ 116561847f8eSopenharmony_ci function addDomainFilterRule(admin: Want, domainFilterRule: DomainFilterRule): void; 116661847f8eSopenharmony_ci 116761847f8eSopenharmony_ci /** 116861847f8eSopenharmony_ci * Removes domain filter rule by {@link DomainFilterRule}. 116961847f8eSopenharmony_ci * This function can be called by a super administrator. 117061847f8eSopenharmony_ci * 117161847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 117261847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 117361847f8eSopenharmony_ci * The admin must have the corresponding permission. 117461847f8eSopenharmony_ci * @param { DomainFilterRule } domainFilterRule - matching rule used to remove domain filter rule. 117561847f8eSopenharmony_ci * if domainFilterRule or domainFilterRule#action is empty, multiple domain filter rule can be removed. 117661847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 117761847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 117861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 117961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 118061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 118161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 118261847f8eSopenharmony_ci * @stagemodelonly 118361847f8eSopenharmony_ci * @since 12 118461847f8eSopenharmony_ci */ 118561847f8eSopenharmony_ci function removeDomainFilterRule(admin: Want, domainFilterRule?: DomainFilterRule): void; 118661847f8eSopenharmony_ci 118761847f8eSopenharmony_ci /** 118861847f8eSopenharmony_ci * Gets all domain filter rules, Contains the rules added by {@link addDomainFilterRule}. 118961847f8eSopenharmony_ci * This function can be called by a super administrator. 119061847f8eSopenharmony_ci * 119161847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK 119261847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 119361847f8eSopenharmony_ci * The admin must have the corresponding permission. 119461847f8eSopenharmony_ci * @returns { Array<DomainFilterRule> } an array of added domain filter rules. 119561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 119661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 119761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 119861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 119961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 120061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 120161847f8eSopenharmony_ci * @stagemodelonly 120261847f8eSopenharmony_ci * @since 12 120361847f8eSopenharmony_ci */ 120461847f8eSopenharmony_ci function getDomainFilterRules(admin: Want): Array<DomainFilterRule>; 120561847f8eSopenharmony_ci} 120661847f8eSopenharmony_ci 120761847f8eSopenharmony_ciexport default networkManager; 1208