当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
46 Star 180 Fork 4.8K

OpenHarmony/interface_sdk-js
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.net.vpn.d.ts 35.51 KB
一键复制 编辑 原始数据 按行查看 历史
Mr_chao 提交于 25天前 . 新增vpn 和 vpnext 接口
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit NetworkKit
*/
import type { AsyncCallback, Callback } from './@ohos.base';
import type connection from './@ohos.net.connection';
import type _AbilityContext from './application/UIAbilityContext';
/**
* Provides VPN related interfaces.
* @namespace vpn
* @syscap SystemCapability.Communication.NetManager.Vpn
* @since 10
*/
declare namespace vpn {
/**
* Get network link information.
* @typedef { connection.LinkAddress }
* @syscap SystemCapability.Communication.NetManager.Core
* @since 10
*/
export type LinkAddress = connection.LinkAddress;
/**
* Get network route information.
* @typedef { connection.RouteInfo }
* @syscap SystemCapability.Communication.NetManager.Core
* @since 10
*/
export type RouteInfo = connection.RouteInfo;
/**
* The context of an ability. It allows access to ability-specific resources.
* @typedef _AbilityContext
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 10
*/
export type AbilityContext = _AbilityContext;
/**
* Create a VPN connection using the AbilityContext.
* @param { AbilityContext } context - Indicates the context of application or capability.
* @returns { VpnConnection } the VpnConnection of the construct VpnConnection instance.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
function createVpnConnection(context: AbilityContext): VpnConnection;
/**
* Subscribes to vpn connect state changes.
* @permission ohos.permission.MANAGE_VPN
* @param { 'connect' } type - Indicates vpn connect state changes.
* @param { Callback<VpnConnectState> } callback - The callback of the vpn connect state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
function on(type: 'connect', callback: Callback<VpnConnectState>): void;
/**
* Subscribes to vpn connect state changes.
* @permission ohos.permission.MANAGE_VPN
* @param { 'connectMulti' } type - Indicates multi vpn connect state changes.
* @param { Callback<MultiVpnConnectState> } callback - The callback of the multi vpn connect state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 19900001 - Invalid parameter value.
* @throws { BusinessError } 19900002 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 20
*/
function on(type: 'connectMulti', callback: Callback<MultiVpnConnectState>): void;
/**
* Unsubscribes from vpn connect state changes.
* @permission ohos.permission.MANAGE_VPN
* @param { 'connect' } type - Indicates vpn connect state changes.
* @param { Callback<VpnConnectState> } callback - The callback of the vpn connect state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
function off(type: 'connect', callback?: Callback<VpnConnectState>): void;
/**
* Unsubscribes from vpn connect state changes.
* @permission ohos.permission.MANAGE_VPN
* @param { 'connectMulti' } type - Indicates multi vpn connect state changes.
* @param { Callback<MultiVpnConnectState> } [callback] - The callback of the multi vpn connect state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 19900001 - Invalid parameter value.
* @throws { BusinessError } 19900002 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 20
*/
function off(type: 'connectMulti', callback?: Callback<MultiVpnConnectState>): void;
/**
* Add a system VPN network configuration.
* @permission ohos.permission.MANAGE_VPN
* @param { SysVpnConfig } config - Indicates the {@link SysVpnConfig} configuration of the VPN network.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
function addSysVpnConfig(config: SysVpnConfig): Promise<void>;
/**
* Delete the configuration of system VPN network by the specified vpnId.
* @permission ohos.permission.MANAGE_VPN
* @param { string } vpnId - Indicates the uuid of the VPN network configuration.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
function deleteSysVpnConfig(vpnId: string): Promise<void>;
/**
* Get all system VPN network configuration.
* @permission ohos.permission.MANAGE_VPN
* @returns { Promise<Array<SysVpnConfig>> } The promise returned by the all VPN network configuration.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
function getSysVpnConfigList(): Promise<Array<SysVpnConfig>>;
/**
* Get the configuration of system VPN network by the specified vpnId.
* @permission ohos.permission.MANAGE_VPN
* @param { string } vpnId - Indicates the uuid of the VPN network.
* @returns { Promise<SysVpnConfig> } The promise returned by the VPN network configuration.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
function getSysVpnConfig(vpnId: string): Promise<SysVpnConfig>;
/**
* Get the connected VPN network configuration.
* @permission ohos.permission.MANAGE_VPN
* @returns { Promise<SysVpnConfig> } The promise returned by the connected VPN network configuration.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
function getConnectedSysVpnConfig(): Promise<SysVpnConfig>;
/**
* Get the connected VPN App Info.
* @permission ohos.permission.MANAGE_VPN
* @returns { Promise<Array<string>> } The promise returned by the connected VPN App Info.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 19900001 - Invalid parameter value.
* @throws { BusinessError } 19900002 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 20
*/
function getConnectedVpnAppInfo(): Promise<Array<string>>;
/**
* Defines a VPN connection.
* @interface VpnConnection
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
export interface VpnConnection {
/**
* Create a VPN network using the VpnConfig.
* @permission ohos.permission.MANAGE_VPN
* @param { VpnConfig } config - Indicates the {@link VpnConfig} configuration of the VPN network.
* @param { AsyncCallback<number> } callback - The callback is used to return file descriptor of VPN interface.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @throws { BusinessError } 2203001 - VPN creation denied. Check the user type.
* @throws { BusinessError } 2203002 - VPN already exists.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
setUp(config: VpnConfig, callback: AsyncCallback<number>): void;
/**
* Create a VPN network using the VpnConfig.
* @permission ohos.permission.MANAGE_VPN
* @param { VpnConfig } config - Indicates the {@link VpnConfig} configuration of the VPN network.
* @returns { Promise<number> } The promise returns file descriptor of VPN interface.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @throws { BusinessError } 2203001 - VPN creation denied. Check the user type.
* @throws { BusinessError } 2203002 - VPN already exists.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
setUp(config: VpnConfig): Promise<number>;
/**
* Protect a socket from VPN connections. After protecting, data sent through this socket will go directly to the
* underlying network so its traffic will not be forwarded through the VPN.
* @permission ohos.permission.MANAGE_VPN
* @param { number } socketFd - File descriptor of socket, this socket from @ohos.net.socket.
* @param { AsyncCallback<void> } callback - The callback of protect.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @throws { BusinessError } 2203004 - Invalid socket file descriptor.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
protect(socketFd: number, callback: AsyncCallback<void>): void;
/**
* Protect a socket from VPN connections. After protecting, data sent through this socket will go directly to the
* underlying network so its traffic will not be forwarded through the VPN.
* @permission ohos.permission.MANAGE_VPN
* @param { number } socketFd - File descriptor of socket, this socket from @ohos.net.socket.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200001 - Invalid parameter value.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @throws { BusinessError } 2203004 - Invalid socket file descriptor.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
protect(socketFd: number): Promise<void>;
/**
* Destroy the VPN network.
* @permission ohos.permission.MANAGE_VPN
* @param { AsyncCallback<void> } callback - The callback of destroy.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
destroy(callback: AsyncCallback<void>): void;
/**
* Destroy the VPN network.
* @permission ohos.permission.MANAGE_VPN
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2200003 - System internal error.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
destroy(): Promise<void>;
}
/**
* Define configuration of the VPN network.
* @typedef VpnConfig
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
export interface VpnConfig {
/**
* The uuid for the VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 20
*/
vpnId?: string;
/**
* The array of addresses for VPN interface.
* @type {Array<LinkAddress>}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
addresses: Array<LinkAddress>;
/**
* The array of routes for VPN interface.
* @type {?Array<RouteInfo>}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
routes?: Array<RouteInfo>;
/**
* The array of DNS servers for the VPN network.
* @type {?Array<string>}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
dnsAddresses?: Array<string>;
/**
* The array of search domains for the DNS resolver.
* @type {?Array<string>}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
searchDomains?: Array<string>;
/**
* The maximum transmission unit (MTU) for the VPN interface.
* @type {?number}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
mtu?: number;
/**
* Whether ipv4 is supported. The default value is true.
* @type {?boolean}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
isIPv4Accepted?: boolean;
/**
* Whether ipv6 is supported. The default value is false.
* @type {?boolean}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
isIPv6Accepted?: boolean;
/**
* Whether to use the built-in VPN. The default value is false.
* @type {?boolean}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
isLegacy?: boolean;
/**
* Whether the VPN interface's file descriptor is in blocking/non-blocking mode. The default value is false.
* @type {?boolean}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
isBlocking?: boolean;
/**
* The array of trustlist for the VPN network. The string indicates package name.
* @type {?Array<string>}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
trustedApplications?: Array<string>;
/**
* The array of blocklist for the VPN network. The string indicates package name.
* @type {?Array<string>}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 10
*/
blockedApplications?: Array<string>;
}
/**
* Define configuration of the system VPN network.
* @typedef SysVpnConfig
* @extends VpnConfig
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
export interface SysVpnConfig extends VpnConfig {
/**
* The uuid for the VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
vpnId?: string;
/**
* The name for the VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
vpnName?: string;
/**
* The type for the VPN network.
* @type {?SysVpnType}
* See {@link SysVpnType}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
vpnType?: SysVpnType;
/**
* The user name for the VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
userName?: string;
/**
* The user password for the VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
password?: string;
/**
* Whether the VPN network save login name and password. The default value is false.
* @type {?boolean}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
saveLogin?: boolean;
/**
* The system user id for the VPN network.
* @type {?number}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
userId?: number;
/**
* The forwarding routes for the VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
forwardingRoutes?: string;
/**
* The array of addresses for remote server.
* @type {?Array<string>}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 20
*/
remoteAddresses?: Array<string>;
/**
* The p12 cert password for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 20
*/
pkcs12Password?: string;
/**
* The p12 cert data for the ipsec VPN network.
* @type {?Uint8Array}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 20
*/
pkcs12FileData?: Uint8Array;
}
/**
* Define configuration of the open VPN network.
* @typedef OpenVpnConfig
* @extends SysVpnConfig
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
export interface OpenVpnConfig extends SysVpnConfig {
/**
* The port for the openvpn VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnPort?: string;
/**
* The protocol for the openvpn VPN network.
* @type {?number}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnProtocol?: number;
/**
* The config for the openvpn VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnConfig?: string;
/**
* The auth type for the openvpn VPN network.
* @type {?number}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnAuthType?: number;
/**
* The ask pass for the openvpn VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
askpass?: string;
/**
* The config file path for the openvpn VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnConfigFilePath?: string;
/**
* The ca cert file path for the openvpn VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnCaCertFilePath?: string;
/**
* The user cert file path for the openvpn VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnUserCertFilePath?: string;
/**
* The private key file path for the openvpn VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ovpnPrivateKeyFilePath?: string;
}
/**
* Define configuration of the ipsec VPN network.
* @typedef IpsecVpnConfig
* @extends SysVpnConfig
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
export interface IpsecVpnConfig extends SysVpnConfig {
/**
* The pre share key for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPreSharedKey?: string;
/**
* The identifier for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecIdentifier?: string;
/**
* The swanctl config for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
swanctlConfig?: string;
/**
* The strongSwan config for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
strongSwanConfig?: string;
/**
* The ca cert config for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecCaCertConfig?: string;
/**
* The private user cert config for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateUserCertConfig?: string;
/**
* The public user cert config for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicUserCertConfig?: string;
/**
* The private server cert config for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateServerCertConfig?: string;
/**
* The public server cert config for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicServerCertConfig?: string;
/**
* The ca cert file path for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecCaCertFilePath?: string;
/**
* The private user cert file path for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateUserCertFilePath?: string;
/**
* The public user cert file path for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicUserCertFilePath?: string;
/**
* The private server cert file path for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateServerCertFilePath?: string;
/**
* The public server cert file path for the ipsec VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicServerCertFilePath?: string;
}
/**
* Define configuration of the l2tp VPN network.
* @typedef L2tpVpnConfig
* @extends SysVpnConfig
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
export interface L2tpVpnConfig extends SysVpnConfig {
/**
* The pre share key for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPreSharedKey?: string;
/**
* The identifier for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecIdentifier?: string;
/**
* The strongSwan config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
strongSwanConfig?: string;
/**
* The ca cert config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecCaCertConfig?: string;
/**
* The private user cert config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateUserCertConfig?: string;
/**
* The public user cert config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicUserCertConfig?: string;
/**
* The private server cert config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateServerCertConfig?: string;
/**
* The public server cert config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicServerCertConfig?: string;
/**
* The ca cert file path for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecCaCertFilePath?: string;
/**
* The private user cert file path for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateUserCertFilePath?: string;
/**
* The public user cert file path for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicUserCertFilePath?: string;
/**
* The private server cert file path for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPrivateServerCertFilePath?: string;
/**
* The public server cert file path for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecPublicServerCertFilePath?: string;
/**
* The config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecConfig?: string;
/**
* The secrets for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
ipsecSecrets?: string;
/**
* The client options for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
optionsL2tpdClient?: string;
/**
* The xl2tpd config for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
xl2tpdConfig?: string;
/**
* The shared key for the l2tp VPN network.
* @type {?string}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
l2tpSharedKey?: string;
}
/**
* Defines the type for the VPN network.
* @enum {number}
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
export enum SysVpnType {
/**
* The type for the IKEv2/IPsec MSCHAPv2 VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
IKEV2_IPSEC_MSCHAPV2 = 1,
/**
* The type for the IKEv2/IPsec PSK VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
IKEV2_IPSEC_PSK = 2,
/**
* The type for the IKEv2/IPsec RSA VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
IKEV2_IPSEC_RSA = 3,
/**
* The type for the L2TP/IPsec PSK VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
L2TP_IPSEC_PSK = 4,
/**
* The type for the L2TP/IPsec RSA VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
L2TP_IPSEC_RSA = 5,
/**
* The type for the IPsec XAUTH PSK VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
IPSEC_XAUTH_PSK = 6,
/**
* The type for the IPsec XAUTH RSA VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
IPSEC_XAUTH_RSA = 7,
/**
* The type for the IPsec HYBRID RSA VPN network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
IPSEC_HYBRID_RSA = 8,
/**
* The type for the OpenVpn network.
* @syscap SystemCapability.Communication.NetManager.Vpn
* @systemapi Hide this for inner system use.
* @since 12
*/
OPENVPN = 9
}
}
export default vpn;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助