utils

package
v0.0.0-...-3e93e3d Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright 2018 Tigera Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	// IPv4AllNet represents the IPv4 all-addresses CIDR 0.0.0.0/0.
	IPv4AllNet *net.IPNet
	// IPv6AllNet represents the IPv6 all-addresses CIDR ::/0.
	IPv6AllNet    *net.IPNet
	DefaultRoutes []*net.IPNet
)

Functions

func CleanUpNamespace

func CleanUpNamespace(args *skel.CmdArgs, logger *logrus.Entry) error

CleanUpNamespace deletes the devices in the network namespace.

func DoNetworking

func DoNetworking(
	args *skel.CmdArgs,
	conf types.IPAMConfig,
	result *current.Result,
	desiredVethName string,
) (hostVethName, contVethMAC string, err error)

DoNetworking performs the networking for the given config and IPAM result

func GetIPTotal

func GetIPTotal(start net.IP, end net.IP) int

GetIPTotal returns the number of IP addresses for the given start and end IP

func GetNodeIP

func GetNodeIP() (net.Addr, error)

func GetNodeMaster

func GetNodeMaster() string

func GetTotal

func GetTotal(pool types.NSIPPool) int

GetTotal returns the number of IP addresses in the given ns IPPool

func Min

func Min(a, b int) int

func SetupRoutes

func SetupRoutes(hostVeth netlink.Link, result *current.Result) error

SetupRoutes sets up the routes for the host side of the veth pair.

Types

This section is empty.

Jump to

Keyboard shortcuts

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