utils

package
v0.0.0-...-e1628ab Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64AndSha256

func Base64AndSha256(input string) string

func Base64Encode

func Base64Encode(message []byte) []byte

func CtLabelDecode

func CtLabelDecode(label []byte) (uint64, uint64, uint64)

func CurrentAgentName

func CurrentAgentName() string

func EncodeNamespacedName

func EncodeNamespacedName(namespacedName coretypes.NamespacedName) string

func EqualIPs

func EqualIPs(ips1, ips2 []types.IPAddress) bool

EqualIPs return true when two IP set have same IPaddresses.

func EqualStringSlice

func EqualStringSlice(list1, list2 []string) bool

EqualStringSlice return true when two unordered string slice have same items.

func GenerateControllerID

func GenerateControllerID(typeID uint16) uint16

func GetGwEndpointName

func GetGwEndpointName(nodeName string) string

func GetIfaceIP

func GetIfaceIP(name string) (net.IP, error)

func GetIfaceMAC

func GetIfaceMAC(name string) (net.HardwareAddr, error)

func GetIfaceMTUByIP

func GetIfaceMTUByIP(ip string) (int, error)

func GetLinkByIP

func GetLinkByIP(ip string) (netlink.Link, error)

func GetNodeInternalIP

func GetNodeInternalIP(node *corev1.Node) string

func IPCopy

func IPCopy(src net.IP) net.IP

func IsK8sLabelDiff

func IsK8sLabelDiff(l1, l2 map[string]string) bool

func IsRuleExist

func IsRuleExist(rule *netlink.Rule, filterMask uint64) (bool, error)

func ParseIPBlock

func ParseIPBlock(ipBlock *networkingv1.IPBlock) ([]*net.IPNet, error)

ParseIPBlock parse ipBlock to list of IPNets.

func RuleAdd

func RuleAdd(rule *netlink.Rule, filterMask uint64) error

func RuleDel

func RuleDel(rule *netlink.Rule, filterMask uint64) error

func SetLinkAddr

func SetLinkAddr(ifname string, inet *net.IPNet) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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