misc

package
v4.4.5 Latest Latest
Warning

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

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

Documentation

Overview

Package misc provides general purpose utilities for rait

Index

Constants

This section is empty.

Variables

View Source
var Bind bool
View Source
var IPNetAll = []net.IPNet{{IP: _4b[:], Mask: _4b[:]}, {IP: _16b[:], Mask: _16b[:]}}

IPNetALL is simply 0/0 plus ::/0

Functions

func LinkIn

func LinkIn(links []Link, link Link) bool

func LinkString

func LinkString(links []Link) (stringed []string)

func NewAF

func NewAF(af string) string

func NewLLAddrFromKey

func NewLLAddrFromKey(key string) *netlink.Addr

func NewLLAddrFromMac

func NewLLAddrFromMac(mac net.HardwareAddr) *netlink.Addr

func NewMacFromKey

func NewMacFromKey(key string) net.HardwareAddr

func NewReadCloser

func NewReadCloser(path string) (io.ReadCloser, error)

NewReadCloser returns a ReadCloser from the given path path can be a file system path, a http url, or "-" for stdin

func NewWriteCloser

func NewWriteCloser(path string) (io.WriteCloser, error)

NewWriteCloser returns a WriteCloser from the given path path can be a file system path, or "-" for stdout

func ResolveBindAddress

func ResolveBindAddress(af string, addrSpec string) net.IP

func StringIn

func StringIn(list []string, item string) bool

func UnmarshalHCL

func UnmarshalHCL(path string, v interface{}) error

UnmarshalHCL decodes the hcl file read from path then unmarshal it into the given interface

func UnmarshalTOML

func UnmarshalTOML(path string, v interface{}) error

UnmarshalTOML decodes the toml file read from path then unmarshal it into the given interface

Types

type Link struct {
	Name          string
	Type          string
	MTU           int
	Address       string
	Mac           string
	VNI           int
	FDB           []netlink.Neigh
	Config        wgtypes.Config
	WgGoInterface string
}

Link represents a single link managed by isolation

Jump to

Keyboard shortcuts

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