161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (C) 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 NetworkKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ci/** 2261847f8eSopenharmony_ci * Provides interfaces to manage net firewall. 2361847f8eSopenharmony_ci * 2461847f8eSopenharmony_ci * @namespace netFirewall 2561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 2661847f8eSopenharmony_ci * @since 12 2761847f8eSopenharmony_ci */ 2861847f8eSopenharmony_cideclare namespace netFirewall { 2961847f8eSopenharmony_ci /** 3061847f8eSopenharmony_ci * Set firewall policy by userId. 3161847f8eSopenharmony_ci * <p>Enables or disables the firewall function, and specifies the default actions for inbound connections and 3261847f8eSopenharmony_ci * outbound connections.</p> 3361847f8eSopenharmony_ci * 3461847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_NET_FIREWALL 3561847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 3661847f8eSopenharmony_ci * @param { NetFirewallPolicy } policy - The firewall policy to be set. 3761847f8eSopenharmony_ci * @returns { Promise<void> } Returns void. 3861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 3961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 4061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 4161847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 4261847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 4361847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 4461847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 4561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 4661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 4761847f8eSopenharmony_ci * @since 12 4861847f8eSopenharmony_ci */ 4961847f8eSopenharmony_ci function setNetFirewallPolicy(userId: number, policy: NetFirewallPolicy): Promise<void>; 5061847f8eSopenharmony_ci 5161847f8eSopenharmony_ci /** 5261847f8eSopenharmony_ci * Get firewall policy by userId. 5361847f8eSopenharmony_ci * 5461847f8eSopenharmony_ci * @permission ohos.permission.GET_NET_FIREWALL 5561847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 5661847f8eSopenharmony_ci * @returns { Promise<NetFirewallPolicy> } Current user firewall policy. 5761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 5961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 6061847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 6161847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 6261847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 6361847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 6461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 6561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 6661847f8eSopenharmony_ci * @since 12 6761847f8eSopenharmony_ci */ 6861847f8eSopenharmony_ci function getNetFirewallPolicy(userId: number): Promise<NetFirewallPolicy>; 6961847f8eSopenharmony_ci 7061847f8eSopenharmony_ci /** 7161847f8eSopenharmony_ci * Add a firewall rule. 7261847f8eSopenharmony_ci * 7361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_NET_FIREWALL 7461847f8eSopenharmony_ci * @param { NetFirewallRule } rule - Firewall rule. 7561847f8eSopenharmony_ci * @returns { Promise<number> } ruleId - Indicates the rule ID, generated by the system. 7661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 7761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 7861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 7961847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 8061847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 8161847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 8261847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 8361847f8eSopenharmony_ci * @throws { BusinessError } 29400001 - The number of firewall rules exceeds the maximum. 8461847f8eSopenharmony_ci * @throws { BusinessError } 29400002 - The number of IP address rules in the firewall rule exceeds the maximum. 8561847f8eSopenharmony_ci * @throws { BusinessError } 29400003 - The number of port rules in the firewall rule exceeds the maximum. 8661847f8eSopenharmony_ci * @throws { BusinessError } 29400004 - The number of domain rules in the firewall rule exceeds the maximum. 8761847f8eSopenharmony_ci * @throws { BusinessError } 29400005 - The number of domain rules exceeds the maximum. 8861847f8eSopenharmony_ci * @throws { BusinessError } 29400007 - The dns rule is duplication. 8961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 9061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 9161847f8eSopenharmony_ci * @since 12 9261847f8eSopenharmony_ci */ 9361847f8eSopenharmony_ci function addNetFirewallRule(rule: NetFirewallRule): Promise<number>; 9461847f8eSopenharmony_ci 9561847f8eSopenharmony_ci /** 9661847f8eSopenharmony_ci * Update a firewall rule. 9761847f8eSopenharmony_ci * 9861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_NET_FIREWALL 9961847f8eSopenharmony_ci * @param { NetFirewallRule } rule - Firewall rule. 10061847f8eSopenharmony_ci * @returns { Promise<void> } Returns void. 10161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 10361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 10461847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 10561847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 10661847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 10761847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 10861847f8eSopenharmony_ci * @throws { BusinessError } 29400002 - The number of IP address rules in the firewall rule exceeds the maximum. 10961847f8eSopenharmony_ci * @throws { BusinessError } 29400003 - The number of port rules in the firewall rule exceeds the maximum. 11061847f8eSopenharmony_ci * @throws { BusinessError } 29400004 - The number of domain rules in the firewall rule exceeds the maximum. 11161847f8eSopenharmony_ci * @throws { BusinessError } 29400005 - The number of domain rules exceeds the maximum. 11261847f8eSopenharmony_ci * @throws { BusinessError } 29400006 - The specified rule does not exist. 11361847f8eSopenharmony_ci * @throws { BusinessError } 29400007 - The dns rule is duplication. 11461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 11561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 11661847f8eSopenharmony_ci * @since 12 11761847f8eSopenharmony_ci */ 11861847f8eSopenharmony_ci function updateNetFirewallRule(rule: NetFirewallRule): Promise<void>; 11961847f8eSopenharmony_ci 12061847f8eSopenharmony_ci /** 12161847f8eSopenharmony_ci * Delete a firewall rule by userId and ruleId. 12261847f8eSopenharmony_ci * 12361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_NET_FIREWALL 12461847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 12561847f8eSopenharmony_ci * @param { number } ruleId - Rule ID. 12661847f8eSopenharmony_ci * @returns { Promise<void> } Returns void. 12761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 12961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 13061847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 13161847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 13261847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 13361847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 13461847f8eSopenharmony_ci * @throws { BusinessError } 29400006 - The specified rule does not exist. 13561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 13661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 13761847f8eSopenharmony_ci * @since 12 13861847f8eSopenharmony_ci */ 13961847f8eSopenharmony_ci function removeNetFirewallRule(userId: number, ruleId: number): Promise<void>; 14061847f8eSopenharmony_ci 14161847f8eSopenharmony_ci /** 14261847f8eSopenharmony_ci * Get firewall rules by userId, and it is necessary to specify the pagination query parameters. 14361847f8eSopenharmony_ci * 14461847f8eSopenharmony_ci * @permission ohos.permission.GET_NET_FIREWALL 14561847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 14661847f8eSopenharmony_ci * @param { RequestParam } requestParam - Paging query input parameters. 14761847f8eSopenharmony_ci * @returns { Promise<FirewallRulePage> } Paginated firewall rule list. 14861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 14961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 15061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 15161847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 15261847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 15361847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 15461847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 15561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 15661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 15761847f8eSopenharmony_ci * @since 12 15861847f8eSopenharmony_ci */ 15961847f8eSopenharmony_ci function getNetFirewallRules(userId: number, requestParam: RequestParam): Promise<FirewallRulePage>; 16061847f8eSopenharmony_ci 16161847f8eSopenharmony_ci /** 16261847f8eSopenharmony_ci * Get a specified firewall rule by userId and ruleId. 16361847f8eSopenharmony_ci * 16461847f8eSopenharmony_ci * @permission ohos.permission.GET_NET_FIREWALL 16561847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 16661847f8eSopenharmony_ci * @param { number } ruleId - Rule ID. 16761847f8eSopenharmony_ci * @returns { Promise<NetFirewallRule> } Firewall Rule. 16861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 16961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 17061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 17161847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 17261847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 17361847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 17461847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 17561847f8eSopenharmony_ci * @throws { BusinessError } 29400006 - The specified rule does not exist. 17661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 17761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 17861847f8eSopenharmony_ci * @since 12 17961847f8eSopenharmony_ci */ 18061847f8eSopenharmony_ci function getNetFirewallRule(userId: number, ruleId: number): Promise<NetFirewallRule>; 18161847f8eSopenharmony_ci 18261847f8eSopenharmony_ci /** 18361847f8eSopenharmony_ci * Get intercepted records by userId, and it is necessary to specify the pagination query parameters. 18461847f8eSopenharmony_ci * 18561847f8eSopenharmony_ci * @permission ohos.permission.GET_NET_FIREWALL 18661847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 18761847f8eSopenharmony_ci * @param { RequestParam } requestParam - Paging query input parameters. 18861847f8eSopenharmony_ci * @returns { Promise<InterceptedRecordPage> } Block Record List. 18961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 19061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 19161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. 19261847f8eSopenharmony_ci * @throws { BusinessError } 2100001 - Invalid parameter value. 19361847f8eSopenharmony_ci * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 19461847f8eSopenharmony_ci * @throws { BusinessError } 2100003 - System internal error. 19561847f8eSopenharmony_ci * @throws { BusinessError } 29400000 - The specified user does not exist. 19661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 19761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 19861847f8eSopenharmony_ci * @since 12 19961847f8eSopenharmony_ci */ 20061847f8eSopenharmony_ci function getInterceptedRecords(userId: number, requestParam: RequestParam): Promise<InterceptedRecordPage>; 20161847f8eSopenharmony_ci 20261847f8eSopenharmony_ci /** 20361847f8eSopenharmony_ci * Firewall rule direction enumeration. 20461847f8eSopenharmony_ci * 20561847f8eSopenharmony_ci * @enum {number} 20661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 20761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 20861847f8eSopenharmony_ci * @since 12 20961847f8eSopenharmony_ci */ 21061847f8eSopenharmony_ci enum NetFirewallRuleDirection { 21161847f8eSopenharmony_ci /** 21261847f8eSopenharmony_ci * Inbound. 21361847f8eSopenharmony_ci * 21461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 21561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 21661847f8eSopenharmony_ci * @since 12 21761847f8eSopenharmony_ci */ 21861847f8eSopenharmony_ci RULE_IN = 1, 21961847f8eSopenharmony_ci /** 22061847f8eSopenharmony_ci * Outbound. 22161847f8eSopenharmony_ci * 22261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 22361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 22461847f8eSopenharmony_ci * @since 12 22561847f8eSopenharmony_ci */ 22661847f8eSopenharmony_ci RULE_OUT = 2 22761847f8eSopenharmony_ci } 22861847f8eSopenharmony_ci 22961847f8eSopenharmony_ci /** 23061847f8eSopenharmony_ci * Firewall rule behavior enumeration. 23161847f8eSopenharmony_ci * 23261847f8eSopenharmony_ci * @enum {number} 23361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 23461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 23561847f8eSopenharmony_ci * @since 12 23661847f8eSopenharmony_ci */ 23761847f8eSopenharmony_ci enum FirewallRuleAction { 23861847f8eSopenharmony_ci /** 23961847f8eSopenharmony_ci * Allow access. 24061847f8eSopenharmony_ci * 24161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 24261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 24361847f8eSopenharmony_ci * @since 12 24461847f8eSopenharmony_ci */ 24561847f8eSopenharmony_ci RULE_ALLOW = 0, 24661847f8eSopenharmony_ci /** 24761847f8eSopenharmony_ci * Deny access. 24861847f8eSopenharmony_ci * 24961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 25061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 25161847f8eSopenharmony_ci * @since 12 25261847f8eSopenharmony_ci */ 25361847f8eSopenharmony_ci RULE_DENY = 1 25461847f8eSopenharmony_ci } 25561847f8eSopenharmony_ci 25661847f8eSopenharmony_ci /** 25761847f8eSopenharmony_ci * Indicates the firewall rule type. 25861847f8eSopenharmony_ci * 25961847f8eSopenharmony_ci * @enum {number} 26061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 26161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 26261847f8eSopenharmony_ci * @since 12 26361847f8eSopenharmony_ci */ 26461847f8eSopenharmony_ci enum NetFirewallRuleType { 26561847f8eSopenharmony_ci /** 26661847f8eSopenharmony_ci * IP type rules. 26761847f8eSopenharmony_ci * 26861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 26961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 27061847f8eSopenharmony_ci * @since 12 27161847f8eSopenharmony_ci */ 27261847f8eSopenharmony_ci RULE_IP = 1, 27361847f8eSopenharmony_ci /** 27461847f8eSopenharmony_ci * Domain type rules. 27561847f8eSopenharmony_ci * 27661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 27761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 27861847f8eSopenharmony_ci * @since 12 27961847f8eSopenharmony_ci */ 28061847f8eSopenharmony_ci RULE_DOMAIN = 2, 28161847f8eSopenharmony_ci /** 28261847f8eSopenharmony_ci * DNS type rules. 28361847f8eSopenharmony_ci * 28461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 28561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 28661847f8eSopenharmony_ci * @since 12 28761847f8eSopenharmony_ci */ 28861847f8eSopenharmony_ci RULE_DNS = 3 28961847f8eSopenharmony_ci } 29061847f8eSopenharmony_ci 29161847f8eSopenharmony_ci /** 29261847f8eSopenharmony_ci * Pagination query sorting field. 29361847f8eSopenharmony_ci * 29461847f8eSopenharmony_ci * @enum {number} 29561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 29661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 29761847f8eSopenharmony_ci * @since 12 29861847f8eSopenharmony_ci */ 29961847f8eSopenharmony_ci enum NetFirewallOrderField { 30061847f8eSopenharmony_ci /** 30161847f8eSopenharmony_ci * Sort rule names, it can be referenced only by the getNetFirewallRules interface. 30261847f8eSopenharmony_ci * 30361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 30461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 30561847f8eSopenharmony_ci * @since 12 30661847f8eSopenharmony_ci */ 30761847f8eSopenharmony_ci ORDER_BY_RULE_NAME = 1, 30861847f8eSopenharmony_ci /** 30961847f8eSopenharmony_ci * Sort the recorded time, it can be referenced only by the getNetFirewallRules interface. 31061847f8eSopenharmony_ci * 31161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 31261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 31361847f8eSopenharmony_ci * @since 12 31461847f8eSopenharmony_ci */ 31561847f8eSopenharmony_ci ORDER_BY_RECORD_TIME = 100, 31661847f8eSopenharmony_ci } 31761847f8eSopenharmony_ci 31861847f8eSopenharmony_ci /** 31961847f8eSopenharmony_ci * Pagination query sorting type. 32061847f8eSopenharmony_ci * 32161847f8eSopenharmony_ci * @enum {number} 32261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 32361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 32461847f8eSopenharmony_ci * @since 12 32561847f8eSopenharmony_ci */ 32661847f8eSopenharmony_ci enum NetFirewallOrderType { 32761847f8eSopenharmony_ci /** 32861847f8eSopenharmony_ci * Ascending order. 32961847f8eSopenharmony_ci * 33061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 33161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 33261847f8eSopenharmony_ci * @since 12 33361847f8eSopenharmony_ci */ 33461847f8eSopenharmony_ci ORDER_ASC = 1, 33561847f8eSopenharmony_ci /** 33661847f8eSopenharmony_ci * Descending order. 33761847f8eSopenharmony_ci * 33861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 33961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 34061847f8eSopenharmony_ci * @since 12 34161847f8eSopenharmony_ci */ 34261847f8eSopenharmony_ci ORDER_DESC = 100, 34361847f8eSopenharmony_ci } 34461847f8eSopenharmony_ci 34561847f8eSopenharmony_ci /** 34661847f8eSopenharmony_ci * Firewall policy. 34761847f8eSopenharmony_ci * 34861847f8eSopenharmony_ci * @interface NetFirewallPolicy 34961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 35061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 35161847f8eSopenharmony_ci * @since 12 35261847f8eSopenharmony_ci */ 35361847f8eSopenharmony_ci interface NetFirewallPolicy { 35461847f8eSopenharmony_ci /** 35561847f8eSopenharmony_ci * Whether the firewall is open. 35661847f8eSopenharmony_ci * 35761847f8eSopenharmony_ci * @type {boolean} 35861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 35961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 36061847f8eSopenharmony_ci * @since 12 36161847f8eSopenharmony_ci */ 36261847f8eSopenharmony_ci isOpen: boolean; 36361847f8eSopenharmony_ci 36461847f8eSopenharmony_ci /** 36561847f8eSopenharmony_ci * Inbound connections are allowed or denied by default. 36661847f8eSopenharmony_ci * 36761847f8eSopenharmony_ci * @type {FirewallRuleAction} 36861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 36961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 37061847f8eSopenharmony_ci * @since 12 37161847f8eSopenharmony_ci */ 37261847f8eSopenharmony_ci inAction: FirewallRuleAction; 37361847f8eSopenharmony_ci 37461847f8eSopenharmony_ci /** 37561847f8eSopenharmony_ci * Outbound connections are allowed or denied by default. 37661847f8eSopenharmony_ci * 37761847f8eSopenharmony_ci * @type {FirewallRuleAction} 37861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 37961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 38061847f8eSopenharmony_ci * @since 12 38161847f8eSopenharmony_ci */ 38261847f8eSopenharmony_ci outAction: FirewallRuleAction; 38361847f8eSopenharmony_ci } 38461847f8eSopenharmony_ci 38561847f8eSopenharmony_ci /** 38661847f8eSopenharmony_ci * Firewall IP parameters. 38761847f8eSopenharmony_ci * 38861847f8eSopenharmony_ci * @interface NetFirewallIpParams 38961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 39061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 39161847f8eSopenharmony_ci * @since 12 39261847f8eSopenharmony_ci */ 39361847f8eSopenharmony_ci interface NetFirewallIpParams { 39461847f8eSopenharmony_ci /** 39561847f8eSopenharmony_ci * 1: IP address or subnet, when using a single IP, the mask is 32; 2: IP segment. 39661847f8eSopenharmony_ci * 39761847f8eSopenharmony_ci * @type {number} 39861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 39961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 40061847f8eSopenharmony_ci * @since 12 40161847f8eSopenharmony_ci */ 40261847f8eSopenharmony_ci type: number; 40361847f8eSopenharmony_ci /** 40461847f8eSopenharmony_ci * 1: IPv4, 2: IPv6, default is IPv4. 40561847f8eSopenharmony_ci * 40661847f8eSopenharmony_ci * @type {?number} 40761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 40861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 40961847f8eSopenharmony_ci * @since 12 41061847f8eSopenharmony_ci */ 41161847f8eSopenharmony_ci family?: number; 41261847f8eSopenharmony_ci /** 41361847f8eSopenharmony_ci * IP address: Valid when type equals 1, otherwise it will be ignored. 41461847f8eSopenharmony_ci * 41561847f8eSopenharmony_ci * @type {?string} 41661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 41761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 41861847f8eSopenharmony_ci * @since 12 41961847f8eSopenharmony_ci */ 42061847f8eSopenharmony_ci address?: string; 42161847f8eSopenharmony_ci /** 42261847f8eSopenharmony_ci * IPv4: subnet mask, IPv6: prefix, valid when type equals 1, otherwise it will be ignored. 42361847f8eSopenharmony_ci * 42461847f8eSopenharmony_ci * @type {?number} 42561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 42661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 42761847f8eSopenharmony_ci * @since 12 42861847f8eSopenharmony_ci */ 42961847f8eSopenharmony_ci mask?: number; 43061847f8eSopenharmony_ci /** 43161847f8eSopenharmony_ci * Start IP: valid when type equals 2, otherwise it will be ignored. 43261847f8eSopenharmony_ci * 43361847f8eSopenharmony_ci * @type {?string} 43461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 43561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 43661847f8eSopenharmony_ci * @since 12 43761847f8eSopenharmony_ci */ 43861847f8eSopenharmony_ci startIp?: string; 43961847f8eSopenharmony_ci /** 44061847f8eSopenharmony_ci * End IP: valid when type equals 2, otherwise it will be ignored. 44161847f8eSopenharmony_ci * 44261847f8eSopenharmony_ci * @type {?string} 44361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 44461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 44561847f8eSopenharmony_ci * @since 12 44661847f8eSopenharmony_ci */ 44761847f8eSopenharmony_ci endIp?: string; 44861847f8eSopenharmony_ci } 44961847f8eSopenharmony_ci 45061847f8eSopenharmony_ci /** 45161847f8eSopenharmony_ci * Firewall port parameters. 45261847f8eSopenharmony_ci * 45361847f8eSopenharmony_ci * @interface NetFirewallPortParams 45461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 45561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 45661847f8eSopenharmony_ci * @since 12 45761847f8eSopenharmony_ci */ 45861847f8eSopenharmony_ci interface NetFirewallPortParams { 45961847f8eSopenharmony_ci /** 46061847f8eSopenharmony_ci * Start port, when there is only one port, the start port is the same as the end port. 46161847f8eSopenharmony_ci * 46261847f8eSopenharmony_ci * @type {number} 46361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 46461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 46561847f8eSopenharmony_ci * @since 12 46661847f8eSopenharmony_ci */ 46761847f8eSopenharmony_ci startPort: number; 46861847f8eSopenharmony_ci /** 46961847f8eSopenharmony_ci * End port, when there is only one port, the start port is the same as the end port. 47061847f8eSopenharmony_ci * 47161847f8eSopenharmony_ci * @type {number} 47261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 47361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 47461847f8eSopenharmony_ci * @since 12 47561847f8eSopenharmony_ci */ 47661847f8eSopenharmony_ci endPort: number; 47761847f8eSopenharmony_ci } 47861847f8eSopenharmony_ci 47961847f8eSopenharmony_ci /** 48061847f8eSopenharmony_ci * Firewall domain name parameters. 48161847f8eSopenharmony_ci * 48261847f8eSopenharmony_ci * @interface NetFirewallDomainParams 48361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 48461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 48561847f8eSopenharmony_ci * @since 12 48661847f8eSopenharmony_ci */ 48761847f8eSopenharmony_ci interface NetFirewallDomainParams { 48861847f8eSopenharmony_ci /** 48961847f8eSopenharmony_ci * Is there a universal configuration rule. 49061847f8eSopenharmony_ci * 49161847f8eSopenharmony_ci * @type {boolean} 49261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 49361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 49461847f8eSopenharmony_ci * @since 12 49561847f8eSopenharmony_ci */ 49661847f8eSopenharmony_ci isWildcard: boolean; 49761847f8eSopenharmony_ci /** 49861847f8eSopenharmony_ci * Domain: when isWildcard is false, the complete domain that needs to be determined; 49961847f8eSopenharmony_ci * When isWildcard is true, fuzzy domain only support domains like *.openharmony.cn; *.com. 50061847f8eSopenharmony_ci * 50161847f8eSopenharmony_ci * @type {string} 50261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 50361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 50461847f8eSopenharmony_ci * @since 12 50561847f8eSopenharmony_ci */ 50661847f8eSopenharmony_ci domain: string; 50761847f8eSopenharmony_ci } 50861847f8eSopenharmony_ci 50961847f8eSopenharmony_ci /** 51061847f8eSopenharmony_ci * Firewall DNS parameters. 51161847f8eSopenharmony_ci * 51261847f8eSopenharmony_ci * @interface NetFirewallDnsParams 51361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 51461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 51561847f8eSopenharmony_ci * @since 12 51661847f8eSopenharmony_ci */ 51761847f8eSopenharmony_ci interface NetFirewallDnsParams { 51861847f8eSopenharmony_ci /** 51961847f8eSopenharmony_ci * Primary DNS. 52061847f8eSopenharmony_ci * 52161847f8eSopenharmony_ci * @type {string} 52261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 52361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 52461847f8eSopenharmony_ci * @since 12 52561847f8eSopenharmony_ci */ 52661847f8eSopenharmony_ci primaryDns: string; 52761847f8eSopenharmony_ci /** 52861847f8eSopenharmony_ci * Backup DNS. 52961847f8eSopenharmony_ci * 53061847f8eSopenharmony_ci * @type {?string} 53161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 53261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 53361847f8eSopenharmony_ci * @since 12 53461847f8eSopenharmony_ci */ 53561847f8eSopenharmony_ci standbyDns?: string; 53661847f8eSopenharmony_ci } 53761847f8eSopenharmony_ci 53861847f8eSopenharmony_ci /** 53961847f8eSopenharmony_ci * Firewall rules. 54061847f8eSopenharmony_ci * 54161847f8eSopenharmony_ci * @interface NetFirewallRule 54261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 54361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 54461847f8eSopenharmony_ci * @since 12 54561847f8eSopenharmony_ci */ 54661847f8eSopenharmony_ci interface NetFirewallRule { 54761847f8eSopenharmony_ci /** 54861847f8eSopenharmony_ci * User id. 54961847f8eSopenharmony_ci * 55061847f8eSopenharmony_ci * @type {number} 55161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 55261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 55361847f8eSopenharmony_ci * @since 12 55461847f8eSopenharmony_ci */ 55561847f8eSopenharmony_ci userId: number; 55661847f8eSopenharmony_ci /** 55761847f8eSopenharmony_ci * Rule name. 55861847f8eSopenharmony_ci * 55961847f8eSopenharmony_ci * @type {string} 56061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 56161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 56261847f8eSopenharmony_ci * @since 12 56361847f8eSopenharmony_ci */ 56461847f8eSopenharmony_ci name: string; 56561847f8eSopenharmony_ci /** 56661847f8eSopenharmony_ci * Rule direction, inbound or outbound. 56761847f8eSopenharmony_ci * 56861847f8eSopenharmony_ci * @type {NetFirewallRuleDirection} 56961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 57061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 57161847f8eSopenharmony_ci * @since 12 57261847f8eSopenharmony_ci */ 57361847f8eSopenharmony_ci direction: NetFirewallRuleDirection; 57461847f8eSopenharmony_ci /** 57561847f8eSopenharmony_ci * Rule action. 57661847f8eSopenharmony_ci * 57761847f8eSopenharmony_ci * @type {FirewallRuleAction} 57861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 57961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 58061847f8eSopenharmony_ci * @since 12 58161847f8eSopenharmony_ci */ 58261847f8eSopenharmony_ci action: FirewallRuleAction; 58361847f8eSopenharmony_ci /** 58461847f8eSopenharmony_ci * Rule type. 58561847f8eSopenharmony_ci * 58661847f8eSopenharmony_ci * @type {NetFirewallRuleType} 58761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 58861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 58961847f8eSopenharmony_ci * @since 12 59061847f8eSopenharmony_ci */ 59161847f8eSopenharmony_ci type: NetFirewallRuleType; 59261847f8eSopenharmony_ci /** 59361847f8eSopenharmony_ci * Whether the rule is enabled. 59461847f8eSopenharmony_ci * 59561847f8eSopenharmony_ci * @type {boolean} 59661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 59761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 59861847f8eSopenharmony_ci * @since 12 59961847f8eSopenharmony_ci */ 60061847f8eSopenharmony_ci isEnabled: boolean; 60161847f8eSopenharmony_ci /** 60261847f8eSopenharmony_ci * Rule id: When a rule is added to the system, the system generates a rule ID. 60361847f8eSopenharmony_ci * 60461847f8eSopenharmony_ci * @type {?number} 60561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 60661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 60761847f8eSopenharmony_ci * @since 12 60861847f8eSopenharmony_ci */ 60961847f8eSopenharmony_ci id?: number; 61061847f8eSopenharmony_ci /** 61161847f8eSopenharmony_ci * Rule description. 61261847f8eSopenharmony_ci * 61361847f8eSopenharmony_ci * @type {?string} 61461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 61561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 61661847f8eSopenharmony_ci * @since 12 61761847f8eSopenharmony_ci */ 61861847f8eSopenharmony_ci description?: string; 61961847f8eSopenharmony_ci /** 62061847f8eSopenharmony_ci * Application or service UID. 62161847f8eSopenharmony_ci * 62261847f8eSopenharmony_ci * @type {?number} 62361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 62461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 62561847f8eSopenharmony_ci * @since 12 62661847f8eSopenharmony_ci */ 62761847f8eSopenharmony_ci appUid?: number; 62861847f8eSopenharmony_ci /** 62961847f8eSopenharmony_ci * Local IP address: valid when ruleType = RULE_IP, otherwise it will be ignored. 63061847f8eSopenharmony_ci * 63161847f8eSopenharmony_ci * @type {?Array<NetFirewallIpParams>} 63261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 63361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 63461847f8eSopenharmony_ci * @since 12 63561847f8eSopenharmony_ci */ 63661847f8eSopenharmony_ci localIps?: Array<NetFirewallIpParams>; 63761847f8eSopenharmony_ci /** 63861847f8eSopenharmony_ci * Remote IP address: valid when ruleType = RULE_IP, otherwise it will be ignored. 63961847f8eSopenharmony_ci * 64061847f8eSopenharmony_ci * @type {?Array<NetFirewallIpParams>} 64161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 64261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 64361847f8eSopenharmony_ci * @since 12 64461847f8eSopenharmony_ci */ 64561847f8eSopenharmony_ci remoteIps?: Array<NetFirewallIpParams>; 64661847f8eSopenharmony_ci /** 64761847f8eSopenharmony_ci * Protocol, 1: ICMPv4, 6: TCP, 17: UDP, 58: ICMPv6. Valid when ruleType = RULE_IP, otherwise it will be ignored. 64861847f8eSopenharmony_ci * 64961847f8eSopenharmony_ci * @type {?number} 65061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 65161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 65261847f8eSopenharmony_ci * @since 12 65361847f8eSopenharmony_ci */ 65461847f8eSopenharmony_ci protocol?: number; 65561847f8eSopenharmony_ci /** 65661847f8eSopenharmony_ci * Local ports: valid when ruleType = RULE_IP, otherwise it will be ignored. 65761847f8eSopenharmony_ci * 65861847f8eSopenharmony_ci * @type {?Array<NetFirewallPortParams>} 65961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 66061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 66161847f8eSopenharmony_ci * @since 12 66261847f8eSopenharmony_ci */ 66361847f8eSopenharmony_ci localPorts?: Array<NetFirewallPortParams>; 66461847f8eSopenharmony_ci /** 66561847f8eSopenharmony_ci * Remote ports: valid when ruleType = RULE_IP, otherwise it will be ignored. 66661847f8eSopenharmony_ci * 66761847f8eSopenharmony_ci * @type {?Array<NetFirewallPortParams>} 66861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 66961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 67061847f8eSopenharmony_ci * @since 12 67161847f8eSopenharmony_ci */ 67261847f8eSopenharmony_ci remotePorts?: Array<NetFirewallPortParams>; 67361847f8eSopenharmony_ci /** 67461847f8eSopenharmony_ci * Domain name list: valid when ruleType = RULE_DOMAIN, otherwise it will be ignored. 67561847f8eSopenharmony_ci * 67661847f8eSopenharmony_ci * @type {?Array<NetFirewallDomainParams>} 67761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 67861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 67961847f8eSopenharmony_ci * @since 12 68061847f8eSopenharmony_ci */ 68161847f8eSopenharmony_ci domains?: Array<NetFirewallDomainParams>; 68261847f8eSopenharmony_ci /** 68361847f8eSopenharmony_ci * DNS: valid when ruleType = RULE_DNS, otherwise it will be ignored. 68461847f8eSopenharmony_ci * 68561847f8eSopenharmony_ci * @type {?NetFirewallDnsParams} 68661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 68761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 68861847f8eSopenharmony_ci * @since 12 68961847f8eSopenharmony_ci */ 69061847f8eSopenharmony_ci dns?: NetFirewallDnsParams; 69161847f8eSopenharmony_ci } 69261847f8eSopenharmony_ci 69361847f8eSopenharmony_ci /** 69461847f8eSopenharmony_ci * Intercepted record. 69561847f8eSopenharmony_ci * 69661847f8eSopenharmony_ci * @interface InterceptedRecord 69761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 69861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 69961847f8eSopenharmony_ci * @since 12 70061847f8eSopenharmony_ci */ 70161847f8eSopenharmony_ci interface InterceptedRecord { 70261847f8eSopenharmony_ci /** 70361847f8eSopenharmony_ci * Time stamp. 70461847f8eSopenharmony_ci * 70561847f8eSopenharmony_ci * @type {number} 70661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 70761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 70861847f8eSopenharmony_ci * @since 12 70961847f8eSopenharmony_ci */ 71061847f8eSopenharmony_ci time: number; 71161847f8eSopenharmony_ci /** 71261847f8eSopenharmony_ci * Local IP. 71361847f8eSopenharmony_ci * 71461847f8eSopenharmony_ci * @type {?string} 71561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 71661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 71761847f8eSopenharmony_ci * @since 12 71861847f8eSopenharmony_ci */ 71961847f8eSopenharmony_ci localIp?: string; 72061847f8eSopenharmony_ci /** 72161847f8eSopenharmony_ci * Remote IP. 72261847f8eSopenharmony_ci * 72361847f8eSopenharmony_ci * @type {?string} 72461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 72561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 72661847f8eSopenharmony_ci * @since 12 72761847f8eSopenharmony_ci */ 72861847f8eSopenharmony_ci remoteIp?: string; 72961847f8eSopenharmony_ci /** 73061847f8eSopenharmony_ci * Local port. 73161847f8eSopenharmony_ci * 73261847f8eSopenharmony_ci * @type {?number} 73361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 73461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 73561847f8eSopenharmony_ci * @since 12 73661847f8eSopenharmony_ci */ 73761847f8eSopenharmony_ci localPort?: number; 73861847f8eSopenharmony_ci /** 73961847f8eSopenharmony_ci * Remote port. 74061847f8eSopenharmony_ci * 74161847f8eSopenharmony_ci * @type {?number} 74261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 74361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 74461847f8eSopenharmony_ci * @since 12 74561847f8eSopenharmony_ci */ 74661847f8eSopenharmony_ci remotePort?: number; 74761847f8eSopenharmony_ci /** 74861847f8eSopenharmony_ci * Transport layer protocol. 74961847f8eSopenharmony_ci * 75061847f8eSopenharmony_ci * @type {?number} 75161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 75261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 75361847f8eSopenharmony_ci * @since 12 75461847f8eSopenharmony_ci */ 75561847f8eSopenharmony_ci protocol?: number; 75661847f8eSopenharmony_ci /** 75761847f8eSopenharmony_ci * Application or service ID. 75861847f8eSopenharmony_ci * 75961847f8eSopenharmony_ci * @type {?number} 76061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 76161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 76261847f8eSopenharmony_ci * @since 12 76361847f8eSopenharmony_ci */ 76461847f8eSopenharmony_ci appUid?: number; 76561847f8eSopenharmony_ci /** 76661847f8eSopenharmony_ci * Blocked domain name information. 76761847f8eSopenharmony_ci * 76861847f8eSopenharmony_ci * @type {?string} 76961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 77061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 77161847f8eSopenharmony_ci * @since 12 77261847f8eSopenharmony_ci */ 77361847f8eSopenharmony_ci domain?: string; 77461847f8eSopenharmony_ci } 77561847f8eSopenharmony_ci 77661847f8eSopenharmony_ci /** 77761847f8eSopenharmony_ci * Pagination query input parameters. 77861847f8eSopenharmony_ci * 77961847f8eSopenharmony_ci * @interface RequestParam 78061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 78161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 78261847f8eSopenharmony_ci * @since 12 78361847f8eSopenharmony_ci */ 78461847f8eSopenharmony_ci interface RequestParam { 78561847f8eSopenharmony_ci /** 78661847f8eSopenharmony_ci * Page number: indicates the page number to be queried. The start value is 1. 78761847f8eSopenharmony_ci * 78861847f8eSopenharmony_ci * @type {number} 78961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 79061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 79161847f8eSopenharmony_ci * @since 12 79261847f8eSopenharmony_ci */ 79361847f8eSopenharmony_ci page: number; 79461847f8eSopenharmony_ci /** 79561847f8eSopenharmony_ci * Page size: indicates the number of data records to be queried at a time. The maximum value is 50. 79661847f8eSopenharmony_ci * 79761847f8eSopenharmony_ci * @type {number} 79861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 79961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 80061847f8eSopenharmony_ci * @since 12 80161847f8eSopenharmony_ci */ 80261847f8eSopenharmony_ci pageSize: number; 80361847f8eSopenharmony_ci /** 80461847f8eSopenharmony_ci * Sort field. 80561847f8eSopenharmony_ci * 80661847f8eSopenharmony_ci * @type {NetFirewallOrderField} 80761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 80861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 80961847f8eSopenharmony_ci * @since 12 81061847f8eSopenharmony_ci */ 81161847f8eSopenharmony_ci orderField: NetFirewallOrderField; 81261847f8eSopenharmony_ci /** 81361847f8eSopenharmony_ci * Sort Type: ascending or descending. 81461847f8eSopenharmony_ci * 81561847f8eSopenharmony_ci * @type {NetFirewallOrderType} 81661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 81761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 81861847f8eSopenharmony_ci * @since 12 81961847f8eSopenharmony_ci */ 82061847f8eSopenharmony_ci orderType: NetFirewallOrderType; 82161847f8eSopenharmony_ci } 82261847f8eSopenharmony_ci 82361847f8eSopenharmony_ci /** 82461847f8eSopenharmony_ci * Rule page information. 82561847f8eSopenharmony_ci * 82661847f8eSopenharmony_ci * @interface FirewallRulePage 82761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 82861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 82961847f8eSopenharmony_ci * @since 12 83061847f8eSopenharmony_ci */ 83161847f8eSopenharmony_ci interface FirewallRulePage { 83261847f8eSopenharmony_ci /** 83361847f8eSopenharmony_ci * Current page number: indicates the page number of this query. 83461847f8eSopenharmony_ci * 83561847f8eSopenharmony_ci * @type {number} 83661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 83761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 83861847f8eSopenharmony_ci * @since 12 83961847f8eSopenharmony_ci */ 84061847f8eSopenharmony_ci page: number; 84161847f8eSopenharmony_ci /** 84261847f8eSopenharmony_ci * Page size: maximum number of records on a page for this query. 84361847f8eSopenharmony_ci * 84461847f8eSopenharmony_ci * @type {number} 84561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 84661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 84761847f8eSopenharmony_ci * @since 12 84861847f8eSopenharmony_ci */ 84961847f8eSopenharmony_ci pageSize: number; 85061847f8eSopenharmony_ci /** 85161847f8eSopenharmony_ci * Total pages: total number of pages. 85261847f8eSopenharmony_ci * 85361847f8eSopenharmony_ci * @type {number} 85461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 85561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 85661847f8eSopenharmony_ci * @since 12 85761847f8eSopenharmony_ci */ 85861847f8eSopenharmony_ci totalPage: number; 85961847f8eSopenharmony_ci /** 86061847f8eSopenharmony_ci * Page data: all records displayed on this page. 86161847f8eSopenharmony_ci * 86261847f8eSopenharmony_ci * @type {Array<NetFirewallRule> } 86361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 86461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 86561847f8eSopenharmony_ci * @since 12 86661847f8eSopenharmony_ci */ 86761847f8eSopenharmony_ci data: Array<NetFirewallRule>; 86861847f8eSopenharmony_ci } 86961847f8eSopenharmony_ci 87061847f8eSopenharmony_ci /** 87161847f8eSopenharmony_ci * Intercepted record page information. 87261847f8eSopenharmony_ci * 87361847f8eSopenharmony_ci * @interface InterceptedRecordPage 87461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 87561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 87661847f8eSopenharmony_ci * @since 12 87761847f8eSopenharmony_ci */ 87861847f8eSopenharmony_ci interface InterceptedRecordPage { 87961847f8eSopenharmony_ci /** 88061847f8eSopenharmony_ci * Current page number: indicates the page number of this query. 88161847f8eSopenharmony_ci * 88261847f8eSopenharmony_ci * @type {number} 88361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 88461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 88561847f8eSopenharmony_ci * @since 12 88661847f8eSopenharmony_ci */ 88761847f8eSopenharmony_ci page: number; 88861847f8eSopenharmony_ci /** 88961847f8eSopenharmony_ci * Page size: maximum number of records on a page for this query. 89061847f8eSopenharmony_ci * 89161847f8eSopenharmony_ci * @type {number} 89261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 89361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 89461847f8eSopenharmony_ci * @since 12 89561847f8eSopenharmony_ci */ 89661847f8eSopenharmony_ci pageSize: number; 89761847f8eSopenharmony_ci /** 89861847f8eSopenharmony_ci * Total pages: total number of pages. 89961847f8eSopenharmony_ci * 90061847f8eSopenharmony_ci * @type {number} 90161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 90261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 90361847f8eSopenharmony_ci * @since 12 90461847f8eSopenharmony_ci */ 90561847f8eSopenharmony_ci totalPage: number; 90661847f8eSopenharmony_ci /** 90761847f8eSopenharmony_ci * Page data: all records displayed on this page. 90861847f8eSopenharmony_ci * 90961847f8eSopenharmony_ci * @type {Array<InterceptedRecord>} 91061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.NetFirewall 91161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 91261847f8eSopenharmony_ci * @since 12 91361847f8eSopenharmony_ci */ 91461847f8eSopenharmony_ci data: Array<InterceptedRecord>; 91561847f8eSopenharmony_ci } 91661847f8eSopenharmony_ci} 91761847f8eSopenharmony_ci 91861847f8eSopenharmony_ciexport default netFirewall;