Documentation
¶
Overview ¶
Package mapping contains utility functions to deal with the mapping of IPs.
Index ¶
- func EnforceAPIServerIPRemapping(ctx context.Context, cl client.Client, liqoNamespace string) error
- func EnforceAPIServerProxyIPRemapping(ctx context.Context, cl client.Client, liqoNamespace string) error
- func MapAddress(ctx context.Context, cl client.Client, clusterID liqov1beta1.ClusterID, ...) (string, error)
- func MapAddressWithConfiguration(cfg *networkingv1beta1.Configuration, address string) (string, error)
- func RemapMask(addr net.IP, mask net.IPNet) net.IP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnforceAPIServerIPRemapping ¶
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 ¶
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.