omci

package module
v1.3.3 Latest Latest
Warning

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

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

README

OMCI

OMCI gopacket library supports the encoding and decoding of ITU G.988 OMCI messages. Support for the Baseline Message Set has been completed and work is underway to support the Extended Message Set format.

Message Types supported and under unit test

The following OMCI message types currently have been coded and are covered satisfactory by unit tests.

  • CreateRequest
  • CreateResponse
  • DeleteRequest
  • DeleteResponse
  • SetRequest
  • GetRequest
  • GetAllAlarmsRequest
  • GetAllAlarmsResponse
  • GetAllAlarmsNextRequest
  • MibUploadRequest
  • MibUploadResponse
  • MibUploadNextRequest
  • MibResetRequest
  • MibResetResponse
  • SynchronizeTimeRequest
  • DownloadSectionRequest
  • DownloadSectionResponse
  • EndSoftwareDownloadRequest
  • EndSoftwareDownloadResponse
  • CommitSoftwareRequest
  • CommitSoftwareResponse
  • AlarmNotification

Message Types supported but lacking full unit test

The following OMCI message types currently have been coded and are partially covered by unit tests, but work still remains for sufficient/better unit test coverage.

  • SetResponse
  • GetResponse
  • GetAllAlarmsNextResponse
  • MibUploadNextResponse
  • SynchronizeTimeResponse
  • AttributeValueChange
  • RebootRequest
  • RebootResponse
  • StartSoftwareDownloadRequest
  • GetNextRequest
  • GetNextResponse
  • TestResult
  • TestRequest
  • TestResponse
  • GetCurrentDataRequest
  • GetCurrentDataResponse

Message Types supported but lacking any unit test

The following OMCI message types currently have been coded but do not have any unit test coverage.

  • StartSoftwareDownloadResponse
  • ActivateSoftwareRequest
  • ActivateSoftwareResponse

Message Types not yet supported

The following OMCI message types currently have not been coded.

  • SetTableRequest
  • SetTableResponse

Extended Message Set Support

As mentioned earlier, support for the Extended Message Set is underway. Currently, the following Message Types have this support and are covered by unit tests:

  • GetRequest
  • GetResponse
  • DownloadSectionRequest/Response
  • AlarmNotification
  • AttributeValueChange
  • TestResult
Upcoming message types that will be supported

The following provides a list of message types that will eventually support the Extended Message Set in the expected order of implementation. The priority was chosen based on speed improvement requests of operations and ease of implementation.

  • GetCurrentDataRequest/Response

  • MibResetRequest/Response

  • RebootRequest/Response

  • SynchronizeTimeRequest/Response

  • CreateRequest/Response

  • DeleteRequest/Response

  • SetRequest/Response

  • GetNextRequest/Response

  • SetTableRequest/Response

  • MibUploadRequest/Response

  • MibUploadNextRequest/Response

  • GetAllAlarmsRequest/Response

  • GetAllAlarmsNextRequest/Response

  • StartSoftwareDownloadRequest/Response

  • EndSoftwareDownloadRequest/Response

  • CommitSoftwareRequest/Response

  • ActivateSoftwareRequest/Response

  • TestRequest/Response

Current user-test coverage

The make test command can be used to create code coverage support for the library. The current coverage for version 1.0.0 (as of 4/21/2021) is:

File Statement Coverage
layers.go 100%
mebase.go 91.7%
meframe.go 50.8%
messagetypes.go 59.1%
omci.go 79.0%

Other outstanding items

Besides OMCI Message decode/serialization, and associated unit tests, the following items would be needed or useful in a first official release of this library. Some changes are to be done in the generated OMCI ME code as well.

  • Constraint checking (these are not yet fully parsed/provided by the OMCI code generated structs). This feature will hopefully be available in the near future.
  • Add AVC flag for appropriate attributes
  • Add some type of logging support

Also searching through the code for TODO statements will also yield additional areas of work to be performed.

What is not provided by this library

This library is not a full OMCI stack for either an OLT or an ONU. It is focused primarily on packet decode/serialization and a variety of structs and functions that are useful for handling the creation of OMCI frames and handling decoded frames from the PON.

For an OLT-side OMCI stack, you would still need to write:

  • OMCI CC sender & receiver (stop & wait protocol) with appropriate timeout support
  • OLT State machines to support
    • MIB Uploads/Audits/Resynchronization (and a MIB database implemention),
    • More sophisticated get & get-next support to make handle of MEs with lots of attributes or table attributes easy to handle and code,
    • Alarm Table support,
    • OMCI ME/Msg-Type capabilities inquiry,
    • Performance Monitoring collection (and initial time synchronization),
    • Service implementation

For an ONU-side OMCI stack, you would still need to write:

  • OMCC implementation,
  • MIB Database,
  • Get-Next cache for table attributes,
  • MIB upload next cache for MIB uploads,
  • Generation of any alarms/AVC notifications,
  • Actually acting on the create/delete/get/set/... requests from an OLT

Documentation

Overview

Package omci provides a library of routines to create, manipulate, serialize, and decode ITU-T G.988 OMCI messages/packets

Index

Constants

