VOL-4028: Add support for ANI-G Test Response and Result

Change-Id: Iae61554c426937a4ce5e78a0499195f6c3975b78
diff --git a/vendor/github.com/opencord/omci-lib-go/meframe.go b/vendor/github.com/opencord/omci-lib-go/meframe.go
index d53a669..472db31 100644
--- a/vendor/github.com/opencord/omci-lib-go/meframe.go
+++ b/vendor/github.com/opencord/omci-lib-go/meframe.go
@@ -10,8 +10,8 @@
  * 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.
-  */
- /*
+ */
+/*
  * NOTE: This file was generated, manual edits will be overwritten!
  *
  * Generated by 'goCodeGenerator.py':
@@ -23,9 +23,9 @@
 import (
 	"errors"
 	"fmt"
-	me "github.com/opencord/omci-lib-go/generated"
 	"github.com/deckarep/golang-set"
 	"github.com/google/gopacket"
+	me "github.com/opencord/omci-lib-go/generated"
 	"time"
 )
 
@@ -43,7 +43,7 @@
 	encoderMap[MibUploadRequestType] = MibUploadRequestFrame
 	encoderMap[MibUploadNextRequestType] = MibUploadNextRequestFrame
 	encoderMap[MibResetRequestType] = MibResetRequestFrame
-	encoderMap[TestRequestType] = TestRequestFrame
+	//encoderMap[TestRequestType] = TestRequestFrame
 	encoderMap[StartSoftwareDownloadRequestType] = StartSoftwareDownloadRequestFrame
 	encoderMap[DownloadSectionRequestType] = DownloadSectionRequestFrame
 	encoderMap[EndSoftwareDownloadRequestType] = EndSoftwareDownloadRequestFrame
@@ -63,7 +63,7 @@
 	encoderMap[MibUploadResponseType] = MibUploadResponseFrame
 	encoderMap[MibUploadNextResponseType] = MibUploadNextResponseFrame
 	encoderMap[MibResetResponseType] = MibResetResponseFrame
-	encoderMap[TestResponseType] = TestResponseFrame
+	//encoderMap[TestResponseType] = TestResponseFrame
 	encoderMap[StartSoftwareDownloadResponseType] = StartSoftwareDownloadResponseFrame
 	encoderMap[DownloadSectionResponseType] = DownloadSectionResponseFrame
 	encoderMap[EndSoftwareDownloadResponseType] = EndSoftwareDownloadResponseFrame
@@ -76,7 +76,7 @@
 	encoderMap[SetTableResponseType] = SetTableResponseFrame
 	encoderMap[AlarmNotificationType] = AlarmNotificationFrame
 	encoderMap[AttributeValueChangeType] = AttributeValueChangeFrame
-	encoderMap[TestResultType] = TestResultFrame
+	//encoderMap[TestResultType] = TestResultFrame
 }
 
 type options struct {
@@ -283,17 +283,21 @@
 // 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 SoftwareOptions struct {
-	WindowSize   uint8 // Window size - 1
-	ImageSize    uint32
-	CircuitPacks []uint16 // slot (upper 8 bits) and instance (lower 8 bits)
-	Results      []DownloadResults
+	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
 }
 
 var defaultSoftwareOptions = SoftwareOptions{
-	WindowSize:   0,
-	ImageSize:    0,
-	CircuitPacks: nil,
-	Results:      nil,
+	WindowSize:    0,
+	SectionNumber: 0,
+	ImageSize:     0,
+	CircuitPacks:  nil,
+	Results:       nil,
+	Data:          nil,
 }
 
 // EncodeFrame will encode the Managed Entity specific protocol struct and an
@@ -364,9 +368,9 @@
 	}
 	// OMCI Header          - 4 octets
 	// Class ID/Instance ID - 4 octets
-	// Length field			- 4 octets
+	// Length field			- 2 octets
 	// MIC                  - 4 octets
-	return MaxExtendedLength - 16
+	return MaxExtendedLength - 14
 }
 
 func calculateAttributeMask(m *me.ManagedEntity, requestedMask uint16) (uint16, error) {
@@ -414,6 +418,9 @@
 }
 
 func CreateRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// NOTE: The OMCI parser does not extract the default values of set-by-create attributes
 	//       and are the zero 'default' (or nil) at this time.  For this reason, make sure
 	//       you specify all non-zero default values and pass them in appropriate
@@ -421,6 +428,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Attributes: m.GetAttributeValueMap(),
 	}
@@ -443,10 +451,14 @@
 }
 
 func CreateResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	meLayer := &CreateResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result: opt.result,
 	}
@@ -457,20 +469,28 @@
 }
 
 func DeleteRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	meLayer := &DeleteRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	return meLayer, nil
 }
 
 func DeleteResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	meLayer := &DeleteResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result: opt.result,
 	}
@@ -493,11 +513,15 @@
 	// Get payload space available
 	maxPayload := maxPacketAvailable(m, opt)
 	payloadAvailable := int(maxPayload) - 2 // Less attribute mask
-
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+		// payloadAvailable -= 2				// Less length
+	}
 	meLayer := &SetRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		AttributeMask: 0,
 		Attributes:    make(me.AttributeValueMap),
@@ -546,10 +570,14 @@
 }
 
 func SetResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	meLayer := &SetResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result: opt.result,
 	}
@@ -582,6 +610,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		AttributeMask: mask,
 	}
@@ -601,6 +630,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result:        opt.result,
 		AttributeMask: 0,
@@ -666,11 +696,15 @@
 }
 
 func GetAllAlarmsRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &GetAllAlarmsRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		AlarmRetrievalMode: opt.mode,
 	}
@@ -678,11 +712,15 @@
 }
 
 func GetAllAlarmsResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &GetAllAlarmsResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		NumberOfCommands: opt.sequenceNumberCountOrSize,
 	}
@@ -690,11 +728,15 @@
 }
 
 func GetAllAlarmsNextRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &GetAllAlarmsNextRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		CommandSequenceNumber: opt.sequenceNumberCountOrSize,
 	}
@@ -702,11 +744,15 @@
 }
 
 func GetAllAlarmsNextResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &GetAllAlarmsNextResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		AlarmEntityClass:    opt.alarm.AlarmClassID,
 		AlarmEntityInstance: opt.alarm.AlarmInstance,
@@ -724,22 +770,30 @@
 }
 
 func MibUploadRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &MibUploadRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: 0,
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	return meLayer, nil
 }
 
 func MibUploadResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &MibUploadResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: 0,
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		NumberOfCommands: opt.sequenceNumberCountOrSize,
 	}
@@ -747,11 +801,15 @@
 }
 
 func MibUploadNextRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &MibUploadNextRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: 0,
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		CommandSequenceNumber: opt.sequenceNumberCountOrSize,
 	}
@@ -759,11 +817,15 @@
 }
 
 func MibUploadNextResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &MibUploadNextResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	if opt.payload == nil {
@@ -792,22 +854,30 @@
 }
 
 func MibResetRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &MibResetRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	return meLayer, nil
 }
 
 func MibResetResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &MibResetResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result: opt.result,
 	}
@@ -815,6 +885,9 @@
 }
 
 func AlarmNotificationFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -824,6 +897,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -837,6 +911,9 @@
 }
 
 func AttributeValueChangeFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -846,6 +923,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		AttributeMask: 0,
 		Attributes:    make(me.AttributeValueMap),
@@ -860,54 +938,66 @@
 	return meLayer, errors.New("todo: Not implemented")
 }
 
-func TestRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
-	mask, err := checkAttributeMask(m, opt.attributeMask)
-	if err != nil {
-		return nil, err
-	}
-	// Common for all MEs
-	meLayer := &TestRequest{
-		MeBasePacket: MeBasePacket{
-			EntityClass:    m.GetClassID(),
-			EntityInstance: m.GetEntityID(),
-		},
-	}
-	// Get payload space available
-	maxPayload := maxPacketAvailable(m, opt)
+//func TestRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+//	if opt.frameFormat == ExtendedIdent {
+//		return nil, errors.New("Extended message set for this message type is not supported")
+//	}
+//	mask, err := checkAttributeMask(m, opt.attributeMask)
+//	if err != nil {
+//		return nil, err
+//	}
+//	// Common for all MEs
+//	meLayer := &TestRequest{
+//		MeBasePacket: MeBasePacket{
+//			EntityClass:    m.GetClassID(),
+//			EntityInstance: m.GetEntityID(),
+//			Extended:       opt.frameFormat == ExtendedIdent,
+//		},
+//	}
+//	// Get payload space available
+//	maxPayload := maxPacketAvailable(m, opt)
+//
+//	// TODO: Lots of work to do
+//
+//	fmt.Println(mask, maxPayload)
+//	return meLayer, errors.New("todo: Not implemented")
+//}
 
-	// TODO: Lots of work to do
-
-	fmt.Println(mask, maxPayload)
-	return meLayer, errors.New("todo: Not implemented")
-}
-
-func TestResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
-	mask, err := checkAttributeMask(m, opt.attributeMask)
-	if err != nil {
-		return nil, err
-	}
-	// Common for all MEs
-	meLayer := &TestResponse{
-		MeBasePacket: MeBasePacket{
-			EntityClass:    m.GetClassID(),
-			EntityInstance: m.GetEntityID(),
-		},
-	}
-	// Get payload space available
-	maxPayload := maxPacketAvailable(m, opt)
-
-	// TODO: Lots of work to do
-
-	fmt.Println(mask, maxPayload)
-	return meLayer, errors.New("todo: Not implemented")
-}
+//func TestResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+//	if opt.frameFormat == ExtendedIdent {
+//		return nil, errors.New("Extended message set for this message type is not supported")
+//	}
+//	mask, err := checkAttributeMask(m, opt.attributeMask)
+//	if err != nil {
+//		return nil, err
+//	}
+//	// Common for all MEs
+//	meLayer := &TestResponse{
+//		MeBasePacket: MeBasePacket{
+//			EntityClass:    m.GetClassID(),
+//			EntityInstance: m.GetEntityID(),
+//			Extended:       opt.frameFormat == ExtendedIdent,
+//		},
+//	}
+//	// Get payload space available
+//	maxPayload := maxPacketAvailable(m, opt)
+//
+//	// TODO: Lots of work to do
+//
+//	fmt.Println(mask, maxPayload)
+//	return meLayer, errors.New("todo: Not implemented")
+//}
 
 func StartSoftwareDownloadRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &StartSoftwareDownloadRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		WindowSize:           opt.software.WindowSize,
 		ImageSize:            opt.software.ImageSize,
@@ -927,11 +1017,15 @@
 }
 
 func StartSoftwareDownloadResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &StartSoftwareDownloadResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		WindowSize:        opt.software.WindowSize,
 		NumberOfInstances: byte(len(opt.software.CircuitPacks)),
@@ -950,48 +1044,40 @@
 }
 
 func DownloadSectionRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
-	mask, err := checkAttributeMask(m, opt.attributeMask)
-	if err != nil {
-		return nil, err
+	if opt.software.Data == nil {
+		return nil, me.NewNonStatusError("Software image data missing")
 	}
 	// Common for all MEs
 	meLayer := &DownloadSectionRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
+		SectionNumber: opt.software.SectionNumber,
+		SectionData:   opt.software.Data,
 	}
-	// Get payload space available
-	maxPayload := maxPacketAvailable(m, opt)
-
-	// TODO: Lots of work to do
-
-	fmt.Println(mask, maxPayload)
-	return meLayer, errors.New("todo: Not implemented")
+	return meLayer, nil
 }
 
 func DownloadSectionResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
-	mask, err := checkAttributeMask(m, opt.attributeMask)
-	if err != nil {
-		return nil, err
-	}
 	// Common for all MEs
 	meLayer := &DownloadSectionResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
+		Result:        opt.result,
+		SectionNumber: opt.software.SectionNumber,
 	}
-	// Get payload space available
-	maxPayload := maxPacketAvailable(m, opt)
-
-	// TODO: Lots of work to do
-
-	fmt.Println(mask, maxPayload)
-	return meLayer, errors.New("todo: Not implemented")
+	return meLayer, nil
 }
 
 func EndSoftwareDownloadRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1001,6 +1087,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1013,6 +1100,9 @@
 }
 
 func EndSoftwareDownloadResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1022,6 +1112,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1034,6 +1125,9 @@
 }
 
 func ActivateSoftwareRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1043,6 +1137,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1055,6 +1150,9 @@
 }
 
 func ActivateSoftwareResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1064,6 +1162,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1076,6 +1175,9 @@
 }
 
 func CommitSoftwareRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1085,6 +1187,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1097,6 +1200,9 @@
 }
 
 func CommitSoftwareResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1106,6 +1212,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1118,11 +1225,15 @@
 }
 
 func SynchronizeTimeRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &SynchronizeTimeRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Decode payload option. If nil, no timestamp provided
@@ -1139,11 +1250,15 @@
 }
 
 func SynchronizeTimeResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &SynchronizeTimeResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result:         opt.result,
 		SuccessResults: opt.mode,
@@ -1152,11 +1267,15 @@
 }
 
 func RebootRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &RebootRequest{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		RebootCondition: opt.mode,
 	}
@@ -1164,11 +1283,15 @@
 }
 
 func RebootResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Common for all MEs
 	meLayer := &RebootResponse{
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result: opt.result,
 	}
@@ -1176,6 +1299,9 @@
 }
 
 func GetNextRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Validate attribute mask
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
@@ -1195,6 +1321,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		AttributeMask:  mask,
 		SequenceNumber: opt.sequenceNumberCountOrSize,
@@ -1203,6 +1330,9 @@
 }
 
 func GetNextResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	// Validate attribute mask
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
@@ -1218,6 +1348,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 		Result:        opt.result,
 		AttributeMask: 0,
@@ -1273,28 +1404,35 @@
 	return meLayer, nil
 }
 
-func TestResultFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
-	mask, err := checkAttributeMask(m, opt.attributeMask)
-	if err != nil {
-		return nil, err
-	}
-	// Common for all MEs
-	meLayer := &TestResultMsg{
-		MeBasePacket: MeBasePacket{
-			EntityClass:    m.GetClassID(),
-			EntityInstance: m.GetEntityID(),
-		},
-	}
-	// Get payload space available
-	maxPayload := maxPacketAvailable(m, opt)
-
-	// TODO: Lots of work to do
-
-	fmt.Println(mask, maxPayload)
-	return meLayer, errors.New("todo: Not implemented")
-}
+//func TestResultFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+//	if opt.frameFormat == ExtendedIdent {
+//		return nil, errors.New("Extended message set for this message type is not supported")
+//	}
+//	mask, err := checkAttributeMask(m, opt.attributeMask)
+//	if err != nil {
+//		return nil, err
+//	}
+//	// Common for all MEs
+//	meLayer := &TestResultNotification{
+//		MeBasePacket: MeBasePacket{
+//			EntityClass:    m.GetClassID(),
+//			EntityInstance: m.GetEntityID(),
+//			Extended:       opt.frameFormat == ExtendedIdent,
+//		},
+//	}
+//	// Get payload space available
+//	maxPayload := maxPacketAvailable(m, opt)
+//
+//	// TODO: Lots of work to do
+//
+//	fmt.Println(mask, maxPayload)
+//	return meLayer, errors.New("todo: Not implemented")
+//}
 
 func GetCurrentDataRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1304,6 +1442,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1316,6 +1455,9 @@
 }
 
 func GetCurrentDataResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1325,6 +1467,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1340,6 +1483,9 @@
 	if opt.frameFormat != ExtendedIdent {
 		return nil, errors.New("SetTable message type only supported with Extended OMCI Messaging")
 	}
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
+	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
 		return nil, err
@@ -1349,6 +1495,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       opt.frameFormat == ExtendedIdent,
 		},
 	}
 	// Get payload space available
@@ -1362,7 +1509,10 @@
 
 func SetTableResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
 	if opt.frameFormat != ExtendedIdent {
-		return nil, errors.New("SetTable message type only supported with Extended OMCI Messaging")
+		return nil, errors.New("SetTable message type only supported with Extended OMCI Message Set")
+	}
+	if opt.frameFormat == ExtendedIdent {
+		return nil, errors.New("Extended message set for this message type is not supported")
 	}
 	mask, err := checkAttributeMask(m, opt.attributeMask)
 	if err != nil {
@@ -1373,6 +1523,7 @@
 		MeBasePacket: MeBasePacket{
 			EntityClass:    m.GetClassID(),
 			EntityInstance: m.GetEntityID(),
+			Extended:       true,
 		},
 	}
 	// Get payload space available