openflow

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package openflow Common Logger initialization

Copyright 2020 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2020 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2020 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var NoVolthaConnectionError = errors.New("no-voltha-connection")

Functions

func GetXid

func GetXid() uint32

func PadString

func PadString(value string, padSize int) string

Types

type Message

type Message interface {
	Serialize(encoder *goloxi.Encoder) error
}

Message interface that represents an open flow message and enables for a unified implementation of SendMessage

type OFClient

type OFClient struct {
	OFControllerEndPoints []string
	DeviceID              string
	VolthaClient          *holder.VolthaServiceClientHolder
	PacketOutChannel      chan *voltha.PacketOut
	ConnectionMaxRetries  int
	ConnectionRetryDelay  time.Duration
	// contains filtered or unexported fields
}

OFClient the configuration and operational state of a connection to an openflow controller

func NewOFClient

func NewOFClient(ctx context.Context, config *OFClient) *OFClient

NewClient returns an initialized OFClient instance based on the configuration specified

func (*OFClient) Run

func (ofc *OFClient) Run(ctx context.Context)

func (*OFClient) SendMessage

func (ofc *OFClient) SendMessage(ctx context.Context, message Message) error

func (*OFClient) Stop

func (ofc *OFClient) Stop()

Stop initiates a shutdown of the OFClient

func (*OFClient) UpdateRoles added in v1.2.0

func (ofc *OFClient) UpdateRoles(ctx context.Context, from string, request *ofp.RoleRequest) bool

UpdateRoles validates a role request and updates role state for connections where it changed

type OFConnection added in v1.2.0

type OFConnection struct {
	OFControllerEndPoint string
	DeviceID             string
	VolthaClient         *holder.VolthaServiceClientHolder
	PacketOutChannel     chan *voltha.PacketOut
	ConnectionMaxRetries int
	ConnectionRetryDelay time.Duration
	// contains filtered or unexported fields
}

func (*OFConnection) Run added in v1.2.0

func (ofc *OFConnection) Run(ctx context.Context)

Run implements the state machine for the OF client reacting to state change events and invoking actions as a reaction to those state changes

func (*OFConnection) SendMessage added in v1.2.0

func (ofc *OFConnection) SendMessage(ctx context.Context, message Message) error

SendMessage queues a message to be sent to the openflow controller

type RoleManager added in v1.2.0

type RoleManager interface {
	UpdateRoles(ctx context.Context, from string, request *ofp.RoleRequest) bool
}

Jump to

Keyboard shortcuts

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