View Source
const (
	CreateRequestType                      = MessageType(byte(me.Create) | me.AR)
	CreateResponseType                     = MessageType(byte(me.Create) | me.AK)
	DeleteRequestType                      = MessageType(byte(me.Delete) | me.AR)
	DeleteResponseType                     = MessageType(byte(me.Delete) | me.AK)
	SetRequestType                         = MessageType(byte(me.Set) | me.AR)
	SetResponseType                        = MessageType(byte(me.Set) | me.AK)
	GetRequestType                         = MessageType(byte(me.Get) | me.AR)
	GetResponseType                        = MessageType(byte(me.Get) | me.AK)
	GetAllAlarmsRequestType                = MessageType(byte(me.GetAllAlarms) | me.AR)
	GetAllAlarmsResponseType               = MessageType(byte(me.GetAllAlarms) | me.AK)
	GetAllAlarmsNextRequestType            = MessageType(byte(me.GetAllAlarmsNext) | me.AR)
	GetAllAlarmsNextResponseType           = MessageType(byte(me.GetAllAlarmsNext) | me.AK)
	MibUploadRequestType                   = MessageType(byte(me.MibUpload) | me.AR)
	MibUploadResponseType                  = MessageType(byte(me.MibUpload) | me.AK)
	MibUploadNextRequestType               = MessageType(byte(me.MibUploadNext) | me.AR)
	MibUploadNextResponseType              = MessageType(byte(me.MibUploadNext) | me.AK)
	MibResetRequestType                    = MessageType(byte(me.MibReset) | me.AR)
	MibResetResponseType                   = MessageType(byte(me.MibReset) | me.AK)
	TestRequestType                        = MessageType(byte(me.Test) | me.AR)
	TestResponseType                       = MessageType(byte(me.Test) | me.AK)
	StartSoftwareDownloadRequestType       = MessageType(byte(me.StartSoftwareDownload) | me.AR)
	StartSoftwareDownloadResponseType      = MessageType(byte(me.StartSoftwareDownload) | me.AK)
	DownloadSectionRequestType             = MessageType(me.DownloadSection) // me.AR is optional
	DownloadSectionRequestWithResponseType = MessageType(byte(me.DownloadSection) | me.AR)
	DownloadSectionResponseType            = MessageType(byte(me.DownloadSection) | me.AK)
	EndSoftwareDownloadRequestType         = MessageType(byte(me.EndSoftwareDownload) | me.AR)
	EndSoftwareDownloadResponseType        = MessageType(byte(me.EndSoftwareDownload) | me.AK)
	ActivateSoftwareRequestType            = MessageType(byte(me.ActivateSoftware) | me.AR)
	ActivateSoftwareResponseType           = MessageType(byte(me.ActivateSoftware) | me.AK)
	CommitSoftwareRequestType              = MessageType(byte(me.CommitSoftware) | me.AR)
	CommitSoftwareResponseType             = MessageType(byte(me.CommitSoftware) | me.AK)
	SynchronizeTimeRequestType             = MessageType(byte(me.SynchronizeTime) | me.AR)
	SynchronizeTimeResponseType            = MessageType(byte(me.SynchronizeTime) | me.AK)
	RebootRequestType                      = MessageType(byte(me.Reboot) | me.AR)
	RebootResponseType                     = MessageType(byte(me.Reboot) | me.AK)
	GetNextRequestType                     = MessageType(byte(me.GetNext) | me.AR)
	GetNextResponseType                    = MessageType(byte(me.GetNext) | me.AK)
	GetCurrentDataRequestType              = MessageType(byte(me.GetCurrentData) | me.AR)
	GetCurrentDataResponseType             = MessageType(byte(me.GetCurrentData) | me.AK)
	SetTableRequestType                    = MessageType(byte(me.SetTable) | me.AR)
	SetTableResponseType                   = MessageType(byte(me.SetTable) | me.AK)

	// Autonomous ONU messages
	AlarmNotificationType    = MessageType(byte(me.AlarmNotification))
	AttributeValueChangeType = MessageType(byte(me.AttributeValueChange))
	TestResultType           = MessageType(byte(me.TestResult))

	// Support mapping of extended format types (use MSB reserved bit)
	ExtendedTypeDecodeOffset = MessageType(byte(0x80))
)
View Source
const AlarmBitmapSize = 224

/////////////////////////////////////////////////////////////////////////// AlarmNotificationMsg

View Source
const MaxAttributeGetNextBaselineLength = MaxBaselineLength - 11 - 8

MaxAttributeGetNextBaselineLength is the maximum payload size for attributes for a Baseline MIB Get Next message for the baseline message set. This is just the attribute portion of the message contents and does not include the Result Code & Attribute Mask.

View Source
const MaxAttributeGetNextExtendedLength = MaxExtendedLength - 13 - 4

MaxAttributeGetNextExtendedLength is the maximum payload size for attributes for a Extended MIB Get Next message. This is just the attribute portion of the message contents and does not include the Result Code & Attribute Mask.

View Source
const MaxAttributeMibUploadNextBaselineLength = MaxBaselineLength - 14 - 8

MaxAttributeMibUploadNextBaselineLength is the maximum payload size for attributes for a Baseline MIB Upload Next message.29

View Source
const MaxBaselineLength = 48

MaxBaselineLength is the maximum number of octets allowed in an OMCI Baseline message. Depending on the adapter, it may or may not include the

View Source
const MaxDownloadSectionExtendedLength = MaxExtendedLength - 11 - 4

MaxDownloadSectionExtendedLength is the maximum payload size for section data of a Download Section request message for the extended message set.

View Source
const MaxDownloadSectionLength = 31

MaxDownloadSectionLength is the maximum payload size for section data of a Download Section request message for the baseline message set.

View Source
const MaxExtendedLength = 1980

MaxExtendedLength is the maximum number of octets allowed in an OMCI Extended message (including header).

View Source
const MaxManagedEntityMibUploadNextExtendedLength = MaxExtendedLength - 10 - 4

MaxManagedEntityMibUploadNextExtendedLength is the maximum payload size for ME entries for an Extended MIB Upload Next message. Extended messages differ from the baseline as multiple MEs can be reported in a single frame, just not multiple attributes.

View Source
const MaxTestRequestLength = MaxBaselineLength - 8 - 8

MaxTestRequestLength is the maximum payload size for test request message for the baseline message set.

View Source
const MaxTestResultsLength = MaxBaselineLength - 8 - 8

MaxTestResultsLength is the maximum payload size for test results message for the baseline message set.

View Source
const NullEntityID = uint16(0xffff)

NullEntityID is often used as the Null/void Managed Entity ID for attributes that are used to refer to other Managed Entities but are currently not provisioned.

Variables

