Documentation ¶
Index ¶
- Constants
- func GetAllAttributesExceptCounters(attributes me.AttributeValueMap, attrDef me.AttributeDefinitionMap) me.AttributeValueMap
- func GetNewAndModifiedWriteAttributes(newValues me.AttributeValueMap, existing me.AttributeValueMap, ...) me.AttributeValueMap
- func GetNumCounterAttributes(attributes *me.AttributeDefinitionMap) int
- func GetReadAttributes(m *me.ManagedEntity, existing me.AttributeValueMap) (me.AttributeValueMap, mapset.Set)
- func LoadPmIndexMap(indexMap map[string]uint, attrDefs me.AttributeDefinitionMap)
- type ErrorCode
- type IBridge
- type IBridgeManager
- type IBridgePort
- type ICommon
- type IMib
- type IOltOmciEndpoint
- type IOnu
- type IOnuOmciEndpoint
- type IPMCounterGroup
- type IPMCounterOrGauge
- type IPacket
- type MeDbClass
- type MeDbEntry
- type MeDbInstance
- type MeHandler
- type OmciOltServiceEndpoint
- type OmciOnuServiceEndpoint
- func (e *OmciOnuServiceEndpoint) Close()
- func (e *OmciOnuServiceEndpoint) OmciChannel(stream omci_pb.OMCI_OmciChannelServer) error
- func (e *OmciOnuServiceEndpoint) OmciSend(stream omci_pb.OMCI_OmciChannelServer, message *omci_pb.OmciResponse) error
- func (e *OmciOnuServiceEndpoint) PloamChannel(stream omci_pb.OMCI_PloamChannelServer) error
- func (e *OmciOnuServiceEndpoint) PloamSend(stream omci_pb.OMCI_PloamChannelServer, ...) error
- type OmciRequest
- type OmciServiceEndpoint
- type OnuReadOnlyInfo
- type PMControlBlock
- type PMCounter
- type PMGauge
- type PloamRequest
- type ReferenceLink
- type Statistics
- func (stats *Statistics) GetAttributeValues(indexes []int) me.AttributeValueMap
- func (stats *Statistics) Increment(index uint, value uint64) error
- func (stats *Statistics) Lock()
- func (stats *Statistics) On15MinuteIntervalEnd()
- func (stats *Statistics) Reset()
- func (stats *Statistics) Set(index uint, value uint64) error
- func (stats *Statistics) Unlock()
Constants ¶
const ManagedEntityIdAttributeName = "ManagedEntityId"
Variables ¶
This section is empty.
Functions ¶
func GetAllAttributesExceptCounters ¶
func GetAllAttributesExceptCounters(attributes me.AttributeValueMap, attrDef me.AttributeDefinitionMap) me.AttributeValueMap
func GetNewAndModifiedWriteAttributes ¶
func GetNewAndModifiedWriteAttributes(newValues me.AttributeValueMap, existing me.AttributeValueMap, attrDef me.AttributeDefinitionMap) me.AttributeValueMap
func GetNumCounterAttributes ¶
func GetNumCounterAttributes(attributes *me.AttributeDefinitionMap) int
func GetReadAttributes ¶
func GetReadAttributes(m *me.ManagedEntity, existing me.AttributeValueMap) (me.AttributeValueMap, mapset.Set)
func LoadPmIndexMap ¶
func LoadPmIndexMap(indexMap map[string]uint, attrDefs me.AttributeDefinitionMap)
LoadPmIndexMap will load a map that relates the counter/gauge name (key) to the attribute index (1..16). These maps are used to simplify incrementer functions for statistics.
Types ¶
type ErrorCode ¶
Define PON error codes
const ( // ErrorUnknown is the default value ErrorUnknown ErrorCode = iota // ErrorPonUnknownStartupPattern is an error returned when requesting a // PON startup generator with an statup pattern ErrorPonUnknownStartupPattern // ErrorOnuUnknownStartupPattern is an error returned when requesting a // ONU startup generator with an statup pattern ErrorOnuUnknownStartupPattern )
type IBridge ¶
type IBridge interface { GetExtendedStatistics(me.ClassID, uint16) *Statistics SetExtendedStatistics(me.ClassID, *Statistics) me.OmciErrors }
type IBridgeManager ¶
type IBridgeManager interface { GetBridgeService(uint16) IBridge GetBridgePort(uint16) IBridgePort }
type IBridgePort ¶
type IBridgePort interface { GetExtendedStatistics(me.ClassID, uint16) *Statistics SetExtendedStatistics(me.ClassID, *Statistics) me.OmciErrors }
type ICommon ¶
type ICommon interface { // Parent returns the next higher layer ICommon entity Parent() ICommon // ID returns the unique ID for this entity. This ID is only unique // among common types ID() uint // Name or serial number of entity Name() string IsEnabled() bool Configuration() interface{} AddTimers(timer *time.Timer) Input() chan<- interface{} State() fsm.State }
ICommon provides an interface that PON and ONU structs can follow and is used to keep from having a circular import of pon/onu go packages
type IMib ¶
type IMib interface { Set(me.ClassID, uint16, me.AttributeValueMap, ...bool) me.OmciErrors // TODO: Move back to just errors returned or 'nil' on no error to make processing simpler SetAttribute(me.ClassID, uint16, string, interface{}) error Delete(me.ClassID, uint16) error QueryClass(me.ClassID) (map[uint16]MeDbInstance, error) QueryInstance(me.ClassID, uint16) (*MeDbEntry, error) // Special Allocation routines AllocateTCont() (uint16, error) ReleaseTCont(uint16) error GetFreeTContAllocID() uint16 }
IMib implements the MIB database
type IOltOmciEndpoint ¶
type IOltOmciEndpoint interface { RxOmci() chan *omci_pb.OmciResponse RxPloam() chan *omci_pb.PloamDiscoveryResponse }
IOltOmciEndpoint sends and receives OMCI gRPC messages as if it was an OLT
type IOnu ¶
type IOnu interface { ICommon GetMIB() IMib GetCurrentIntervalEndTime() uint8 GetMibCache() OnuReadOnlyInfo AddManagedEntity(item interface{}, attr me.AttributeValueMap) me.OmciErrors DeleteManagedEntity(cid me.ClassID, eid uint16) interface{} GetNextMacAddress() []byte GetHandler(*me.ManagedEntity, me.AttributeValueMap) gopacket.SerializableLayer SetHandler(*me.ManagedEntity, me.AttributeValueMap, me.Results, uint16, uint16) gopacket.SerializableLayer GetBridgeManager() IBridgeManager }
type IOnuOmciEndpoint ¶
type IOnuOmciEndpoint interface { RxOmci() chan *OmciRequest RxPloam() chan *PloamRequest }
IOnuOmciEndpoint sends and receives OMCI gRPC messages as if it was an ONU
type IPMCounterGroup ¶
type IPMCounterOrGauge ¶
type IPacket ¶
IPacket providers are OMCI ME objects in the path of frame transmission and reception
type MeDbClass ¶
type MeDbClass struct { ClassId me.ClassID `yaml:"classId" json:"classId"` Instances map[uint16]MeDbInstance `yaml:"instances" json:"instances"` }
MeDbClass encapsulates all instances of a specific ME Class
func NewMeDbClass ¶
type MeDbEntry ¶
type MeDbEntry struct { ClassId me.ClassID InstanceId uint16 Attributes me.AttributeValueMap }
MeDbEntries are returned by query
type MeDbInstance ¶
type MeDbInstance struct { InstanceId uint16 `yaml:"instanceId" json:"instanceId"` Attributes me.AttributeValueMap `yaml:"attributes" json:"attributes"` // contains filtered or unexported fields }
MeDbInstance encapsulates the Attributes for a single instance of an ME Class
func NewMeDbInstance ¶
func NewMeDbInstance(instanceID uint16) MeDbInstance
func (*MeDbInstance) AddReference ¶
func (inst *MeDbInstance) AddReference(ref ReferenceLink)
AddReference adds a reference link from another ME Instance (ref) to this one
func (*MeDbInstance) ContainsReference ¶
func (inst *MeDbInstance) ContainsReference(ref ReferenceLink) bool
func (*MeDbInstance) Copy ¶
func (inst *MeDbInstance) Copy() MeDbInstance
func (*MeDbInstance) DropReference ¶
func (inst *MeDbInstance) DropReference(ref ReferenceLink)
DropReference removes a reference link from another ME Instance (ref) to this one
func (*MeDbInstance) IsReferenced ¶
func (inst *MeDbInstance) IsReferenced() bool
type MeHandler ¶
type MeHandler func(*me.ManagedEntity, *MeDbEntry, omci.MessageType) gopacket.SerializableLayer
type OmciOltServiceEndpoint ¶
type OmciOltServiceEndpoint struct { OmciServiceEndpoint // Common elements // Client (OLT side specific fields) Olt IOltOmciEndpoint OmciTxChannel chan *omci_pb.OmciRequest PloamTxChannel chan *omci_pb.PloamRequest // contains filtered or unexported fields }
func NewOltOmciEndpoint ¶
func NewOltOmciEndpoint(endPt IOltOmciEndpoint, host string, port string) (*OmciOltServiceEndpoint, error)
NewO)ltOmciEndpoint create a new Client/OLT object with the provided configuration It returns the created Service type
func (*OmciOltServiceEndpoint) Cancel ¶
func (e *OmciOltServiceEndpoint) Cancel()
func (*OmciOltServiceEndpoint) Close ¶
func (e *OmciOltServiceEndpoint) Close()
func (*OmciOltServiceEndpoint) OmciSend ¶
func (e *OmciOltServiceEndpoint) OmciSend(message *omci_pb.OmciRequest) error
func (*OmciOltServiceEndpoint) PloamSend ¶
func (e *OmciOltServiceEndpoint) PloamSend(message *omci_pb.PloamRequest) error
type OmciOnuServiceEndpoint ¶
type OmciOnuServiceEndpoint struct { OmciServiceEndpoint // Common elements // Server (ONU side specific fields) OnuMockService IOnuOmciEndpoint // contains filtered or unexported fields }
func NewOnuOmciEndpoint ¶
func NewOnuOmciEndpoint(endPt IOnuOmciEndpoint, port string, omciChan chan *OmciRequest, ploamChan chan *PloamRequest) (*OmciOnuServiceEndpoint, error)
NewOnuOmciEndpoint create a new Service object with the provided configuration. The service acts as the ONU side of an OMCI channel and receives OMCI Requests and generates OMCI Responses and Autonomous OMCI Notifications. The NewOnuOmciEndpoint function returns the created Service type
func (*OmciOnuServiceEndpoint) Close ¶
func (e *OmciOnuServiceEndpoint) Close()
func (*OmciOnuServiceEndpoint) OmciChannel ¶
func (e *OmciOnuServiceEndpoint) OmciChannel(stream omci_pb.OMCI_OmciChannelServer) error
OmciChannel is used to send/receive OMCI Requests/Responses. The ONU Mock will also use this channel for autonomous ONU notifications.
func (*OmciOnuServiceEndpoint) OmciSend ¶
func (e *OmciOnuServiceEndpoint) OmciSend(stream omci_pb.OMCI_OmciChannelServer, message *omci_pb.OmciResponse) error
func (*OmciOnuServiceEndpoint) PloamChannel ¶
func (e *OmciOnuServiceEndpoint) PloamChannel(stream omci_pb.OMCI_PloamChannelServer) error
PloamChannel is used to send PLOAM (or Impairment) messages from the OLT to the ONU Mock. Only the Discovery request returns a response.
func (*OmciOnuServiceEndpoint) PloamSend ¶
func (e *OmciOnuServiceEndpoint) PloamSend(stream omci_pb.OMCI_PloamChannelServer, message *omci_pb.PloamDiscoveryResponse) error
type OmciRequest ¶
type OmciRequest struct { Request *omci_pb.OmciRequest Stream omci_pb.OMCI_OmciChannelServer // contains filtered or unexported fields }
func (*OmciRequest) Lock ¶
func (o *OmciRequest) Lock()
func (*OmciRequest) Unlock ¶
func (o *OmciRequest) Unlock()
type OmciServiceEndpoint ¶
type OmciServiceEndpoint struct { // Common elements //mutex sync.Mutex Done chan struct{} // contains filtered or unexported fields }
OmciServiceReceiver is responsible for receiving and sending gRPC messages as defined by the OMCI Service
func NewOmciServiceEndpoint ¶
func NewOmciServiceEndpoint() OmciServiceEndpoint
type OnuReadOnlyInfo ¶
type OnuReadOnlyInfo struct { // ONU-G TrafficManagementOption byte // ONU-2G OmccVersion byte SecurityCapability byte PriorityQueueCount uint16 TrafficSchedulerCount byte GemPortCount uint16 ConnectivityCapability uint16 // QOS Flexibility values PriorityQueuePortReadWrite bool PriorityQueueSchedulerFlexible bool PriorityQueuePriorityReadWrite bool SchedulerTContReadWrite bool SchedulerPolicyReadWrite bool TContPolicyReadWrite bool }
onuInfo provides a cache from the MIB database for some commonly used read-only attributes
type PMControlBlock ¶
type PMControlBlock struct { ThresholdDataID uint16 ParentMEClass me.ClassID ParentMEInstance uint16 AccumulationDisable uint16 TCADisable uint16 TCI uint16 // Following from control fields ContinuousCollection bool DownstreamTraffic bool TCIEnabled bool VIDEnabled bool // Following dictates if extended or not Extended bool }
PMControlBlock is present in extended PM statistics
func NewPMControlBlock ¶
func NewPMControlBlock(octets []byte) *PMControlBlock
func (*PMControlBlock) Serialize ¶
func (pm *PMControlBlock) Serialize() []byte
type PMCounter ¶
type PMCounter struct {
// contains filtered or unexported fields
}
PMCounter models a statistical counter that
func NewPMCounter ¶
type PMGauge ¶
type PMGauge struct {
// contains filtered or unexported fields
}
PMGauge is used to store discrete values
func NewPMGauge ¶
type PloamRequest ¶
type PloamRequest struct { Request *omci_pb.PloamRequest Stream omci_pb.OMCI_PloamChannelServer }
type ReferenceLink ¶
ReferenceLink is held by an ME Instance when another (the Referencing cid/eid) has linked to the ME. The ME cannot be deleted while other instances still reference it.
type Statistics ¶
type Statistics struct { ClassID me.ClassID EntityID uint16 // This attribute identifies the most recently finished 15 min interval IntervalEndTime uint8 // This attribute points to an instance of the threshold data 1/2 ME that contains PM // threshold values for regular PM or the Control Block for extended PM ControlBlock PMControlBlock // Data/counters for current interval CurrentInterval map[uint]IPMCounterOrGauge // contains filtered or unexported fields }
Statistics tracks the current interval (or free-running counters). For previous intervals, this is stored in the MIB database
func NewStatistics ¶
func NewStatistics(entity *me.ManagedEntity, control *PMControlBlock, intervalEndTime uint8) *Statistics
func (*Statistics) GetAttributeValues ¶
func (stats *Statistics) GetAttributeValues(indexes []int) me.AttributeValueMap
func (*Statistics) Lock ¶
func (stats *Statistics) Lock()
func (*Statistics) On15MinuteIntervalEnd ¶
func (stats *Statistics) On15MinuteIntervalEnd()
func (*Statistics) Reset ¶
func (stats *Statistics) Reset()
func (*Statistics) Unlock ¶
func (stats *Statistics) Unlock()