gre_probe

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyGREProbe

type DummyGREProbe struct{}

func (*DummyGREProbe) GetStatus

func (d *DummyGREProbe) GetStatus() *GREProbeStatus

func (*DummyGREProbe) Start

func (d *DummyGREProbe) Start() error

type GREEndpointStatus

type GREEndpointStatus uint
const (
	EndpointReachable   GREEndpointStatus = 0
	EndpointUnreachable GREEndpointStatus = 1
)

type GREProbe

type GREProbe interface {
	// Start begins the probe of the GRE endpoint(s).
	Start() error

	// Stop stops the probe of the GRE endpoint(s).
	Stop()

	// GetStatus fetches the status of the GRE probe. The GREProbeStatus
	// returned contains slices of reachable and unreachable endpoint IPs.
	GetStatus() *GREProbeStatus
}

GREProbe defines an interface to begin a probe of GRE endpoints and fetch that status at a later point.

type GREProbeStatus

type GREProbeStatus struct {
	Reachable   []string
	Unreachable []string
}

type ICMPProbe

type ICMPProbe struct {
	Endpoints []*mconfig.CwfGatewayHealthConfigGrePeer
	Interval  time.Duration
	PktCount  int

	sync.RWMutex // R/W lock synchronizing map endpoint status access
	// contains filtered or unexported fields
}

ICMPProbe implements the GRE probe interface using ICMP over GRE.

func NewICMPProbe

func NewICMPProbe(endpoints []*mconfig.CwfGatewayHealthConfigGrePeer, interval uint32, pktCount int) *ICMPProbe

NewICMPProbe create a new ICMPProbe with the provided endpoints and probe interval.

func (*ICMPProbe) GetStatus

func (i *ICMPProbe) GetStatus() *GREProbeStatus

GetStatus returns the current GREEndpointStatus of each endpoint.

func (*ICMPProbe) Start

func (i *ICMPProbe) Start() error

Start begins the ICMP probes of the ICMPProbe's endpoints.

func (*ICMPProbe) Stop

func (i *ICMPProbe) Stop()

Stop stops the ICMP probes of the ICMPProbe's endpoints

Jump to

Keyboard shortcuts

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