keepalive

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package keepalive implements tasks and handlers related IFID keepalives.

Handler

Call NewHandler to create an IFID keepalive handler that implements infra.Handler. The handler validates the keepalive and activates the interface it was received on. In case the interface changed its state to active, the handler immediately pushes in IfStateInfo update to all border routers and starts beaconing on the activated interface.

Sender

The sender periodically creates keepalive messages for all links.

Index

Constants

View Source
const (
	// BeaconTimeout is the timeout for beaconing on an activated interface.
	BeaconTimeout = time.Second
	// IfStatePushTimeout is the timeout for pushing interface state info.
	IfStatePushTimeout = time.Second
	// DropRevTimeout is the timeout for dropping revocations.
	DropRevTimeout = time.Second
)

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(ia addr.IA, intfs *ifstate.Interfaces, tasks StateChangeTasks) infra.Handler

NewHandler returns an infra.Handler for IFID keepalive messages. The state change tasks must all be set. Nil tasks will cause the handler to panic.

Types

type IfStatePusher

type IfStatePusher interface {
	Push(ctx context.Context, ifid common.IFIDType)
}

IfStatePusher is used to push interface state changes to the border routers when an interface changes its state to active.

type RevDropper

type RevDropper interface {
	DeleteRevocation(ctx context.Context, ia addr.IA, ifid common.IFIDType) error
}

RevDropper is used to drop revocations from the beacon store for interfaces that change their state to active.

type Sender

type Sender struct {
	*onehop.Sender
	Signer       infra.Signer
	TopoProvider itopo.ProviderI
}

Sender sends ifid keepalive messages on all border routers.

func (*Sender) Name

func (s *Sender) Name() string

Name returns the tasks name.

func (*Sender) Run

func (s *Sender) Run(ctx context.Context)

Run sends ifid keepalive messages on all border routers.

type StateChangeTasks

type StateChangeTasks struct {
	IfStatePusher IfStatePusher
	RevDropper    RevDropper
}

StateChangeTasks holds the tasks that are executed when the state of an interface changes to active.

Directories

Path Synopsis
Package mock_keepalive is a generated GoMock package.
Package mock_keepalive is a generated GoMock package.

Jump to

Keyboard shortcuts

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