161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (C) 2023 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_ciimport type { AsyncCallback, Callback } from './@ohos.base';
2261847f8eSopenharmony_ciimport type connection from './@ohos.net.connection';
2361847f8eSopenharmony_ciimport type _AbilityContext from './application/UIAbilityContext';
2461847f8eSopenharmony_ci
2561847f8eSopenharmony_ci/**
2661847f8eSopenharmony_ci * Provides VPN related interfaces.
2761847f8eSopenharmony_ci * @namespace vpn
2861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.NetManager.Vpn
2961847f8eSopenharmony_ci * @since 10
3061847f8eSopenharmony_ci */
3161847f8eSopenharmony_cideclare namespace vpn {
3261847f8eSopenharmony_ci  /**
3361847f8eSopenharmony_ci   * Get network link information.
3461847f8eSopenharmony_ci   * @typedef { connection.LinkAddress }
3561847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Core
3661847f8eSopenharmony_ci   * @since 10
3761847f8eSopenharmony_ci   */
3861847f8eSopenharmony_ci  export type LinkAddress = connection.LinkAddress;
3961847f8eSopenharmony_ci
4061847f8eSopenharmony_ci  /**
4161847f8eSopenharmony_ci   * Get network route information.
4261847f8eSopenharmony_ci   * @typedef { connection.RouteInfo }
4361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Core
4461847f8eSopenharmony_ci   * @since 10
4561847f8eSopenharmony_ci   */
4661847f8eSopenharmony_ci  export type RouteInfo = connection.RouteInfo;
4761847f8eSopenharmony_ci
4861847f8eSopenharmony_ci  /**
4961847f8eSopenharmony_ci   * The context of an ability. It allows access to ability-specific resources.
5061847f8eSopenharmony_ci   * @typedef _AbilityContext
5161847f8eSopenharmony_ci   * @syscap SystemCapability.Ability.AbilityRuntime.Core
5261847f8eSopenharmony_ci   * @since 10
5361847f8eSopenharmony_ci   */
5461847f8eSopenharmony_ci  export type AbilityContext = _AbilityContext;
5561847f8eSopenharmony_ci
5661847f8eSopenharmony_ci  /**
5761847f8eSopenharmony_ci   * Create a VPN connection using the AbilityContext.
5861847f8eSopenharmony_ci   * @param { AbilityContext } context - Indicates the context of application or capability.
5961847f8eSopenharmony_ci   * @returns { VpnConnection } the VpnConnection of the construct VpnConnection instance.
6061847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
6161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
6261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
6361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
6461847f8eSopenharmony_ci   * @since 10
6561847f8eSopenharmony_ci   */
6661847f8eSopenharmony_ci  function createVpnConnection(context: AbilityContext): VpnConnection;
6761847f8eSopenharmony_ci 
6861847f8eSopenharmony_ci  /**
6961847f8eSopenharmony_ci   * Subscribes to vpn connect state changes.
7061847f8eSopenharmony_ci   * @permission ohos.permission.MANAGE_VPN
7161847f8eSopenharmony_ci   * @param { 'connect' } type - Indicates vpn connect state changes.
7261847f8eSopenharmony_ci   * @param { Callback<VpnConnectState> } callback - The callback of the vpn connect state.
7361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
7461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
7561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
7661847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
7761847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
7861847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
7961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
8061847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
8161847f8eSopenharmony_ci   * @since 12
8261847f8eSopenharmony_ci   */
8361847f8eSopenharmony_ci  function on(type: 'connect', callback: Callback<VpnConnectState>): void;
8461847f8eSopenharmony_ci
8561847f8eSopenharmony_ci  /**
8661847f8eSopenharmony_ci   * Unsubscribes from vpn connect state changes.
8761847f8eSopenharmony_ci   * @permission ohos.permission.MANAGE_VPN
8861847f8eSopenharmony_ci   * @param { 'connect' } type - Indicates vpn connect state changes.
8961847f8eSopenharmony_ci   * @param { Callback<VpnConnectState> } callback - The callback of the vpn connect state.
9061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
9161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
9261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
9361847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
9461847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
9561847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
9661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
9761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
9861847f8eSopenharmony_ci   * @since 12
9961847f8eSopenharmony_ci   */
10061847f8eSopenharmony_ci  function off(type: 'connect', callback?: Callback<VpnConnectState>): void;
10161847f8eSopenharmony_ci
10261847f8eSopenharmony_ci  /**
10361847f8eSopenharmony_ci   * Add a system VPN network configuration.
10461847f8eSopenharmony_ci   * @permission ohos.permission.MANAGE_VPN
10561847f8eSopenharmony_ci   * @param { SysVpnConfig } config - Indicates the {@link SysVpnConfig} configuration of the VPN network.
10661847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
10761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
10861847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
10961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
11061847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
11161847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
11261847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
11361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
11461847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
11561847f8eSopenharmony_ci   * @since 12
11661847f8eSopenharmony_ci   */
11761847f8eSopenharmony_ci  function addSysVpnConfig(config: SysVpnConfig): Promise<void>;
11861847f8eSopenharmony_ci
11961847f8eSopenharmony_ci  /**
12061847f8eSopenharmony_ci   * Delete the configuration of system VPN network by the specified vpnId.
12161847f8eSopenharmony_ci   * @permission ohos.permission.MANAGE_VPN
12261847f8eSopenharmony_ci   * @param { string } vpnId - Indicates the uuid of the VPN network configuration.
12361847f8eSopenharmony_ci   * @returns { Promise<void> } The promise returned by the function.
12461847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
12561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
12661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
12761847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
12861847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
12961847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
13061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
13161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
13261847f8eSopenharmony_ci   * @since 12
13361847f8eSopenharmony_ci   */
13461847f8eSopenharmony_ci  function deleteSysVpnConfig(vpnId: string): Promise<void>;
13561847f8eSopenharmony_ci
13661847f8eSopenharmony_ci  /**
13761847f8eSopenharmony_ci   * Get all system VPN network configuration.
13861847f8eSopenharmony_ci   * @permission ohos.permission.MANAGE_VPN
13961847f8eSopenharmony_ci   * @returns { Promise<Array<SysVpnConfig>> } The promise returned by the all VPN network configuration.
14061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
14161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
14261847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
14361847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
14461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
14561847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
14661847f8eSopenharmony_ci   * @since 12
14761847f8eSopenharmony_ci   */
14861847f8eSopenharmony_ci  function getSysVpnConfigList(): Promise<Array<SysVpnConfig>>;
14961847f8eSopenharmony_ci
15061847f8eSopenharmony_ci  /**
15161847f8eSopenharmony_ci   * Get the configuration of system VPN network by the specified vpnId.
15261847f8eSopenharmony_ci   * @permission ohos.permission.MANAGE_VPN
15361847f8eSopenharmony_ci   * @param { string } vpnId - Indicates the uuid of the VPN network.
15461847f8eSopenharmony_ci   * @returns { Promise<SysVpnConfig> } The promise returned by the VPN network configuration.
15561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
15661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
15761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error.
15861847f8eSopenharmony_ci   * @throws { BusinessError } 2200001 - Invalid parameter value.
15961847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
16061847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
16161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
16261847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
16361847f8eSopenharmony_ci   * @since 12
16461847f8eSopenharmony_ci   */
16561847f8eSopenharmony_ci  function getSysVpnConfig(vpnId: string): Promise<SysVpnConfig>;
16661847f8eSopenharmony_ci
16761847f8eSopenharmony_ci  /**
16861847f8eSopenharmony_ci   * Get the connected VPN network configuration.
16961847f8eSopenharmony_ci   * @permission ohos.permission.MANAGE_VPN
17061847f8eSopenharmony_ci   * @returns { Promise<SysVpnConfig> } The promise returned by the connected VPN network configuration.
17161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
17261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications use system APIs.
17361847f8eSopenharmony_ci   * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
17461847f8eSopenharmony_ci   * @throws { BusinessError } 2200003 - System internal error.
17561847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
17661847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
17761847f8eSopenharmony_ci   * @since 12
17861847f8eSopenharmony_ci   */
17961847f8eSopenharmony_ci  function getConnectedSysVpnConfig(): Promise<SysVpnConfig>;
18061847f8eSopenharmony_ci
18161847f8eSopenharmony_ci  /**
18261847f8eSopenharmony_ci   * Defines a VPN connection.
18361847f8eSopenharmony_ci   * @interface VpnConnection
18461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
18561847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
18661847f8eSopenharmony_ci   * @since 10
18761847f8eSopenharmony_ci   */
18861847f8eSopenharmony_ci  export interface VpnConnection {
18961847f8eSopenharmony_ci    /**
19061847f8eSopenharmony_ci     * Create a VPN network using the VpnConfig.
19161847f8eSopenharmony_ci     * @permission ohos.permission.MANAGE_VPN
19261847f8eSopenharmony_ci     * @param { VpnConfig } config - Indicates the {@link VpnConfig} configuration of the VPN network.
19361847f8eSopenharmony_ci     * @param { AsyncCallback<number> } callback - The callback is used to return file descriptor of VPN interface.
19461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
19561847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Non-system applications use system APIs.
19661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
19761847f8eSopenharmony_ci     * @throws { BusinessError } 2200001 - Invalid parameter value.
19861847f8eSopenharmony_ci     * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
19961847f8eSopenharmony_ci     * @throws { BusinessError } 2200003 - System internal error.
20061847f8eSopenharmony_ci     * @throws { BusinessError } 2203001 - VPN creation denied. Check the user type.
20161847f8eSopenharmony_ci     * @throws { BusinessError } 2203002 - VPN already exists.
20261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
20361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
20461847f8eSopenharmony_ci     * @since 10
20561847f8eSopenharmony_ci     */
20661847f8eSopenharmony_ci    setUp(config: VpnConfig, callback: AsyncCallback<number>): void;
20761847f8eSopenharmony_ci 
20861847f8eSopenharmony_ci    /**
20961847f8eSopenharmony_ci     * Create a VPN network using the VpnConfig.
21061847f8eSopenharmony_ci     * @permission ohos.permission.MANAGE_VPN
21161847f8eSopenharmony_ci     * @param { VpnConfig } config - Indicates the {@link VpnConfig} configuration of the VPN network.
21261847f8eSopenharmony_ci     * @returns { Promise<number> } The promise returns file descriptor of VPN interface.
21361847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
21461847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Non-system applications use system APIs.
21561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
21661847f8eSopenharmony_ci     * @throws { BusinessError } 2200001 - Invalid parameter value.
21761847f8eSopenharmony_ci     * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
21861847f8eSopenharmony_ci     * @throws { BusinessError } 2200003 - System internal error.
21961847f8eSopenharmony_ci     * @throws { BusinessError } 2203001 - VPN creation denied. Check the user type.
22061847f8eSopenharmony_ci     * @throws { BusinessError } 2203002 - VPN already exists.
22161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
22261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
22361847f8eSopenharmony_ci     * @since 10
22461847f8eSopenharmony_ci     */
22561847f8eSopenharmony_ci    setUp(config: VpnConfig): Promise<number>;
22661847f8eSopenharmony_ci 
22761847f8eSopenharmony_ci    /**
22861847f8eSopenharmony_ci     * Protect a socket from VPN connections. After protecting, data sent through this socket will go directly to the
22961847f8eSopenharmony_ci     * underlying network so its traffic will not be forwarded through the VPN.
23061847f8eSopenharmony_ci     * @permission ohos.permission.MANAGE_VPN
23161847f8eSopenharmony_ci     * @param { number } socketFd - File descriptor of socket, this socket from @ohos.net.socket.
23261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - The callback of protect.
23361847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
23461847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Non-system applications use system APIs.
23561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
23661847f8eSopenharmony_ci     * @throws { BusinessError } 2200001 - Invalid parameter value.
23761847f8eSopenharmony_ci     * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
23861847f8eSopenharmony_ci     * @throws { BusinessError } 2200003 - System internal error.
23961847f8eSopenharmony_ci     * @throws { BusinessError } 2203004 - Invalid socket file descriptor.
24061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
24161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
24261847f8eSopenharmony_ci     * @since 10
24361847f8eSopenharmony_ci     */
24461847f8eSopenharmony_ci    protect(socketFd: number, callback: AsyncCallback<void>): void;
24561847f8eSopenharmony_ci 
24661847f8eSopenharmony_ci    /**
24761847f8eSopenharmony_ci     * Protect a socket from VPN connections. After protecting, data sent through this socket will go directly to the
24861847f8eSopenharmony_ci     * underlying network so its traffic will not be forwarded through the VPN.
24961847f8eSopenharmony_ci     * @permission ohos.permission.MANAGE_VPN
25061847f8eSopenharmony_ci     * @param { number } socketFd - File descriptor of socket, this socket from @ohos.net.socket.
25161847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the function.
25261847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
25361847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Non-system applications use system APIs.
25461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
25561847f8eSopenharmony_ci     * @throws { BusinessError } 2200001 - Invalid parameter value.
25661847f8eSopenharmony_ci     * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
25761847f8eSopenharmony_ci     * @throws { BusinessError } 2200003 - System internal error.
25861847f8eSopenharmony_ci     * @throws { BusinessError } 2203004 - Invalid socket file descriptor.
25961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
26061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
26161847f8eSopenharmony_ci     * @since 10
26261847f8eSopenharmony_ci     */
26361847f8eSopenharmony_ci    protect(socketFd: number): Promise<void>;
26461847f8eSopenharmony_ci 
26561847f8eSopenharmony_ci    /**
26661847f8eSopenharmony_ci     * Destroy the VPN network.
26761847f8eSopenharmony_ci     * @permission ohos.permission.MANAGE_VPN
26861847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - The callback of destroy.
26961847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
27061847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Non-system applications use system APIs.
27161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
27261847f8eSopenharmony_ci     * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
27361847f8eSopenharmony_ci     * @throws { BusinessError } 2200003 - System internal error.
27461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
27561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
27661847f8eSopenharmony_ci     * @since 10
27761847f8eSopenharmony_ci     */
27861847f8eSopenharmony_ci    destroy(callback: AsyncCallback<void>): void;
27961847f8eSopenharmony_ci 
28061847f8eSopenharmony_ci    /**
28161847f8eSopenharmony_ci     * Destroy the VPN network.
28261847f8eSopenharmony_ci     * @permission ohos.permission.MANAGE_VPN
28361847f8eSopenharmony_ci     * @returns { Promise<void> } The promise returned by the function.
28461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission denied.
28561847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Non-system applications use system APIs.
28661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error.
28761847f8eSopenharmony_ci     * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
28861847f8eSopenharmony_ci     * @throws { BusinessError } 2200003 - System internal error.
28961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
29061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
29161847f8eSopenharmony_ci     * @since 10
29261847f8eSopenharmony_ci     */
29361847f8eSopenharmony_ci    destroy(): Promise<void>;
29461847f8eSopenharmony_ci  }
29561847f8eSopenharmony_ci
29661847f8eSopenharmony_ci  /**
29761847f8eSopenharmony_ci   * Define configuration of the VPN network.
29861847f8eSopenharmony_ci   * @typedef VpnConfig
29961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
30061847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
30161847f8eSopenharmony_ci   * @since 10
30261847f8eSopenharmony_ci   */
30361847f8eSopenharmony_ci  export interface VpnConfig {
30461847f8eSopenharmony_ci    /**
30561847f8eSopenharmony_ci     * The array of addresses for VPN interface.
30661847f8eSopenharmony_ci     * @type {Array<LinkAddress>}
30761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
30861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
30961847f8eSopenharmony_ci     * @since 10
31061847f8eSopenharmony_ci     */
31161847f8eSopenharmony_ci    addresses: Array<LinkAddress>;
31261847f8eSopenharmony_ci 
31361847f8eSopenharmony_ci    /**
31461847f8eSopenharmony_ci     * The array of routes for VPN interface.
31561847f8eSopenharmony_ci     * @type {?Array<RouteInfo>}
31661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
31761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
31861847f8eSopenharmony_ci     * @since 10
31961847f8eSopenharmony_ci     */
32061847f8eSopenharmony_ci    routes?: Array<RouteInfo>;
32161847f8eSopenharmony_ci
32261847f8eSopenharmony_ci    /**
32361847f8eSopenharmony_ci     * The array of DNS servers for the VPN network.
32461847f8eSopenharmony_ci     * @type {?Array<string>}
32561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
32661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
32761847f8eSopenharmony_ci     * @since 10
32861847f8eSopenharmony_ci     */
32961847f8eSopenharmony_ci    dnsAddresses?: Array<string>;
33061847f8eSopenharmony_ci 
33161847f8eSopenharmony_ci    /**
33261847f8eSopenharmony_ci     * The array of search domains for the DNS resolver.
33361847f8eSopenharmony_ci     * @type {?Array<string>}
33461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
33561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
33661847f8eSopenharmony_ci     * @since 10
33761847f8eSopenharmony_ci     */
33861847f8eSopenharmony_ci    searchDomains?: Array<string>;
33961847f8eSopenharmony_ci 
34061847f8eSopenharmony_ci    /**
34161847f8eSopenharmony_ci     * The maximum transmission unit (MTU) for the VPN interface.
34261847f8eSopenharmony_ci     * @type {?number}
34361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
34461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
34561847f8eSopenharmony_ci     * @since 10
34661847f8eSopenharmony_ci     */
34761847f8eSopenharmony_ci    mtu?: number;
34861847f8eSopenharmony_ci 
34961847f8eSopenharmony_ci    /**
35061847f8eSopenharmony_ci     * Whether ipv4 is supported. The default value is true.
35161847f8eSopenharmony_ci     * @type {?boolean}
35261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
35361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
35461847f8eSopenharmony_ci     * @since 10
35561847f8eSopenharmony_ci     */
35661847f8eSopenharmony_ci    isIPv4Accepted?: boolean;
35761847f8eSopenharmony_ci 
35861847f8eSopenharmony_ci    /**
35961847f8eSopenharmony_ci     * Whether ipv6 is supported. The default value is false.
36061847f8eSopenharmony_ci     * @type {?boolean}
36161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
36261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
36361847f8eSopenharmony_ci     * @since 10
36461847f8eSopenharmony_ci     */
36561847f8eSopenharmony_ci    isIPv6Accepted?: boolean;
36661847f8eSopenharmony_ci 
36761847f8eSopenharmony_ci    /**
36861847f8eSopenharmony_ci     * Whether to use the built-in VPN. The default value is false.
36961847f8eSopenharmony_ci     * @type {?boolean}
37061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
37161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
37261847f8eSopenharmony_ci     * @since 10
37361847f8eSopenharmony_ci     */
37461847f8eSopenharmony_ci    isLegacy?: boolean;
37561847f8eSopenharmony_ci 
37661847f8eSopenharmony_ci    /**
37761847f8eSopenharmony_ci     * Whether the VPN interface's file descriptor is in blocking/non-blocking mode. The default value is false.
37861847f8eSopenharmony_ci     * @type {?boolean}
37961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
38061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
38161847f8eSopenharmony_ci     * @since 10
38261847f8eSopenharmony_ci     */
38361847f8eSopenharmony_ci    isBlocking?: boolean;
38461847f8eSopenharmony_ci 
38561847f8eSopenharmony_ci    /**
38661847f8eSopenharmony_ci     * The array of trustlist for the VPN network. The string indicates package name.
38761847f8eSopenharmony_ci     * @type {?Array<string>}
38861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
38961847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
39061847f8eSopenharmony_ci     * @since 10
39161847f8eSopenharmony_ci     */
39261847f8eSopenharmony_ci    trustedApplications?: Array<string>;
39361847f8eSopenharmony_ci 
39461847f8eSopenharmony_ci    /**
39561847f8eSopenharmony_ci     * The array of blocklist for the VPN network. The string indicates package name.
39661847f8eSopenharmony_ci     * @type {?Array<string>}
39761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
39861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
39961847f8eSopenharmony_ci     * @since 10
40061847f8eSopenharmony_ci     */
40161847f8eSopenharmony_ci    blockedApplications?: Array<string>;
40261847f8eSopenharmony_ci  }
40361847f8eSopenharmony_ci
40461847f8eSopenharmony_ci  /**
40561847f8eSopenharmony_ci   * Define configuration of the system VPN network.
40661847f8eSopenharmony_ci   * @typedef SysVpnConfig
40761847f8eSopenharmony_ci   * @extends VpnConfig
40861847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
40961847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
41061847f8eSopenharmony_ci   * @since 12
41161847f8eSopenharmony_ci   */
41261847f8eSopenharmony_ci  export interface SysVpnConfig extends VpnConfig {
41361847f8eSopenharmony_ci    /**
41461847f8eSopenharmony_ci     * The uuid for the VPN network.
41561847f8eSopenharmony_ci     * @type {?string}
41661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
41761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
41861847f8eSopenharmony_ci     * @since 12
41961847f8eSopenharmony_ci     */
42061847f8eSopenharmony_ci    vpnId?: string;
42161847f8eSopenharmony_ci
42261847f8eSopenharmony_ci    /**
42361847f8eSopenharmony_ci     * The name for the VPN network.
42461847f8eSopenharmony_ci     * @type {?string}
42561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
42661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
42761847f8eSopenharmony_ci     * @since 12
42861847f8eSopenharmony_ci     */
42961847f8eSopenharmony_ci    vpnName?: string;
43061847f8eSopenharmony_ci
43161847f8eSopenharmony_ci    /**
43261847f8eSopenharmony_ci     * The type for the VPN network.
43361847f8eSopenharmony_ci     * @type {?SysVpnType}
43461847f8eSopenharmony_ci     * See {@link SysVpnType}
43561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
43661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
43761847f8eSopenharmony_ci     * @since 12
43861847f8eSopenharmony_ci     */
43961847f8eSopenharmony_ci    vpnType?: SysVpnType;
44061847f8eSopenharmony_ci
44161847f8eSopenharmony_ci    /**
44261847f8eSopenharmony_ci     * The user name for the VPN network.
44361847f8eSopenharmony_ci     * @type {?string}
44461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
44561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
44661847f8eSopenharmony_ci     * @since 12
44761847f8eSopenharmony_ci     */
44861847f8eSopenharmony_ci    userName?: string;
44961847f8eSopenharmony_ci
45061847f8eSopenharmony_ci    /**
45161847f8eSopenharmony_ci     * The user password for the VPN network.
45261847f8eSopenharmony_ci     * @type {?string}
45361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
45461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
45561847f8eSopenharmony_ci     * @since 12
45661847f8eSopenharmony_ci     */
45761847f8eSopenharmony_ci    password?: string;
45861847f8eSopenharmony_ci
45961847f8eSopenharmony_ci    /**
46061847f8eSopenharmony_ci     * Whether the VPN network save login name and password. The default value is false.
46161847f8eSopenharmony_ci     * @type {?boolean}
46261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
46361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
46461847f8eSopenharmony_ci     * @since 12
46561847f8eSopenharmony_ci     */
46661847f8eSopenharmony_ci    saveLogin?: boolean;
46761847f8eSopenharmony_ci
46861847f8eSopenharmony_ci    /**
46961847f8eSopenharmony_ci     * The system user id for the VPN network.
47061847f8eSopenharmony_ci     * @type {?number}
47161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
47261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
47361847f8eSopenharmony_ci     * @since 12
47461847f8eSopenharmony_ci     */
47561847f8eSopenharmony_ci    userId?: number;
47661847f8eSopenharmony_ci
47761847f8eSopenharmony_ci    /**
47861847f8eSopenharmony_ci     * The forwarding routes for the VPN network.
47961847f8eSopenharmony_ci     * @type {?string}
48061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
48161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
48261847f8eSopenharmony_ci     * @since 12
48361847f8eSopenharmony_ci     */
48461847f8eSopenharmony_ci    forwardingRoutes?: string;
48561847f8eSopenharmony_ci  }
48661847f8eSopenharmony_ci
48761847f8eSopenharmony_ci  /**
48861847f8eSopenharmony_ci   * Define configuration of the open VPN network.
48961847f8eSopenharmony_ci   * @typedef OpenVpnConfig
49061847f8eSopenharmony_ci   * @extends SysVpnConfig
49161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
49261847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
49361847f8eSopenharmony_ci   * @since 12
49461847f8eSopenharmony_ci   */
49561847f8eSopenharmony_ci  export interface OpenVpnConfig extends SysVpnConfig {
49661847f8eSopenharmony_ci    /**
49761847f8eSopenharmony_ci     * The port for the openvpn VPN network.
49861847f8eSopenharmony_ci     * @type {?string}
49961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
50061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
50161847f8eSopenharmony_ci     * @since 12
50261847f8eSopenharmony_ci     */
50361847f8eSopenharmony_ci    ovpnPort?: string;
50461847f8eSopenharmony_ci
50561847f8eSopenharmony_ci    /**
50661847f8eSopenharmony_ci     * The protocol for the openvpn VPN network.
50761847f8eSopenharmony_ci     * @type {?number}
50861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
50961847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
51061847f8eSopenharmony_ci     * @since 12
51161847f8eSopenharmony_ci     */
51261847f8eSopenharmony_ci    ovpnProtocol?: number;
51361847f8eSopenharmony_ci
51461847f8eSopenharmony_ci    /**
51561847f8eSopenharmony_ci     * The config for the openvpn VPN network.
51661847f8eSopenharmony_ci     * @type {?string}
51761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
51861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
51961847f8eSopenharmony_ci     * @since 12
52061847f8eSopenharmony_ci     */
52161847f8eSopenharmony_ci    ovpnConfig?: string;
52261847f8eSopenharmony_ci
52361847f8eSopenharmony_ci    /**
52461847f8eSopenharmony_ci     * The auth type for the openvpn VPN network.
52561847f8eSopenharmony_ci     * @type {?number}
52661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
52761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
52861847f8eSopenharmony_ci     * @since 12
52961847f8eSopenharmony_ci     */
53061847f8eSopenharmony_ci    ovpnAuthType?: number;
53161847f8eSopenharmony_ci
53261847f8eSopenharmony_ci    /**
53361847f8eSopenharmony_ci     * The ask pass for the openvpn VPN network.
53461847f8eSopenharmony_ci     * @type {?string}
53561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
53661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
53761847f8eSopenharmony_ci     * @since 12
53861847f8eSopenharmony_ci     */
53961847f8eSopenharmony_ci    askpass?: string;
54061847f8eSopenharmony_ci
54161847f8eSopenharmony_ci    /**
54261847f8eSopenharmony_ci     * The config file path for the openvpn VPN network.
54361847f8eSopenharmony_ci     * @type {?string}
54461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
54561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
54661847f8eSopenharmony_ci     * @since 12
54761847f8eSopenharmony_ci     */
54861847f8eSopenharmony_ci    ovpnConfigFilePath?: string;
54961847f8eSopenharmony_ci
55061847f8eSopenharmony_ci    /**
55161847f8eSopenharmony_ci     * The ca cert file path for the openvpn VPN network.
55261847f8eSopenharmony_ci     * @type {?string}
55361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
55461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
55561847f8eSopenharmony_ci     * @since 12
55661847f8eSopenharmony_ci     */
55761847f8eSopenharmony_ci    ovpnCaCertFilePath?: string;
55861847f8eSopenharmony_ci
55961847f8eSopenharmony_ci    /**
56061847f8eSopenharmony_ci     * The user cert file path for the openvpn VPN network.
56161847f8eSopenharmony_ci     * @type {?string}
56261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
56361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
56461847f8eSopenharmony_ci     * @since 12
56561847f8eSopenharmony_ci     */
56661847f8eSopenharmony_ci    ovpnUserCertFilePath?: string;
56761847f8eSopenharmony_ci
56861847f8eSopenharmony_ci    /**
56961847f8eSopenharmony_ci     * The private key file path for the openvpn VPN network.
57061847f8eSopenharmony_ci     * @type {?string}
57161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
57261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
57361847f8eSopenharmony_ci     * @since 12
57461847f8eSopenharmony_ci     */
57561847f8eSopenharmony_ci    ovpnPrivateKeyFilePath?: string;
57661847f8eSopenharmony_ci  }
57761847f8eSopenharmony_ci
57861847f8eSopenharmony_ci  /**
57961847f8eSopenharmony_ci   * Define configuration of the ipsec VPN network.
58061847f8eSopenharmony_ci   * @typedef IpsecVpnConfig
58161847f8eSopenharmony_ci   * @extends SysVpnConfig
58261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
58361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
58461847f8eSopenharmony_ci   * @since 12
58561847f8eSopenharmony_ci   */
58661847f8eSopenharmony_ci  export interface IpsecVpnConfig extends SysVpnConfig {
58761847f8eSopenharmony_ci    /**
58861847f8eSopenharmony_ci     * The pre share key for the ipsec VPN network.
58961847f8eSopenharmony_ci     * @type {?string}
59061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
59161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
59261847f8eSopenharmony_ci     * @since 12
59361847f8eSopenharmony_ci     */
59461847f8eSopenharmony_ci    ipsecPreSharedKey?: string;
59561847f8eSopenharmony_ci
59661847f8eSopenharmony_ci    /**
59761847f8eSopenharmony_ci     * The identifier for the ipsec VPN network.
59861847f8eSopenharmony_ci     * @type {?string}
59961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
60061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
60161847f8eSopenharmony_ci     * @since 12
60261847f8eSopenharmony_ci     */
60361847f8eSopenharmony_ci    ipsecIdentifier?: string;
60461847f8eSopenharmony_ci
60561847f8eSopenharmony_ci    /**
60661847f8eSopenharmony_ci     * The swanctl config for the ipsec VPN network.
60761847f8eSopenharmony_ci     * @type {?string}
60861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
60961847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
61061847f8eSopenharmony_ci     * @since 12
61161847f8eSopenharmony_ci     */
61261847f8eSopenharmony_ci    swanctlConfig?: string;
61361847f8eSopenharmony_ci
61461847f8eSopenharmony_ci    /**
61561847f8eSopenharmony_ci     * The strongSwan config for the ipsec VPN network.
61661847f8eSopenharmony_ci     * @type {?string}
61761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
61861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
61961847f8eSopenharmony_ci     * @since 12
62061847f8eSopenharmony_ci     */
62161847f8eSopenharmony_ci    strongSwanConfig?: string;
62261847f8eSopenharmony_ci
62361847f8eSopenharmony_ci    /**
62461847f8eSopenharmony_ci     * The ca cert config for the ipsec VPN network.
62561847f8eSopenharmony_ci     * @type {?string}
62661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
62761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
62861847f8eSopenharmony_ci     * @since 12
62961847f8eSopenharmony_ci     */
63061847f8eSopenharmony_ci    ipsecCaCertConfig?: string;
63161847f8eSopenharmony_ci
63261847f8eSopenharmony_ci    /**
63361847f8eSopenharmony_ci     * The private user cert config for the ipsec VPN network.
63461847f8eSopenharmony_ci     * @type {?string}
63561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
63661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
63761847f8eSopenharmony_ci     * @since 12
63861847f8eSopenharmony_ci     */
63961847f8eSopenharmony_ci    ipsecPrivateUserCertConfig?: string;
64061847f8eSopenharmony_ci
64161847f8eSopenharmony_ci    /**
64261847f8eSopenharmony_ci     * The public user cert config for the ipsec VPN network.
64361847f8eSopenharmony_ci     * @type {?string}
64461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
64561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
64661847f8eSopenharmony_ci     * @since 12
64761847f8eSopenharmony_ci     */
64861847f8eSopenharmony_ci    ipsecPublicUserCertConfig?: string;
64961847f8eSopenharmony_ci
65061847f8eSopenharmony_ci    /**
65161847f8eSopenharmony_ci     * The private server cert config for the ipsec VPN network.
65261847f8eSopenharmony_ci     * @type {?string}
65361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
65461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
65561847f8eSopenharmony_ci     * @since 12
65661847f8eSopenharmony_ci     */
65761847f8eSopenharmony_ci    ipsecPrivateServerCertConfig?: string;
65861847f8eSopenharmony_ci
65961847f8eSopenharmony_ci    /**
66061847f8eSopenharmony_ci     * The public server cert config for the ipsec VPN network.
66161847f8eSopenharmony_ci     * @type {?string}
66261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
66361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
66461847f8eSopenharmony_ci     * @since 12
66561847f8eSopenharmony_ci     */
66661847f8eSopenharmony_ci    ipsecPublicServerCertConfig?: string;
66761847f8eSopenharmony_ci
66861847f8eSopenharmony_ci    /**
66961847f8eSopenharmony_ci     * The ca cert file path for the ipsec VPN network.
67061847f8eSopenharmony_ci     * @type {?string}
67161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
67261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
67361847f8eSopenharmony_ci     * @since 12
67461847f8eSopenharmony_ci     */
67561847f8eSopenharmony_ci    ipsecCaCertFilePath?: string;
67661847f8eSopenharmony_ci
67761847f8eSopenharmony_ci    /**
67861847f8eSopenharmony_ci     * The private user cert file path for the ipsec VPN network.
67961847f8eSopenharmony_ci     * @type {?string}
68061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
68161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
68261847f8eSopenharmony_ci     * @since 12
68361847f8eSopenharmony_ci     */
68461847f8eSopenharmony_ci    ipsecPrivateUserCertFilePath?: string;
68561847f8eSopenharmony_ci
68661847f8eSopenharmony_ci    /**
68761847f8eSopenharmony_ci     * The public user cert file path for the ipsec VPN network.
68861847f8eSopenharmony_ci     * @type {?string}
68961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
69061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
69161847f8eSopenharmony_ci     * @since 12
69261847f8eSopenharmony_ci     */
69361847f8eSopenharmony_ci    ipsecPublicUserCertFilePath?: string;
69461847f8eSopenharmony_ci
69561847f8eSopenharmony_ci    /**
69661847f8eSopenharmony_ci     * The private server cert file path for the ipsec VPN network.
69761847f8eSopenharmony_ci     * @type {?string}
69861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
69961847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
70061847f8eSopenharmony_ci     * @since 12
70161847f8eSopenharmony_ci     */
70261847f8eSopenharmony_ci    ipsecPrivateServerCertFilePath?: string;
70361847f8eSopenharmony_ci
70461847f8eSopenharmony_ci    /**
70561847f8eSopenharmony_ci     * The public server cert file path for the ipsec VPN network.
70661847f8eSopenharmony_ci     * @type {?string}
70761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
70861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
70961847f8eSopenharmony_ci     * @since 12
71061847f8eSopenharmony_ci     */
71161847f8eSopenharmony_ci    ipsecPublicServerCertFilePath?: string;
71261847f8eSopenharmony_ci  }
71361847f8eSopenharmony_ci
71461847f8eSopenharmony_ci  /**
71561847f8eSopenharmony_ci   * Define configuration of the l2tp VPN network.
71661847f8eSopenharmony_ci   * @typedef L2tpVpnConfig
71761847f8eSopenharmony_ci   * @extends SysVpnConfig
71861847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
71961847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
72061847f8eSopenharmony_ci   * @since 12
72161847f8eSopenharmony_ci   */
72261847f8eSopenharmony_ci  export interface L2tpVpnConfig extends SysVpnConfig {
72361847f8eSopenharmony_ci    /**
72461847f8eSopenharmony_ci     * The pre share key for the l2tp VPN network.
72561847f8eSopenharmony_ci     * @type {?string}
72661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
72761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
72861847f8eSopenharmony_ci     * @since 12
72961847f8eSopenharmony_ci     */
73061847f8eSopenharmony_ci    ipsecPreSharedKey?: string;
73161847f8eSopenharmony_ci
73261847f8eSopenharmony_ci    /**
73361847f8eSopenharmony_ci     * The identifier for the l2tp VPN network.
73461847f8eSopenharmony_ci     * @type {?string}
73561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
73661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
73761847f8eSopenharmony_ci     * @since 12
73861847f8eSopenharmony_ci     */
73961847f8eSopenharmony_ci    ipsecIdentifier?: string;
74061847f8eSopenharmony_ci
74161847f8eSopenharmony_ci    /**
74261847f8eSopenharmony_ci     * The strongSwan config for the l2tp VPN network.
74361847f8eSopenharmony_ci     * @type {?string}
74461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
74561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
74661847f8eSopenharmony_ci     * @since 12
74761847f8eSopenharmony_ci     */
74861847f8eSopenharmony_ci    strongSwanConfig?: string;
74961847f8eSopenharmony_ci
75061847f8eSopenharmony_ci    /**
75161847f8eSopenharmony_ci     * The ca cert config for the l2tp VPN network.
75261847f8eSopenharmony_ci     * @type {?string}
75361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
75461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
75561847f8eSopenharmony_ci     * @since 12
75661847f8eSopenharmony_ci     */
75761847f8eSopenharmony_ci    ipsecCaCertConfig?: string;
75861847f8eSopenharmony_ci
75961847f8eSopenharmony_ci    /**
76061847f8eSopenharmony_ci     * The private user cert config for the l2tp VPN network.
76161847f8eSopenharmony_ci     * @type {?string}
76261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
76361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
76461847f8eSopenharmony_ci     * @since 12
76561847f8eSopenharmony_ci     */
76661847f8eSopenharmony_ci    ipsecPrivateUserCertConfig?: string;
76761847f8eSopenharmony_ci
76861847f8eSopenharmony_ci    /**
76961847f8eSopenharmony_ci     * The public user cert config for the l2tp VPN network.
77061847f8eSopenharmony_ci     * @type {?string}
77161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
77261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
77361847f8eSopenharmony_ci     * @since 12
77461847f8eSopenharmony_ci     */
77561847f8eSopenharmony_ci    ipsecPublicUserCertConfig?: string;
77661847f8eSopenharmony_ci
77761847f8eSopenharmony_ci    /**
77861847f8eSopenharmony_ci     * The private server cert config for the l2tp VPN network.
77961847f8eSopenharmony_ci     * @type {?string}
78061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
78161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
78261847f8eSopenharmony_ci     * @since 12
78361847f8eSopenharmony_ci     */
78461847f8eSopenharmony_ci    ipsecPrivateServerCertConfig?: string;
78561847f8eSopenharmony_ci
78661847f8eSopenharmony_ci    /**
78761847f8eSopenharmony_ci     * The public server cert config for the l2tp VPN network.
78861847f8eSopenharmony_ci     * @type {?string}
78961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
79061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
79161847f8eSopenharmony_ci     * @since 12
79261847f8eSopenharmony_ci     */
79361847f8eSopenharmony_ci    ipsecPublicServerCertConfig?: string;
79461847f8eSopenharmony_ci
79561847f8eSopenharmony_ci    /**
79661847f8eSopenharmony_ci     * The ca cert file path for the l2tp VPN network.
79761847f8eSopenharmony_ci     * @type {?string}
79861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
79961847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
80061847f8eSopenharmony_ci     * @since 12
80161847f8eSopenharmony_ci     */
80261847f8eSopenharmony_ci    ipsecCaCertFilePath?: string;
80361847f8eSopenharmony_ci
80461847f8eSopenharmony_ci    /**
80561847f8eSopenharmony_ci     * The private user cert file path for the l2tp VPN network.
80661847f8eSopenharmony_ci     * @type {?string}
80761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
80861847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
80961847f8eSopenharmony_ci     * @since 12
81061847f8eSopenharmony_ci     */
81161847f8eSopenharmony_ci    ipsecPrivateUserCertFilePath?: string;
81261847f8eSopenharmony_ci
81361847f8eSopenharmony_ci    /**
81461847f8eSopenharmony_ci     * The public user cert file path for the l2tp VPN network.
81561847f8eSopenharmony_ci     * @type {?string}
81661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
81761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
81861847f8eSopenharmony_ci     * @since 12
81961847f8eSopenharmony_ci     */
82061847f8eSopenharmony_ci    ipsecPublicUserCertFilePath?: string;
82161847f8eSopenharmony_ci
82261847f8eSopenharmony_ci    /**
82361847f8eSopenharmony_ci     * The private server cert file path for the l2tp VPN network.
82461847f8eSopenharmony_ci     * @type {?string}
82561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
82661847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
82761847f8eSopenharmony_ci     * @since 12
82861847f8eSopenharmony_ci     */
82961847f8eSopenharmony_ci    ipsecPrivateServerCertFilePath?: string;
83061847f8eSopenharmony_ci
83161847f8eSopenharmony_ci    /**
83261847f8eSopenharmony_ci     * The public server cert file path for the l2tp VPN network.
83361847f8eSopenharmony_ci     * @type {?string}
83461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
83561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
83661847f8eSopenharmony_ci     * @since 12
83761847f8eSopenharmony_ci     */
83861847f8eSopenharmony_ci    ipsecPublicServerCertFilePath?: string;
83961847f8eSopenharmony_ci
84061847f8eSopenharmony_ci    /**
84161847f8eSopenharmony_ci     * The config for the l2tp VPN network.
84261847f8eSopenharmony_ci     * @type {?string}
84361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
84461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
84561847f8eSopenharmony_ci     * @since 12
84661847f8eSopenharmony_ci     */
84761847f8eSopenharmony_ci    ipsecConfig?: string;
84861847f8eSopenharmony_ci
84961847f8eSopenharmony_ci    /**
85061847f8eSopenharmony_ci     * The secrets for the l2tp VPN network.
85161847f8eSopenharmony_ci     * @type {?string}
85261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
85361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
85461847f8eSopenharmony_ci     * @since 12
85561847f8eSopenharmony_ci     */
85661847f8eSopenharmony_ci    ipsecSecrets?: string;
85761847f8eSopenharmony_ci
85861847f8eSopenharmony_ci    /**
85961847f8eSopenharmony_ci     * The client options for the l2tp VPN network.
86061847f8eSopenharmony_ci     * @type {?string}
86161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
86261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
86361847f8eSopenharmony_ci     * @since 12
86461847f8eSopenharmony_ci     */
86561847f8eSopenharmony_ci    optionsL2tpdClient?: string;
86661847f8eSopenharmony_ci
86761847f8eSopenharmony_ci    /**
86861847f8eSopenharmony_ci     * The xl2tpd config for the l2tp VPN network.
86961847f8eSopenharmony_ci     * @type {?string}
87061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
87161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
87261847f8eSopenharmony_ci     * @since 12
87361847f8eSopenharmony_ci     */
87461847f8eSopenharmony_ci    xl2tpdConfig?: string;
87561847f8eSopenharmony_ci
87661847f8eSopenharmony_ci    /**
87761847f8eSopenharmony_ci     * The shared key for the l2tp VPN network.
87861847f8eSopenharmony_ci     * @type {?string}
87961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
88061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
88161847f8eSopenharmony_ci     * @since 12
88261847f8eSopenharmony_ci     */
88361847f8eSopenharmony_ci    l2tpSharedKey?: string;
88461847f8eSopenharmony_ci  }
88561847f8eSopenharmony_ci
88661847f8eSopenharmony_ci  /**
88761847f8eSopenharmony_ci   * Defines the type for the VPN network.
88861847f8eSopenharmony_ci   * @enum {number}
88961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.NetManager.Vpn
89061847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
89161847f8eSopenharmony_ci   * @since 12
89261847f8eSopenharmony_ci   */
89361847f8eSopenharmony_ci  export enum SysVpnType {
89461847f8eSopenharmony_ci    /**
89561847f8eSopenharmony_ci     * The type for the IKEv2/IPsec MSCHAPv2 VPN network.
89661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
89761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
89861847f8eSopenharmony_ci     * @since 12
89961847f8eSopenharmony_ci     */
90061847f8eSopenharmony_ci    IKEV2_IPSEC_MSCHAPV2 = 1,
90161847f8eSopenharmony_ci
90261847f8eSopenharmony_ci    /**
90361847f8eSopenharmony_ci     * The type for the IKEv2/IPsec PSK VPN network.
90461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
90561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
90661847f8eSopenharmony_ci     * @since 12
90761847f8eSopenharmony_ci     */
90861847f8eSopenharmony_ci    IKEV2_IPSEC_PSK = 2,
90961847f8eSopenharmony_ci
91061847f8eSopenharmony_ci    /**
91161847f8eSopenharmony_ci     * The type for the IKEv2/IPsec RSA VPN network.
91261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
91361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
91461847f8eSopenharmony_ci     * @since 12
91561847f8eSopenharmony_ci     */
91661847f8eSopenharmony_ci    IKEV2_IPSEC_RSA = 3,
91761847f8eSopenharmony_ci
91861847f8eSopenharmony_ci    /**
91961847f8eSopenharmony_ci     * The type for the L2TP/IPsec PSK VPN network.
92061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
92161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
92261847f8eSopenharmony_ci     * @since 12
92361847f8eSopenharmony_ci     */
92461847f8eSopenharmony_ci    L2TP_IPSEC_PSK = 4,
92561847f8eSopenharmony_ci
92661847f8eSopenharmony_ci    /**
92761847f8eSopenharmony_ci     * The type for the L2TP/IPsec RSA VPN network.
92861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
92961847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
93061847f8eSopenharmony_ci     * @since 12
93161847f8eSopenharmony_ci     */
93261847f8eSopenharmony_ci    L2TP_IPSEC_RSA = 5,
93361847f8eSopenharmony_ci
93461847f8eSopenharmony_ci    /**
93561847f8eSopenharmony_ci     * The type for the IPsec XAUTH PSK VPN network.
93661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
93761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
93861847f8eSopenharmony_ci     * @since 12
93961847f8eSopenharmony_ci     */
94061847f8eSopenharmony_ci    IPSEC_XAUTH_PSK = 6,
94161847f8eSopenharmony_ci
94261847f8eSopenharmony_ci    /**
94361847f8eSopenharmony_ci     * The type for the IPsec XAUTH RSA VPN network.
94461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
94561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
94661847f8eSopenharmony_ci     * @since 12
94761847f8eSopenharmony_ci     */
94861847f8eSopenharmony_ci    IPSEC_XAUTH_RSA = 7,
94961847f8eSopenharmony_ci
95061847f8eSopenharmony_ci    /**
95161847f8eSopenharmony_ci     * The type for the IPsec HYBRID RSA VPN network.
95261847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
95361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
95461847f8eSopenharmony_ci     * @since 12
95561847f8eSopenharmony_ci     */
95661847f8eSopenharmony_ci    IPSEC_HYBRID_RSA = 8,
95761847f8eSopenharmony_ci
95861847f8eSopenharmony_ci    /**
95961847f8eSopenharmony_ci     * The type for the OpenVpn network.
96061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.NetManager.Vpn
96161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
96261847f8eSopenharmony_ci     * @since 12
96361847f8eSopenharmony_ci     */
96461847f8eSopenharmony_ci    OPENVPN = 9
96561847f8eSopenharmony_ci  }
96661847f8eSopenharmony_ci}
96761847f8eSopenharmony_ciexport default vpn;
96861847f8eSopenharmony_ci 
969