networking

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInterfacesToExclude = []string{
	"docker.*", "cbr.*", "dummy.*",
	"virbr.*", "lxcbr.*", "veth.*", "lo",
	"cali.*", "tunl.*", "flannel.*", "kube-ipvs.*", "cni.*", "vx-submariner",
}

Functions

func AddFromRuleTable

func AddFromRuleTable(logger *zap.Logger, ipAddrs []netlink.Addr, ruleTable int) error

AddFromRuleTable add route rule for calico/cilium cidr(ipv4 and ipv6) Equivalent to: `ip rule add from <cidr> `

func AddNeighborTable

func AddNeighborTable(iface string, dstIP net.IP, hwAddress net.HardwareAddr) error

AddNeighborTable add static neighborhood table

func AddRouteTable

func AddRouteTable(logger *zap.Logger, ruleTable int, scope netlink.Scope, device string, destinations []string, v4Gw, v6Gw net.IP) error

func AddToRuleTable

func AddToRuleTable(preInterfaceIPAddress []netlink.Addr, ruleTable int) error

AddToRuleTable

func AddrsToString

func AddrsToString(addrs []netlink.Addr) []string

AddrsToString convert addr to

func EnableIpv6Sysctl

func EnableIpv6Sysctl(logger *zap.Logger, netns ns.NetNS) error

func GetGatewayIP added in v0.1.4

func GetGatewayIP(addrs []netlink.Addr) (v4Gw, v6Gw net.IP, err error)

func GetIPFamily

func GetIPFamily(prevResult cnitypes.Result) (int, error)

func HwAddressByName

func HwAddressByName(netns ns.NetNS, hostVethPairName string) (net.HardwareAddr, net.HardwareAddr, error)

func IPAddressByName

func IPAddressByName(netns ns.NetNS, interfacenName string, ipFamily int) ([]netlink.Addr, error)

IPAddressByName returns all IP addresses of the given interface group by ipFamily

func IPAddressOnNode

func IPAddressOnNode(logger *zap.Logger, ipFamily int) ([]netlink.Addr, error)

IPAddressOnNode return all ip addresses on the node, filter by ipFamily skipping any interfaces whose name matches any of the exclusion list regexes

func MoveRoutes

func MoveRoutes(logger *zap.Logger, netns ns.NetNS, routeMoveInterface string, currentInterfaceIPAddress []netlink.Addr, moveValue types.MoveRouteValue, ruleTable, ipFamily int) error

MoveRoutes make sure that the reply packets accessing the overlay interface are still sent from the overlay interface.

func OverrideHwAddress

func OverrideHwAddress(logger *zap.Logger, netns ns.NetNS, macPrefix, iface string) (string, error)

OverrideHwAddress override the hardware address of the specified interface.

func SysctlRPFilter

func SysctlRPFilter(netns ns.NetNS, rp *types.RPFilter) error

SysctlRPFilter set rp_filter value

Types

This section is empty.

Jump to

Keyboard shortcuts

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