mapping

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Package mapping contains utility functions to deal with the mapping of IPs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnforceAPIServerIPRemapping

func EnforceAPIServerIPRemapping(ctx context.Context, cl client.Client, liqoNamespace string) error

EnforceAPIServerIPRemapping creates or updates the IP resource for the API server IP remapping.

func EnforceAPIServerProxyIPRemapping

func EnforceAPIServerProxyIPRemapping(ctx context.Context, cl client.Client, liqoNamespace string) error

EnforceAPIServerProxyIPRemapping creates or updates the IP resource for the API server proxy IP remapping.

func MapAddress

func MapAddress(ctx context.Context, cl client.Client,
	clusterID liqov1beta1.ClusterID, address string) (string, error)

MapAddress maps the address with the network configuration of the cluster.

func MapAddressWithConfiguration

func MapAddressWithConfiguration(cfg *networkingv1beta1.Configuration, address string) (string, error)

MapAddressWithConfiguration maps the address with the network configuration of the cluster.

func RemapMask

func RemapMask(addr net.IP, mask net.IPNet) net.IP

RemapMask take an IP address and a network mask and remap the address to the network. This means that the host part of the address is preserved, while the network part is replaced with the one in the mask.

Example: addr: 10.1.0.1 mask: 40.32.0.0/10 result: 40.1.0.1 addrBin: 00001010000000010000000000000001 maskBin: 11111111110000000000000000000000 netBin : 00101000000000000000000000000000 hostBin: 00000000000000010000000000000001 resultBin : 00101000000000010000000000000001

addr: 10.255.1.1 mask: 78.5.78.143/18 result: 78.5.65.1 addrBin: 00001010111111110000000100000001 maskBin: 11111111111111111100000000000000 netBin : 01001110000001010100000000000000 hostBin: 00000000000000000000000100000001 resultBin: 01001110000001010100000100000001 // nolint: godot // this comment must not end with a period.

Types

This section is empty.

Jump to

Keyboard shortcuts

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