uni

package
v0.0.0-...-4bc4564 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

* Copyright (c) 2019 - present. Boling Consulting Solutions (bcsw.net) * * 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

View Source
const InitialState fsm.State = "initial" // State after creation of UNI
View Source
const UniDisabledState fsm.State = "disabled" // Initial state
View Source
const UniEnabledState fsm.State = "enabled" // UNI has be activated, normal state
View Source
const UniImpairedState fsm.State = "impaired" // UNI has some type of fault

Variables

View Source
var EthernetPart1StatisticsNameToIndex map[string]uint
View Source
var EthernetPart2StatisticsNameToIndex map[string]uint
View Source
var EthernetPart3StatisticsNameToIndex map[string]uint

Functions

func NewEthernetStatistics

func NewEthernetStatistics(request *me.ManagedEntity, control *interfaces.PMControlBlock, intervalEndTime uint8) *interfaces.Statistics

Types

type ExtendedVlanTaggingConfig

type ExtendedVlanTaggingConfig struct {
	EntityID uint16
	// contains filtered or unexported fields
}

func NewExtendedVlanMappingConfig

func NewExtendedVlanMappingConfig(onu interfaces.IOnu, request *me.ManagedEntity) (*ExtendedVlanTaggingConfig, me.OmciErrors)

func (*ExtendedVlanTaggingConfig) Get

Get is responsible for parsing the attribute values to pulling the data from the MIB

func (*ExtendedVlanTaggingConfig) RxFrame

func (config *ExtendedVlanTaggingConfig) RxFrame(packet gopacket.Packet, sender interface{})

RxFrame handles frame reception from the PON and is responsible for looking up a matching GEM Port to forward the packet to while updating approprate statistics

func (*ExtendedVlanTaggingConfig) Set

Set is responsible for parsing the attribute values to set and after validation, updating both the cached struct and the MIB database

type ReceiveVlanTaggingOperationTable

type ReceiveVlanTaggingOperationTable struct {
	// contains filtered or unexported fields
}

ReceiveVlanTaggingOperationTable is used to manage the rows of the table. For each table row, the first 8 bytes of ReceiveVlanTaggingOperationTable each entry are guaranteed to be unique, and are used to identify table entries (list order, above, refers to a sort on the first 8 bytes). The OLT deletes a table entry by setting all of its last 8 bytes to 0xFF.

func DefaultReceiveVlanTaggingOperationTable

func DefaultReceiveVlanTaggingOperationTable() *ReceiveVlanTaggingOperationTable

func NewReceiveVlanTaggingOperationTable

func NewReceiveVlanTaggingOperationTable() *ReceiveVlanTaggingOperationTable

func (*ReceiveVlanTaggingOperationTable) Insert

type ReceivedFrameVlanTaggingOperationRow

type ReceivedFrameVlanTaggingOperationRow struct {
	// Word 1
	FilterOuterPriority uint8  // 4-bits
	FilterOuterVID      uint16 // 13-bits
	FilterOuterTPID_DEI uint8  // 3-bits

	// Word 2
	FilterInnerPriority uint8  // 4-bits
	FilterInnerVID      uint16 // 13-bits
	FilterInnerTPID_DEI uint8  // 3-bits
	FilterEthertype     uint8  // 4-bits

	// Word 3
	TreatmentTagsToRemove  uint8  // 2-bits
	TreatmentOuterPriority uint8  // 4-bits
	TreatmentOuterVID      uint16 // 13-bits
	TreatmentOuterTPID_DEI uint8  // 3-bits

	// Word 4
	TreatmentInnerPriority uint8  // 4-bits
	TreatmentInnerVID      uint16 // 13-bits
	TreatmentInnerTPID_DEI uint8  // 3-bits
}

func DefaultDownstreamVlanTaggingOperations

func DefaultDownstreamVlanTaggingOperations() []ReceivedFrameVlanTaggingOperationRow

