utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotExist = RamaDaemonError("not exist")
)

Variables

This section is empty.

Functions

func FindSubnetExcludeIPBlocks

func FindSubnetExcludeIPBlocks(cidr *net.IPNet, includedRanges []*IPRange, gateway net.IP,
	excludeIPs []net.IP) ([]*net.IPNet, error)

Translate a subnet range into a series ip block description.

func GetSysctl

func GetSysctl(sysctlPath string) (int, error)

GetSysctl modifies the specified sysctl flag to the new value

func IsFs

func IsFs(path string, magic int64) bool

func IsNsFS

func IsNsFS(path string) bool

func IsProcFS

func IsProcFS(path string) bool

func LastIP

func LastIP(cidr *net.IPNet) net.IP

func SetSysctl

func SetSysctl(sysctlPath string, newVal int) error

SetSysctl modifies the specified sysctl flag to the new value

func SetSysctlIgnoreNotExist

func SetSysctlIgnoreNotExist(sysctlPath string, newVal int) error

func ValidDockerNetnsDir

func ValidDockerNetnsDir(path string) bool

Types

type IPRange

type IPRange struct {
	// contains filtered or unexported fields
}

func CreateIPRange

func CreateIPRange(start, end net.IP) (*IPRange, error)

func (*IPRange) TryAddIP

func (ir *IPRange) TryAddIP(ipAddr net.IP) (success bool)

type RamaDaemonError

type RamaDaemonError string

func (RamaDaemonError) Error

func (e RamaDaemonError) Error() string

Jump to

Keyboard shortcuts

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