Version: v1.1.0 Latest Latest

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0




View Source
const (
	V4BitLen = 8 * net.IPv4len
	V6BitLen = 8 * net.IPv6len
View Source
const (
	ICMPProtocol   = 1
	TCPProtocol    = 6
	UDPProtocol    = 17
	ICMPv6Protocol = 58
	SCTPProtocol   = 132


This section is empty.


func DiffFromCIDRs

func DiffFromCIDRs(allowCIDR *net.IPNet, exceptCIDRs []*net.IPNet) ([]*net.IPNet, error)

This function takes in one allow CIDR and multiple except CIDRs and gives diff CIDRs in allowCIDR eliminating except CIDRs. It currently supports only IPv4. except CIDR input can be changed.

func IPNetToNetIPNet

func IPNetToNetIPNet(ipNet *v1beta2.IPNet) *net.IPNet

IPNetToNetIPNet converts Antrea IPNet to *net.IPNet. Note that K8s allows non-standard CIDRs to be specified (e.g., fe80::7015:efff:fe9a:146b/64). However, OVS will report OFPBMC_BAD_WILDCARDS error if using them in the OpenFlow messages. The function will normalize the CIDR if it's non-standard.

func IPProtocolNumberToString

func IPProtocolNumberToString(protocolNum uint8, defaultValue string) string

IPProtocolNumberToString returns the string name of the IP protocol with number protocolNum. If the number does not match a "known" protocol, we return the defaultValue string.


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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