vxlan

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Overview

Package vxlan provides helper methods for the Mechanism vxlan

Index

Constants

View Source
const (
	// MECHANISM string
	MECHANISM = "VXLAN"

	// SrcIP - source IP
	SrcIP = common.SrcIP
	// DstIP - destination IP
	DstIP = common.DstIP
	// SrcPort - Source vxlan listening port
	SrcPort = common.SrcPort
	// DstPort - Destination vxlan listening port
	DstPort = common.DstPort

	// VNI - vni
	VNI = "vni"
	// MTU - maximum transmission unit
	MTU = common.MTU
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mechanism

type Mechanism struct {
	*networkservice.Mechanism
}

Mechanism - a vxlan Mechanism utility wrapper

func ToMechanism

func ToMechanism(m *networkservice.Mechanism) *Mechanism

ToMechanism - convert unified Mechanism to useful wrapper

func (*Mechanism) DstIP

func (m *Mechanism) DstIP() net.IP

DstIP - returns the net.IP for the DstIP of the vxlan tunnel

func (*Mechanism) DstPort

func (m *Mechanism) DstPort() uint16

DstPort - Destination vxlan listening port

func (*Mechanism) EvenVNI

func (m *Mechanism) EvenVNI() bool

EvenVNI - true if the VNI issues by the NSE should be even, false otherwise

func (*Mechanism) GenerateRandomVNI

func (m *Mechanism) GenerateRandomVNI() (uint32, error)

GenerateRandomVNI - generates a random VNI for the mechanism, even or odd as determined by EvenVNI()

func (*Mechanism) GetParameters

func (m *Mechanism) GetParameters() map[string]string

GetParameters returns the map of all parameters to the mechanism

func (*Mechanism) MTU

func (m *Mechanism) MTU() uint32

MTU - return MTU value - 0 if unset

func (*Mechanism) SetDstIP

func (m *Mechanism) SetDstIP(ip net.IP) *Mechanism

SetDstIP - sets the DstIP for the VXLAN and returns the *vxlan.Mechanism

func (*Mechanism) SetDstPort

func (m *Mechanism) SetDstPort(port uint16) *Mechanism

SetDstPort - Set destination vxlan listening port

func (*Mechanism) SetMTU

func (m *Mechanism) SetMTU(mtu uint32) *Mechanism

SetMTU - set the MTU value

func (*Mechanism) SetSrcIP

func (m *Mechanism) SetSrcIP(ip net.IP) *Mechanism

SetSrcIP - sets the SrcIP for the VXLAN and returns the *vxlan.Mechanism

func (*Mechanism) SetSrcPort

func (m *Mechanism) SetSrcPort(port uint16) *Mechanism

SetSrcPort - Set source vxlan listening port

func (*Mechanism) SetVNI

func (m *Mechanism) SetVNI(vni uint32) *Mechanism

SetVNI - set the VNI for the vxlan tunnel and return *vxlan.Mechanism

func (*Mechanism) SrcIP

func (m *Mechanism) SrcIP() net.IP

SrcIP - Source net.IP for the VXLAN tunnel

func (*Mechanism) SrcPort

func (m *Mechanism) SrcPort() uint16

SrcPort - Source vxlan listening port

func (*Mechanism) VNI

func (m *Mechanism) VNI() uint32

VNI returns the VNI parameter of the Mechanism

Jump to

Keyboard shortcuts

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