[VOL-4741] openonuAdapterGo: Make OMCI message set support configurable

Change-Id: Icb0dafd2b42f9d544f17bdb72ca9c5860604e0af
diff --git a/VERSION b/VERSION
index ecf00d9..1506473 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.5
\ No newline at end of file
+2.2.6
\ No newline at end of file
diff --git a/docker/Dockerfile.openonu b/docker/Dockerfile.openonu
index 43c959c..f728cfc 100755
--- a/docker/Dockerfile.openonu
+++ b/docker/Dockerfile.openonu
@@ -18,7 +18,7 @@
 FROM --platform=linux/amd64 golang:1.16.3-alpine3.13 AS dev
 
 # Install required packages
-RUN apk add --no-cache build-base=0.5-r2
+RUN apk add --no-cache build-base=0.5-r3
 
 # Use Standard go build directory structure
 WORKDIR /go/src
diff --git a/internal/pkg/common/interfaces.go b/internal/pkg/common/interfaces.go
index ed8cf1e..98f644c 100755
--- a/internal/pkg/common/interfaces.go
+++ b/internal/pkg/common/interfaces.go
@@ -62,6 +62,7 @@
 	GetOnuIndication() *openolt.OnuIndication
 	GetUniVlanConfigFsm(uint8) IuniVlanConfigFsm
 	GetTechProfileInstanceFromParentAdapter(context.Context, uint8, string) (*ia.TechProfileDownloadMessage, error)
+	GetExtendedOmciSupportEnabled() bool
 
 	GetDeviceReasonString() string
 	ReasonUpdate(context.Context, uint8, bool) error
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index 4e0eeb4..639d5fe 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -59,6 +59,7 @@
 	LogCorrelationEnabled       bool
 	OnuVendorIds                string
 	MetricsEnabled              bool
+	ExtendedOmciSupportEnabled  bool
 	MibAuditInterval            time.Duration
 	OmciTimeout                 time.Duration
 	AlarmAuditInterval          time.Duration
@@ -209,6 +210,11 @@
 		false,
 		"Whether to enable metrics collection")
 
+	fs.BoolVar(&(so.ExtendedOmciSupportEnabled),
+		"extended_omci_support_enabled",
+		false,
+		"Whether to enable extended OMCI support")
+
 	fs.DurationVar(&(so.MibAuditInterval),
 		"mib_audit_interval",
 		300*time.Second,
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 641bd28..af7fef3 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -4516,6 +4516,11 @@
 	return dh.pOpenOnuAc.MetricsEnabled
 }
 
+// GetExtendedOmciSupportEnabled - TODO: add comment
+func (dh *deviceHandler) GetExtendedOmciSupportEnabled() bool {
+	return dh.pOpenOnuAc.ExtendedOmciSupportEnabled
+}
+
 // InitPmConfigs - TODO: add comment
 func (dh *deviceHandler) InitPmConfigs() {
 	dh.pmConfigs = &voltha.PmConfigs{}
diff --git a/internal/pkg/core/openonu.go b/internal/pkg/core/openonu.go
index 3c2b127..96c13aa 100755
--- a/internal/pkg/core/openonu.go
+++ b/internal/pkg/core/openonu.go
@@ -90,6 +90,7 @@
 	pDownloadManager            *swupg.AdapterDownloadManager
 	pFileManager                *swupg.FileDownloadManager //let coexist 'old and new' DownloadManager as long as 'old' does not get obsolete
 	MetricsEnabled              bool
+	ExtendedOmciSupportEnabled  bool
 	mibAuditInterval            time.Duration
 	omciTimeout                 int // in seconds
 	alarmAuditInterval          time.Duration
@@ -126,6 +127,7 @@
 	openOnuAc.maxTimeoutReconciling = cfg.MaxTimeoutReconciling
 	//openOnuAc.GrpcTimeoutInterval = cfg.GrpcTimeoutInterval
 	openOnuAc.MetricsEnabled = cfg.MetricsEnabled
+	openOnuAc.ExtendedOmciSupportEnabled = cfg.ExtendedOmciSupportEnabled
 	openOnuAc.mibAuditInterval = cfg.MibAuditInterval
 	// since consumers of OMCI timeout value everywhere in code is in "int seconds", do this useful conversion
 	openOnuAc.omciTimeout = int(cfg.OmciTimeout.Seconds())
diff --git a/internal/pkg/mib/mib_sync.go b/internal/pkg/mib/mib_sync.go
index 1cbe2a3..4c93720 100755
--- a/internal/pkg/mib/mib_sync.go
+++ b/internal/pkg/mib/mib_sync.go
@@ -847,6 +847,11 @@
 					omccVersion = onu2GOmccVersion.(uint8)
 					if _, ok := omccVersionSupportsExtendedOmciFormat[omccVersion]; ok {
 						oo.SOnuPersistentData.PersIsExtOmciSupported = omccVersionSupportsExtendedOmciFormat[omccVersion]
+						if oo.SOnuPersistentData.PersIsExtOmciSupported && !oo.baseDeviceHandler.GetExtendedOmciSupportEnabled() {
+							logger.Infow(ctx, "MibSync FSM - ONU supports extended OMCI, but support is disabled in the adapter: reset flag",
+								log.Fields{"device-id": oo.deviceID})
+							oo.SOnuPersistentData.PersIsExtOmciSupported = false
+						}
 					} else {
 						logger.Infow(ctx, "MibSync FSM - unknown OMCC version in Onu2G instance - disable extended OMCI support",
 							log.Fields{"device-id": oo.deviceID})