VOL-2041: Setup Vlan Tagging Filter/EVTO only in vlan task

Also remove some hardcoded parameters as they are now available
in the handler.

Change-Id: Ia5492eeae9f42b451f0ed4b9bc934c54cafcc649
diff --git a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
index 1fb8e43..3bc1afb 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -230,12 +230,6 @@
             self.logical_device_id = self.device_id
 
             yield self.core_proxy.device_update(device)
-	    #We commented out the line below because it is now being done in openolt-adapter,
-	    #in onuDiscovery step. Line can be removed after tests.
-            #yield self.core_proxy.device_state_update(device.id, oper_status=OperStatus.DISCOVERED,
-            #                                             connect_status=ConnectStatus.REACHABLE)
-
-
             self.log.debug('device updated', device=device)
 
             yield self._init_pon_state()
@@ -651,13 +645,12 @@
                         self.log.error('unsupported-action-type',
                                        action_type=action.type, in_port=_in_port)
 
-                # TODO: We only set vlan omci flows.  Handle omci matching ethertypes at some point in another task
-                if _type is not None:
-                    self.log.warn('ignoring-flow-with-ethType', ethType=_type)
-                elif _set_vlan_vid is None or _set_vlan_vid == 0:
-                    self.log.warn('ignorning-flow-that-does-not-set-vlanid')
+                # OMCI set vlan task can only filter and set on vlan header attributes.  Any other openflow
+                # supported match and action criteria cannot be handled by omci and must be ignored.
+                if _set_vlan_vid is None or _set_vlan_vid == 0:
+                    self.log.warn('ignoring-flow-that-does-not-set-vlanid')
                 else:
-                    self.log.warn('set-vlanid', uni_id=uni_id, uni_port=uni_port, set_vlan_vid=_set_vlan_vid)
+                    self.log.info('set-vlanid', uni_id=uni_id, uni_port=uni_port, set_vlan_vid=_set_vlan_vid)
                     self._add_vlan_filter_task(device, uni_id, uni_port, _set_vlan_vid)
             except Exception as e:
                 self.log.exception('failed-to-install-flow', e=e, flow=flow)
@@ -681,13 +674,13 @@
                                                        self._add_vlan_filter_task, device,uni_port.port_number, uni_port, _set_vlan_vid)
 
             self.log.info('setting-vlan-tag')
-            self._vlan_filter_task = BrcmVlanFilterTask(self.omci_agent, self.device_id, uni_port, _set_vlan_vid)
+            self._vlan_filter_task = BrcmVlanFilterTask(self.omci_agent, self, uni_port, _set_vlan_vid)
             self._deferred = self._onu_omci_device.task_runner.queue_task(self._vlan_filter_task)
             self._deferred.addCallbacks(success, failure)
         else:
             self.log.info('tp-service-specific-task-not-done-adding-request-to-local-cache',
                           uni_id=uni_id)
