Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2018 the original author or authors. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 16 | |
Matt Jeanneret | 2e3cb8d | 2019-11-16 09:22:41 -0500 | [diff] [blame] | 17 | from __future__ import absolute_import |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 18 | import structlog |
Matt Jeanneret | 72f96fc | 2019-02-11 10:53:05 -0500 | [diff] [blame] | 19 | from pyvoltha.adapters.extensions.omci.tasks.task import Task |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 20 | from twisted.internet import reactor |
| 21 | from twisted.internet.defer import inlineCallbacks, failure, returnValue |
Matt Jeanneret | 72f96fc | 2019-02-11 10:53:05 -0500 | [diff] [blame] | 22 | from pyvoltha.adapters.extensions.omci.omci_defs import ReasonCodes, EntityOperations |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 23 | from pyvoltha.adapters.extensions.omci.omci_me import \ |
| 24 | VlanTaggingOperation, VlanTaggingFilterDataFrame, ExtendedVlanTaggingOperationConfigurationDataFrame |
Matt Jeanneret | 2e3cb8d | 2019-11-16 09:22:41 -0500 | [diff] [blame] | 25 | from uni_port import UniType |
| 26 | from pon_port import DEFAULT_TPID |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 27 | |
| 28 | RC = ReasonCodes |
| 29 | OP = EntityOperations |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 30 | RESERVED_TRANSPARENT_VLAN = 4095 |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 31 | |
| 32 | |
| 33 | class BrcmVlanFilterException(Exception): |
| 34 | pass |
| 35 | |
| 36 | |
| 37 | class BrcmVlanFilterTask(Task): |
| 38 | """ |
| 39 | Apply Vlan Tagging Filter Data and Extended VLAN Tagging Operation Configuration on an ANI and UNI |
| 40 | """ |
| 41 | task_priority = 200 |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 42 | name = "Broadcom VLAN Filter/Tagging Task" |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 43 | |
Mahir Gunyel | d680cb6 | 2020-02-18 10:28:12 -0800 | [diff] [blame] | 44 | def __init__(self, omci_agent, handler, uni_port, set_vlan_id, |
| 45 | match_vlan=0, set_vlan_pcp=8, add_tag=True, |
| 46 | priority=task_priority, tp_id=0): |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 47 | """ |
| 48 | Class initialization |
| 49 | |
| 50 | :param omci_agent: (OmciAdapterAgent) OMCI Adapter agent |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 51 | :param handler: (BrcmOpenomciOnuHandler) ONU Device Handler Instance |
| 52 | :param uni_port: (UniPort) Object instance representing the uni port and its settings |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 53 | :param set_vlan_id: (int) VLAN to filter for and set |
Girish Gowdra | a73ee45 | 2019-12-20 18:52:17 +0530 | [diff] [blame] | 54 | :param tp_id: (int) TP ID for the flow |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 55 | :param priority: (int) OpenOMCI Task priority (0..255) 255 is the highest |
| 56 | """ |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 57 | super(BrcmVlanFilterTask, self).__init__(BrcmVlanFilterTask.name, |
| 58 | omci_agent, |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 59 | handler.device_id, |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 60 | priority=priority, |
| 61 | exclusive=True) |
Matt Jeanneret | 08a8e86 | 2019-12-20 14:02:32 -0500 | [diff] [blame] | 62 | |
| 63 | self.log = structlog.get_logger(device_id=handler.device_id, |
| 64 | name=BrcmVlanFilterTask.name, |
| 65 | task_id=self._task_id, |
| 66 | entity_id=uni_port.entity_id, |
| 67 | uni_id=uni_port.uni_id, |
| 68 | uni_port=uni_port.port_number, |
| 69 | set_vlan_id=set_vlan_id) |
| 70 | |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 71 | self._device = omci_agent.get_device(handler.device_id) |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 72 | self._uni_port = uni_port |
| 73 | self._set_vlan_id = set_vlan_id |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 74 | self._set_vlan_pcp = set_vlan_pcp |
| 75 | self._match_vlan = match_vlan |
| 76 | self._add_tag = add_tag |
Girish Gowdra | a73ee45 | 2019-12-20 18:52:17 +0530 | [diff] [blame] | 77 | self._tp_id = tp_id |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 78 | self._results = None |
| 79 | self._local_deferred = None |
| 80 | self._config = self._device.configuration |
| 81 | |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 82 | self._input_tpid = DEFAULT_TPID |
| 83 | self._output_tpid = DEFAULT_TPID |
| 84 | |
| 85 | self._mac_bridge_service_profile_entity_id = \ |
| 86 | handler.mac_bridge_service_profile_entity_id |
| 87 | self._ieee_mapper_service_profile_entity_id = \ |
| 88 | handler.pon_port.ieee_mapper_service_profile_entity_id |
| 89 | self._mac_bridge_port_ani_entity_id = \ |
| 90 | handler.pon_port.mac_bridge_port_ani_entity_id |
| 91 | self._gal_enet_profile_entity_id = \ |
| 92 | handler.gal_enet_profile_entity_id |
| 93 | |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 94 | def cancel_deferred(self): |
| 95 | super(BrcmVlanFilterTask, self).cancel_deferred() |
| 96 | |
| 97 | d, self._local_deferred = self._local_deferred, None |
| 98 | try: |
| 99 | if d is not None and not d.called: |
| 100 | d.cancel() |
| 101 | except: |
| 102 | pass |
| 103 | |
| 104 | def start(self): |
| 105 | """ |
| 106 | Start Vlan Tagging Task |
| 107 | """ |
| 108 | super(BrcmVlanFilterTask, self).start() |
| 109 | self._local_deferred = reactor.callLater(0, self.perform_vlan_tagging) |
| 110 | |
| 111 | @inlineCallbacks |
| 112 | def perform_vlan_tagging(self): |
| 113 | """ |
| 114 | Perform the vlan tagging |
| 115 | """ |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 116 | self.log.debug('vlan-filter-tagging-task', device_id=self._device._device_id, uni_port=self._uni_port, set_vlan_id=self._set_vlan_id, \ |
| 117 | set_vlan_pcp=self._set_vlan_pcp, match_vlan=self._match_vlan, tp_id=self._tp_id, add_tag=self._add_tag) |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 118 | |
| 119 | try: |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 120 | if self._add_tag: |
| 121 | ################################################################################ |
| 122 | # VLAN Tagging Filter config |
| 123 | # |
| 124 | # EntityID will be referenced by: |
| 125 | # - Nothing |
| 126 | # References: |
| 127 | # - MacBridgePortConfigurationData for the ANI/PON side |
| 128 | # |
Matt Jeanneret | 810148b | 2019-09-29 12:44:01 -0400 | [diff] [blame] | 129 | |
Matt Jeanneret | 31509ec | 2019-12-20 14:57:53 -0500 | [diff] [blame] | 130 | |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 131 | # Delete bridge ani side vlan filter |
| 132 | eid = self._mac_bridge_port_ani_entity_id + self._uni_port.entity_id + self._tp_id # Entity ID |
| 133 | msg = VlanTaggingFilterDataFrame(eid) |
| 134 | frame = msg.delete() |
| 135 | self.log.debug('openomci-msg', omci_msg=msg) |
| 136 | self.strobe_watchdog() |
| 137 | results = yield self._device.omci_cc.send(frame) |
| 138 | self.check_status_and_state(results, 'flow-delete-vlan-tagging-filter-data') |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 139 | |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 140 | ################################################################################ |
| 141 | # Create Extended VLAN Tagging Operation config (UNI-side) |
| 142 | # |
| 143 | # EntityID relates to the VLAN TCIS later used int vlan filter task. This only |
| 144 | # sets up the inital MIB entry as it relates to port config, it does not set vlan |
| 145 | # that is saved for the vlan filter task |
| 146 | # |
| 147 | # References: |
| 148 | # - PPTP Ethernet or VEIP UNI |
| 149 | # |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 150 | |
Matt Jeanneret | 31509ec | 2019-12-20 14:57:53 -0500 | [diff] [blame] | 151 | |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 152 | # Delete uni side evto |
| 153 | msg = ExtendedVlanTaggingOperationConfigurationDataFrame( |
| 154 | self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num, |
| 155 | ) |
| 156 | frame = msg.delete() |
| 157 | self.log.debug('openomci-msg', omci_msg=msg) |
| 158 | results = yield self._device.omci_cc.send(frame) |
| 159 | self.check_status_and_state(results, 'delete-extended-vlan-tagging-operation-configuration-data') |
Matt Jeanneret | 31509ec | 2019-12-20 14:57:53 -0500 | [diff] [blame] | 160 | |
| 161 | |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 162 | # Re-Create uni side evto |
| 163 | # default to PPTP |
Matt Jeanneret | 31509ec | 2019-12-20 14:57:53 -0500 | [diff] [blame] | 164 | association_type = 2 |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 165 | if self._uni_port.type.value == UniType.VEIP.value: |
| 166 | association_type = 10 |
| 167 | elif self._uni_port.type.value == UniType.PPTP.value: |
| 168 | association_type = 2 |
Matt Jeanneret | 31509ec | 2019-12-20 14:57:53 -0500 | [diff] [blame] | 169 | |
Harsh Awasthi | b10a708 | 2019-08-26 02:17:33 -0400 | [diff] [blame] | 170 | attributes = dict( |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 171 | association_type=association_type, # Assoc Type, PPTP/VEIP Ethernet UNI |
| 172 | associated_me_pointer=self._uni_port.entity_id, # Assoc ME, PPTP/VEIP Entity Id |
| 173 | |
| 174 | # See VOL-1311 - Need to set table during create to avoid exception |
| 175 | # trying to read back table during post-create-read-missing-attributes |
| 176 | # But, because this is a R/W attribute. Some ONU may not accept the |
| 177 | # value during create. It is repeated again in a set below. |
| 178 | input_tpid=self._input_tpid, # input TPID |
| 179 | output_tpid=self._output_tpid, # output TPID |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 180 | ) |
Chaitrashree G S | cac5695 | 2020-01-16 15:50:08 -0500 | [diff] [blame] | 181 | |
| 182 | msg = ExtendedVlanTaggingOperationConfigurationDataFrame( |
| 183 | self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num, # Bridge Entity ID |
| 184 | attributes=attributes |
| 185 | ) |
| 186 | |
Chaitrashree G S | cac5695 | 2020-01-16 15:50:08 -0500 | [diff] [blame] | 187 | frame = msg.create() |
| 188 | self.log.debug('openomci-msg', omci_msg=msg) |
Chaitrashree G S | cac5695 | 2020-01-16 15:50:08 -0500 | [diff] [blame] | 189 | results = yield self._device.omci_cc.send(frame) |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 190 | self.check_status_and_state(results, 'create-extended-vlan-tagging-operation-configuration-data') |
| 191 | |
Harsh Awasthi | b10a708 | 2019-08-26 02:17:33 -0400 | [diff] [blame] | 192 | attributes = dict( |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 193 | # Specifies the TPIDs in use and that operations in the downstream direction are |
| 194 | # inverse to the operations in the upstream direction |
| 195 | input_tpid=self._input_tpid, # input TPID |
| 196 | output_tpid=self._output_tpid, # output TPID |
| 197 | downstream_mode=0, # inverse of upstream |
Harsh Awasthi | b10a708 | 2019-08-26 02:17:33 -0400 | [diff] [blame] | 198 | ) |
| 199 | |
Chaitrashree G S | cac5695 | 2020-01-16 15:50:08 -0500 | [diff] [blame] | 200 | msg = ExtendedVlanTaggingOperationConfigurationDataFrame( |
| 201 | self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num, # Bridge Entity ID |
| 202 | attributes=attributes |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 203 | ) |
Chaitrashree G S | cac5695 | 2020-01-16 15:50:08 -0500 | [diff] [blame] | 204 | |
| 205 | frame = msg.set() |
| 206 | self.log.debug('openomci-msg', omci_msg=msg) |
| 207 | self.strobe_watchdog() |
| 208 | results = yield self._device.omci_cc.send(frame) |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 209 | self.check_status_and_state(results, 'set-extended-vlan-tagging-operation-configuration-data') |
Chaitrashree G S | cac5695 | 2020-01-16 15:50:08 -0500 | [diff] [blame] | 210 | |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 211 | # Onu-Transparent |
| 212 | if self._set_vlan_id == RESERVED_TRANSPARENT_VLAN: |
| 213 | # Transparently send any single tagged packet. |
| 214 | # As the onu is to be transparent, no need to create VlanTaggingFilterData ME. |
| 215 | # Any other specific rules will take priority over this, so not setting any other vlan specific rules |
| 216 | attributes = dict( |
| 217 | received_frame_vlan_tagging_operation_table= |
| 218 | VlanTaggingOperation( |
| 219 | filter_outer_priority=15, |
| 220 | filter_outer_vid=4096, |
| 221 | filter_outer_tpid_de=0, |
| 222 | filter_inner_priority=14, |
| 223 | filter_inner_vid=4096, |
| 224 | filter_inner_tpid_de=0, |
| 225 | filter_ether_type=0, |
| 226 | treatment_tags_to_remove=0, |
| 227 | treatment_outer_priority=15, |
| 228 | treatment_outer_vid=0, |
| 229 | treatment_outer_tpid_de=0, |
| 230 | treatment_inner_priority=15, |
| 231 | treatment_inner_vid=0, |
| 232 | treatment_inner_tpid_de=4 |
| 233 | ) |
Chaitrashree G S | cac5695 | 2020-01-16 15:50:08 -0500 | [diff] [blame] | 234 | ) |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 235 | |
Mahir Gunyel | a982ec3 | 2020-02-25 12:30:37 -0800 | [diff] [blame^] | 236 | msg = ExtendedVlanTaggingOperationConfigurationDataFrame( |
| 237 | self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num, # Bridge Entity ID |
| 238 | attributes=attributes |
| 239 | ) |
| 240 | |
| 241 | frame = msg.set() |
| 242 | self.log.debug('openomci-msg', omci_msg=msg) |
| 243 | self.strobe_watchdog() |
| 244 | results = yield self._device.omci_cc.send(frame) |
| 245 | self.check_status_and_state(results, 'set-evto-table-transparent-vlan') |
| 246 | |
| 247 | else: |
| 248 | # Re-Create bridge ani side vlan filter |
| 249 | forward_operation = 0x10 # VID investigation |
| 250 | |
| 251 | msg = VlanTaggingFilterDataFrame( |
| 252 | eid, |
| 253 | vlan_tcis=[self._set_vlan_id], # VLAN IDs |
| 254 | forward_operation=forward_operation |
| 255 | ) |
| 256 | frame = msg.create() |
| 257 | self.log.debug('openomci-msg', omci_msg=msg) |
| 258 | self.strobe_watchdog() |
| 259 | results = yield self._device.omci_cc.send(frame) |
| 260 | self.check_status_and_state(results, 'flow-create-vlan-tagging-filter-data') |
| 261 | # Update uni side extended vlan filter |
| 262 | # filter for untagged |
| 263 | attributes = dict( |
| 264 | received_frame_vlan_tagging_operation_table= |
| 265 | VlanTaggingOperation( |
| 266 | filter_outer_priority=15, |
| 267 | filter_outer_vid=4096, |
| 268 | filter_outer_tpid_de=0, |
| 269 | filter_inner_priority=15, |
| 270 | filter_inner_vid=4096, |
| 271 | filter_inner_tpid_de=0, |
| 272 | filter_ether_type=0, |
| 273 | treatment_tags_to_remove=0, |
| 274 | treatment_outer_priority=15, |
| 275 | treatment_outer_vid=0, |
| 276 | treatment_outer_tpid_de=0, |
| 277 | treatment_inner_priority=0, |
| 278 | treatment_inner_vid=self._set_vlan_id, |
| 279 | treatment_inner_tpid_de=4 |
| 280 | ) |
| 281 | ) |
| 282 | |
| 283 | msg = ExtendedVlanTaggingOperationConfigurationDataFrame( |
| 284 | self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num, # Bridge Entity ID |
| 285 | attributes=attributes |
| 286 | ) |
| 287 | |
| 288 | frame = msg.set() |
| 289 | self.log.debug('openomci-msg', omci_msg=msg) |
| 290 | self.strobe_watchdog() |
| 291 | results = yield self._device.omci_cc.send(frame) |
| 292 | self.check_status_and_state(results, 'set-evto-table-untagged') |
| 293 | |
| 294 | # Update uni side extended vlan filter |
| 295 | # filter for vlan 0 |
| 296 | attributes = dict( |
| 297 | received_frame_vlan_tagging_operation_table= |
| 298 | VlanTaggingOperation( |
| 299 | filter_outer_priority=15, # This entry is not a double-tag rule |
| 300 | filter_outer_vid=4096, # Do not filter on the outer VID value |
| 301 | filter_outer_tpid_de=0, # Do not filter on the outer TPID field |
| 302 | |
| 303 | filter_inner_priority=8, # Filter on inner vlan |
| 304 | filter_inner_vid=0x0, # Look for vlan 0 |
| 305 | filter_inner_tpid_de=0, # Do not filter on inner TPID field |
| 306 | filter_ether_type=0, # Do not filter on EtherType |
| 307 | |
| 308 | treatment_tags_to_remove=1, |
| 309 | treatment_outer_priority=15, |
| 310 | treatment_outer_vid=0, |
| 311 | treatment_outer_tpid_de=0, |
| 312 | |
| 313 | treatment_inner_priority=8, # Add an inner tag and insert this value as the priority |
| 314 | treatment_inner_vid=self._set_vlan_id, # use this value as the VID in the inner VLAN tag |
| 315 | treatment_inner_tpid_de=4, # set TPID |
| 316 | ) |
| 317 | ) |
| 318 | msg = ExtendedVlanTaggingOperationConfigurationDataFrame( |
| 319 | self._mac_bridge_service_profile_entity_id + self._uni_port.mac_bridge_port_num, # Bridge Entity ID |
| 320 | attributes=attributes # See above |
| 321 | ) |
| 322 | frame = msg.set() |
| 323 | self.log.debug('openomci-msg', omci_msg=msg) |
| 324 | self.strobe_watchdog() |
| 325 | results = yield self._device.omci_cc.send(frame) |
| 326 | self.check_status_and_state(results, 'set-evto-table-zero-tagged') |
| 327 | |
| 328 | else: #addTag = False |
| 329 | #TODO: needs to be implemented - future task. |
| 330 | self.log.debug('removing-vlan-filter-tag', uni_port=self._uni_port, match_vlan=self._match_vlan, ) |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 331 | self.deferred.callback(self) |
| 332 | |
| 333 | except Exception as e: |
| 334 | self.log.exception('setting-vlan-tagging', e=e) |
| 335 | self.deferred.errback(failure.Failure(e)) |
| 336 | |
| 337 | def check_status_and_state(self, results, operation=''): |
| 338 | """ |
| 339 | Check the results of an OMCI response. An exception is thrown |
| 340 | if the task was cancelled or an error was detected. |
| 341 | |
| 342 | :param results: (OmciFrame) OMCI Response frame |
| 343 | :param operation: (str) what operation was being performed |
| 344 | :return: True if successful, False if the entity existed (already created) |
| 345 | """ |
| 346 | |
| 347 | omci_msg = results.fields['omci_message'].fields |
| 348 | status = omci_msg['success_code'] |
| 349 | error_mask = omci_msg.get('parameter_error_attributes_mask', 'n/a') |
| 350 | failed_mask = omci_msg.get('failed_attributes_mask', 'n/a') |
| 351 | unsupported_mask = omci_msg.get('unsupported_attributes_mask', 'n/a') |
| 352 | |
Matt Jeanneret | e8fc53e | 2019-04-13 15:58:33 -0400 | [diff] [blame] | 353 | self.log.debug("OMCI Result", operation=operation, omci_msg=omci_msg, |
Matt Jeanneret | f1e9c5d | 2019-02-08 07:41:29 -0500 | [diff] [blame] | 354 | status=status, error_mask=error_mask, |
| 355 | failed_mask=failed_mask, unsupported_mask=unsupported_mask) |
| 356 | |
| 357 | if status == RC.Success: |
| 358 | self.strobe_watchdog() |
| 359 | return True |
| 360 | |
| 361 | elif status == RC.InstanceExists: |
| 362 | return False |
Harsh Awasthi | b10a708 | 2019-08-26 02:17:33 -0400 | [diff] [blame] | 363 | |