001/*
002 * ===========================================================================================
003 * = COPYRIGHT
004 *          PAX Computer Technology (Shenzhen) Co., Ltd. PROPRIETARY INFORMATION
005 *   This software is supplied under the terms of a license agreement or nondisclosure
006 *   agreement with PAX Computer Technology (Shenzhen) Co., Ltd. and may not be copied or
007 *   disclosed except in accordance with the terms in that agreement.
008 *     Copyright (C) 2017-2023 PAX Computer Technology (Shenzhen) Co., Ltd. All rights reserved.
009 * Description: // Detail description about the function of this module,
010 *             // interfaces with the other modules, and dependencies.
011 * Revision History:
012 * Date                         Author                        Action
013 * 2017/04/01                   PAX                     Create/Add/Modify/Delete
014 * ===========================================================================================
015 */
016package com.pax.dal;
017
018public interface IPaxVpn {
019    /**
020     * <div class="zh">连接PPTP类型的VPN。</div> <div class="en">Connect to the PPTP type VPN.</div>
021     * 
022     * @param ip <div class="zh">服务器IP地址。</div> <div class="en">Server IP address.</div>
023     * 
024     * @param userName <div class="zh">用户名。</div> <div class="en">User name.</div>
025     * 
026     * @param password <div class="zh">密码。</div> <div class="en">Password.</div>
027     * 
028     * @param mppe <div class="zh">是否使用mppe加密。</div> <div class="en">Whether to use mppe encryption.</div>
029     * 
030     * @return <div class="zh">执行结果。
031     * <ul>
032     * <li>-1:连接错误。</li>
033     * <li>0:执行成功。(使用 {@link IPaxVpn #getVpnStatus()}来获取VPN连接状态。)</li>
034     * </ul>
035     * </div> <div class="en">result of execution.
036     * <ul>
037     * <li>-1:Connect error.</li>
038     * <li>0:Execution successful.(Use {@link IPaxVpn #getVpnStatus()} to get the VPN connection status.)</li>
039     * </ul>
040     * </div>
041     * @since V3.20.00
042     */
043    int connectPPTP(String ip, String userName, String password, boolean mppe);
044    
045    /**
046     * <div class="zh">连接VPN。</div> <div class="en">Connect to the VPN.</div>
047     * 
048     * @param ip <div class="zh">服务器IP地址。</div> <div class="en">Server IP address.</div>
049     * 
050     * @param userName <div class="zh">用户名。</div> <div class="en">User name.</div>
051     * 
052     * @param password <div class="zh">密码。</div> <div class="en">Password.</div>
053     * 
054     * @param type <div class="zh">连接类型。
055     * <ul>
056     * <li>0:TYPE_PPTP.</li>
057     * <li>1:TYPE_L2TP_IPSEC_PSK.</li>
058     * <li>2:TYPE_L2TP_IPSEC_RSA.</li>
059     * <li>3:TYPE_IPSEC_XAUTH_PSK.</li>
060     * <li>4:TYPE_IPSEC_XAUTH_RSA.</li>
061     * <li>5:TYPE_IPSEC_HYBRID_RSA.</li>
062     * </ul>
063     * </div> <div class="en">Connection type.
064     * <ul>
065     * <li>0:TYPE_PPTP.</li>
066     * <li>1:TYPE_L2TP_IPSEC_PSK.</li>
067     * <li>2:TYPE_L2TP_IPSEC_RSA.</li>
068     * <li>3:TYPE_IPSEC_XAUTH_PSK.</li>
069     * <li>4:TYPE_IPSEC_XAUTH_RSA.</li>
070     * <li>5:TYPE_IPSEC_HYBRID_RSA.</li>
071     * </ul>
072     * </div>
073     * 
074     * @return <div class="zh">执行结果。
075     * <ul>
076     * <li>-1:连接错误。</li>
077     * <li>0:执行成功。(使用 {@link IPaxVpn #getVpnStatus()}来获取VPN连接状态。)</li>
078     * </ul>
079     * </div> <div class="en">result of execution.
080     * <ul>
081     * <li>-1:Connect error.</li>
082     * <li>0:Execution successful.(Use {@link IPaxVpn #getVpnStatus()} to get the VPN connection status.)</li>
083     * </ul>
084     * </div>
085     * @since V3.20.00
086     */
087    int connectVpn(String ip, String userName, String password, int type);
088    
089    /**
090     * <div class="zh">获取当前VPN连接的状态。</div> <div class="en">Gets the status of the current VPN connection.</div>
091     * 
092     * @return <div class="zh">VPN连接的状态。
093     * <ul>
094     * <li>-1:获取状态出错。</li>
095     * <li>0:已断开。</li>
096     * <li>1:正在初始化。</li>
097     * <li>2:连接中。</li>
098     * <li>3:已连接。</li>
099     * <li>4:执行超时。</li>
100     * <li>5:执行失败。</li>
101     * </ul>
102     * </div> <div class="en">Status of the VPN connection.
103     * <ul>
104     * <li>-1:Error obtaining state.</li>
105     * <li>0:Disconnected.</li>
106     * <li>1:Initializing.</li>
107     * <li>2:Connecting.</li>
108     * <li>3:Connected.</li>
109     * <li>4:Timeouts.</li>
110     * <li>5:Exec failure.</li>
111     * </ul>
112     * </div>
113     * @since V3.20.00
114     */
115    int getVpnStatus();
116    
117    /**
118     * <div class="zh">断开VPN的连接。</div> <div class="en">Disconnect the VPN.</div>
119     * 
120     * @return <div class="zh">执行结果。
121     * <ul>
122     * <li>-1:断开错误。</li>
123     * <li>0:执行成功。(使用 {@link IPaxVpn #getVpnStatus()}来获取VPN连接状态。)</li>
124     * </ul>
125     * </div> <div class="en">result of execution.
126     * <ul>
127     * <li>-1:Disconnect error.</li>
128     * <li>0:Execution successful.(Use {@link IPaxVpn #getVpnStatus()} to get the VPN connection status.)</li>
129     * </ul>
130     * </div>
131     * @since V3.20.00
132     */
133    int disconnectVpn();
134    
135}