util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControllerName       = "kube-ovn-controller"
	AllocatedAnnotation  = "ovn.kubernetes.io/allocated"
	MacAddressAnnotation = "ovn.kubernetes.io/mac_address"
	IpAddressAnnotation  = "ovn.kubernetes.io/ip_address"
	CidrAnnotation       = "ovn.kubernetes.io/cidr"
	GatewayAnnotation    = "ovn.kubernetes.io/gateway"
	IpPoolAnnotation     = "ovn.kubernetes.io/ip_pool"
	ExcludeIpsAnnotation = "ovn.kubernetes.io/exclude_ips"

	IngressRateAnnotation = "ovn.kubernetes.io/ingress_rate"
	EgressRateAnnotation  = "ovn.kubernetes.io/egress_rate"

	PortNameAnnotation = "ovn.kubernetes.io/port_name"

	LogicalSwitchAnnotation = "ovn.kubernetes.io/logical_switch"

	SubnetNameLabel = "ovn.kubernetes.io/subnet"

	ProtocolTCP = "tcp"
	ProtocolUDP = "udp"

	NodeNic           = "ovn0"
	NodeAllowPriority = "3000"

	IngressExceptDropPriority = "2002"
	IngressAllowPriority      = "2001"
	IngressDefaultDrop        = "2000"

	EgressExceptDropPriority = "2002"
	EgressAllowPriority      = "2001"
	EgressDefaultDrop        = "2000"

	SubnetAllowPriority = "1001"
	DefaultDropPriority = "1000"

	GeneveHeaderLength = 100
)

Variables

This section is empty.

Functions

func AddressCount added in v0.7.0

func AddressCount(network *net.IPNet) uint64

func BigInt2Ip added in v0.6.0

func BigInt2Ip(ipInt *big.Int) string

func CIDRConflict added in v0.6.0

func CIDRConflict(a, b string) bool

func CheckProtocol added in v0.6.0

func CheckProtocol(address string) string

func ContainsString added in v0.9.1

func ContainsString(slice []string, s string) bool

Helper functions to check and remove string from a slice of strings.

func DiffStringSlice added in v0.5.0

func DiffStringSlice(slice1, slice2 []string) []string

func FirstSubnetIP added in v0.5.0

func FirstSubnetIP(subnet string) (string, error)

func GenerateMac

func GenerateMac() string

GenerateMac generates mac address.

func Ip2BigInt added in v0.6.0

func Ip2BigInt(ipStr string) *big.Int

func IsStringIn added in v0.9.0

func IsStringIn(str string, slice []string) bool

func IsStringsOverlap added in v0.6.0

func IsStringsOverlap(a, b []string) bool

IsStringsOverlap check if two string slices are overlapped

func RemoveString added in v0.9.1

func RemoveString(slice []string, s string) (result []string)

func UniqString added in v0.6.0

func UniqString(a []string) []string

UniqString creates an array of string with unique values.

func ValidatePodNetwork added in v0.4.0

func ValidatePodNetwork(annotations map[string]string) error

func ValidateSubnet added in v0.6.0

func ValidateSubnet(subnet kubeovnv1.Subnet) error

Types

type IPTableRule

type IPTableRule struct {
	Table string
	Chain string
	Rule  []string
}

IPTableRule wraps iptables rule

Jump to

Keyboard shortcuts

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