DefaultDownstreamVlanTaggingOperations provides three default downstream rules. When the Rx VLAN Tagging operation table is created, the ONU should autonomously predefine three entries that list the default treatment (normal forwarding without filtering or modification) for untagged, single tagged, and double tagged frames. As an exception to the rule on ordered processing, these default rules are always considered as a last resort for frames that do not match any other rule. Best practice dictates that these entries not be deleted by the OLT; however, they can be modified to produce the desired default behaviour.

It should be noted that downstream frame treatment is defined by the downstream mode attribute and is not affected by the upstream default rules.

func NewReceivedFrameVlanTaggingOperationRow

func NewReceivedFrameVlanTaggingOperationRow(data []uint8) (*ReceivedFrameVlanTaggingOperationRow, error)

NewReceivedFrameVlanTaggingOperationRow creates a new table with optional default entries

func (*ReceivedFrameVlanTaggingOperationRow) Serialize

func (table *ReceivedFrameVlanTaggingOperationRow) Serialize() []uint8

Serialize returns the DSCP PBit Mapping as an array of octets ready for insertion into a frame for transmission

type UNI

type UNI struct {
	Onu        interfaces.IOnu // Associated ONU
	PortNumber uint16          // Port number
	UniType    me.ClassID      // UNI Type (Class ID) PPTP, VEIP, ...

	FSM *fsm.Machine // Finite state machien

	ExtendedPMStats      *interfaces.Statistics
	ExtendedPM64BitStats *interfaces.Statistics
	EthernetPart1Stats   *interfaces.Statistics
	EthernetPart2Stats   *interfaces.Statistics
	EthernetPart3Stats   *interfaces.Statistics
	// contains filtered or unexported fields
}

UNI is used to model the UNI/PON interface of an ONU

func NewUNI

func NewUNI(onu interfaces.IOnu, portNumber uint16, uniType me.ClassID) *UNI

NewUNI is used to construct a new UNI/PON port for an ONU

func (*UNI) AddTimers

func (uni *UNI) AddTimers(timer *time.Timer)

func (*UNI) Configuration

func (uni *UNI) Configuration() interface{}

func (*UNI) Disable

func (uni *UNI) Disable() error

Disable sends the equivalent of an 'disable' event to the FSM

func (*UNI) Enable

func (uni *UNI) Enable() error

Enable will move an UNI into the discoverable state

func (*UNI) EthernetPerformanceMonitoringHistoryDataHandler

func (uni *UNI) EthernetPerformanceMonitoringHistoryDataHandler(request *me.ManagedEntity, existing *interfaces.MeDbEntry, mt omci.MessageType) gopacket.SerializableLayer

func (*UNI) ID

func (uni *UNI) ID() uint

func (*UNI) Input

func (uni *UNI) Input() chan<- interface{}

func (*UNI) IsEnabled

func (uni *UNI) IsEnabled() bool

IsEnabled returns the current UNI enable state. An enabled UNI is activated and able to pass OMCI messages

func (*UNI) Name

func (uni *UNI) Name() string

func (*UNI) Parent

func (uni *UNI) Parent() interfaces.ICommon

Parent returns the parent object of this UNI (an ONU)

func (*UNI) PhysicalPathTerminationPointEthernetUniHandler

func (uni *UNI) PhysicalPathTerminationPointEthernetUniHandler(request *me.ManagedEntity, existing *interfaces.MeDbEntry, mt omci.MessageType) gopacket.SerializableLayer

func (*UNI) RxFrame

func (uni *UNI) RxFrame(packet gopacket.Packet, sender interface{})

RxFrame handles frame reception from the PON and is responsible for looking up a matching GEM Port to forward the packet to while updating approprate statistics

func (*UNI) State

func (uni *UNI) State() fsm.State

func (*UNI) StateTransitionCallback

func (uni *UNI) StateTransitionCallback(state fsm.State) error

StateTransitionCallback is called after transition to the new state and when the FSM mutex is locked. If synchronous, it will call directly into method. If async, uses a go routine to call the callback

func (*UNI) String

func (uni *UNI) String() string

Convert type to string

func (*UNI) UniGHandler

func (uni *UNI) UniGHandler(request *me.ManagedEntity, existing *interfaces.MeDbEntry, mt omci.MessageType) gopacket.SerializableLayer

Jump to

Keyboard shortcuts

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