Package netutils

import "github.com/chaos-mesh/chaos-mesh/controllers/podnetworkchaos/netutils"

Overview ▾

func CompressName

func CompressName(originalName string, targetLength int, namePostFix string) (name string)

CompressName compresses name to targetLength with specified postfix targetLength < 7 or targetLength-7-len(namePostFix) < 0 are not allowed

func IPToCidr

func IPToCidr(ip string) string

IPToCidr converts from an ip to a full mask cidr

func LookupIP

func LookupIP(host string) ([]net.IP, error)

func ResolveCidr

func ResolveCidr(name string) ([]v1alpha1.CidrAndPort, error)

ResolveCidr converts cidr/ip/domain into cidr

func ResolveCidrs

func ResolveCidrs(names []string) ([]v1alpha1.CidrAndPort, error)

ResolveCidrs converts multiple cidrs/ips/domains into cidr