Documentation ¶
Overview ¶
Package geneve implements marshaling and unmarshaling of Generic Network Virtualization Encapsulation (Geneve) headers, as described in the IETF internet draft: https://tools.ietf.org/html/draft-ietf-nvo3-geneve-02.
Index ¶
Constants ¶
const ( // MaxVNI is the maximum possible value for a VNI: the maximum value // of a 24-bit integer. MaxVNI = (1 << 24) - 1 // Version is the current version of the Geneve protocol. Version = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { // Version specifies the version of the Geneve header. Version uint8 // FlagOAM specifies if this Header is an OAM (Operations, Administration, // and Management) packet, containing a control message instead of a data // payload. FlagOAM bool // FlagCritical specifies if this Header contains one or more options // with the critical bit set. FlagCritical bool // ProtocolType specifies the type of the protocol data unit appearing // after the Geneve header. ProtocolType ProtocolType // VNI specifies the virtual network identifier for a unique element // of a virtual network. VNI VNI // Options contains zero or more Geneve options. Options []*Option }
A Header is a Geneve header, as described in the Geneve internet draft, Section 3.4.
func (*Header) MarshalBinary ¶
MarshalBinary allocates a byte slice and marshals a Header into binary form.
func (*Header) UnmarshalBinary ¶
UnmarshalBinary unmarshals a byte slice into a Header.
type Option ¶
type Option struct { // OptionClass specifies an IANA-assigned namespace for Type field. OptionClass uint16 // FlagCritical indicates if this Option is a critical option. FlagCritical bool // Type specifies the format of data contained in this Option. Type uint8 // Data is arbitrary data whose format is specified by OptionClass and Type. Data []byte }
An Option is a Geneve option, as described in the Geneve internet draft, Section 3.5.
func (*Option) MarshalBinary ¶
MarshalBinary allocates a byte slice and marshals an Option into binary form.
func (*Option) UnmarshalBinary ¶
UnmarshalBinary unmarshals a byte slice into an Option.
type ProtocolType ¶
type ProtocolType uint16
A ProtocolType specifies the type of the protocol data unit appearing after a Geneve header.
const ( // ProtocolTypeEthernet indicates that an Ethernet frame is encapsulated // by a Geneve header. ProtocolTypeEthernet ProtocolType = 0x6558 )