View Source
var (
	// Baseline Message Types
	LayerTypeCreateRequest                gopacket.LayerType
	LayerTypeDeleteRequest                gopacket.LayerType
	LayerTypeSetRequest                   gopacket.LayerType
	LayerTypeGetRequest                   gopacket.LayerType
	LayerTypeGetAllAlarmsRequest          gopacket.LayerType
	LayerTypeGetAllAlarmsNextRequest      gopacket.LayerType
	LayerTypeMibUploadRequest             gopacket.LayerType
	LayerTypeMibUploadNextRequest         gopacket.LayerType
	LayerTypeMibResetRequest              gopacket.LayerType
	LayerTypeTestRequest                  gopacket.LayerType
	LayerTypeStartSoftwareDownloadRequest gopacket.LayerType
	LayerTypeDownloadSectionRequest       gopacket.LayerType
	LayerTypeDownloadSectionLastRequest   gopacket.LayerType
	LayerTypeEndSoftwareDownloadRequest   gopacket.LayerType
	LayerTypeActivateSoftwareRequest      gopacket.LayerType
	LayerTypeCommitSoftwareRequest        gopacket.LayerType
	LayerTypeSynchronizeTimeRequest       gopacket.LayerType
	LayerTypeRebootRequest                gopacket.LayerType
	LayerTypeGetNextRequest               gopacket.LayerType
	LayerTypeGetCurrentDataRequest        gopacket.LayerType
	LayerTypeSetTableRequest              gopacket.LayerType

	// Extended Request Message Types
	LayerTypeGetRequestExtended                 gopacket.LayerType
	LayerTypeDownloadSectionRequestExtended     gopacket.LayerType
	LayerTypeDownloadSectionLastRequestExtended gopacket.LayerType
)
View Source
var (
	// Baseline Message Types
	LayerTypeCreateResponse                gopacket.LayerType
	LayerTypeDeleteResponse                gopacket.LayerType
	LayerTypeSetResponse                   gopacket.LayerType
	LayerTypeGetResponse                   gopacket.LayerType
	LayerTypeGetAllAlarmsResponse          gopacket.LayerType
	LayerTypeGetAllAlarmsNextResponse      gopacket.LayerType
	LayerTypeMibUploadResponse             gopacket.LayerType
	LayerTypeMibUploadNextResponse         gopacket.LayerType
	LayerTypeMibResetResponse              gopacket.LayerType
	LayerTypeAlarmNotification             gopacket.LayerType
	LayerTypeAttributeValueChange          gopacket.LayerType
	LayerTypeTestResponse                  gopacket.LayerType
	LayerTypeStartSoftwareDownloadResponse gopacket.LayerType
	LayerTypeDownloadSectionResponse       gopacket.LayerType
	LayerTypeEndSoftwareDownloadResponse   gopacket.LayerType
	LayerTypeActivateSoftwareResponse      gopacket.LayerType
	LayerTypeCommitSoftwareResponse        gopacket.LayerType
	LayerTypeSynchronizeTimeResponse       gopacket.LayerType
	LayerTypeRebootResponse                gopacket.LayerType
	LayerTypeGetNextResponse               gopacket.LayerType
	LayerTypeTestResult                    gopacket.LayerType
	LayerTypeGetCurrentDataResponse        gopacket.LayerType
	LayerTypeSetTableResponse              gopacket.LayerType

	// Extended Response/Notification Message Types
	LayerTypeGetResponseExtended             gopacket.LayerType
	LayerTypeDownloadSectionResponseExtended gopacket.LayerType
	LayerTypeAlarmNotificationExtended       gopacket.LayerType
	LayerTypeAttributeValueChangeExtended    gopacket.LayerType
	LayerTypeTestResultExtended              gopacket.LayerType
)
View Source
var (
	LayerTypeOMCI gopacket.LayerType
)

LayerTypeOmci provide a gopacket LayerType for OMCI messages

Functions

func ActivateSoftwareRequestFrame

func ActivateSoftwareRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func ActivateSoftwareResponseFrame

func ActivateSoftwareResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func AlarmNotificationFrame

func AlarmNotificationFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func AttributeValueChangeFrame

func AttributeValueChangeFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func CommitSoftwareRequestFrame

func CommitSoftwareRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func CommitSoftwareResponseFrame

func CommitSoftwareResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func CreateRequestFrame

func CreateRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func CreateResponseFrame

func CreateResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func DeleteRequestFrame

func DeleteRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func DeleteResponseFrame

func DeleteResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func DownloadSectionRequestFrame

func DownloadSectionRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func DownloadSectionResponseFrame

func DownloadSectionResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func EndSoftwareDownloadRequestFrame

func EndSoftwareDownloadRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func EndSoftwareDownloadResponseFrame

func EndSoftwareDownloadResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GenFrame

func GenFrame(meInstance *me.ManagedEntity, messageType MessageType, options ...FrameOption) ([]byte, error)

GenFrame is a helper function to make tests a little easier to read. For a real application, use the .../omci/generated/class.go 'New' functions to create your Managed Entity and then use it to call the EncodeFrame method.

func GetAllAlarmsNextRequestFrame

func GetAllAlarmsNextRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetAllAlarmsNextResponseFrame

func GetAllAlarmsNextResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetAllAlarmsRequestFrame

func GetAllAlarmsRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetAllAlarmsResponseFrame

func GetAllAlarmsResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetCurrentDataRequestFrame

func GetCurrentDataRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetCurrentDataResponseFrame

func GetCurrentDataResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetNextRequestFrame

func GetNextRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetNextResponseFrame

func GetNextResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetRequestFrame

func GetRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func GetResponseFrame

func GetResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func MibResetRequestFrame

func MibResetRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func MibResetResponseFrame

func MibResetResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func MibUploadNextRequestFrame

func MibUploadNextRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func MibUploadNextResponseFrame

func MibUploadNextResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func MibUploadRequestFrame

func MibUploadRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func MibUploadResponseFrame

func MibUploadResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func MsgTypeToNextLayer

func MsgTypeToNextLayer(mt MessageType, isExtended bool) (gopacket.LayerType, error)

func RebootRequestFrame

func RebootRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func RebootResponseFrame

func RebootResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func SetRequestFrame

func SetRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func SetResponseFrame

func SetResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func SetTableRequestFrame

func SetTableRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func SetTableResponseFrame

func SetTableResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func StartSoftwareDownloadRequestFrame

func StartSoftwareDownloadRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func StartSoftwareDownloadResponseFrame

func StartSoftwareDownloadResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func SynchronizeTimeRequestFrame

func SynchronizeTimeRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

func SynchronizeTimeResponseFrame

func SynchronizeTimeResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error)

Types

type ActivateSoftwareRequest

type ActivateSoftwareRequest struct {
	MeBasePacket  // Note: EntityInstance for software download is two specific values
	ActivateFlags byte
}

///////////////////////////////////////////////////////////////////////////

func (*ActivateSoftwareRequest) DecodeFromBytes

