kernel

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 16 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

func NewNFQueue

func NewNFQueue(name string, nfqueueNumber uint16, protocols []string, sourceIPs []string, destinationIPs []string, sourcePorts []string, destinationPorts []string, priority int32) (networking.NFQueue, error)

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) *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 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) 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) NewNFQueue

func (ku *KernelUtils) NewNFQueue(name string, nfqueueNumber uint16, protocols []string, sourceIPs []string, destinationIPs []string, sourcePorts []string, destinationPorts []string, priority int32) (networking.NFQueue, error)

func (*KernelUtils) NewSourceBasedRoute

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

type NFQueue

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

func (*NFQueue) Delete

func (nfq *NFQueue) Delete() error

func (*NFQueue) Update

func (nfq *NFQueue) Update(protocols []string, sourceIPs []string, destinationIPs []string, sourcePorts []string, destinationPorts []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