cable

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

© 2021 Red Hat, Inc. and others

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDriver

func AddDriver(name string, driverCreate DriverCreateFunc)

Adds a supported driver, prints a fatal error in the case of double registration

func GetDefaultCableDriver

func GetDefaultCableDriver() string

Returns the default cable driver name

func RecordConnection added in v0.8.0

func RecordConnection(cableDriverName string, localEndpoint, remoteEndpoint *submv1.EndpointSpec, status string, isNew bool)

func RecordConnectionLatency added in v0.8.0

func RecordConnectionLatency(cableDriverName string, localEndpoint, remoteEndpoint *submv1.EndpointSpec, latencySeconds float64)

func RecordDisconnected added in v0.8.0

func RecordDisconnected(cableDriverName string, localEndpoint, remoteEndpoint *submv1.EndpointSpec)

func RecordNoConnections added in v0.8.0

func RecordNoConnections()

func RecordRxBytes added in v0.8.0

func RecordRxBytes(cableDriverName string, localEndpoint, remoteEndpoint *submv1.EndpointSpec, bytes int)

func RecordTxBytes added in v0.8.0

func RecordTxBytes(cableDriverName string, localEndpoint, remoteEndpoint *submv1.EndpointSpec, bytes int)

func SetDefaultCableDriver added in v0.3.0

func SetDefaultCableDriver(driver string)

Sets the default cable driver name, if it is not specified by user.

Types

type Driver

type Driver interface {

	// Init initializes the driver with any state it needs.
	Init() error

	// GetActiveConnections returns an array of all the active connections.
	GetActiveConnections() ([]v1.Connection, error)

	// GetConnections() returns an array of the existing connections, including status and endpoint info
	GetConnections() ([]v1.Connection, error)

	// ConnectToEndpoint establishes a connection to the given endpoint and returns a string
	// representation of the IP address of the target endpoint.
	ConnectToEndpoint(endpointInfo *natdiscovery.NATEndpointInfo) (string, error)

	// DisconnectFromEndpoint disconnects from the connection to the given endpoint.
	DisconnectFromEndpoint(endpoint types.SubmarinerEndpoint) error

	// GetName returns driver's name
	GetName() string
}

Driver is used by the ipsec engine to actually connect the tunnels.

func NewDriver

func NewDriver(localEndpoint types.SubmarinerEndpoint, localCluster types.SubmarinerCluster) (Driver, error)

Returns a new driver according the required Backend

type DriverCreateFunc

type DriverCreateFunc func(localEndpoint types.SubmarinerEndpoint, localCluster types.SubmarinerCluster) (Driver, error)

Function prototype to create a new driver

Directories

Path Synopsis
© 2021 Red Hat, Inc.
© 2021 Red Hat, Inc.
© 2021 Red Hat, Inc.
© 2021 Red Hat, Inc.
© 2021 Red Hat, Inc.
© 2021 Red Hat, Inc.
© 2021 Red Hat, Inc.
© 2021 Red Hat, Inc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL