Documentation ¶
Overview ¶
Package openvpn contains a generic openvpn experiment.
Index ¶
- Variables
- func NewExperimentMeasurer() model.ExperimentMeasurer
- func NewLoader(loader *targetloading.Loader, gopts any) model.ExperimentTargetLoader
- func TimestampsFromHandshake(events []*vpntracex.Event) (float64, float64, float64)
- type AuthMethod
- type Config
- type Measurer
- type SingleConnection
- type Target
- type TestKeys
Constants ¶
This section is empty.
Variables ¶
var ( ErrInputRequired = targetloading.ErrInputRequired ErrInvalidInput = targetloading.ErrInvalidInput )
var ( // AuthCertificate is used for providers that authenticate clients via certificates. AuthCertificate = AuthMethod("cert") // AuthUserPass is used for providers that authenticate clients via username (or token) and password. AuthUserPass = AuthMethod("userpass") )
var APIEnabledProviders = []string{
"riseupvpn",
"oonivpn",
}
APIEnabledProviders is the list of providers that the stable API Endpoint and/or this experiment knows about.
var (
ErrInvalidInputType = targetloading.ErrInvalidInputType
)
Functions ¶
func NewExperimentMeasurer ¶
func NewExperimentMeasurer() model.ExperimentMeasurer
NewExperimentMeasurer creates a new ExperimentMeasurer.
func NewLoader ¶
func NewLoader(loader *targetloading.Loader, gopts any) model.ExperimentTargetLoader
NewLoader constructs a new model.ExperimentTargerLoader instance.
This function PANICS if options is not an instance of *openvpn.Config.
Types ¶
type AuthMethod ¶
type AuthMethod string
AuthMethod is the authentication method used by a provider.
type Config ¶
type Config struct { Auth string `ooni:"OpenVPN authentication to use"` Cipher string `ooni:"OpenVPN cipher to use"` Compress string `ooni:"OpenVPN compression to use"` Provider string `ooni:"VPN provider"` Obfuscation string `ooni:"Obfuscation to use (obfs4, none)"` SafeKey string `ooni:"key to connect to the OpenVPN endpoint"` SafeCert string `ooni:"cert to connect to the OpenVPN endpoint"` SafeCA string `ooni:"ca to connect to the OpenVPN endpoint"` }
Config contains the experiment config.
This contains all the settings that user can set to modify the behaviour of this experiment. By tagging these variables with `ooni:"..."`, we allow miniooni's -O flag to find them and set them. TODO(ainghazal): do pass Auth, Cipher and Compress to OpenVPN config options.
type Measurer ¶
type Measurer struct{}
Measurer performs the measurement.
func (*Measurer) ExperimentName ¶
ExperimentName implements model.ExperimentMeasurer.ExperimentName.
func (*Measurer) ExperimentVersion ¶
ExperimentVersion implements model.ExperimentMeasurer.ExperimentVersion.
type SingleConnection ¶
type SingleConnection struct { BootstrapTime float64 TCPConnect *model.ArchivalTCPConnectResult `json:"tcp_connect,omitempty"` OpenVPNHandshake *model.ArchivalOpenVPNHandshakeResult `json:"openvpn_handshake"` NetworkEvents []*vpntracex.Event `json:"network_events"` }
SingleConnection contains the results of a single handshake.
type Target ¶
type Target struct { // Config contains the configuration. Config *Config // URL is the input URL. URL string }
Target is a richer-input target that this experiment should measure.
func (*Target) Category ¶
Category implements model.ExperimentTarget.
func (*Target) Country ¶
Country implements model.ExperimentTarget.
func (*Target) Options ¶
Options implements model.ExperimentTarget.
type TestKeys ¶
type TestKeys struct { Success bool `json:"success"` NetworkEvents []*vpntracex.Event `json:"network_events"` TCPConnect []*model.ArchivalTCPConnectResult `json:"tcp_connect,omitempty"` OpenVPNHandshake []*model.ArchivalOpenVPNHandshakeResult `json:"openvpn_handshake"` BootstrapTime float64 `json:"bootstrap_time"` Tunnel string `json:"tunnel"` Failure *string `json:"failure"` }
TestKeys contains the experiment's result.
func (*TestKeys) AddConnectionTestKeys ¶
func (tk *TestKeys) AddConnectionTestKeys(result *SingleConnection)
AddConnectionTestKeys adds the result of a single OpenVPN connection attempt to the corresponding array in the TestKeys object.
func (*TestKeys) AllConnectionsSuccessful ¶
AllConnectionsSuccessful returns true if all the registered handshakes have nil failures.