vxlan

package module
v0.0.0-...-b4915bd Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2016 License: MIT Imports: 4 Imported by: 0

README

vxlan Build Status Coverage Status GoDoc Report Card

Package vxlan implements marshaling and unmarshaling of Virtual eXtensible Local Area Network (VXLAN) frames, as described in RFC 7348. MIT Licensed.

Documentation

Overview

Package vxlan implements marshaling and unmarshaling of Virtual eXtensible Local Area Network (VXLAN) frames, as described in RFC 7348.

Index

Constants

View Source
const (
	// MaxVNI is the maximum possible value for a VNI: the maximum value
	// of a 24-bit integer.
	MaxVNI = (1 << 24) - 1
)

Variables

View Source
var (
	// ErrInvalidFrame is returned when the reserved I bit is not set in
	// a byte slice when Frame.UnmarshalBinary is called.
	ErrInvalidFrame = errors.New("invalid Frame")

	// ErrInvalidVNI is returned when a Frame contains an invalid VNI,
	// and Frame.MarshalBinary is called.
	ErrInvalidVNI = errors.New("invalid VNI")
)

Functions

This section is empty.

Types

type Frame

type Frame struct {
	VNI      VNI
	Ethernet *ethernet.Frame
}

A Frame is an Virtual eXtensible Local Area Network (VXLAN) frame, as described in RFC 7348, Section 5.

It contains a VNI used to designate an overlay network, and an embedded Ethernet frame which transports an arbitrary payload within the overlay network.

func (*Frame) MarshalBinary

func (f *Frame) MarshalBinary() ([]byte, error)

MarshalBinary allocates a byte slice and marshals a Frame into binary form.

If a VNI value is invalid, ErrInvalidVNI will be returned.

func (*Frame) UnmarshalBinary

func (f *Frame) UnmarshalBinary(b []byte) error

UnmarshalBinary allocates a byte slice and marshals a Frame into binary form.

If a VNI value is invalid, ErrInvalidVNI will be returned.

type VNI

type VNI uint32

A VNI is a 24-bit Virtual Network Identifier. It is used to designate a VXLAN overlay network. Use its Valid method to determine if a VNI contains a valid value.

func (VNI) Valid

func (v VNI) Valid() bool

Valid determines if a VNI is a valid, 24-bit integer.

Jump to

Keyboard shortcuts

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