Documentation ¶
Index ¶
- Constants
- func CheckIPIsGlobalUnicast(ip net.IP) bool
- func CheckIPv6Disabled(nicName string) (bool, error)
- func CheckIPv6GlobalDisabled() (bool, error)
- func CheckIfContainerNetworkLink(linkName string) bool
- func ConfigureContainerNic(containerNicName, hostNicName, nodeIfName string, ...) error
- func ConfigureHostNic(nicName string, allocatedIPs map[networkingv1.IPVersion]*IPInfo, ...) error
- func EnsureVlanIf(nodeIfName string, vlanID *uint32) (string, error)
- func GenerateContainerVethPair(containerID string) (string, string)
- func GenerateIPListString(addrList []netlink.Addr) string
- func GenerateVlanNetIfName(parentName string, vlanID *uint32) (string, error)
- func GenerateVxlanNetIfName(parentName string, vlanID *uint32) (string, error)
- func GetDefaultInterface(family int) (*net.Interface, error)
- func GetDefaultRoute(family int) (*netlink.Route, error)
- func GetInterfaceByPreferString(preferString string) (*net.Interface, error)
- func ListAllAddress(link netlink.Link) ([]netlink.Addr, error)
- func ListLocalAddressExceptLink(exceptLinkName string) ([]netlink.Addr, error)
- type IPInfo
Constants ¶
View Source
const ( DockerNetnsDir = "/var/run/docker/netns" ContainerdNetnsDir = "/var/run/netns/" ContainerHostLinkPrefix = "h_" ContainerHostLinkMac = "ee:ee:ee:ee:ee:ee" ContainerInitLinkSuffix = "_c" VxlanLinkInfix = ".vxlan" ContainerNicName = "eth0" ProxyArpSysctl = "/proc/sys/net/ipv4/conf/%s/proxy_arp" ProxyDelaySysctl = "/proc/sys/net/ipv4/neigh/%s/proxy_delay" RouteLocalNetSysctl = "/proc/sys/net/ipv4/conf/%s/route_localnet" IPv4ForwardingSysctl = "/proc/sys/net/ipv4/conf/%s/forwarding" RpFilterSysctl = "/proc/sys/net/ipv4/conf/%s/rp_filter" IPv4NeighGCThresh1 = "/proc/sys/net/ipv4/neigh/default/gc_thresh1" IPv4NeighGCThresh2 = "/proc/sys/net/ipv4/neigh/default/gc_thresh2" IPv4NeighGCThresh3 = "/proc/sys/net/ipv4/neigh/default/gc_thresh3" IPv6NeighGCThresh1 = "/proc/sys/net/ipv6/neigh/default/gc_thresh1" IPv6NeighGCThresh2 = "/proc/sys/net/ipv6/neigh/default/gc_thresh2" IPv6NeighGCThresh3 = "/proc/sys/net/ipv6/neigh/default/gc_thresh3" ProxyNdpSysctl = "/proc/sys/net/ipv6/conf/%s/proxy_ndp" IPv6ForwardingSysctl = "/proc/sys/net/ipv6/conf/%s/forwarding" IPv4AppSolicitSysctl = "/proc/sys/net/ipv4/neigh/%s/app_solicit" IPv6AppSolicitSysctl = "/proc/sys/net/ipv6/neigh/%s/app_solicit" AcceptDADSysctl = "/proc/sys/net/ipv6/conf/%s/accept_dad" AcceptRASysctl = "/proc/sys/net/ipv6/conf/%s/accept_ra" IPv4BaseReachableTimeMSSysctl = "/proc/sys/net/ipv4/neigh/%s/base_reachable_time_ms" IPv6BaseReachableTimeMSSysctl = "/proc/sys/net/ipv6/neigh/%s/base_reachable_time_ms" IPv6DisableModuleParameter = "/sys/module/ipv6/parameters/disable" IPv6DisableSysctl = "/proc/sys/net/ipv6/conf/%s/disable_ipv6" // IP Masks that have no effect on IP Address DefaultIP4Mask = "255.255.255.255" DefaultIP6Mask = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" )
Variables ¶
This section is empty.
Functions ¶
func CheckIPIsGlobalUnicast ¶
func CheckIPv6Disabled ¶ added in v0.3.1
func CheckIPv6GlobalDisabled ¶ added in v0.3.1
func ConfigureContainerNic ¶
func ConfigureContainerNic(containerNicName, hostNicName, nodeIfName string, allocatedIPs map[networkingv1.IPVersion]*IPInfo, macAddr net.HardwareAddr, netID *uint32, netns ns.NetNS, mtu int, vlanCheckTimeout time.Duration, networkType networkingv1.NetworkType, neighGCThresh1, neighGCThresh2, neighGCThresh3 int) error
ipAddr is a CIDR notation IP address and prefix length
func ConfigureHostNic ¶
func GenerateIPListString ¶
func GenerateVlanNetIfName ¶
func GenerateVxlanNetIfName ¶
func GetInterfaceByPreferString ¶
Get first valid interface by prefer string.
Types ¶
Click to show internal directories.
Click to hide internal directories.