network

package
v0.0.0-...-4f7f726 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors

SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	ScopeUniverse = 0
	ScopeLink     = 253
)

Variables

This section is empty.

Functions

func AllBondingShootClientIPs

func AllBondingShootClientIPs(vpnNetwork *net.IPNet, haVPNClients int) []net.IP

func BondIP6TunnelLinkName

func BondIP6TunnelLinkName(index int) string

func BondingAddressForClient

func BondingAddressForClient(ip net.IP) *net.IPNet

func BondingSeedClientRange

func BondingSeedClientRange(vpnNetworkIP net.IP) (base net.IP, startIndex, endIndex int)

func BondingShootClientAddress

func BondingShootClientAddress(vpnNetwork *net.IPNet, vpnClientIndex int) *net.IPNet

func BondingShootClientIP

func BondingShootClientIP(vpnNetwork *net.IPNet, index int) net.IP

func ClientIndexFromBondingShootClientIP

func ClientIndexFromBondingShootClientIP(clientIP net.IP) int

func CreateTunnel

func CreateTunnel(linkName string, local, remote net.IP) error

CreateTunnel creates an ip6tnl tunnel to allow IPv4 and IPv6 packages over IPv6 and sets it up.

func DeleteLinkByName

func DeleteLinkByName(name string) error

DeleteLinkByName delete a link by name.

func GetLinkIPAddressesByName

func GetLinkIPAddressesByName(name string, scope int) ([]net.IP, error)

GetLinkIPAddressesByName gets the IP addresses for the given link name and scope (`ScopeLink` or `ScopeUniversal`).

func NewIPTables

func NewIPTables(log logr.Logger, proto iptables.Protocol) (*iptables.IPTables, error)

NewIPTables wraps the creation of IPTables to patch the path to the correct implementation binary. It has been introduced to avoid the risk that the command doesn't work due to missing kernel modules.

func ReplaceRoute

func ReplaceRoute(log logr.Logger, ipnet *net.IPNet, dev netlink.Link) error

Types

type CIDR

type CIDR net.IPNet

func HAVPNTunnelNetwork

func HAVPNTunnelNetwork(vpnNetworkIP net.IP, vpnIndex int) CIDR

func (CIDR) String

func (c CIDR) String() string

func (CIDR) ToIPNet

func (c CIDR) ToIPNet() *net.IPNet

func (*CIDR) UnmarshalText

func (c *CIDR) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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