Documentation ¶
Index ¶
- Constants
- Variables
- func InetAtoN(ip string) int64
- func InetNtoA(ip int64) string
- func InetNtoI(ip int64) (b [4]int)
- func NewPasswordAuthData(username, password string) []byte
- func Protocol(payload []byte) (p *protocol)
- func RpcError(code int) error
- func Sha0Sum(p []byte) []byte
- type API
- func (a *API) Authenticate(hub string) (err error)
- func (a *API) CallMethod(method string, request Request) (res Response, err error)
- func (a *API) Connect() (err error)
- func (a *API) CreateGroup(hub, name, realname, note string) (Response, error)
- func (a *API) CreateHub(name string, online bool, hub_type int) (Response, error)
- func (a *API) CreateListener(port int, enable bool) (Response, error)
- func (a *API) CreateUser(hub, useranme, realname, note, password string) (Response, error)
- func (a *API) DeleteGroup(hub, name string) (Response, error)
- func (a *API) DeleteHub(name string) (Response, error)
- func (a *API) DeleteListener(port int) (Response, error)
- func (a *API) DeleteSession(hub, name string) (Response, error)
- func (a *API) DeleteUser(hub, name string) (Response, error)
- func (a *API) DisableSecureNat(name string) (Response, error)
- func (a *API) Disconnect()
- func (a *API) DisconnectConnection(cid string) (Response, error)
- func (a *API) EnableListener(port int, enable bool) (Response, error)
- func (a *API) EnableSecureNat(name string) (Response, error)
- func (a *API) GetConfig() (Response, error)
- func (a *API) GetConnection(cid string) (Response, error)
- func (a *API) GetCrl(name string, key int) (Response, error)
- func (a *API) GetDDnsClientStatus() (Response, error)
- func (a *API) GetDDnsHostName() (string, string, error)
- func (a *API) GetDDnsInternetSetting() (Response, error)
- func (a *API) GetGroup(hub, name string) (Response, error)
- func (a *API) GetHub(name string) (Response, error)
- func (a *API) GetHubAdminOptions(name string) (Response, error)
- func (a *API) GetHubStatus(name string) (Response, error)
- func (a *API) GetOpenVpnRemoteAccess() (string, error)
- func (a *API) GetOpenVpnSSTPConfig() (Response, error)
- func (a *API) GetSecureNatOption(hubname string) (Response, error)
- func (a *API) GetSecureNatStatus(name string) (Response, error)
- func (a *API) GetServerCert() (string, error)
- func (a *API) GetServerCipher() (Response, error)
- func (a *API) GetServerInfo() (Response, error)
- func (a *API) GetSession(hub, name string) (Response, error)
- func (a *API) GetUser(hub, name string) (Response, error)
- func (a *API) HandShake() error
- func (a *API) IPsecEnable() (Response, error)
- func (a *API) IPsecGet() (Response, error)
- func (a *API) IPsecSet(l2tp, l2tpraw, ehterip bool, psk string, hub string) (Response, error)
- func (a *API) ListConnection(hubname string) (Response, error)
- func (a *API) ListDhcp(hubname string) (Response, error)
- func (a *API) ListGroup(hub string) (Response, error)
- func (a *API) ListHub() (Response, error)
- func (a *API) ListListener() (map[int]bool, error)
- func (a *API) ListSessions(hub string) (Response, error)
- func (a *API) ListUser(hub string) (Response, error)
- func (a *API) MakeOpenVpnConfigFile() (Response, error)
- func (a *API) Request(method, target string, body []byte, headers http.Header) (res Response, err error)
- func (a *API) SetGroup(hub, name string) (Response, error)
- func (a *API) SetHub(name string, online bool, hub_type int) (Response, error)
- func (a *API) SetHubOnline(name string) (Response, error)
- func (a *API) SetOpenVpnSSTPConfig(enable_open_vpn, enable_sstp bool, open_vpn_port_list []int) (Response, error)
- func (a *API) SetSecureNatOption(hubname string, natoptions map[string]interface{}) (Response, error)
- func (a *API) SetServerPassword(password string) (Response, error)
- func (a *API) SetUserExpireTime(hub, name string, timestamp time.Time) (Response, error)
- func (a *API) SetUserPassword(hub, useranme, password string) (Response, error)
- func (a *API) SetUserPolicy(hub, name string, MaxUpload, MaxDownload int) (Response, error)
- func (a *API) SetUserUpdateTime(hub, name string, timestamp time.Time) (Response, error)
- func (a *API) Test() (Response, error)
- type APIConnect
- type ApiError
- type Connector
- type Request
- type Response
- type SHA0
Constants ¶
View Source
const ( AUTHTYPE_ANONYMOUS = iota // Anonymous authentication AUTHTYPE_PASSWORD // Password authentication AUTHTYPE_USERCERT // User certificate authentication AUTHTYPE_ROOTCERT // Root certificate which is issued by trusted Certificate Authority AUTHTYPE_RADIUS // Radius authentication AUTHTYPE_NT // Windows NT authentication AUTHTYPE_TICKET // Ticket authentication )
View Source
const ( HUB_TYPE_STANDALONE = 0 // Stand-alone HUB HUB_TYPE_FARM_STATIC = 1 // Static HUB HUB_TYPE_FARM_DYNAMIC = 2 // Dynamic HUB )
Type of HUB
View Source
const ( ERR_NO_ERROR = iota ERR_CONNECT_FAILED ERR_SERVER_IS_NOT_VPN ERR_DISCONNECTED ERR_PROTOCOL_ERROR ERR_CLIENT_IS_NOT_VPN ERR_USER_CANCEL ERR_AUTHTYPE_NOT_SUPPORTED ERR_HUB_NOT_FOUND ERR_AUTH_FAILED ERR_HUB_STOPPING ERR_SESSION_REMOVED ERR_ACCESS_DENIED ERR_SESSION_TIMEOUT ERR_INVALID_PROTOCOL ERR_TOO_MANY_CONNECTION ERR_HUB_IS_BUSY ERR_PROXY_CONNECT_FAILED ERR_PROXY_ERROR ERR_PROXY_AUTH_FAILED ERR_TOO_MANY_USER_SESSION ERR_LICENSE_ERROR ERR_DEVICE_DRIVER_ERROR ERR_INTERNAL_ERROR ERR_SECURE_DEVICE_OPEN_FAILED ERR_SECURE_PIN_LOGIN_FAILED ERR_SECURE_NO_CERT ERR_SECURE_NO_PRIVATE_KEY ERR_SECURE_CANT_WRITE ERR_OBJECT_NOT_FOUND ERR_VLAN_ALREADY_EXISTS ERR_VLAN_INSTALL_ERROR ERR_VLAN_INVALID_NAME ERR_NOT_SUPPORTED ERR_ACCOUNT_ALREADY_EXISTS ERR_ACCOUNT_ACTIVE ERR_ACCOUNT_NOT_FOUND ERR_ACCOUNT_INACTIVE ERR_INVALID_PARAMETER ERR_SECURE_DEVICE_ERROR ERR_NO_SECURE_DEVICE_SPECIFIED ERR_VLAN_IS_USED ERR_VLAN_FOR_ACCOUNT_NOT_FOUND ERR_VLAN_FOR_ACCOUNT_USED ERR_VLAN_FOR_ACCOUNT_DISABLED ERR_INVALID_VALUE ERR_NOT_FARM_CONTROLLER ERR_TRYING_TO_CONNECT ERR_CONNECT_TO_FARM_CONTROLLER ERR_COULD_NOT_HOST_HUB_ON_FARM ERR_FARM_MEMBER_HUB_ADMIN ERR_NULL_PASSWORD_LOCAL_ONLY ERR_NOT_ENOUGH_RIGHT ERR_LISTENER_NOT_FOUND ERR_LISTENER_ALREADY_EXISTS ERR_NOT_FARM_MEMBER ERR_CIPHER_NOT_SUPPORTED ERR_HUB_ALREADY_EXISTS ERR_TOO_MANY_HUBS ERR_LINK_ALREADY_EXISTS ERR_LINK_CANT_CREATE_ON_FARM ERR_LINK_IS_OFFLINE ERR_TOO_MANY_ACCESS_LIST ERR_TOO_MANY_USER ERR_TOO_MANY_GROUP ERR_GROUP_NOT_FOUND ERR_USER_ALREADY_EXISTS ERR_GROUP_ALREADY_EXISTS ERR_USER_AUTHTYPE_NOT_PASSWORD ERR_OLD_PASSWORD_WRONG ERR_LINK_CANT_DISCONNECT ERR_ACCOUNT_NOT_PRESENT ERR_ALREADY_ONLINE ERR_OFFLINE ERR_NOT_RSA_1024 ERR_SNAT_CANT_DISCONNECT ERR_SNAT_NEED_STANDALONE ERR_SNAT_NOT_RUNNING ERR_SE_VPN_BLOCK ERR_BRIDGE_CANT_DISCONNECT ERR_LOCAL_BRIDGE_STOPPING ERR_LOCAL_BRIDGE_UNSUPPORTED ERR_CERT_NOT_TRUSTED ERR_PRODUCT_CODE_INVALID ERR_VERSION_INVALID ERR_CAPTURE_DEVICE_ADD_ERROR ERR_VPN_CODE_INVALID ERR_CAPTURE_NOT_FOUND ERR_LAYER3_CANT_DISCONNECT ERR_LAYER3_SW_EXISTS ERR_LAYER3_SW_NOT_FOUND ERR_INVALID_NAME ERR_LAYER3_IF_ADD_FAILED ERR_LAYER3_IF_DEL_FAILED ERR_LAYER3_IF_EXISTS ERR_LAYER3_TABLE_ADD_FAILED ERR_LAYER3_TABLE_DEL_FAILED ERR_LAYER3_TABLE_EXISTS ERR_BAD_CLOCK ERR_LAYER3_CANT_START_SWITCH ERR_CLIENT_LICENSE_NOT_ENOUGH ERR_BRIDGE_LICENSE_NOT_ENOUGH ERR_SERVER_CANT_ACCEPT ERR_SERVER_CERT_EXPIRES ERR_MONITOR_MODE_DENIED ERR_BRIDGE_MODE_DENIED ERR_IP_ADDRESS_DENIED ERR_TOO_MANT_ITEMS ERR_MEMORY_NOT_ENOUGH ERR_OBJECT_EXISTS ERR_FATAL ERR_SERVER_LICENSE_FAILED ERR_SERVER_INTERNET_FAILED ERR_CLIENT_LICENSE_FAILED ERR_BAD_COMMAND_OR_PARAM ERR_INVALID_LICENSE_KEY ERR_NO_VPN_SERVER_LICENSE ERR_NO_VPN_CLUSTER_LICENSE ERR_NOT_ADMINPACK_SERVER ERR_NOT_ADMINPACK_SERVER_NET ERR_BETA_EXPIRES ERR_BRANDED_C_TO_S ERR_BRANDED_C_FROM_S ERR_AUTO_DISCONNECTED ERR_CLIENT_ID_REQUIRED ERR_TOO_MANY_USERS_CREATED ERR_SUBSCRIPTION_IS_OLDER ERR_ILLEGAL_TRIAL_VERSION ERR_NAT_T_TWO_OR_MORE ERR_DUPLICATE_DDNS_KEY ERR_DDNS_HOSTNAME_EXISTS ERR_DDNS_HOSTNAME_INVALID_CHAR ERR_DDNS_HOSTNAME_TOO_LONG ERR_DDNS_HOSTNAME_IS_EMPTY ERR_DDNS_HOSTNAME_TOO_SHORT ERR_MSCHAP2_PASSWORD_NEED_RESET ERR_DDNS_DISCONNECTED ERR_SPECIAL_LISTENER_ICMP_ERROR ERR_SPECIAL_LISTENER_DNS_ERROR ERR_OPENVPN_IS_NOT_ENABLED ERR_NOT_SUPPORTED_AUTH_ON_OPENSOURCE ERR_VPNGATE ERR_VPNGATE_CLIENT ERR_VPNGATE_INCLIENT_CANT_STOP ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE ERR_SUSPENDING )
Error Code
Variables ¶
View Source
var DefaultCallMethodTimeout = time.Second * 20
View Source
var ErrorNo = _ErrorNo{}/* 146 elements not displayed */
Functions ¶
func NewPasswordAuthData ¶
Types ¶
type API ¶
type API struct { Host string Port int Password string Conn Connector ConnectResponse map[string]interface{} // contains filtered or unexported fields }
func (*API) Authenticate ¶
func (*API) CallMethod ¶
func (*API) CreateGroup ¶
Group Operation
func (*API) CreateListener ¶
Listener Operation
func (*API) CreateUser ¶
User Operation
func (*API) Disconnect ¶
func (a *API) Disconnect()
func (*API) EnableSecureNat ¶
SecureNat Operation
func (*API) GetDDnsClientStatus ¶
func (*API) GetDDnsInternetSetting ¶
DynamicDnsOperation
func (*API) GetOpenVpnRemoteAccess ¶
func (*API) GetOpenVpnSSTPConfig ¶
func (*API) GetServerCert ¶
func (*API) GetServerInfo ¶
func (*API) ListConnection ¶
Connection Operation
func (*API) ListSessions ¶
Session Operation
func (*API) MakeOpenVpnConfigFile ¶
func (*API) SetOpenVpnSSTPConfig ¶
func (a *API) SetOpenVpnSSTPConfig(enable_open_vpn, enable_sstp bool, open_vpn_port_list []int) (Response, error)
OpenVPN Operation
func (*API) SetSecureNatOption ¶
func (*API) SetServerPassword ¶
Server Operation
func (*API) SetUserExpireTime ¶
func (*API) SetUserPassword ¶
func (*API) SetUserPolicy ¶
func (*API) SetUserUpdateTime ¶
type APIConnect ¶
func (*APIConnect) Close ¶
func (c *APIConnect) Close() error
func (*APIConnect) Connect ¶
func (c *APIConnect) Connect() error
func (*APIConnect) GetSock ¶
func (c *APIConnect) GetSock() net.Conn
func (*APIConnect) Send ¶
func (c *APIConnect) Send(buf []byte) error
Click to show internal directories.
Click to hide internal directories.