func (omci *ActivateSoftwareRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of an Activate Software Request into this layer

func (*ActivateSoftwareRequest) SerializeTo

SerializeTo provides serialization of an Activate Software message

func (*ActivateSoftwareRequest) String

func (omci *ActivateSoftwareRequest) String() string

type ActivateSoftwareResponse

type ActivateSoftwareResponse struct {
	MeBasePacket
	Result me.Results
}

///////////////////////////////////////////////////////////////////////////

func (*ActivateSoftwareResponse) DecodeFromBytes

func (omci *ActivateSoftwareResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of an Activate Softwre Response into this layer

func (*ActivateSoftwareResponse) SerializeTo

SerializeTo provides serialization of an Activate Software Response message

func (*ActivateSoftwareResponse) String

func (omci *ActivateSoftwareResponse) String() string

type AlarmNotificationMsg

type AlarmNotificationMsg struct {
	MeBasePacket
	AlarmBitmap [AlarmBitmapSize / 8]byte

	AlarmSequenceNumber byte
	// contains filtered or unexported fields
}

func (*AlarmNotificationMsg) ActivateAlarm

func (omci *AlarmNotificationMsg) ActivateAlarm(alarmNumber uint8) error

func (*AlarmNotificationMsg) ClearAlarm

func (omci *AlarmNotificationMsg) ClearAlarm(alarmNumber uint8) error

func (*AlarmNotificationMsg) DecodeFromBytes

func (omci *AlarmNotificationMsg) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of an Alarm Notification into this layer

func (*AlarmNotificationMsg) IsAlarmActive

func (omci *AlarmNotificationMsg) IsAlarmActive(alarmNumber uint8) (bool, error)

func (*AlarmNotificationMsg) IsAlarmClear

func (omci *AlarmNotificationMsg) IsAlarmClear(alarmNumber uint8) (bool, error)

func (*AlarmNotificationMsg) SerializeTo

SerializeTo provides serialization of an Alarm Notification message

func (*AlarmNotificationMsg) String

func (omci *AlarmNotificationMsg) String() string

type AlarmOptions

type AlarmOptions struct {
	AlarmClassID  me.ClassID
	AlarmInstance uint16
	AlarmBitmap   []byte // Should be up to 58 octets
}

Alarm related frames have a wide variety of settable values. Placing them in a separate struct is mainly to keep the base options simple

type AttributeValueChangeMsg

type AttributeValueChangeMsg struct {
	MeBasePacket
	AttributeMask uint16
	Attributes    me.AttributeValueMap
}

/////////////////////////////////////////////////////////////////////////// AttributeValueChangeMsg

func (*AttributeValueChangeMsg) DecodeFromBytes

func (omci *AttributeValueChangeMsg) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of an Attribute Value Change notification into this layer

func (*AttributeValueChangeMsg) SerializeTo

SerializeTo provides serialization of an Attribute Value Change Notification message

func (*AttributeValueChangeMsg) String

func (omci *AttributeValueChangeMsg) String() string

type CommitSoftwareRequest

type CommitSoftwareRequest struct {
	MeBasePacket
}

///////////////////////////////////////////////////////////////////////////

func (*CommitSoftwareRequest) DecodeFromBytes

func (omci *CommitSoftwareRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Commit Software Request into this layer

func (*CommitSoftwareRequest) SerializeTo

SerializeTo provides serialization of an Commit Software Request message

func (*CommitSoftwareRequest) String

func (omci *CommitSoftwareRequest) String() string

type CommitSoftwareResponse

type CommitSoftwareResponse struct {
	MeBasePacket
	Result me.Results
}

///////////////////////////////////////////////////////////////////////////

func (*CommitSoftwareResponse) DecodeFromBytes

func (omci *CommitSoftwareResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Commit Softwar Response into this layer

func (*CommitSoftwareResponse) SerializeTo

SerializeTo provides serialization of an Commit Software Response message

func (*CommitSoftwareResponse) String

func (omci *CommitSoftwareResponse) String() string

type CreateRequest

type CreateRequest struct {
	MeBasePacket
	Attributes me.AttributeValueMap
}

/////////////////////////////////////////////////////////////////////////// CreateRequest

func (*CreateRequest) DecodeFromBytes

func (omci *CreateRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Create Request into this layer

func (*CreateRequest) SerializeTo

SerializeTo provides serialization of an Create Request Message

func (*CreateRequest) String

func (omci *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {
	MeBasePacket
	Result                 me.Results
	AttributeExecutionMask uint16 // Used when Result == ParameterError
}

/////////////////////////////////////////////////////////////////////////// CreateResponse

func (*CreateResponse) DecodeFromBytes

func (omci *CreateResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Create Response into this layer

func (*CreateResponse) SerializeTo

SerializeTo provides serialization of an Create Response message

func (*CreateResponse) String

func (omci *CreateResponse) String() string

type DeleteRequest

type DeleteRequest struct {
	MeBasePacket
}

/////////////////////////////////////////////////////////////////////////// DeleteRequest

func (*DeleteRequest) DecodeFromBytes

func (omci *DeleteRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Delete Request into this layer

func (*DeleteRequest) SerializeTo

SerializeTo provides serialization of an Delete Request message

func (*DeleteRequest) String

func (omci *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	MeBasePacket
	Result me.Results
}

/////////////////////////////////////////////////////////////////////////// DeleteResponse

func (*DeleteResponse) DecodeFromBytes

func (omci *DeleteResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Delete Response into this layer

func (*DeleteResponse) SerializeTo

SerializeTo provides serialization of an Delete Response message

func (*DeleteResponse) String

func (omci *DeleteResponse) String() string

type DeviceIdent

type DeviceIdent byte

DeviceIdent identifies the OMCI message format. Currently either baseline or extended.

const (

	// BaselineIdent message are composed of a fixed 40 octet packet + 8-octet trailer. All
	// G-PON OLTs and ONUs support the baseline message set
	BaselineIdent DeviceIdent = 0x0A

	// ExtendedIdent messager are up to 1920 octets but may not be supported by all ONUs or OLTs.
	ExtendedIdent DeviceIdent = 0x0B
)

func (DeviceIdent) String

func (di DeviceIdent) String() string

type DownloadResults added in v0.16.1

type DownloadResults struct {
	ManagedEntityID uint16 // ME ID of software image entity instance (slot number plus instance 0..1 or 2..254 vendor-specific)
	Result          me.Results
}

///////////////////////////////////////////////////////////////////////////

func (*DownloadResults) String added in v0.16.1

func (dr *DownloadResults) String() string

type DownloadSectionRequest

type DownloadSectionRequest struct {
	MeBasePacket  // Note: EntityInstance for software download is two specific values
	SectionNumber byte
	SectionData   []byte // 0 padding if final transfer requires only a partial block for baseline set
}

DownloadSectionRequest data is bound by the message set in use. For the Baseline message set use MaxDownloadSectionLength and for the Extended message set, MaxDownloadSectionExtendedLength is provided

func (*DownloadSectionRequest) DecodeFromBytes

func (omci *DownloadSectionRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Download Section Request into this layer

func (*DownloadSectionRequest) SerializeTo

SerializeTo provides serialization of an Download Section Request message

func (*DownloadSectionRequest) String

func (omci *DownloadSectionRequest) String() string

type DownloadSectionResponse

type DownloadSectionResponse struct {
	MeBasePacket  // Note: EntityInstance for software download is two specific values
	Result        me.Results
	SectionNumber byte
}

///////////////////////////////////////////////////////////////////////////

func (*DownloadSectionResponse) DecodeFromBytes

func (omci *DownloadSectionResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Download Section Response into this layer

func (*DownloadSectionResponse) SerializeTo

SerializeTo provides serialization of an Download Section Response message

func (*DownloadSectionResponse) String

func (omci *DownloadSectionResponse) String() string

type EndSoftwareDownloadRequest

type EndSoftwareDownloadRequest struct {
	MeBasePacket      // Note: EntityInstance for software download is two specific values
	CRC32             uint32
	ImageSize         uint32
	NumberOfInstances byte
	ImageInstances    []uint16
}

///////////////////////////////////////////////////////////////////////////

func (*EndSoftwareDownloadRequest) DecodeFromBytes

func (omci *EndSoftwareDownloadRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of an End Software Download Request into this layer

func (*EndSoftwareDownloadRequest) SerializeTo

SerializeTo provides serialization of an End Software Download Request message

func (*EndSoftwareDownloadRequest) String

func (omci *EndSoftwareDownloadRequest) String() string

type EndSoftwareDownloadResponse

type EndSoftwareDownloadResponse struct {
	MeBasePacket      // Note: EntityInstance for software download is two specific values
	Result            me.Results
	NumberOfInstances byte
	MeResults         []DownloadResults
}

///////////////////////////////////////////////////////////////////////////

func (*EndSoftwareDownloadResponse) DecodeFromBytes

func (omci *EndSoftwareDownloadResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of an End Software Download Response into this layer

func (*EndSoftwareDownloadResponse) SerializeTo

SerializeTo provides serialization of an End Software Download Response message

func (*EndSoftwareDownloadResponse) String

func (omci *EndSoftwareDownloadResponse) String() string

type FrameOption

type FrameOption func(*options)

FrameOption sets options such as frame format, etc.

func AddDefaults

func AddDefaults(add bool) FrameOption

AddDefaults is used to specify that if a SetByCreate attribute is not specified in the list of attributes for a Create Request, use the attribute defined default

func Alarm

func Alarm(ao AlarmOptions) FrameOption

Alarm is used to specify a collection of options related to Alarm notifications

func AttributeExecutionMask

func AttributeExecutionMask(m uint16) FrameOption

AttributeExecutionMask is used by the Create and Set Response frames to indicate attributes that failed to be created/set.

func AttributeMask

func AttributeMask(m uint16) FrameOption

attributeMask determines the attributes to encode into the frame. The default value is 0xFFFF which specifies all available attributes in the frame

func FailIfTruncated

func FailIfTruncated(f bool) FrameOption

FailIfTruncated determines whether a request to encode a frame that does not have enough room for all requested options should fail and return an error.

If set to 'false', the behaviour depends on the message type/operation requested. The table below provides more information:

  Request Type	Behavour
	 ------------------------------------------------------------------------
	 CreateRequest  A single CreateRequest struct is always returned as the
                 CreateRequest message does not have an attributes Mask
                 field and a Baseline OMCI message is large enough to
                 support all Set-By-Create attributes.

  GetResponse	If multiple OMCI response frames are needed to return
					all requested attributes, only the attributes that can
					fit will be returned and the FailedAttributeMask field
					set to the attributes that could not be returned

					If this is an ME with an attribute that is a table, the
					first GetResponse struct will return the size of the
					attribute and the following GetNextResponse structs will
					contain the attribute data. The ONU application is
					responsible for stashing these extra struct(s) away in
					anticipation of possible GetNext Requests occurring for
					the attribute.  See the discussion on Table attributes
					in the GetResponse section of ITU G.988 for more
					information.

If set to 'true', no struct(s) are returned and an error is provided.

The default value is 'false'

func FrameFormat

func FrameFormat(ff DeviceIdent) FrameOption

FrameFormat determines determines the OMCI message format used on the fiber. The default value is BaselineIdent

func Payload

func Payload(p interface{}) FrameOption

Payload is used to specify ME payload options that are not simple types. This include the ME (list of MEs) to encode into a GetNextMibUpload response, the alarm bitmap for alarm relates responses/notifications, alarm bitmaps, and for specifying the download section data when performing Software Download.

func RebootCondition

func RebootCondition(m uint8) FrameOption

RebootCondition is to specify the the Reboot Condition for a ONU Reboot request

func Result

func Result(r me.Results) FrameOption

Result is used to set returned results in responses that have that field

func RetrievalMode

func RetrievalMode(m uint8) FrameOption

RetrievalMode is to specify the the Alarm Retrieval Mode in a GetAllAlarms Request

func SequenceNumberCountOrSize

func SequenceNumberCountOrSize(m uint16) FrameOption

SequenceNumberCountOrSize is used by the GetNext and MibUploadGetNext request frames and for frames that return number of commands or length such as Get (table attribute) or MibUpload/GetAllAlarms/...

func Software

func Software(so SoftwareOptions) FrameOption

Software is used to specify a collection of options related to Software image manipulation

func SuccessResult

func SuccessResult(m uint8) FrameOption

SuccessResult is to specify the the SuccessResult for a SynchronizeTime Response

func TransactionID

func TransactionID(tid uint16) FrameOption

TransactionID is to specify the TID in the OMCI header. The default is zero which requires the caller to set it to the appropriate value if this is not an autonomous ONU notification frame

func UnsupportedAttributeMask

func UnsupportedAttributeMask(m uint16) FrameOption

UnsupportedAttributeMask is used by the Set Response frames to indicate attributes are not supported on this ONU

type GetAllAlarmsNextRequest

type GetAllAlarmsNextRequest struct {
	MeBasePacket
	CommandSequenceNumber uint16
}

/////////////////////////////////////////////////////////////////////////// GetAllAlarms

func (*GetAllAlarmsNextRequest) DecodeFromBytes

func (omci *GetAllAlarmsNextRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get All Alarms Next Request into this layer

func (*GetAllAlarmsNextRequest) SerializeTo

SerializeTo provides serialization of an Get All Alarms Next Request message

func (*GetAllAlarmsNextRequest) String

func (omci *GetAllAlarmsNextRequest) String() string

type GetAllAlarmsNextResponse

type GetAllAlarmsNextResponse struct {
	MeBasePacket
	AlarmEntityClass    me.ClassID
	AlarmEntityInstance uint16
	AlarmBitMap         [28]byte // 224 bits
}

/////////////////////////////////////////////////////////////////////////// GetAllAlarms

func (*GetAllAlarmsNextResponse) DecodeFromBytes

func (omci *GetAllAlarmsNextResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get All Alarms Next Response into this layer

func (*GetAllAlarmsNextResponse) SerializeTo

SerializeTo provides serialization of an Get All Alarms Next Response message

func (*GetAllAlarmsNextResponse) String

func (omci *GetAllAlarmsNextResponse) String() string

type GetAllAlarmsRequest

type GetAllAlarmsRequest struct {
	MeBasePacket
	AlarmRetrievalMode byte
}

/////////////////////////////////////////////////////////////////////////// GetAllAlarms

func (*GetAllAlarmsRequest) DecodeFromBytes

func (omci *GetAllAlarmsRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get All Alarms Request into this layer

func (*GetAllAlarmsRequest) SerializeTo

SerializeTo provides serialization of an Get All Alarms Request message

func (*GetAllAlarmsRequest) String

func (omci *GetAllAlarmsRequest) String() string

type GetAllAlarmsResponse

type GetAllAlarmsResponse struct {
	MeBasePacket
	NumberOfCommands uint16
}

/////////////////////////////////////////////////////////////////////////// GetAllAlarms

func (*GetAllAlarmsResponse) DecodeFromBytes

func (omci *GetAllAlarmsResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get All Alarms Response into this layer

func (*GetAllAlarmsResponse) SerializeTo

SerializeTo provides serialization of an Get All Alarms Response message

func (*GetAllAlarmsResponse) String

func (omci *GetAllAlarmsResponse) String() string

type GetCurrentDataRequest

type GetCurrentDataRequest struct {
	MeBasePacket
	AttributeMask uint16
}

///////////////////////////////////////////////////////////////////////////

func (*GetCurrentDataRequest) DecodeFromBytes

func (omci *GetCurrentDataRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get Current Data Request into this layer

func (*GetCurrentDataRequest) SerializeTo

SerializeTo provides serialization of an Get Current Data Request message

func (*GetCurrentDataRequest) String

func (omci *GetCurrentDataRequest) String() string

type GetCurrentDataResponse

type GetCurrentDataResponse struct {
	MeBasePacket
	Result                   me.Results
	AttributeMask            uint16
	UnsupportedAttributeMask uint16
	FailedAttributeMask      uint16
	Attributes               me.AttributeValueMap
}

///////////////////////////////////////////////////////////////////////////

func (*GetCurrentDataResponse) DecodeFromBytes

func (omci *GetCurrentDataResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get Current Data Respnse into this layer

func (*GetCurrentDataResponse) SerializeTo

SerializeTo provides serialization of an Get Current Data Message Type Response

func (*GetCurrentDataResponse) String

func (omci *GetCurrentDataResponse) String() string

type GetNextRequest

type GetNextRequest struct {
	MeBasePacket
	AttributeMask  uint16
	SequenceNumber uint16
}

///////////////////////////////////////////////////////////////////////////

func (*GetNextRequest) DecodeFromBytes

func (omci *GetNextRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get Next Request into this layer

func (*GetNextRequest) SerializeTo

SerializeTo provides serialization of an Get Next Message Type Request

func (*GetNextRequest) String

func (omci *GetNextRequest) String() string

type GetNextResponse

type GetNextResponse struct {
	MeBasePacket
	Result        me.Results
	AttributeMask uint16
	Attributes    me.AttributeValueMap
}

///////////////////////////////////////////////////////////////////////////

func (*GetNextResponse) DecodeFromBytes

func (omci *GetNextResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get Next Response into this layer

func (*GetNextResponse) SerializeTo

SerializeTo provides serialization of an Get Next Message Type Response

func (*GetNextResponse) String

func (omci *GetNextResponse) String() string

SerializeTo provides serialization of an Get Next Message Type Response

type GetRequest

type GetRequest struct {
	MeBasePacket
	AttributeMask uint16
}

/////////////////////////////////////////////////////////////////////////// GetRequest

func (*GetRequest) DecodeFromBytes

func (omci *GetRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get Request into this layer

func (*GetRequest) SerializeTo

SerializeTo provides serialization of an Get Request message

func (*GetRequest) SerializeToExtended added in v1.0.0

func (omci *GetRequest) SerializeToExtended(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

func (*GetRequest) String

func (omci *GetRequest) String() string

type GetResponse

type GetResponse struct {
	MeBasePacket
	Result                   me.Results
	AttributeMask            uint16
	Attributes               me.AttributeValueMap
	UnsupportedAttributeMask uint16
	FailedAttributeMask      uint16
}

/////////////////////////////////////////////////////////////////////////// GetResponse

func (*GetResponse) DecodeFromBytes

func (omci *GetResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Get Response into this layer

func (*GetResponse) SerializeTo

SerializeTo provides serialization of an Get Response message

func (*GetResponse) String

func (omci *GetResponse) String() string

type MeBasePacket

type MeBasePacket struct {
	EntityClass    me.ClassID
	EntityInstance uint16

	gopacket.Layer
	layers.BaseLayer
	MsgLayerType gopacket.LayerType
	Extended     bool
}

func (*MeBasePacket) CanDecode

func (msg *MeBasePacket) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode

func (*MeBasePacket) DecodeFromBytes

func (msg *MeBasePacket) DecodeFromBytes(data []byte, p gopacket.PacketBuilder, contentSize int) error

DecodeFromBytes decodes the given bytes into this layer

func (*MeBasePacket) LayerContents

func (msg *MeBasePacket) LayerContents() []byte

LayerContents returns the bytes of the packet layer.

func (*MeBasePacket) LayerPayload

func (msg *MeBasePacket) LayerPayload() []byte

LayerPayload returns the bytes contained within the packet layer

func (*MeBasePacket) LayerType

func (msg *MeBasePacket) LayerType() gopacket.LayerType

LayerType returns MsgLayerType. It partially satisfies Layer and SerializableLayer

func (*MeBasePacket) NextLayerType

func (msg *MeBasePacket) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer

func (*MeBasePacket) SerializeTo

func (msg *MeBasePacket) SerializeTo(b gopacket.SerializeBuffer) error

SerializeTo provides serialization of this message layer

func (*MeBasePacket) String

func (msg *MeBasePacket) String() string

type MessageType

type MessageType byte

MessageType is the OMCI Message Type or'ed with the AR/AK flags as appropriate.

func (MessageType) String

func (mt MessageType) String() string

type MibResetRequest

type MibResetRequest struct {
	MeBasePacket
}

/////////////////////////////////////////////////////////////////////////// MibResetRequest

func (*MibResetRequest) DecodeFromBytes

func (omci *MibResetRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a MIB Reset Request into this layer

func (*MibResetRequest) SerializeTo

SerializeTo provides serialization of an MIB Reset Request message

func (*MibResetRequest) String

func (omci *MibResetRequest) String() string

type MibResetResponse

type MibResetResponse struct {
	MeBasePacket
	Result me.Results
}

/////////////////////////////////////////////////////////////////////////// MibResetResponse

func (*MibResetResponse) DecodeFromBytes

func (omci *MibResetResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a MIB Reset Response into this layer

func (*MibResetResponse) SerializeTo

SerializeTo provides serialization of an MIB Reset Response message

func (*MibResetResponse) String

func (omci *MibResetResponse) String() string

type MibUploadNextRequest

type MibUploadNextRequest struct {
	MeBasePacket
	CommandSequenceNumber uint16
}

///////////////////////////////////////////////////////////////////////////

func (*MibUploadNextRequest) DecodeFromBytes

func (omci *MibUploadNextRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a MIB Upload Next Request into this layer

func (*MibUploadNextRequest) SerializeTo

SerializeTo provides serialization of an MIB Upload Next Request message

func (*MibUploadNextRequest) String

func (omci *MibUploadNextRequest) String() string

type MibUploadNextResponse

type MibUploadNextResponse struct {
	MeBasePacket
	ReportedME me.ManagedEntity
}

///////////////////////////////////////////////////////////////////////////

func (*MibUploadNextResponse) DecodeFromBytes

func (omci *MibUploadNextResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a MIB Upload Next Response into this layer

func (*MibUploadNextResponse) SerializeTo

SerializeTo provides serialization of an MIB Upload Next Response message

func (*MibUploadNextResponse) String

func (omci *MibUploadNextResponse) String() string

type MibUploadRequest

type MibUploadRequest struct {
	MeBasePacket
}

/////////////////////////////////////////////////////////////////////////// MibUploadRequest

func (*MibUploadRequest) DecodeFromBytes

func (omci *MibUploadRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a MIB Upload Request into this layer

func (*MibUploadRequest) SerializeTo

SerializeTo provides serialization of an MIB Upload Request message

func (*MibUploadRequest) String

func (omci *MibUploadRequest) String() string

type MibUploadResponse

type MibUploadResponse struct {
	MeBasePacket
	NumberOfCommands uint16
}

/////////////////////////////////////////////////////////////////////////// MibUploadResponse

func (*MibUploadResponse) DecodeFromBytes

func (omci *MibUploadResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a MIB Upload Response into this layer

func (*MibUploadResponse) SerializeTo

SerializeTo provides serialization of an MIB Upload Response message

func (*MibUploadResponse) String

func (omci *MibUploadResponse) String() string

type OMCI

type OMCI struct {
	layers.BaseLayer
	TransactionID    uint16
	MessageType      MessageType
	DeviceIdentifier DeviceIdent
	ResponseExpected bool   // Significant for Download Section Request only
	Payload          []byte // TODO: Deprecated.  Use layers.BaseLayer.Payload
	Length           uint16
	MIC              uint32
}

OMCI defines the common protocol. Extended will be added once I can get basic working (and layered properly). See ITU-T G.988 11/2017 section A.3 for more information

func EncodeFrame

func EncodeFrame(m *me.ManagedEntity, messageType MessageType, opt ...FrameOption) (*OMCI, gopacket.SerializableLayer, error)

EncodeFrame will encode the Managed Entity specific protocol struct and an OMCILayer struct. This struct can be provided to the gopacket.SerializeLayers() function to be serialized into a buffer for transmission.

func (*OMCI) CanDecode

func (omci *OMCI) CanDecode() gopacket.LayerClass

CanDecode returns the layers that this class can decode

func (*OMCI) DecodeFromBytes

func (omci *OMCI) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes will decode the OMCI layer of a packet/message

func (*OMCI) LayerContents

func (omci *OMCI) LayerContents() []byte

LayerContents returns the OMCI specific layer information

func (*OMCI) LayerType

func (omci *OMCI) LayerType() gopacket.LayerType

LayerType returns LayerTypeOMCI

func (*OMCI) NextLayerType

func (omci *OMCI) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*OMCI) SerializeTo

func (omci *OMCI) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*OMCI) String

func (omci *OMCI) String() string

type OpticalLineSupervisionTestRequest added in v1.1.0

type OpticalLineSupervisionTestRequest struct {
	MeBasePacket
	SelectTest               uint8  // Bitfield
	GeneralPurposeBuffer     uint16 // Pointer to General Purpose Buffer ME
	VendorSpecificParameters uint16 // Pointer to Octet String ME
}

func (*OpticalLineSupervisionTestRequest) DecodeFromBytes added in v1.1.0

func (omci *OpticalLineSupervisionTestRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Test Result Notification into this layer

func (*OpticalLineSupervisionTestRequest) SerializeTo added in v1.1.0

SerializeTo provides serialization of an Test Result notification message

func (*OpticalLineSupervisionTestRequest) String added in v1.1.0

func (*OpticalLineSupervisionTestRequest) TestRequest added in v1.1.0

func (omci *OpticalLineSupervisionTestRequest) TestRequest() []byte

type OpticalLineSupervisionTestResult added in v1.1.0

type OpticalLineSupervisionTestResult struct {
	MeBasePacket
	PowerFeedVoltageType     uint8  // Type = 1
	PowerFeedVoltage         uint16 // value
	ReceivedOpticalPowerType uint8  // Type = 3
	ReceivedOpticalPower     uint16 // value
	MeanOpticalLaunchType    uint8  // Type = 5
	MeanOpticalLaunch        uint16 // value
	LaserBiasCurrentType     uint8  // Type = 9
	LaserBiasCurrent         uint16 // value
	TemperatureType          uint8  // Type = 12
	Temperature              uint16 // value

	GeneralPurposeBuffer uint16 // Pointer to General Purpose Buffer ME
}

OpticalLineSupervisionTestResult provides a Optical Specific test results message decode for the associated Managed Entities

func (*OpticalLineSupervisionTestResult) DecodeFromBytes added in v1.1.0

func (omci *OpticalLineSupervisionTestResult) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Test Result Notification into this layer

func (*OpticalLineSupervisionTestResult) SerializeTo added in v1.1.0

SerializeTo provides serialization of an Test Result notification message

func (*OpticalLineSupervisionTestResult) String added in v1.1.0

func (*OpticalLineSupervisionTestResult) TestResults added in v1.1.0

func (omci *OpticalLineSupervisionTestResult) TestResults() []byte

type RebootRequest

type RebootRequest struct {
	MeBasePacket
	RebootCondition byte
}

///////////////////////////////////////////////////////////////////////////

func (*RebootRequest) DecodeFromBytes

func (omci *RebootRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Reboot Request into this layer

func (*RebootRequest) SerializeTo

SerializeTo provides serialization of an Reboot Request message

func (*RebootRequest) String

func (omci *RebootRequest) String() string

type RebootResponse

type RebootResponse struct {
	MeBasePacket
	Result me.Results
}

///////////////////////////////////////////////////////////////////////////

func (*RebootResponse) DecodeFromBytes

func (omci *RebootResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Reboot Response into this layer

func (*RebootResponse) SerializeTo

SerializeTo provides serialization of an Reboot Response message

func (*RebootResponse) String

func (omci *RebootResponse) String() string

DecodeFromBytes decodes the given bytes of a Reboot Response into this layer

type SetRequest

type SetRequest struct {
	MeBasePacket
	AttributeMask uint16
	Attributes    me.AttributeValueMap
}

/////////////////////////////////////////////////////////////////////////// SetRequest

func (*SetRequest) DecodeFromBytes

func (omci *SetRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Set Request into this layer

func (*SetRequest) SerializeTo

SerializeTo provides serialization of an Set Request message

func (*SetRequest) String

func (omci *SetRequest) String() string

type SetResponse

type SetResponse struct {
	MeBasePacket
	Result                   me.Results
	UnsupportedAttributeMask uint16
	FailedAttributeMask      uint16
}

/////////////////////////////////////////////////////////////////////////// SetResponse

func (*SetResponse) DecodeFromBytes

func (omci *SetResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Set Response into this layer

func (*SetResponse) SerializeTo

SerializeTo provides serialization of an Set Response message

func (*SetResponse) String

func (omci *SetResponse) String() string

type SetTableRequest

type SetTableRequest struct {
	MeBasePacket
}

///////////////////////////////////////////////////////////////////////////

func (*SetTableRequest) DecodeFromBytes

func (omci *SetTableRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Set Table Request into this layer

func (*SetTableRequest) SerializeTo

SerializeTo provides serialization of an Set Table Message Type Request

func (*SetTableRequest) String

func (omci *SetTableRequest) String() string

type SetTableResponse

type SetTableResponse struct {
	MeBasePacket
}

///////////////////////////////////////////////////////////////////////////

func (*SetTableResponse) DecodeFromBytes

func (omci *SetTableResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Set Table Response into this layer

func (*SetTableResponse) SerializeTo

SerializeTo provides serialization of an Set Table Message Type Response

func (*SetTableResponse) String

func (omci *SetTableResponse) String() string

type SoftwareOptions

type SoftwareOptions struct {
	WindowSize    uint8 // Window size - 1
	SectionNumber uint8 // [0..Window size - 1]
	ImageSize     uint32
	CircuitPacks  []uint16 // slot (upper 8 bits) and instance (lower 8 bits)
	Results       []DownloadResults
	Data          []byte
}

Software related frames have a wide variety of settable values. Placing them in a separate struct is mainly to keep the base options simple

type StartSoftwareDownloadRequest

type StartSoftwareDownloadRequest struct {
	MeBasePacket                // Note: EntityInstance for software download is two specific values
	WindowSize           byte   // Window Size -1
	ImageSize            uint32 // Octets
	NumberOfCircuitPacks byte
	CircuitPacks         []uint16 // MSB & LSB of software image instance
}

///////////////////////////////////////////////////////////////////////////

func (*StartSoftwareDownloadRequest) DecodeFromBytes

func (omci *StartSoftwareDownloadRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Start Software Download Request into this layer

func (*StartSoftwareDownloadRequest) SerializeTo

SerializeTo provides serialization of an Start Software Download Request message

func (*StartSoftwareDownloadRequest) String

func (omci *StartSoftwareDownloadRequest) String() string

type StartSoftwareDownloadResponse

type StartSoftwareDownloadResponse struct {
	MeBasePacket      // Note: EntityInstance for software download is two specific values
	Result            me.Results
	WindowSize        byte // Window Size -1
	NumberOfInstances byte
	MeResults         []DownloadResults
}

func (*StartSoftwareDownloadResponse) DecodeFromBytes

func (omci *StartSoftwareDownloadResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Start Software Download Response into this layer

func (*StartSoftwareDownloadResponse) SerializeTo

SerializeTo provides serialization of an Start Software Download Response message

func (*StartSoftwareDownloadResponse) String

func (omci *StartSoftwareDownloadResponse) String() string

type SynchronizeTimeRequest

type SynchronizeTimeRequest struct {
	MeBasePacket
	Year   uint16
	Month  uint8
	Day    uint8
	Hour   uint8
	Minute uint8
	Second uint8
}

///////////////////////////////////////////////////////////////////////////

func (*SynchronizeTimeRequest) DecodeFromBytes

func (omci *SynchronizeTimeRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Synchronize Time Request into this layer

func (*SynchronizeTimeRequest) SerializeTo

SerializeTo provides serialization of an Synchronize Time Request message

func (*SynchronizeTimeRequest) String

func (omci *SynchronizeTimeRequest) String() string

type SynchronizeTimeResponse

type SynchronizeTimeResponse struct {
	MeBasePacket
	Result         me.Results
	SuccessResults uint8 // Only if 'Result' is 0 -> success
}

///////////////////////////////////////////////////////////////////////////

func (*SynchronizeTimeResponse) DecodeFromBytes

func (omci *SynchronizeTimeResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Synchronize Time Response into this layer

func (*SynchronizeTimeResponse) SerializeTo

SerializeTo provides serialization of an Synchronize Time Response message

func (*SynchronizeTimeResponse) String

func (omci *SynchronizeTimeResponse) String() string

type TestRequest

type TestRequest struct {
	MeBasePacket
	Payload []byte
}

TestRequest message

func (*TestRequest) DecodeFromBytes

func (omci *TestRequest) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Test Request into this layer

func (*TestRequest) SerializeTo

SerializeTo provides serialization of an Test Request message

func (*TestRequest) String

func (omci *TestRequest) String() string

func (*TestRequest) TestRequest added in v1.1.0

func (omci *TestRequest) TestRequest() []byte

type TestResponse

type TestResponse struct {
	MeBasePacket
	Result me.Results
}

TestResponse message

func (*TestResponse) DecodeFromBytes

func (omci *TestResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Test Response into this layer

func (*TestResponse) SerializeTo

SerializeTo provides serialization of an Test Response message

func (*TestResponse) String

func (omci *TestResponse) String() string

type TestResultNotification added in v1.1.0

type TestResultNotification struct {
	MeBasePacket
	Payload []byte
}

func (*TestResultNotification) DecodeFromBytes added in v1.1.0

func (omci *TestResultNotification) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of a Test Result Notification into this layer

func (*TestResultNotification) SerializeTo added in v1.1.0

SerializeTo provides serialization of an Test Result notification message

func (*TestResultNotification) String added in v1.1.0

func (omci *TestResultNotification) String() string

func (*TestResultNotification) TestResults added in v1.1.0

func (omci *TestResultNotification) TestResults() []byte

type UnsupportedMessageTypeResponse

type UnsupportedMessageTypeResponse struct {
	MeBasePacket
	Result me.Results
}

///////////////////////////////////////////////////////////////////////////

func (*UnsupportedMessageTypeResponse) DecodeFromBytes

func (omci *UnsupportedMessageTypeResponse) DecodeFromBytes(data []byte, p gopacket.PacketBuilder) error

DecodeFromBytes decodes the given bytes of an Unsupported Message Type Response into this layer

func (*UnsupportedMessageTypeResponse) SerializeTo

SerializeTo provides serialization of an Unsupported Message Type Response

Directories

Path Synopsis
* Copyright 2020-present Open Networking Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2020-present Open Networking Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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