kernel

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddVIP

func AddVIP(vip string) error

func DeleteVIP

func DeleteVIP(vip string) error

func GetIndexFromName

func GetIndexFromName(name string) (int, error)

GetIndexFromName - Get the index of an interface from its name

Types

type Bridge

type Bridge struct {
	Interface
	// contains filtered or unexported fields
}

func NewBridge

func NewBridge(name string) (*Bridge, error)

func (*Bridge) Delete

func (b *Bridge) Delete() error

func (*Bridge) LinkInterface

func (b *Bridge) LinkInterface(intf networking.Iface) error

LinkInterface set the bridge as master of another interface

func (*Bridge) UnLinkInterface

func (b *Bridge) UnLinkInterface(intf networking.Iface) error

type FWMarkRoute

type FWMarkRoute struct {
	// contains filtered or unexported fields
}

FWMarkRoute -

func NewFWMarkRoute

func NewFWMarkRoute(ip string, fwmark int, tableID int) (*FWMarkRoute, error)

NewFWMarkRoute -

func (*FWMarkRoute) Delete

func (fwmr *FWMarkRoute) Delete() error

Delete -

func (*FWMarkRoute) Verify

func (fwmr *FWMarkRoute) Verify() bool

type Interface

type Interface struct {
	LocalIPs      []string
	NeighborIPs   []string
	Gateways      []string
	InterfaceType networking.InterfaceType
	// contains filtered or unexported fields
}

func NewInterface

func NewInterface(index int, options ...InterfaceOption) *Interface

func (*Interface) AddLocalPrefix

func (intf *Interface) AddLocalPrefix(prefix string) error

func (*Interface) Equals

func (intf *Interface) Equals(iface networking.Iface) bool

func (*Interface) GetGatewayPrefixes

func (intf *Interface) GetGatewayPrefixes() []string

func (*Interface) GetIndex

func (intf *Interface) GetIndex() int

func (*Interface) GetInterfaceType

func (intf *Interface) GetInterfaceType() networking.InterfaceType

func (*Interface) GetLocalPrefixes

func (intf *Interface) GetLocalPrefixes() []string

func (*Interface) GetName

func (intf *Interface) GetName() string

func (*Interface) GetNeighborPrefixes

func (intf *Interface) GetNeighborPrefixes() []string

func (*Interface) RemoveLocalPrefix

func (intf *Interface) RemoveLocalPrefix(prefix string) error

func (*Interface) SetGatewayPrefixes

func (intf *Interface) SetGatewayPrefixes(gateways []string)

func (*Interface) SetInterfaceType

func (intf *Interface) SetInterfaceType(ifaceType networking.InterfaceType)

func (*Interface) SetLocalPrefixes

func (intf *Interface) SetLocalPrefixes(localPrefixes []string)

func (*Interface) SetNeighborPrefixes

func (intf *Interface) SetNeighborPrefixes(neighborPrefixes []string)

type InterfaceMonitor

type InterfaceMonitor struct {
	// contains filtered or unexported fields
}

func NewInterfaceMonitor

func NewInterfaceMonitor() (*InterfaceMonitor, error)

NewInterfaceMonitor -

func (*InterfaceMonitor) Close

func (im *InterfaceMonitor) Close()

Close -

func (*InterfaceMonitor) Subscribe

func (im *InterfaceMonitor) Subscribe(subscriber networking.InterfaceMonitorSubscriber)

Subscribe -

func (*InterfaceMonitor) UnSubscribe

func (im *InterfaceMonitor) UnSubscribe(subscriber networking.InterfaceMonitorSubscriber)

UnSubscribe -

type InterfaceOption added in v0.4.0

type InterfaceOption func(o *interfaceOptions)

func WithInterfaceName added in v0.4.0

func WithInterfaceName(name string) InterfaceOption

type KernelUtils

type KernelUtils struct {
}

func (*KernelUtils) AddVIP

func (ku *KernelUtils) AddVIP(vip string) error

func (*KernelUtils) DeleteVIP

func (ku *KernelUtils) DeleteVIP(vip string) error

func (*KernelUtils) GetIndexFromName

func (ku *KernelUtils) GetIndexFromName(name string) (int, error)

func (*KernelUtils) GetInterfaceMonitor added in v0.4.0

func (ku *KernelUtils) GetInterfaceMonitor(ctx context.Context) networking.InterfaceMonitor

GetInterfaceMonitor - Returns InterfaceMonitor from Context

func (*KernelUtils) NewBridge

func (ku *KernelUtils) NewBridge(name string) (networking.Bridge, error)

func (*KernelUtils) NewFWMarkRoute

func (ku *KernelUtils) NewFWMarkRoute(ip string, fwmark int, tableID int) (networking.FWMarkRoute, error)

func (*KernelUtils) NewInterface

func (ku *KernelUtils) NewInterface(index int) networking.Iface

func (*KernelUtils) NewInterfaceMonitor

func (ku *KernelUtils) NewInterfaceMonitor() (networking.InterfaceMonitor, error)

func (*KernelUtils) NewSourceBasedRoute

func (ku *KernelUtils) NewSourceBasedRoute(tableID int, prefix string) (networking.SourceBasedRoute, error)

func (*KernelUtils) WithInterfaceMonitor added in v0.4.0

func (ku *KernelUtils) WithInterfaceMonitor(parent context.Context, monitor networking.InterfaceMonitor) context.Context

WithInterfaceMonitor - Stores InterfaceMonitor in Context

type NFSetIP added in v0.4.0

type NFSetIP struct {
	*nftables.Set
	// contains filtered or unexported fields
}

NFSetIP is a wrapper for IP type nftables.Set (either IPv4 or IPv6) Supports update of IPs

func NewNFSetIP added in v0.4.0

func NewNFSetIP(name string, family int, table *nftables.Table) (*NFSetIP, error)

func (*NFSetIP) Delete added in v0.4.0

func (nfs *NFSetIP) Delete() error

func (*NFSetIP) Update added in v0.4.0

func (nfs *NFSetIP) Update(ips []string) error

type SourceBasedRoute

type SourceBasedRoute struct {
	// contains filtered or unexported fields
}

SourceBasedRoute -

func NewSourceBasedRoute

func NewSourceBasedRoute(tableID int, vip string) (*SourceBasedRoute, error)

NewSourceBasedRoute -

func (*SourceBasedRoute) AddNexthop

func (sbr *SourceBasedRoute) AddNexthop(nexthop string) error

AddNexthop -

func (*SourceBasedRoute) Delete

func (sbr *SourceBasedRoute) Delete() error

func (*SourceBasedRoute) RemoveNexthop

func (sbr *SourceBasedRoute) RemoveNexthop(nexthop string) error

RemoveNexthop -

Jump to

Keyboard shortcuts

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