1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.net.vpn.d.ts 32.43 KB
一键复制 编辑 原始数据 按行查看 历史
m30063213 提交于 2024-07-26 12:04 +08:00 . api lint 告警
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
/*
* 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;
/**
* 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;
/**
* 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>;
/**
* 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 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;
}
/**
* 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/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助