netlink

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultExternalBridgeName = "externalBridge"
	DefaultInternalBridgeName = "internalBridge"

	TYPEVETH   = "veth"
	TYPEBRIDGE = "bridge"

	DefaultInternalContainerInterface = "ethint"
	DefaultExternalContainerInterface = "ethext"
)

ToDo: make this variable later

Variables

This section is empty.

Functions

func Clear

func Clear(cfg *Config) error

func ClearVethInterface

func ClearVethInterface(interfaceName string, isInternal bool) error

func GetNsHandle

func GetNsHandle(arg interface{}) netns.NsHandle

func GetRootNetlinkHandle

func GetRootNetlinkHandle() (*remoteNetlink.Handle, error)

func GetTargetNetlinkHandle

func GetTargetNetlinkHandle(ns netns.NsHandle) (*remoteNetlink.Handle, error)

func Initialize

func Initialize(cfg *Config) error

func PBR

func PBR() error

func SetDefaultRoute2Container

func SetDefaultRoute2Container(containerPid int, gwIP string, tableNum int) error

func SetIPaddress2Container

func SetIPaddress2Container(containerPid int, ip string, netmask string, isInternal bool) error

func SetInterface2Container

func SetInterface2Container(containerPid int, interfaceName string, isInternal bool, cfg *Config) error

func SetRoute2Container

func SetRoute2Container(containerPid int, interfaceName string, tableNum int) error

func SetRouteRule2Container

func SetRouteRule2Container(containerPid int, markNumber int, tableNumber int) error

func SetVlan

func SetVlan(interfaceName string, newVlan int, oldVlan int, cfg *Config) error

Types

type Config

type Config struct {
	InternalBridgeName string
	ExternalBridgeName string

	OriginInternalInterfaceName string
	OriginExternalInterfaceName string

	NewInternalInterfaceName string
	NewExternalInterfaceName string

	InternalIPCIDR string
	ExternalIPCIDR string

	InternalIP      string
	InternalNetmask string

	ExternalIP      string
	ExternalNetmaks string

	GatewayIP string
}

type CrioType

type CrioType int

type DockerType

type DockerType string

Jump to

Keyboard shortcuts

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