1/* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit NetworkKit 19 */ 20 21/** 22 * Provides interfaces to manage net firewall. 23 * 24 * @namespace netFirewall 25 * @syscap SystemCapability.Communication.NetManager.NetFirewall 26 * @since 14 27 */ 28declare namespace netFirewall { 29 /** 30 * Set firewall policy by userId. 31 * <p>Enables or disables the firewall function, and specifies the default actions for inbound connections and 32 * outbound connections.</p> 33 * 34 * @permission ohos.permission.MANAGE_NET_FIREWALL 35 * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 36 * @param { NetFirewallPolicy } policy - The firewall policy to be set. 37 * @returns { Promise<void> } Returns void. 38 * @throws { BusinessError } 201 - Permission denied. 39 * @throws { BusinessError } 401 - Parameter error. 40 * @throws { BusinessError } 2100001 - Invalid parameter value. 41 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 42 * @throws { BusinessError } 2100003 - System internal error. 43 * @throws { BusinessError } 29400000 - The specified user does not exist. 44 * @syscap SystemCapability.Communication.NetManager.NetFirewall 45 * @since 15 46 */ 47 function setNetFirewallPolicy(userId: number, policy: NetFirewallPolicy): Promise<void>; 48 49 /** 50 * Get firewall policy by userId. 51 * 52 * @permission ohos.permission.GET_NET_FIREWALL 53 * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 54 * @returns { Promise<NetFirewallPolicy> } Current user firewall policy. 55 * @throws { BusinessError } 201 - Permission denied. 56 * @throws { BusinessError } 401 - Parameter error. 57 * @throws { BusinessError } 2100001 - Invalid parameter value. 58 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 59 * @throws { BusinessError } 2100003 - System internal error. 60 * @throws { BusinessError } 29400000 - The specified user does not exist. 61 * @syscap SystemCapability.Communication.NetManager.NetFirewall 62 * @since 15 63 */ 64 function getNetFirewallPolicy(userId: number): Promise<NetFirewallPolicy>; 65 66 /** 67 * Add a firewall rule. 68 * 69 * @permission ohos.permission.MANAGE_NET_FIREWALL 70 * @param { NetFirewallRule } rule - Firewall rule. 71 * @returns { Promise<number> } ruleId - Indicates the rule ID, generated by the system. 72 * @throws { BusinessError } 201 - Permission denied. 73 * @throws { BusinessError } 401 - Parameter error. 74 * @throws { BusinessError } 2100001 - Invalid parameter value. 75 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 76 * @throws { BusinessError } 2100003 - System internal error. 77 * @throws { BusinessError } 29400000 - The specified user does not exist. 78 * @throws { BusinessError } 29400001 - The number of firewall rules exceeds the maximum. 79 * @throws { BusinessError } 29400002 - The number of IP address rules in the firewall rule exceeds the maximum. 80 * @throws { BusinessError } 29400003 - The number of port rules in the firewall rule exceeds the maximum. 81 * @throws { BusinessError } 29400004 - The number of domain rules in the firewall rule exceeds the maximum. 82 * @throws { BusinessError } 29400005 - The number of domain rules exceeds the maximum. 83 * @throws { BusinessError } 29400007 - The dns rule is duplication. 84 * @syscap SystemCapability.Communication.NetManager.NetFirewall 85 * @since 15 86 */ 87 function addNetFirewallRule(rule: NetFirewallRule): Promise<number>; 88 89 /** 90 * Update a firewall rule. 91 * 92 * @permission ohos.permission.MANAGE_NET_FIREWALL 93 * @param { NetFirewallRule } rule - Firewall rule. 94 * @returns { Promise<void> } Returns void. 95 * @throws { BusinessError } 201 - Permission denied. 96 * @throws { BusinessError } 401 - Parameter error. 97 * @throws { BusinessError } 2100001 - Invalid parameter value. 98 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 99 * @throws { BusinessError } 2100003 - System internal error. 100 * @throws { BusinessError } 29400000 - The specified user does not exist. 101 * @throws { BusinessError } 29400002 - The number of IP address rules in the firewall rule exceeds the maximum. 102 * @throws { BusinessError } 29400003 - The number of port rules in the firewall rule exceeds the maximum. 103 * @throws { BusinessError } 29400004 - The number of domain rules in the firewall rule exceeds the maximum. 104 * @throws { BusinessError } 29400005 - The number of domain rules exceeds the maximum. 105 * @throws { BusinessError } 29400006 - The specified rule does not exist. 106 * @throws { BusinessError } 29400007 - The dns rule is duplication. 107 * @syscap SystemCapability.Communication.NetManager.NetFirewall 108 * @since 15 109 */ 110 function updateNetFirewallRule(rule: NetFirewallRule): Promise<void>; 111 112 /** 113 * Delete a firewall rule by userId and ruleId. 114 * 115 * @permission ohos.permission.MANAGE_NET_FIREWALL 116 * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 117 * @param { number } ruleId - Rule ID. 118 * @returns { Promise<void> } Returns void. 119 * @throws { BusinessError } 201 - Permission denied. 120 * @throws { BusinessError } 401 - Parameter error. 121 * @throws { BusinessError } 2100001 - Invalid parameter value. 122 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 123 * @throws { BusinessError } 2100003 - System internal error. 124 * @throws { BusinessError } 29400000 - The specified user does not exist. 125 * @throws { BusinessError } 29400006 - The specified rule does not exist. 126 * @syscap SystemCapability.Communication.NetManager.NetFirewall 127 * @since 15 128 */ 129 function removeNetFirewallRule(userId: number, ruleId: number): Promise<void>; 130 131 /** 132 * Get firewall rules by userId, and it is necessary to specify the pagination query parameters. 133 * 134 * @permission ohos.permission.GET_NET_FIREWALL 135 * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 136 * @param { RequestParam } requestParam - Paging query input parameters. 137 * @returns { Promise<FirewallRulePage> } Paginated firewall rule list. 138 * @throws { BusinessError } 201 - Permission denied. 139 * @throws { BusinessError } 401 - Parameter error. 140 * @throws { BusinessError } 2100001 - Invalid parameter value. 141 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 142 * @throws { BusinessError } 2100003 - System internal error. 143 * @throws { BusinessError } 29400000 - The specified user does not exist. 144 * @syscap SystemCapability.Communication.NetManager.NetFirewall 145 * @since 15 146 */ 147 function getNetFirewallRules(userId: number, requestParam: RequestParam): Promise<FirewallRulePage>; 148 149 /** 150 * Get a specified firewall rule by userId and ruleId. 151 * 152 * @permission ohos.permission.GET_NET_FIREWALL 153 * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 154 * @param { number } ruleId - Rule ID. 155 * @returns { Promise<NetFirewallRule> } Firewall Rule. 156 * @throws { BusinessError } 201 - Permission denied. 157 * @throws { BusinessError } 401 - Parameter error. 158 * @throws { BusinessError } 2100001 - Invalid parameter value. 159 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 160 * @throws { BusinessError } 2100003 - System internal error. 161 * @throws { BusinessError } 29400000 - The specified user does not exist. 162 * @throws { BusinessError } 29400006 - The specified rule does not exist. 163 * @syscap SystemCapability.Communication.NetManager.NetFirewall 164 * @since 15 165 */ 166 function getNetFirewallRule(userId: number, ruleId: number): Promise<NetFirewallRule>; 167 168 /** 169 * Get intercepted records by userId, and it is necessary to specify the pagination query parameters. 170 * 171 * @permission ohos.permission.GET_NET_FIREWALL 172 * @param { number } userId - Indicates the user ID. It cannot be the ID of a user that does not exist. 173 * @param { RequestParam } requestParam - Paging query input parameters. 174 * @returns { Promise<InterceptedRecordPage> } Block Record List. 175 * @throws { BusinessError } 201 - Permission denied. 176 * @throws { BusinessError } 202 - Non-system applications use system APIs. 177 * @throws { BusinessError } 401 - Parameter error. 178 * @throws { BusinessError } 2100001 - Invalid parameter value. 179 * @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service. 180 * @throws { BusinessError } 2100003 - System internal error. 181 * @throws { BusinessError } 29400000 - The specified user does not exist. 182 * @syscap SystemCapability.Communication.NetManager.NetFirewall 183 * @systemapi Hide this for inner system use. 184 * @since 14 185 */ 186 function getInterceptedRecords(userId: number, requestParam: RequestParam): Promise<InterceptedRecordPage>; 187 188 /** 189 * Firewall rule direction enumeration. 190 * 191 * @enum {number} 192 * @syscap SystemCapability.Communication.NetManager.NetFirewall 193 * @since 15 194 */ 195 enum NetFirewallRuleDirection { 196 /** 197 * Inbound. 198 * 199 * @syscap SystemCapability.Communication.NetManager.NetFirewall 200 * @since 15 201 */ 202 RULE_IN = 1, 203 /** 204 * Outbound. 205 * 206 * @syscap SystemCapability.Communication.NetManager.NetFirewall 207 * @since 15 208 */ 209 RULE_OUT = 2 210 } 211 212 /** 213 * Firewall rule behavior enumeration. 214 * 215 * @enum {number} 216 * @syscap SystemCapability.Communication.NetManager.NetFirewall 217 * @since 15 218 */ 219 enum FirewallRuleAction { 220 /** 221 * Allow access. 222 * 223 * @syscap SystemCapability.Communication.NetManager.NetFirewall 224 * @since 15 225 */ 226 RULE_ALLOW = 0, 227 /** 228 * Deny access. 229 * 230 * @syscap SystemCapability.Communication.NetManager.NetFirewall 231 * @since 15 232 */ 233 RULE_DENY = 1 234 } 235 236 /** 237 * Indicates the firewall rule type. 238 * 239 * @enum {number} 240 * @syscap SystemCapability.Communication.NetManager.NetFirewall 241 * @since 15 242 */ 243 enum NetFirewallRuleType { 244 /** 245 * IP type rules. 246 * 247 * @syscap SystemCapability.Communication.NetManager.NetFirewall 248 * @since 15 249 */ 250 RULE_IP = 1, 251 /** 252 * Domain type rules. 253 * 254 * @syscap SystemCapability.Communication.NetManager.NetFirewall 255 * @since 15 256 */ 257 RULE_DOMAIN = 2, 258 /** 259 * DNS type rules. 260 * 261 * @syscap SystemCapability.Communication.NetManager.NetFirewall 262 * @since 15 263 */ 264 RULE_DNS = 3 265 } 266 267 /** 268 * Pagination query sorting field. 269 * 270 * @enum {number} 271 * @syscap SystemCapability.Communication.NetManager.NetFirewall 272 * @since 15 273 */ 274 enum NetFirewallOrderField { 275 /** 276 * Sort rule names, it can be referenced only by the getNetFirewallRules interface. 277 * 278 * @syscap SystemCapability.Communication.NetManager.NetFirewall 279 * @since 15 280 */ 281 ORDER_BY_RULE_NAME = 1, 282 /** 283 * Sort the recorded time, it can be referenced only by the getNetFirewallRules interface. 284 * 285 * @syscap SystemCapability.Communication.NetManager.NetFirewall 286 * @since 15 287 */ 288 ORDER_BY_RECORD_TIME = 100, 289 } 290 291 /** 292 * Pagination query sorting type. 293 * 294 * @enum {number} 295 * @syscap SystemCapability.Communication.NetManager.NetFirewall 296 * @since 15 297 */ 298 enum NetFirewallOrderType { 299 /** 300 * Ascending order. 301 * 302 * @syscap SystemCapability.Communication.NetManager.NetFirewall 303 * @since 15 304 */ 305 ORDER_ASC = 1, 306 /** 307 * Descending order. 308 * 309 * @syscap SystemCapability.Communication.NetManager.NetFirewall 310 * @since 15 311 */ 312 ORDER_DESC = 100, 313 } 314 315 /** 316 * Firewall policy. 317 * 318 * @interface NetFirewallPolicy 319 * @syscap SystemCapability.Communication.NetManager.NetFirewall 320 * @since 15 321 */ 322 interface NetFirewallPolicy { 323 /** 324 * Whether the firewall is open. 325 * 326 * @type {boolean} 327 * @syscap SystemCapability.Communication.NetManager.NetFirewall 328 * @since 15 329 */ 330 isOpen: boolean; 331 332 /** 333 * Inbound connections are allowed or denied by default. 334 * 335 * @type {FirewallRuleAction} 336 * @syscap SystemCapability.Communication.NetManager.NetFirewall 337 * @since 15 338 */ 339 inAction: FirewallRuleAction; 340 341 /** 342 * Outbound connections are allowed or denied by default. 343 * 344 * @type {FirewallRuleAction} 345 * @syscap SystemCapability.Communication.NetManager.NetFirewall 346 * @since 15 347 */ 348 outAction: FirewallRuleAction; 349 } 350 351 /** 352 * Firewall IP parameters. 353 * 354 * @interface NetFirewallIpParams 355 * @syscap SystemCapability.Communication.NetManager.NetFirewall 356 * @since 15 357 */ 358 interface NetFirewallIpParams { 359 /** 360 * 1: IP address or subnet, when using a single IP, the mask is 32; 2: IP segment. 361 * 362 * @type {number} 363 * @syscap SystemCapability.Communication.NetManager.NetFirewall 364 * @since 15 365 */ 366 type: number; 367 /** 368 * 1: IPv4, 2: IPv6, default is IPv4. 369 * 370 * @type {?number} 371 * @syscap SystemCapability.Communication.NetManager.NetFirewall 372 * @since 15 373 */ 374 family?: number; 375 /** 376 * IP address: Valid when type equals 1, otherwise it will be ignored. 377 * 378 * @type {?string} 379 * @syscap SystemCapability.Communication.NetManager.NetFirewall 380 * @since 15 381 */ 382 address?: string; 383 /** 384 * IPv4: subnet mask, IPv6: prefix, valid when type equals 1, otherwise it will be ignored. 385 * 386 * @type {?number} 387 * @syscap SystemCapability.Communication.NetManager.NetFirewall 388 * @since 15 389 */ 390 mask?: number; 391 /** 392 * Start IP: valid when type equals 2, otherwise it will be ignored. 393 * 394 * @type {?string} 395 * @syscap SystemCapability.Communication.NetManager.NetFirewall 396 * @since 15 397 */ 398 startIp?: string; 399 /** 400 * End IP: valid when type equals 2, otherwise it will be ignored. 401 * 402 * @type {?string} 403 * @syscap SystemCapability.Communication.NetManager.NetFirewall 404 * @since 15 405 */ 406 endIp?: string; 407 } 408 409 /** 410 * Firewall port parameters. 411 * 412 * @interface NetFirewallPortParams 413 * @syscap SystemCapability.Communication.NetManager.NetFirewall 414 * @since 15 415 */ 416 interface NetFirewallPortParams { 417 /** 418 * Start port, when there is only one port, the start port is the same as the end port. 419 * 420 * @type {number} 421 * @syscap SystemCapability.Communication.NetManager.NetFirewall 422 * @since 15 423 */ 424 startPort: number; 425 /** 426 * End port, when there is only one port, the start port is the same as the end port. 427 * 428 * @type {number} 429 * @syscap SystemCapability.Communication.NetManager.NetFirewall 430 * @since 15 431 */ 432 endPort: number; 433 } 434 435 /** 436 * Firewall domain name parameters. 437 * 438 * @interface NetFirewallDomainParams 439 * @syscap SystemCapability.Communication.NetManager.NetFirewall 440 * @since 15 441 */ 442 interface NetFirewallDomainParams { 443 /** 444 * Is there a universal configuration rule. 445 * 446 * @type {boolean} 447 * @syscap SystemCapability.Communication.NetManager.NetFirewall 448 * @since 15 449 */ 450 isWildcard: boolean; 451 /** 452 * Domain: when isWildcard is false, the complete domain that needs to be determined; 453 * When isWildcard is true, fuzzy domain only support domains like *.openharmony.cn; *.com. 454 * 455 * @type {string} 456 * @syscap SystemCapability.Communication.NetManager.NetFirewall 457 * @since 15 458 */ 459 domain: string; 460 } 461 462 /** 463 * Firewall DNS parameters. 464 * 465 * @interface NetFirewallDnsParams 466 * @syscap SystemCapability.Communication.NetManager.NetFirewall 467 * @since 15 468 */ 469 interface NetFirewallDnsParams { 470 /** 471 * Primary DNS. 472 * 473 * @type {string} 474 * @syscap SystemCapability.Communication.NetManager.NetFirewall 475 * @since 15 476 */ 477 primaryDns: string; 478 /** 479 * Backup DNS. 480 * 481 * @type {?string} 482 * @syscap SystemCapability.Communication.NetManager.NetFirewall 483 * @since 15 484 */ 485 standbyDns?: string; 486 } 487 488 /** 489 * Firewall rules. 490 * 491 * @interface NetFirewallRule 492 * @syscap SystemCapability.Communication.NetManager.NetFirewall 493 * @since 15 494 */ 495 interface NetFirewallRule { 496 /** 497 * User id. 498 * 499 * @type {number} 500 * @syscap SystemCapability.Communication.NetManager.NetFirewall 501 * @since 15 502 */ 503 userId: number; 504 /** 505 * Rule name. 506 * 507 * @type {string} 508 * @syscap SystemCapability.Communication.NetManager.NetFirewall 509 * @since 15 510 */ 511 name: string; 512 /** 513 * Rule direction, inbound or outbound. 514 * 515 * @type {NetFirewallRuleDirection} 516 * @syscap SystemCapability.Communication.NetManager.NetFirewall 517 * @since 15 518 */ 519 direction: NetFirewallRuleDirection; 520 /** 521 * Rule action. 522 * 523 * @type {FirewallRuleAction} 524 * @syscap SystemCapability.Communication.NetManager.NetFirewall 525 * @since 15 526 */ 527 action: FirewallRuleAction; 528 /** 529 * Rule type. 530 * 531 * @type {NetFirewallRuleType} 532 * @syscap SystemCapability.Communication.NetManager.NetFirewall 533 * @since 15 534 */ 535 type: NetFirewallRuleType; 536 /** 537 * Whether the rule is enabled. 538 * 539 * @type {boolean} 540 * @syscap SystemCapability.Communication.NetManager.NetFirewall 541 * @since 15 542 */ 543 isEnabled: boolean; 544 /** 545 * Rule id: When a rule is added to the system, the system generates a rule ID. 546 * 547 * @type {?number} 548 * @syscap SystemCapability.Communication.NetManager.NetFirewall 549 * @since 15 550 */ 551 id?: number; 552 /** 553 * Rule description. 554 * 555 * @type {?string} 556 * @syscap SystemCapability.Communication.NetManager.NetFirewall 557 * @since 15 558 */ 559 description?: string; 560 /** 561 * Application or service UID. 562 * 563 * @type {?number} 564 * @syscap SystemCapability.Communication.NetManager.NetFirewall 565 * @since 15 566 */ 567 appUid?: number; 568 /** 569 * Local IP address: valid when ruleType = RULE_IP, otherwise it will be ignored. 570 * 571 * @type {?Array<NetFirewallIpParams>} 572 * @syscap SystemCapability.Communication.NetManager.NetFirewall 573 * @since 15 574 */ 575 localIps?: Array<NetFirewallIpParams>; 576 /** 577 * Remote IP address: valid when ruleType = RULE_IP, otherwise it will be ignored. 578 * 579 * @type {?Array<NetFirewallIpParams>} 580 * @syscap SystemCapability.Communication.NetManager.NetFirewall 581 * @since 15 582 */ 583 remoteIps?: Array<NetFirewallIpParams>; 584 /** 585 * Protocol, 1: ICMPv4, 6: TCP, 17: UDP, 58: ICMPv6. Valid when ruleType = RULE_IP, otherwise it will be ignored. 586 * 587 * @type {?number} 588 * @syscap SystemCapability.Communication.NetManager.NetFirewall 589 * @since 15 590 */ 591 protocol?: number; 592 /** 593 * Local ports: valid when ruleType = RULE_IP, otherwise it will be ignored. 594 * 595 * @type {?Array<NetFirewallPortParams>} 596 * @syscap SystemCapability.Communication.NetManager.NetFirewall 597 * @since 15 598 */ 599 localPorts?: Array<NetFirewallPortParams>; 600 /** 601 * Remote ports: valid when ruleType = RULE_IP, otherwise it will be ignored. 602 * 603 * @type {?Array<NetFirewallPortParams>} 604 * @syscap SystemCapability.Communication.NetManager.NetFirewall 605 * @since 15 606 */ 607 remotePorts?: Array<NetFirewallPortParams>; 608 /** 609 * Domain name list: valid when ruleType = RULE_DOMAIN, otherwise it will be ignored. 610 * 611 * @type {?Array<NetFirewallDomainParams>} 612 * @syscap SystemCapability.Communication.NetManager.NetFirewall 613 * @since 15 614 */ 615 domains?: Array<NetFirewallDomainParams>; 616 /** 617 * DNS: valid when ruleType = RULE_DNS, otherwise it will be ignored. 618 * 619 * @type {?NetFirewallDnsParams} 620 * @syscap SystemCapability.Communication.NetManager.NetFirewall 621 * @since 15 622 */ 623 dns?: NetFirewallDnsParams; 624 } 625 626 /** 627 * Intercepted record. 628 * 629 * @interface InterceptedRecord 630 * @syscap SystemCapability.Communication.NetManager.NetFirewall 631 * @systemapi Hide this for inner system use. 632 * @since 14 633 */ 634 interface InterceptedRecord { 635 /** 636 * Time stamp. 637 * 638 * @type {number} 639 * @syscap SystemCapability.Communication.NetManager.NetFirewall 640 * @systemapi Hide this for inner system use. 641 * @since 14 642 */ 643 time: number; 644 /** 645 * Local IP. 646 * 647 * @type {?string} 648 * @syscap SystemCapability.Communication.NetManager.NetFirewall 649 * @systemapi Hide this for inner system use. 650 * @since 14 651 */ 652 localIp?: string; 653 /** 654 * Remote IP. 655 * 656 * @type {?string} 657 * @syscap SystemCapability.Communication.NetManager.NetFirewall 658 * @systemapi Hide this for inner system use. 659 * @since 14 660 */ 661 remoteIp?: string; 662 /** 663 * Local port. 664 * 665 * @type {?number} 666 * @syscap SystemCapability.Communication.NetManager.NetFirewall 667 * @systemapi Hide this for inner system use. 668 * @since 14 669 */ 670 localPort?: number; 671 /** 672 * Remote port. 673 * 674 * @type {?number} 675 * @syscap SystemCapability.Communication.NetManager.NetFirewall 676 * @systemapi Hide this for inner system use. 677 * @since 14 678 */ 679 remotePort?: number; 680 /** 681 * Transport layer protocol. 682 * 683 * @type {?number} 684 * @syscap SystemCapability.Communication.NetManager.NetFirewall 685 * @systemapi Hide this for inner system use. 686 * @since 14 687 */ 688 protocol?: number; 689 /** 690 * Application or service ID. 691 * 692 * @type {?number} 693 * @syscap SystemCapability.Communication.NetManager.NetFirewall 694 * @systemapi Hide this for inner system use. 695 * @since 14 696 */ 697 appUid?: number; 698 /** 699 * Blocked domain name information. 700 * 701 * @type {?string} 702 * @syscap SystemCapability.Communication.NetManager.NetFirewall 703 * @systemapi Hide this for inner system use. 704 * @since 14 705 */ 706 domain?: string; 707 } 708 709 /** 710 * Pagination query input parameters. 711 * 712 * @interface RequestParam 713 * @syscap SystemCapability.Communication.NetManager.NetFirewall 714 * @since 15 715 */ 716 interface RequestParam { 717 /** 718 * Page number: indicates the page number to be queried. The start value is 1. 719 * 720 * @type {number} 721 * @syscap SystemCapability.Communication.NetManager.NetFirewall 722 * @since 15 723 */ 724 page: number; 725 /** 726 * Page size: indicates the number of data records to be queried at a time. The maximum value is 50. 727 * 728 * @type {number} 729 * @syscap SystemCapability.Communication.NetManager.NetFirewall 730 * @since 15 731 */ 732 pageSize: number; 733 /** 734 * Sort field. 735 * 736 * @type {NetFirewallOrderField} 737 * @syscap SystemCapability.Communication.NetManager.NetFirewall 738 * @since 15 739 */ 740 orderField: NetFirewallOrderField; 741 /** 742 * Sort Type: ascending or descending. 743 * 744 * @type {NetFirewallOrderType} 745 * @syscap SystemCapability.Communication.NetManager.NetFirewall 746 * @since 15 747 */ 748 orderType: NetFirewallOrderType; 749 } 750 751 /** 752 * Rule page information. 753 * 754 * @interface FirewallRulePage 755 * @syscap SystemCapability.Communication.NetManager.NetFirewall 756 * @since 15 757 */ 758 interface FirewallRulePage { 759 /** 760 * Current page number: indicates the page number of this query. 761 * 762 * @type {number} 763 * @syscap SystemCapability.Communication.NetManager.NetFirewall 764 * @since 15 765 */ 766 page: number; 767 /** 768 * Page size: maximum number of records on a page for this query. 769 * 770 * @type {number} 771 * @syscap SystemCapability.Communication.NetManager.NetFirewall 772 * @since 15 773 */ 774 pageSize: number; 775 /** 776 * Total pages: total number of pages. 777 * 778 * @type {number} 779 * @syscap SystemCapability.Communication.NetManager.NetFirewall 780 * @since 15 781 */ 782 totalPage: number; 783 /** 784 * Page data: all records displayed on this page. 785 * 786 * @type {Array<NetFirewallRule> } 787 * @syscap SystemCapability.Communication.NetManager.NetFirewall 788 * @since 15 789 */ 790 data: Array<NetFirewallRule>; 791 } 792 793 /** 794 * Intercepted record page information. 795 * 796 * @interface InterceptedRecordPage 797 * @syscap SystemCapability.Communication.NetManager.NetFirewall 798 * @systemapi Hide this for inner system use. 799 * @since 14 800 */ 801 interface InterceptedRecordPage { 802 /** 803 * Current page number: indicates the page number of this query. 804 * 805 * @type {number} 806 * @syscap SystemCapability.Communication.NetManager.NetFirewall 807 * @systemapi Hide this for inner system use. 808 * @since 14 809 */ 810 page: number; 811 /** 812 * Page size: maximum number of records on a page for this query. 813 * 814 * @type {number} 815 * @syscap SystemCapability.Communication.NetManager.NetFirewall 816 * @systemapi Hide this for inner system use. 817 * @since 14 818 */ 819 pageSize: number; 820 /** 821 * Total pages: total number of pages. 822 * 823 * @type {number} 824 * @syscap SystemCapability.Communication.NetManager.NetFirewall 825 * @systemapi Hide this for inner system use. 826 * @since 14 827 */ 828 totalPage: number; 829 /** 830 * Page data: all records displayed on this page. 831 * 832 * @type {Array<InterceptedRecord>} 833 * @syscap SystemCapability.Communication.NetManager.NetFirewall 834 * @systemapi Hide this for inner system use. 835 * @since 14 836 */ 837 data: Array<InterceptedRecord>; 838 } 839} 840 841export default netFirewall;