networking

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 1 Imported by: 10

Documentation

Index

Constants

View Source
const (
	NSE = iota // Interface linked to a NSC (e.g. target)
	NSC        // Interface linked to a NSE (e.g. Load balancer)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge interface {
	Iface
	LinkInterface(intf Iface) error
	UnLinkInterface(intf Iface) error
}

type FWMarkRoute

type FWMarkRoute interface {
	Verify() bool
	Delete() error
}

type Iface

type Iface interface {
	GetIndex() int
	GetName() string

	GetLocalPrefixes() []string
	SetLocalPrefixes(localPrefixes []string)
	AddLocalPrefix(prefix string) error
	RemoveLocalPrefix(prefix string) error

	GetNeighborPrefixes() []string
	SetNeighborPrefixes(neighborPrefixes []string)

	GetGatewayPrefixes() []string
	SetGatewayPrefixes(gateways []string)

	GetInterfaceType() InterfaceType
	SetInterfaceType(ifaceType InterfaceType)

	Equals(Iface) bool
}

type InterfaceMonitor

type InterfaceMonitor interface {
	Subscribe(subscriber InterfaceMonitorSubscriber)
	UnSubscribe(subscriber InterfaceMonitorSubscriber)
	Close()
}

type InterfaceMonitorSubscriber

type InterfaceMonitorSubscriber interface {
	InterfaceCreated(Iface)
	InterfaceDeleted(Iface)
}

type InterfaceType

type InterfaceType int

type SourceBasedRoute

type SourceBasedRoute interface {
	Delete() error
	AddNexthop(nexthop string) error
	RemoveNexthop(nexthop string) error
}

type Utils

type Utils interface {
	NewInterface(index int) Iface
	NewBridge(name string) (Bridge, error)
	NewFWMarkRoute(ip string, fwmark int, tableID int) (FWMarkRoute, error)
	NewSourceBasedRoute(tableID int, prefix string) (SourceBasedRoute, error)

	NewInterfaceMonitor() (InterfaceMonitor, error)
	WithInterfaceMonitor(parent context.Context, monitor InterfaceMonitor) context.Context
	GetInterfaceMonitor(ctx context.Context) InterfaceMonitor

	GetIndexFromName(name string) (int, error)
	AddVIP(vip string) error
	DeleteVIP(vip string) error
}

Jump to

Keyboard shortcuts

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