-            self._queued_vlan_filter_task[uni_id] = {"device": device, \
+            self._queued_vlan_filter_task[uni_id] = {"device": device,
                                                      "uni_id":uni_id,
                                                      "uni_port": uni_port,
                                                      "set_vlan_vid": _set_vlan_vid}
diff --git a/python/adapters/brcm_openomci_onu/omci/brcm_mib_download_task.py b/python/adapters/brcm_openomci_onu/omci/brcm_mib_download_task.py
index 973af86..76af28b 100644
--- a/python/adapters/brcm_openomci_onu/omci/brcm_mib_download_task.py
+++ b/python/adapters/brcm_openomci_onu/omci/brcm_mib_download_task.py
@@ -21,7 +21,7 @@
 from pyvoltha.adapters.extensions.omci.omci_defs import *
 from adapters.brcm_openomci_onu.uni_port import *
 from adapters.brcm_openomci_onu.pon_port \
-    import BRDCM_DEFAULT_VLAN, TASK_PRIORITY, DEFAULT_TPID, DEFAULT_GEM_PAYLOAD
+    import TASK_PRIORITY, DEFAULT_TPID, DEFAULT_GEM_PAYLOAD
 
 OP = EntityOperations
 RC = ReasonCodes
@@ -41,7 +41,7 @@
 
 class BrcmMibDownloadTask(Task):
     """
-    OpenOMCI MIB Download Example
+    OpenOMCI MIB Download Bridge Setup Task
 
     This task takes the legacy OMCI 'script' for provisioning the Broadcom ONU
     and converts it to run as a Task on the OpenOMCI Task runner.  This is
@@ -52,11 +52,9 @@
     be moved into OpenOMCI if there are any very common settings/configs to do
     for any profile that may be provided in the v2.0 release
 
-    Currently, the only service tech profiles expected by v2.0 will be for AT&T
-    residential data service and DT residential data service.
     """
 
-    name = "Broadcom MIB Download Example Task"
+    name = "Broadcom MIB Download Bridge Setup Task"
 
     def __init__(self, omci_agent, handler):
         """
@@ -86,10 +84,6 @@
         self._input_tpid = DEFAULT_TPID
         self._output_tpid = DEFAULT_TPID
 
-        self._vlan_tcis_1 = BRDCM_DEFAULT_VLAN
-        self._cvid = BRDCM_DEFAULT_VLAN
-        self._vlan_config_entity_id = self._vlan_tcis_1
-
         # Entity IDs. IDs with values can probably be most anything for most ONUs,
         #             IDs set to None are discovered/set
 
@@ -212,15 +206,13 @@
                                         len(self._handler.uni_ports))
                 self.deferred.errback(failure.Failure(e))
         except BaseException as e:
-            self.log.debug('@thyy_mib_check:', exception=e)
+            self.log.debug('cannot-start-mib-download', exception=e)
 
     @inlineCallbacks
     def perform_initial_bridge_setup(self):
         self.log.debug('function-entry')
 
         omci_cc = self._onu_device.omci_cc
-        # TODO: too many magic numbers
-
         try:
             ########################################################################################
             # Create GalEthernetProfile - Once per ONU/PON interface
@@ -240,11 +232,11 @@
             self.check_status_and_state(results, 'create-gal-ethernet-profile')
 
         except TimeoutError as e:
-            self.log.warn('rx-timeout-0', e=e)
+            self.log.warn('rx-timeout-initial-gal-profile', e=e)
             raise
 
         except Exception as e:
-            self.log.exception('omci-setup-0', e=e)
+            self.log.exception('omci-setup-initial-gal-profile', e=e)
             raise
 
         returnValue(None)
@@ -327,28 +319,7 @@
             frame = msg.create()
             self.log.debug('openomci-msg', omci_msg=msg)
             results = yield omci_cc.send(frame)
-            self.check_status_and_state(results, 'create-mac-bridge-port-configuration-data-part-1')
-
-            ################################################################################
-            # VLAN Tagging Filter config
-            #
-            #  EntityID will be referenced by:
-            #            - Nothing
-            #  References:
-            #            - MacBridgePortConfigurationData for the ANI/PON side
-            #
-            # Set anything, this request will not be used when using Extended Vlan
-
-            # TODO: magic. make a static variable for forward_op
-            msg = VlanTaggingFilterDataFrame(
-                self._mac_bridge_port_ani_entity_id + uni_port.mac_bridge_port_num,  # Entity ID
-                vlan_tcis=[self._vlan_tcis_1],        # VLAN IDs
-                forward_operation=0x10
-            )
-            frame = msg.create()
-            self.log.debug('openomci-msg', omci_msg=msg)
-            results = yield omci_cc.send(frame)
-            self.check_status_and_state(results, 'create-vlan-tagging-filter-data')
+            self.check_status_and_state(results, 'create-mac-bridge-port-configuration-data-8021p-mapper')
 
             ################################################################################
             # UNI Specific                                                                 #
@@ -362,17 +333,18 @@
             #            - MAC Bridge Service Profile (the bridge)
             #            - PPTP Ethernet or VEIP UNI
 
-            # TODO: do this for all uni/ports...
-            # TODO: magic. make a static variable for tp_type
-
+            # TODO: magic. make a static variable for tp_type and association_type
             # default to PPTP
             tp_type = None
             if uni_port.type.value == UniType.VEIP.value:
                 tp_type = 11
+                association_type = 10
             elif uni_port.type.value == UniType.PPTP.value:
                 tp_type = 1
+                association_type = 2
             else:
                 tp_type = 1
+                association_type = 2
 
             msg = MacBridgePortConfigurationDataFrame(
                 uni_port.entity_id,            # Entity ID - This is read-only/set-by-create !!!
@@ -384,14 +356,47 @@
             frame = msg.create()
             self.log.debug('openomci-msg', omci_msg=msg)
             results = yield omci_cc.send(frame)
-            self.check_status_and_state(results, 'create-mac-bridge-port-configuration-data-part-2')
+            self.check_status_and_state(results, 'create-mac-bridge-port-configuration-data-uni-port')
+
+            ################################################################################
+            # Create Extended VLAN Tagging Operation config (UNI-side)
+            #
+            #  EntityID relates to the VLAN TCIS later used int vlan filter task.  This only
+            #  sets up the inital MIB entry as it relates to port config, it does not set vlan
+            #  that is saved for the vlan filter task
+            #
+            #  References:
+            #            - PPTP Ethernet or VEIP UNI
+            #
+
+            attributes = dict(
+                association_type=association_type,             # Assoc Type, PPTP/VEIP Ethernet UNI
+                associated_me_pointer=uni_port.entity_id,      # Assoc ME, PPTP/VEIP Entity Id
+
+                # See VOL-1311 - Need to set table during create to avoid exception
+                # trying to read back table during post-create-read-missing-attributes
+                # But, because this is a R/W attribute. Some ONU may not accept the
+                # value during create. It is repeated again in a set below.
+                input_tpid=self._input_tpid,    # input TPID
+                output_tpid=self._output_tpid,  # output TPID
+            )
+
+            msg = ExtendedVlanTaggingOperationConfigurationDataFrame(
+                self._mac_bridge_service_profile_entity_id + uni_port.mac_bridge_port_num,  # Bridge Entity ID
+                attributes=attributes
+            )
+
+            frame = msg.create()
+            self.log.debug('openomci-msg', omci_msg=msg)
+            results = yield omci_cc.send(frame)
+            self.check_status_and_state(results, 'create-extended-vlan-tagging-operation-configuration-data')
 
         except TimeoutError as e:
-            self.log.warn('rx-timeout-1', e=e)
+            self.log.warn('rx-timeout-inital-per-uni-setup', e=e)
             raise
 
         except Exception as e:
-            self.log.exception('omci-setup-1', e=e)
+            self.log.exception('omci-setup-initial-per-uni-setup', e=e)
             raise
 
         returnValue(None)
diff --git a/python/adapters/brcm_openomci_onu/omci/brcm_tp_service_specific_task.py b/python/adapters/brcm_openomci_onu/omci/brcm_tp_service_specific_task.py
index 65a0320..7ba4523 100644
--- a/python/adapters/brcm_openomci_onu/omci/brcm_tp_service_specific_task.py
+++ b/python/adapters/brcm_openomci_onu/omci/brcm_tp_service_specific_task.py
@@ -21,8 +21,7 @@
 from pyvoltha.adapters.extensions.omci.omci_defs import *
 from pyvoltha.adapters.extensions.omci.omci_entities import *
 from adapters.brcm_openomci_onu.uni_port import *
-from adapters.brcm_openomci_onu.pon_port \
-    import BRDCM_DEFAULT_VLAN, TASK_PRIORITY, DEFAULT_TPID, DEFAULT_GEM_PAYLOAD
+from adapters.brcm_openomci_onu.pon_port import TASK_PRIORITY, DEFAULT_GEM_PAYLOAD
 
 
 OP = EntityOperations
@@ -54,7 +53,8 @@
         Class initialization
 
         :param omci_agent: (OmciAdapterAgent) OMCI Adapter agent
-        :param device_id: (str) ONU Device ID
+        :param handler: (BrcmOpenomciOnuHandler) ONU Device Handler Instance
+        :param uni_id: (int) numeric id of the uni port on the onu device, starts at 0
         """
         log = structlog.get_logger(device_id=handler.device_id, uni_id=uni_id)
         log.debug('function-entry')
@@ -70,20 +70,9 @@
         self._onu_device = omci_agent.get_device(handler.device_id)
         self._local_deferred = None
 
-        # Frame size
-        self._max_gem_payload = DEFAULT_GEM_PAYLOAD
-
         self._uni_port = handler.uni_ports[uni_id]
         assert self._uni_port.uni_id == uni_id
 
-        # Port numbers
-        self._input_tpid = DEFAULT_TPID
-        self._output_tpid = DEFAULT_TPID
-
-        self._vlan_tcis_1 = BRDCM_DEFAULT_VLAN
-        self._cvid = BRDCM_DEFAULT_VLAN
-        self._vlan_config_entity_id = self._vlan_tcis_1
-
         # Entity IDs. IDs with values can probably be most anything for most ONUs,
         #             IDs set to None are discovered/set
 
@@ -411,113 +400,12 @@
             results = yield omci_cc.send(frame)
             self.check_status_and_state(results, 'set-8021p-mapper-service-profile-ul')
 
-            ################################################################################
-            # Create Extended VLAN Tagging Operation config (PON-side)
-            #
-            #  EntityID relates to the VLAN TCIS
-            #  References:
-            #            - VLAN TCIS from previously created VLAN Tagging filter data
-            #            - PPTP Ethernet or VEIP UNI
-            #
-
-            # TODO: do this for all uni/ports...
-            # TODO: magic.  static variable for assoc_type
-
-            # default to PPTP
-            if self._uni_port.type.value == UniType.VEIP.value:
-                association_type = 10
-            elif self._uni_port.type.value == UniType.PPTP.value:
-                association_type = 2
-            else:
-                association_type = 2
-
-            attributes = dict(
-                association_type=association_type,                  # Assoc Type, PPTP/VEIP Ethernet UNI
-                associated_me_pointer=self._uni_port.entity_id,      # Assoc ME, PPTP/VEIP Entity Id
-
-                # See VOL-1311 - Need to set table during create to avoid exception
-                # trying to read back table during post-create-read-missing-attributes
-                # But, because this is a R/W attribute. Some ONU may not accept the
-                # value during create. It is repeated again in a set below.
-                input_tpid=self._input_tpid,  # input TPID
-                output_tpid=self._output_tpid,  # output TPID
-            )
-
-            msg = ExtendedVlanTaggingOperationConfigurationDataFrame(
-                self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
-                attributes=attributes
-            )
-
-            frame = msg.create()
-            self.log.debug('openomci-msg', omci_msg=msg)
-            results = yield omci_cc.send(frame)
-            self.check_status_and_state(results, 'create-extended-vlan-tagging-operation-configuration-data')
-
-            attributes = dict(
-                # Specifies the TPIDs in use and that operations in the downstream direction are
-                # inverse to the operations in the upstream direction
-                input_tpid=self._input_tpid,    # input TPID
-                output_tpid=self._output_tpid,  # output TPID
-                downstream_mode=0,              # inverse of upstream
-            )
-
-            msg = ExtendedVlanTaggingOperationConfigurationDataFrame(
-                self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
-                attributes=attributes
-            )
-
-            frame = msg.set()
-            self.log.debug('openomci-msg', omci_msg=msg)
-            results = yield omci_cc.send(frame)
-            self.check_status_and_state(results, 'set-extended-vlan-tagging-operation-configuration-data')
-
-            attributes = dict(
-                # parameters: Entity Id ( 0x900), Filter Inner Vlan Id(0x1000-4096,do not filter on Inner vid,
-                #             Treatment Inner Vlan Id : 2
-
-                # Update uni side extended vlan filter
-                # filter for untagged
-                # probably for eapol
-                # TODO: lots of magic
-                # TODO: magic 0x1000 / 4096?
-                received_frame_vlan_tagging_operation_table=
-                VlanTaggingOperation(
-                    filter_outer_priority=15,  # This entry is not a double-tag rule
-                    filter_outer_vid=4096,     # Do not filter on the outer VID value
-                    filter_outer_tpid_de=0,    # Do not filter on the outer TPID field
-
-                    filter_inner_priority=15,
-                    filter_inner_vid=4096,
-                    filter_inner_tpid_de=0,
-                    filter_ether_type=0,
-
-                    treatment_tags_to_remove=0,
-                    treatment_outer_priority=15,
-                    treatment_outer_vid=0,
-                    treatment_outer_tpid_de=0,
-
-                    treatment_inner_priority=0,
-                    treatment_inner_vid=self._cvid,
-                    treatment_inner_tpid_de=4,
-                )
-            )
-
-            msg = ExtendedVlanTaggingOperationConfigurationDataFrame(
-                self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
-                attributes=attributes
-            )
-
-            frame = msg.set()
-            self.log.debug('openomci-msg', omci_msg=msg)
-            results = yield omci_cc.send(frame)
-            self.check_status_and_state(results, 'set-extended-vlan-tagging-operation-configuration-data-table')
-
             self.deferred.callback("tech-profile-download-success")
 
         except TimeoutError as e:
-            self.log.warn('rx-timeout-2', e=e)
+            self.log.warn('rx-timeout-tech-profile', e=e)
             self.deferred.errback(failure.Failure(e))
 
         except Exception as e:
-            self.log.exception('omci-setup-2', e=e)
+            self.log.exception('omci-setup-tech-profile', e=e)
             self.deferred.errback(failure.Failure(e))
diff --git a/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py b/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py
index 92ddd7a..eaa3176 100644
--- a/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py
+++ b/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py
@@ -13,15 +13,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+import structlog
 from pyvoltha.adapters.extensions.omci.tasks.task import Task
 from twisted.internet import reactor
 from twisted.internet.defer import inlineCallbacks, failure, returnValue
 from pyvoltha.adapters.extensions.omci.omci_defs import ReasonCodes, EntityOperations
-from pyvoltha.adapters.extensions.omci.omci_me import *
+from pyvoltha.adapters.extensions.omci.omci_me import \
+    VlanTaggingOperation, VlanTaggingFilterDataFrame, ExtendedVlanTaggingOperationConfigurationDataFrame
+from adapters.brcm_openomci_onu.uni_port import UniType
+from adapters.brcm_openomci_onu.pon_port import DEFAULT_TPID
 
 RC = ReasonCodes
 OP = EntityOperations
-RESERVED_VLAN = 4095
+RESERVED_TRANSPARENT_VLAN = 4095
 
 
 class BrcmVlanFilterException(Exception):
@@ -33,32 +38,45 @@
     Apply Vlan Tagging Filter Data and Extended VLAN Tagging Operation Configuration on an ANI and UNI
     """
     task_priority = 200
-    name = "Broadcom VLAN Filter Task"
+    name = "Broadcom VLAN Filter/Tagging Task"
 
-    def __init__(self, omci_agent, device_id, uni_port, set_vlan_id, priority=task_priority):
+    def __init__(self, omci_agent, handler, uni_port, set_vlan_id, priority=task_priority):
         """
         Class initialization
 
         :param omci_agent: (OmciAdapterAgent) OMCI Adapter agent
-        :param device_id: (str) ONU Device ID
+        :param handler: (BrcmOpenomciOnuHandler) ONU Device Handler Instance
+        :param uni_port: (UniPort) Object instance representing the uni port and its settings
         :param set_vlan_id: (int) VLAN to filter for and set
         :param priority: (int) OpenOMCI Task priority (0..255) 255 is the highest
         """
 
-        self.log = structlog.get_logger(device_id=device_id, uni_port=uni_port.port_number)
+        self.log = structlog.get_logger(device_id=handler.device_id, uni_port=uni_port.port_number)
 
         super(BrcmVlanFilterTask, self).__init__(BrcmVlanFilterTask.name,
                                                  omci_agent,
-                                                 device_id,
+                                                 handler.device_id,
                                                  priority=priority,
                                                  exclusive=True)
-        self._device = omci_agent.get_device(device_id)
+        self._device = omci_agent.get_device(handler.device_id)
         self._uni_port = uni_port
         self._set_vlan_id = set_vlan_id
         self._results = None
         self._local_deferred = None
         self._config = self._device.configuration
 
+        self._input_tpid = DEFAULT_TPID
+        self._output_tpid = DEFAULT_TPID
+
+        self._mac_bridge_service_profile_entity_id = \
+            handler.mac_bridge_service_profile_entity_id
+        self._ieee_mapper_service_profile_entity_id = \
+            handler.pon_port.ieee_mapper_service_profile_entity_id
+        self._mac_bridge_port_ani_entity_id = \
+            handler.pon_port.mac_bridge_port_ani_entity_id
+        self._gal_enet_profile_entity_id = \
+            handler.gal_enet_profile_entity_id
+
     def cancel_deferred(self):
         super(BrcmVlanFilterTask, self).cancel_deferred()
 
@@ -84,25 +102,33 @@
         self.log.info('setting-vlan-tagging')
 
         try:
-            # TODO: parameterize these from the handler, or objects in the handler
-            # TODO: make this a member of the onu gem port or the uni port
-            _mac_bridge_service_profile_entity_id = 0x201
-            _mac_bridge_port_ani_entity_id = 0x2102  # TODO: can we just use the entity id from the anis list?
+            ################################################################################
+            # VLAN Tagging Filter config
+            #
+            #  EntityID will be referenced by:
+            #            - Nothing
+            #  References:
+            #            - MacBridgePortConfigurationData for the ANI/PON side
+            #
+
             # Delete bridge ani side vlan filter
-            msg = VlanTaggingFilterDataFrame(_mac_bridge_port_ani_entity_id + self._uni_port.mac_bridge_port_num)
+            # TODO: check if its in our local mib first before blindly deleting
+            msg = VlanTaggingFilterDataFrame(self._mac_bridge_port_ani_entity_id + self._uni_port.mac_bridge_port_num)
             frame = msg.delete()
             self.log.debug('openomci-msg', omci_msg=msg)
             self.strobe_watchdog()
             results = yield self._device.omci_cc.send(frame)
             self.check_status_and_state(results, 'flow-delete-vlan-tagging-filter-data')
-            forward_operation = 0x10  # VID investigation
-            # When the PUSH VLAN is RESERVED_VLAN (4095), let ONU be transparent
-            if self._set_vlan_id == RESERVED_VLAN:
-                forward_operation = 0x00  # no investigation, ONU transparent
 
             # Re-Create bridge ani side vlan filter
+            # TODO: check if its in our local mib first before blindly recreating
+            forward_operation = 0x10  # VID investigation
+            # When the PUSH VLAN is RESERVED_VLAN (4095), let ONU be transparent
+            if self._set_vlan_id == RESERVED_TRANSPARENT_VLAN:
+                forward_operation = 0x00  # no investigation, ONU transparent
+
             msg = VlanTaggingFilterDataFrame(
-                _mac_bridge_port_ani_entity_id + self._uni_port.mac_bridge_port_num,  # Entity ID
+                self._mac_bridge_port_ani_entity_id + self._uni_port.mac_bridge_port_num,  # Entity ID
                 vlan_tcis=[self._set_vlan_id],  # VLAN IDs
                 forward_operation=forward_operation
             )
@@ -112,9 +138,35 @@
             results = yield self._device.omci_cc.send(frame)
             self.check_status_and_state(results, 'flow-create-vlan-tagging-filter-data')
 
-            # Re-Create bridge ani side vlan filter
+            ################################################################################
+            # Create Extended VLAN Tagging Operation config (UNI-side)
+            #
+            #  EntityID relates to the VLAN TCIS
+            #  References:
+            #            - VLAN TCIS from previously created VLAN Tagging filter data
+            #            - PPTP Ethernet or VEIP UNI
+            #
 
-            if self._set_vlan_id == RESERVED_VLAN:
+            attributes = dict(
+                # Specifies the TPIDs in use and that operations in the downstream direction are
+                # inverse to the operations in the upstream direction
+                input_tpid=self._input_tpid,    # input TPID
+                output_tpid=self._output_tpid,  # output TPID
+                downstream_mode=0,              # inverse of upstream
+            )
+
+            msg = ExtendedVlanTaggingOperationConfigurationDataFrame(
+                self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
+                attributes=attributes
+            )
+
+            frame = msg.set()
+            self.log.debug('openomci-msg', omci_msg=msg)
+            self.strobe_watchdog()
+            results = yield self._device.omci_cc.send(frame)
+            self.check_status_and_state(results, 'set-extended-vlan-tagging-operation-configuration-data')
+
+            if self._set_vlan_id == RESERVED_TRANSPARENT_VLAN:
                 # Transparently send any single tagged packet.
                 # Any other specific rules will take priority over this
                 attributes = dict(
@@ -139,8 +191,6 @@
             else:
                 # Update uni side extended vlan filter
                 # filter for untagged
-                # probably for eapol
-                # TODO: Create constants for the operation values.  See omci spec
                 attributes = dict(
                     received_frame_vlan_tagging_operation_table=
                     VlanTaggingOperation(
@@ -162,19 +212,18 @@
                 )
 
             msg = ExtendedVlanTaggingOperationConfigurationDataFrame(
-                _mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
-                attributes=attributes  # See above
+                self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
+                attributes=attributes
             )
+
             frame = msg.set()
             self.log.debug('openomci-msg', omci_msg=msg)
             self.strobe_watchdog()
             results = yield self._device.omci_cc.send(frame)
-            self.check_status_and_state(results,
-                                        'flow-set-ext-vlan-tagging-op-config-data-untagged')
+            self.check_status_and_state(results, 'set-evto-table')
 
             # Update uni side extended vlan filter
             # filter for vlan 0
-            # TODO: Create constants for the operation values.  See omci spec
             attributes = dict(
                 received_frame_vlan_tagging_operation_table=
                 VlanTaggingOperation(
@@ -198,15 +247,14 @@
                 )
             )
             msg = ExtendedVlanTaggingOperationConfigurationDataFrame(
-                _mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
+                self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num,  # Bridge Entity ID
                 attributes=attributes  # See above
             )
             frame = msg.set()
             self.log.debug('openomci-msg', omci_msg=msg)
             self.strobe_watchdog()
             results = yield self._device.omci_cc.send(frame)
-            self.check_status_and_state(results,
-                                        'flow-set-ext-vlan-tagging-op-config-data-zero-tagged')
+            self.check_status_and_state(results, 'set-evto-table-zero-tagged')
 
             self.deferred.callback(self)