utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffGateways

func DiffGateways(a, b []*Gateway) bool

func Difference

func Difference(a, b []string) ([]string, []string)

compare two lists return values: (b - a), (a - b)

func GetAF

func GetAF(ip string) int

func IsIPv4

func IsIPv4(ip string) bool

func IsIPv6

func IsIPv6(ip string) bool

func StrToIPNet

func StrToIPNet(in string) *net.IPNet

Types

type BfdSpec

type BfdSpec struct {
	MinTx      uint32
	MinRx      uint32
	Multiplier uint32
}

func NewBfdSpec

func NewBfdSpec(spec *nspAPI.Gateway_BfdSpec) *BfdSpec

type BgpAuth added in v0.9.0

type BgpAuth struct {
	KeyName   string
	KeySource string
}

func NewBgpAuth added in v0.9.0

func NewBgpAuth(auth *nspAPI.Gateway_BgpAuth) *BgpAuth

type Gateway

type Gateway struct {
	Name       string
	Address    string
	IPFamily   string
	Protocol   string
	RemoteASN  uint32
	LocalASN   uint32
	RemotePort uint16
	LocalPort  uint16
	HoldTime   uint
	BFD        bool
	BfdSpec    *BfdSpec

	BgpAuth *BgpAuth
	// contains filtered or unexported fields
}

func ConvertGateways

func ConvertGateways(gateways []*nspAPI.Gateway) []*Gateway

func NewGateway

func NewGateway(gateway *nspAPI.Gateway) *Gateway

func (*Gateway) GetAF

func (gw *Gateway) GetAF() int

func (*Gateway) GetNeighbor

func (gw *Gateway) GetNeighbor() string

func (*Gateway) String

func (gw *Gateway) String() string

Jump to

Keyboard shortcuts

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