util

package
Version: v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct{ bytes.Buffer }

func NewBuffer

func NewBuffer(buf []byte) *Buffer

func (*Buffer) Len

func (b *Buffer) Len() uint16

func (*Buffer) MarshalBinary

func (b *Buffer) MarshalBinary() (data []byte, err error)

func (*Buffer) UnmarshalBinary

func (b *Buffer) UnmarshalBinary(data []byte) error

type BufferPool

type BufferPool struct {
	Empty chan *bytes.Buffer
}

func NewBufferPool

func NewBufferPool() *BufferPool

type Message

type Message interface {
	//encoding.BinaryMarshaler
	//encoding.BinaryUnmarshaler
	MarshalBinary() (data []byte, err error)
	UnmarshalBinary(data []byte) error

	Len() uint16
}

type MessageStream

type MessageStream struct {

	// OpenFlow Version
	Version uint8
	// Channel on which to publish connection errors
	Error chan error
	// Channel on which to publish inbound messages
	Inbound chan Message
	// Channel on which to receive outbound messages
	Outbound chan Message
	// Channel on which to receive a shutdown command
	Shutdown chan bool
	// contains filtered or unexported fields
}

func NewMessageStream

func NewMessageStream(conn net.Conn, parser Parser) *MessageStream

Returns a pointer to a new MessageStream. Used to parse OpenFlow messages from conn.

func (*MessageStream) GetAddr

func (m *MessageStream) GetAddr() net.Addr

type Parser

type Parser interface {
	Parse(b []byte) (message Message, err error)
}

Parser interface

Source Files

Jump to

Keyboard shortcuts

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