blob: 2d749460ef73107bea0b1802fa8dbfa51ab8b9df [file] [log] [blame]
Zsolt Haraszticc153aa2016-12-14 02:28:59 -08001#
Zsolt Haraszti3eb27a52017-01-03 21:56:48 -08002# Copyright 2017 the original author or authors.
Zsolt Haraszticc153aa2016-12-14 02:28:59 -08003#
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#
16
17"""
Steve Crooks3c2c7582017-01-10 15:02:26 -060018Broadcom OLT/ONU adapter.
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080019"""
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080020
Steve Crooks3c2c7582017-01-10 15:02:26 -060021from uuid import uuid4
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080022import structlog
23from twisted.internet import reactor
Steve Crooks3c2c7582017-01-10 15:02:26 -060024from twisted.internet.defer import DeferredQueue, inlineCallbacks
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080025from zope.interface import implementer
26
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080027from voltha.adapters.interface import IAdapterInterface
28from voltha.core.logical_device_agent import mac_str_to_tuple
Steve Crooks3c2c7582017-01-10 15:02:26 -060029from voltha.protos import third_party
30from voltha.protos.adapter_pb2 import Adapter
31from voltha.protos.adapter_pb2 import AdapterConfig
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080032from voltha.protos.common_pb2 import LogLevel, OperStatus, ConnectStatus, \
33 AdminState
Steve Crooks3c2c7582017-01-10 15:02:26 -060034from voltha.protos.device_pb2 import DeviceType, DeviceTypes, Port
35from voltha.protos.health_pb2 import HealthStatus
36from voltha.protos.logical_device_pb2 import LogicalPort
37from voltha.protos.openflow_13_pb2 import OFPPS_LIVE, OFPPF_FIBER, OFPPF_1GB_FD
38from voltha.protos.openflow_13_pb2 import ofp_port
39from common.frameio.frameio import hexify
40from voltha.extensions.omci.omci import *
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080041
Steve Crooks3c2c7582017-01-10 15:02:26 -060042_ = third_party
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080043log = structlog.get_logger()
44
45
46@implementer(IAdapterInterface)
47class BroadcomOnuAdapter(object):
48
49 name = 'broadcom_onu'
50
51 supported_device_types = [
52 DeviceType(
Steve Crooks3c2c7582017-01-10 15:02:26 -060053 id=name,
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080054 adapter=name,
55 accepts_bulk_flow_update=True
56 )
57 ]
58
59 def __init__(self, adapter_agent, config):
60 self.adapter_agent = adapter_agent
61 self.config = config
62 self.descriptor = Adapter(
63 id=self.name,
64 vendor='Voltha project',
Steve Crooks3c2c7582017-01-10 15:02:26 -060065 version='0.4',
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080066 config=AdapterConfig(log_level=LogLevel.INFO)
67 )
Steve Crooks3c2c7582017-01-10 15:02:26 -060068 self.devices_handlers = dict() # device_id -> BroadcomOnuHandler()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080069
70 def start(self):
71 log.debug('starting')
72 log.info('started')
73
74 def stop(self):
75 log.debug('stopping')
76 log.info('stopped')
77
78 def adapter_descriptor(self):
79 return self.descriptor
80
81 def device_types(self):
82 return DeviceTypes(items=self.supported_device_types)
83
84 def health(self):
85 return HealthStatus(state=HealthStatus.HealthState.HEALTHY)
86
87 def change_master_state(self, master):
88 raise NotImplementedError()
89
90 def adopt_device(self, device):
Steve Crooks3c2c7582017-01-10 15:02:26 -060091 log.info('adopt_device', device_id=device.id)
92 self.devices_handlers[device.proxy_address.channel_id] = BroadcomOnuHandler(self, device.id)
93 reactor.callLater(0, self.devices_handlers[device.proxy_address.channel_id].activate, device)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080094 return device
95
96 def abandon_device(self, device):
97 raise NotImplementedError()
98
99 def deactivate_device(self, device):
100 raise NotImplementedError()
101
Steve Crooks3c2c7582017-01-10 15:02:26 -0600102 def update_flows_bulk(self, device, flows, groups):
103 log.info('bulk-flow-update', device_id=device.id,
104 flows=flows, groups=groups)
105 assert len(groups.items) == 0
106 handler = self.devices_handlers[device.proxy_address.channel_id]
107 return handler.update_flow_table(flows.items)
108
109 def update_flows_incrementally(self, device, flow_changes, group_changes):
110 raise NotImplementedError()
111
112 def send_proxied_message(self, proxy_address, msg):
113 log.info('send-proxied-message', proxy_address=proxy_address, msg=msg)
114
115 def receive_proxied_message(self, proxy_address, msg):
116 log.info('receive-proxied-message', proxy_address=proxy_address,
117 device_id=proxy_address.device_id, msg=hexify(msg))
118 handler = self.devices_handlers[proxy_address.channel_id]
119 handler.receive_message(msg)
120
121 def receive_packet_out(self, logical_device_id, egress_port_no, msg):
122 log.info('packet-out', logical_device_id=logical_device_id,
123 egress_port_no=egress_port_no, msg_len=len(msg))
124
125
126class BroadcomOnuHandler(object):
127
128 def __init__(self, adapter, device_id):
129 self.adapter = adapter
130 self.adapter_agent = adapter.adapter_agent
131 self.device_id = device_id
132 self.log = structlog.get_logger(device_id=device_id)
133 self.incoming_messages = DeferredQueue()
134 self.proxy_address = None
135 self.tx_id = 0
136
137 def receive_message(self, msg):
138 self.incoming_messages.put(msg)
139
140 def activate(self, device):
141 self.log.info('activating')
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800142
143 # first we verify that we got parent reference and proxy info
144 assert device.parent_id
145 assert device.proxy_address.device_id
146 assert device.proxy_address.channel_id
147
Steve Crooks3c2c7582017-01-10 15:02:26 -0600148 # register for proxied messages right away
149 self.proxy_address = device.proxy_address
150 self.adapter_agent.register_for_proxied_messages(device.proxy_address)
151
152 # populate device info
153 device.root = True
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800154 device.vendor = 'Broadcom'
Steve Crooks3c2c7582017-01-10 15:02:26 -0600155 device.model ='n/a'
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800156 device.hardware_version = 'to be filled'
157 device.firmware_version = 'to be filled'
158 device.software_version = 'to be filled'
159 device.serial_number = uuid4().hex
160 device.connect_status = ConnectStatus.REACHABLE
161 self.adapter_agent.update_device(device)
162
Steve Crooks3c2c7582017-01-10 15:02:26 -0600163 # register physical ports
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800164 uni_port = Port(
Steve Crooks3c2c7582017-01-10 15:02:26 -0600165 port_no=2,
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800166 label='UNI facing Ethernet port',
167 type=Port.ETHERNET_UNI,
168 admin_state=AdminState.ENABLED,
169 oper_status=OperStatus.ACTIVE
170 )
171 self.adapter_agent.add_port(device.id, uni_port)
172 self.adapter_agent.add_port(device.id, Port(
173 port_no=1,
174 label='PON port',
175 type=Port.PON_ONU,
176 admin_state=AdminState.ENABLED,
177 oper_status=OperStatus.ACTIVE,
178 peers=[
179 Port.PeerPort(
180 device_id=device.parent_id,
181 port_no=device.parent_port_no
182 )
183 ]
184 ))
185
Steve Crooks3c2c7582017-01-10 15:02:26 -0600186 # add uni port to logical device
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800187 parent_device = self.adapter_agent.get_device(device.parent_id)
188 logical_device_id = parent_device.parent_id
189 assert logical_device_id
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800190 port_no = device.proxy_address.channel_id
191 cap = OFPPF_1GB_FD | OFPPF_FIBER
192 self.adapter_agent.add_logical_port(logical_device_id, LogicalPort(
Steve Crooks3c2c7582017-01-10 15:02:26 -0600193 id='uni-{}'.format(port_no),
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800194 ofp_port=ofp_port(
195 port_no=port_no,
196 hw_addr=mac_str_to_tuple('00:00:00:00:00:%02x' % port_no),
197 name='uni-{}'.format(port_no),
198 config=0,
199 state=OFPPS_LIVE,
200 curr=cap,
201 advertised=cap,
202 peer=cap,
203 curr_speed=OFPPF_1GB_FD,
204 max_speed=OFPPF_1GB_FD
205 ),
206 device_id=device.id,
207 device_port_no=uni_port.port_no
208 ))
209
Steve Crooks3c2c7582017-01-10 15:02:26 -0600210 reactor.callLater(5, self.message_exchange)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800211
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800212 device = self.adapter_agent.get_device(device.id)
213 device.oper_status = OperStatus.ACTIVE
214 self.adapter_agent.update_device(device)
215
Steve Crooks3c2c7582017-01-10 15:02:26 -0600216 @inlineCallbacks
217 def update_flow_table(self, flows):
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800218
Steve Crooks3c2c7582017-01-10 15:02:26 -0600219 # we need to proxy through the OLT to get to the ONU
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800220
Steve Crooks3c2c7582017-01-10 15:02:26 -0600221 # reset response queue
222 while self.incoming_messages.pending:
223 yield self.incoming_messages.get()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800224
Steve Crooks3c2c7582017-01-10 15:02:26 -0600225 msg = FlowTable(
226 port=self.proxy_address.channel_id,
227 flows=flows
228 )
229 self.adapter_agent.send_proxied_message(self.proxy_address, msg)
230
231 yield self.incoming_messages.get()
232
233 def get_tx_id(self):
234 self.tx_id += 1
235 return self.tx_id
236
237 def send_omci_message(self, frame):
238 _frame = hexify(str(frame))
239 self.log.info('send-omci-message-%s' % _frame)
240 device = self.adapter_agent.get_device(self.device_id)
241 try:
242 self.adapter_agent.send_proxied_message(device.proxy_address, _frame)
243 except Exception as e:
244 self.log.info('send-omci-message-exception', exc=str(e))
245
246 def send_get_circuit_pack(self, entity_id=0):
247 frame = OmciFrame(
248 transaction_id=self.get_tx_id(),
249 message_type=OmciGet.message_id,
250 omci_message=OmciGet(
251 entity_class=CircuitPack.class_id,
252 entity_id=entity_id,
253 attributes_mask=CircuitPack.mask_for('vendor_id')
254 )
255 )
256 self.send_omci_message(frame)
257
258 def send_mib_reset(self, entity_id=0):
259 frame = OmciFrame(
260 transaction_id=self.get_tx_id(),
261 message_type=OmciMibReset.message_id,
262 omci_message=OmciMibReset(
263 entity_class=OntData.class_id,
264 entity_id=entity_id
265 )
266 )
267 self.send_omci_message(frame)
268
269 def send_create_gal_ethernet_profile(self, entity_id, max_gem_payload_size):
270 frame = OmciFrame(
271 transaction_id=self.get_tx_id(),
272 message_type=OmciCreate.message_id,
273 omci_message=OmciCreate(
274 entity_class=GalEthernetProfile.class_id,
275 entity_id=entity_id,
276 data=dict(
277 max_gem_payload_size=max_gem_payload_size
278 )
279 )
280 )
281 self.send_omci_message(frame)
282
283 def send_set_tcont(self, entity_id, alloc_id):
284 data = dict(
285 alloc_id=alloc_id
286 )
287 frame = OmciFrame(
288 transaction_id=self.get_tx_id(),
289 message_type=OmciSet.message_id,
290 omci_message=OmciSet(
291 entity_class=Tcont.class_id,
292 entity_id = entity_id,
293 attributes_mask=Tcont.mask_for(*data.keys()),
294 data=data
295 )
296 )
297 self.send_omci_message(frame)
298
299 def send_create_8021p_mapper_service_profile(self, entity_id):
300 frame = OmciFrame(
301 transaction_id = self.get_tx_id(),
302 message_type=OmciCreate.message_id,
303 omci_message=OmciCreate(
304 entity_class=Ieee8021pMapperServiceProfile.class_id,
305 entity_id=entity_id,
306 data=dict(
307 tp_pointer=OmciNullPointer,
308 interwork_tp_pointer_for_p_bit_priority_0=OmciNullPointer,
309 )
310 )
311 )
312 self.send_omci_message(frame)
313
314 def send_create_mac_bridge_service_profile(self, entity_id):
315 frame = OmciFrame(
316 transaction_id = self.get_tx_id(),
317 message_type=OmciCreate.message_id,
318 omci_message=OmciCreate(
319 entity_class=MacBridgeServiceProfile.class_id,
320 entity_id=entity_id,
321 data=dict(
322 spanning_tree_ind=False,
323 learning_ind=True,
324 priority=0x8000,
325 max_age=20 * 256,
326 hello_time=2 * 256,
327 forward_delay=15 * 256,
328 unknown_mac_address_discard=True
329 )
330 )
331 )
332 self.send_omci_message(frame)
333
334 def send_create_gem_port_network_ctp(self, entity_id, port_id, tcont_id):
335 frame = OmciFrame(
336 transaction_id = self.get_tx_id(),
337 message_type=OmciCreate.message_id,
338 omci_message=OmciCreate(
339 entity_class=GemPortNetworkCtp.class_id,
340 entity_id=entity_id,
341 data=dict(
342 port_id=port_id,
343 tcont_pointer=tcont_id,
344 direction=3,
345 traffic_management_pointer_upstream=0x100
346 )
347 )
348 )
349 self.send_omci_message(frame)
350
351 def send_create_multicast_gem_interworking_tp(self, entity_id, gem_port_net_ctp_id):
352 frame = OmciFrame(
353 transaction_id = self.get_tx_id(),
354 message_type=OmciCreate.message_id,
355 omci_message=OmciCreate(
356 entity_class=MulticastGemInterworkingTp.class_id,
357 entity_id=entity_id,
358 data=dict(
359 gem_port_network_ctp_pointer=gem_port_net_ctp_id,
360 interworking_option=0,
361 service_profile_pointer=0x1,
362 )
363 )
364 )
365 self.send_omci_message(frame)
366
367 def send_create_gem_inteworking_tp(self, entity_id, gem_port_net_ctp_id, service_profile_id):
368 frame = OmciFrame(
369 transaction_id = self.get_tx_id(),
370 message_type=OmciCreate.message_id,
371 omci_message=OmciCreate(
372 entity_class=GemInterworkingTp.class_id,
373 entity_id=entity_id,
374 data=dict(
375 gem_port_network_ctp_pointer=gem_port_net_ctp_id,
376 interworking_option=5,
377 service_profile_pointer=service_profile_id,
378 interworking_tp_pointer=0x0,
379 gal_profile_pointer=0x1
380 )
381 )
382 )
383 self.send_omci_message(frame)
384
385 def send_set_8021p_mapper_service_profile(self, entity_id, interwork_tp_id):
386 data = dict(
387 interwork_tp_pointer_for_p_bit_priority_0 = interwork_tp_id
388 )
389 frame = OmciFrame(
390 transaction_id = self.get_tx_id(),
391 message_type=OmciSet.message_id,
392 omci_message=OmciSet(
393 entity_class=Ieee8021pMapperServiceProfile.class_id,
394 entity_id=entity_id,
395 attributes_mask=Ieee8021pMapperServiceProfile.mask_for(
396 *data.keys()),
397 data=data
398 )
399 )
400 self.send_omci_message(frame)
401
402 def send_create_mac_bridge_port_configuration_data(self,
403 entity_id,
404 bridge_id,
405 port_id,
406 tp_type,
407 tp_id):
408 frame = OmciFrame(
409 transaction_id=self.get_tx_id(),
410 message_type=OmciCreate.message_id,
411 omci_message=OmciCreate(
412 entity_class=MacBridgePortConfigurationData.class_id,
413 entity_id=entity_id,
414 data=dict(
415 bridge_id_pointer = bridge_id,
416 port_num=port_id,
417 tp_type=tp_type,
418 tp_pointer = tp_id
419 )
420 )
421 )
422 self.send_omci_message(frame)
423
424 def send_create_vlan_tagging_filter_data(self, entity_id, vlan_id):
425 frame = OmciFrame(
426 transaction_id = self.get_tx_id(),
427 message_type=OmciCreate.message_id,
428 omci_message=OmciCreate(
429 entity_class=VlanTaggingFilterData.class_id,
430 entity_id=entity_id,
431 data=dict(
432 vlan_filter_0=vlan_id,
433 forward_operation=0x10,
434 number_of_entries=1
435 )
436 )
437 )
438 self.send_omci_message(frame)
439
440 def send_create_extended_vlan_tagging_operation_configuration_data(self, entity_id):
441 frame = OmciFrame(
442 transaction_id = self.get_tx_id(),
443 message_type=OmciCreate.message_id,
444 omci_message=OmciCreate(
445 entity_class=
446 ExtendedVlanTaggingOperationConfigurationData.class_id,
447 entity_id=entity_id,
448 data=dict(
449 association_type=10,
450 associated_me_pointer=0x401
451 )
452 )
453 )
454 self.send_omci_message(frame)
455
456 def send_set_extended_vlan_tagging_operation_tpid_configuration_data(self, entity_id, input_tpid, output_tpid):
457 data = dict(
458 input_tpid = input_tpid,
459 output_tpid = output_tpid,
460 downstream_mode=0, # inverse of upstream
461 )
462 frame = OmciFrame(
463 transaction_id = self.get_tx_id(),
464 message_type=OmciSet.message_id,
465 omci_message=OmciSet(
466 entity_class=\
467 ExtendedVlanTaggingOperationConfigurationData.class_id,
468 entity_id=entity_id,
469 attributes_mask= \
470 ExtendedVlanTaggingOperationConfigurationData.mask_for(
471 *data.keys()),
472 data=data
473 )
474 )
475 self.send_omci_message(frame)
476
477 def send_set_extended_vlan_tagging_operation_vlan_configuration_data(self,
478 entity_id,
479 filter_inner_vid,
480 treatment_inner_vid):
481 data = dict(
482 received_frame_vlan_tagging_operation_table=\
483 VlanTaggingOperation(
484 filter_outer_priority=15,
485 filter_inner_priority=8,
486 filter_inner_vid = filter_inner_vid,
487 filter_inner_tpid_de=5,
488 filter_ether_type=0,
489 treatment_tags_to_remove=1,
490 pad3=2,
491 treatment_outer_priority=15,
492 treatment_inner_priority=8,
493 treatment_inner_vid = treatment_inner_vid,
494 treatment_inner_tpid_de=4
495 )
496 )
497 frame = OmciFrame(
498 transaction_id = self.get_tx_id(),
499 message_type=OmciSet.message_id,
500 omci_message=OmciSet(
501 entity_class=\
502 ExtendedVlanTaggingOperationConfigurationData.class_id,
503 entity_id = entity_id,
504 attributes_mask= \
505 ExtendedVlanTaggingOperationConfigurationData.mask_for(
506 *data.keys()),
507 data=data
508 )
509 )
510 self.send_omci_message(frame)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800511
512 @inlineCallbacks
Steve Crooks3c2c7582017-01-10 15:02:26 -0600513 def wait_for_response(self):
514 log.info('wait-for-response')
515 try:
516 response = yield self.incoming_messages.get()
517 resp = OmciFrame(response)
518 resp.show()
519 except Exception as e:
520 self.log.info('wait-for-response-exception', exc=str(e))
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800521
Steve Crooks3c2c7582017-01-10 15:02:26 -0600522 @inlineCallbacks
523 def message_exchange(self):
524 log.info('message_exchange')
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800525 # reset incoming message queue
526 while self.incoming_messages.pending:
527 _ = yield self.incoming_messages.get()
528
529 # construct message
Steve Crooks3c2c7582017-01-10 15:02:26 -0600530 # MIB Reset - OntData - 0
531 self.send_mib_reset()
532 yield self.wait_for_response()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800533
Steve Crooks3c2c7582017-01-10 15:02:26 -0600534 # Create AR - GalEthernetProfile - 1
535 self.send_create_gal_ethernet_profile(1, 48)
536 yield self.wait_for_response()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800537
Steve Crooks3c2c7582017-01-10 15:02:26 -0600538 # Set AR - TCont - 32768 - 1024
539 self.send_set_tcont(0x8000, 0x400)
540 yield self.wait_for_response()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800541
Steve Crooks3c2c7582017-01-10 15:02:26 -0600542 # Set AR - TCont - 32769 - 1025
543 self.send_set_tcont(0x8001, 0x401)
544 yield self.wait_for_response()
Zsolt Haraszti656ecc62016-12-28 15:08:23 -0800545
Steve Crooks3c2c7582017-01-10 15:02:26 -0600546 # Set AR - TCont - 32770 - 1026
547 self.send_set_tcont(0x8002, 0x402)
548 yield self.wait_for_response()
549
550 # Set AR - TCont - 32771 - 1027
551 self.send_set_tcont(0x8003, 0x403)
552 yield self.wait_for_response()
553
554 # Create AR - 802.1pMapperServiceProfile - 32768
555 self.send_create_8021p_mapper_service_profile(0x8000)
556 yield self.wait_for_response()
557
558 # Create AR - 802.1pMapperServiceProfile - 32769
559 self.send_create_8021p_mapper_service_profile(0x8001)
560 yield self.wait_for_response()
561
562 # Create AR - 802.1pMapperServiceProfile - 32770
563 self.send_create_8021p_mapper_service_profile(0x8002)
564 yield self.wait_for_response()
565
566 # Create AR - 802.1pMapperServiceProfile - 32771
567 self.send_create_8021p_mapper_service_profile(0x8003)
568 yield self.wait_for_response()
569
570 # Create AR - MacBridgeServiceProfile - 513
571 self.send_create_mac_bridge_service_profile(0x201)
572 yield self.wait_for_response()
573
574 # Create AR - GemPortNetworkCtp - 256 - 1024 - 32768
575 self.send_create_gem_port_network_ctp(0x100, 0x400, 0x8000)
576 yield self.wait_for_response()
577
578 # Create AR - GemPortNetworkCtp - 257 - 1025 - 32769
579 self.send_create_gem_port_network_ctp(0x101, 0x401, 0x8001)
580 yield self.wait_for_response()
581
582 # Create AR - GemPortNetworkCtp - 258 - 1026 - 32770
583 self.send_create_gem_port_network_ctp(0x102, 0x402, 0x8002)
584 yield self.wait_for_response()
585
586 # Create AR - GemPortNetworkCtp - 259 - 1027 - 32771
587 self.send_create_gem_port_network_ctp(0x103, 0x403, 0x8003)
588 yield self.wait_for_response()
589
590 # Create AR - MulticastGemInterworkingTp - 6 - 260
591 self.send_create_multicast_gem_interworking_tp(0x6, 0x104)
592 yield self.wait_for_response()
593
594 # Create AR - GemInterworkingTp - 32769 - 256 -32768 - 1
595 self.send_create_gem_inteworking_tp(0x8001, 0x100, 0x8000)
596 yield self.wait_for_response()
597
598 # Create AR - GemInterworkingTp - 32770 - 257 -32769 - 1
599 self.send_create_gem_inteworking_tp(0x8002, 0x101, 0x8001)
600 yield self.wait_for_response()
601
602 # Create AR - GemInterworkingTp - 32771 - 258 -32770 - 1
603 self.send_create_gem_inteworking_tp(0x8003, 0x102, 0x8002)
604 yield self.wait_for_response()
605
606 # Create AR - GemInterworkingTp - 32772 - 259 -32771 - 1
607 self.send_create_gem_inteworking_tp(0x8004, 0x103, 0x8003)
608 yield self.wait_for_response()
609
610 # Set AR - 802.1pMapperServiceProfile - 32768 - 32769
611 self.send_set_8021p_mapper_service_profile(0x8000, 0x8001)
612 yield self.wait_for_response()
613
614 # Set AR - 802.1pMapperServiceProfile - 32769 - 32770
615 self.send_set_8021p_mapper_service_profile(0x8001, 0x8002)
616 yield self.wait_for_response()
617
618 # Set AR - 802.1pMapperServiceProfile - 32770 - 32771
619 self.send_set_8021p_mapper_service_profile(0x8002, 0x8003)
620 yield self.wait_for_response()
621
622 # Set AR - 802.1pMapperServiceProfile - 32771 - 32772
623 self.send_set_8021p_mapper_service_profile(0x8003, 0x8004)
624 yield self.wait_for_response()
625
626 # Create AR - MacBridgePortConfigData - 8449 - 513 - 2 - 3 - 32768
627 self.send_create_mac_bridge_port_configuration_data(0x2101, 0x201, 2, 3, 0x8000)
628 yield self.wait_for_response()
629
630 # Create AR - MacBridgePortConfigData - 8450 - 513 - 3 - 3 - 32769
631 self.send_create_mac_bridge_port_configuration_data(0x2102, 0x201, 3, 3, 0x8001)
632 yield self.wait_for_response()
633
634 # Create AR - MacBridgePortConfigData - 8451 - 513 - 4 - 3 - 32770
635 self.send_create_mac_bridge_port_configuration_data(0x2103, 0x201, 4, 3, 0x8002)
636 yield self.wait_for_response()
637
638 # Create AR - MacBridgePortConfigData - 8452 - 513 - 5 - 3 - 32771
639 self.send_create_mac_bridge_port_configuration_data(0x2104, 0x201, 5, 3, 0x8003)
640 yield self.wait_for_response()
641
642 # Create AR - MacBridgePortConfigData - 9000 - 513 - 6 - 6 - 6
643 self.send_create_mac_bridge_port_configuration_data(0x2328, 0x201, 6, 6, 6)
644 yield self.wait_for_response()
645
646 # Create AR - VlanTaggingFilterData - 8449 - 040000000000000000000000000000000000000000000000
647 self.send_create_vlan_tagging_filter_data(0x2101, 0x0400)
648 yield self.wait_for_response()
649
650 # Create AR - VlanTaggingFilterData - 8450 - 040100000000000000000000000000000000000000000000
651 self.send_create_vlan_tagging_filter_data(0x2102, 0x0401)
652 yield self.wait_for_response()
653
654 # Create AR - VlanTaggingFilterData - 8451 - 040200000000000000000000000000000000000000000000
655 self.send_create_vlan_tagging_filter_data(0x2103, 0x0402)
656 yield self.wait_for_response()
657
658 # Create AR - VlanTaggingFilterData - 8452 - 040300000000000000000000000000000000000000000000
659 self.send_create_vlan_tagging_filter_data(0x2104, 0x0403)
660 yield self.wait_for_response()
661
662 # Create AR - ExtendedVlanTaggingOperationConfigData - 514 - 10 - 1025
663 self.send_create_extended_vlan_tagging_operation_configuration_data(0x202)
664 yield self.wait_for_response()
665
666 # Set AR - ExtendedVlanTaggingOperationConfigData - 514 - 8100 - 8100
667 self.send_set_extended_vlan_tagging_operation_tpid_configuration_data(0x202,0x8100,0x8100)
668 yield self.wait_for_response()
669
670 # Set AR - ExtendedVlanTaggingOperationConfigData - 514 - RxVlanTaggingOperationTable - 0x400 - 5 - 0x400 - 4
671 self.send_set_extended_vlan_tagging_operation_vlan_configuration_data(0x202, 0x400, 0x400)
672 yield self.wait_for_response()
673
674 # Set AR - ExtendedVlanTaggingOperationConfigData - 514 - RxVlanTaggingOperationTable - 0x401 - 5 - 0x401 - 4
675 self.send_set_extended_vlan_tagging_operation_vlan_configuration_data(0x202, 0x401, 0x401)
676 yield self.wait_for_response()
677
678 # Set AR - ExtendedVlanTaggingOperationConfigData - 514 - RxVlanTaggingOperationTable - 0x402 - 5 - 0x402 - 4
679 self.send_set_extended_vlan_tagging_operation_vlan_configuration_data(0x202, 0x402, 0x402)
680 yield self.wait_for_response()
681
682 # Set AR - ExtendedVlanTaggingOperationConfigData - 514 - RxVlanTaggingOperationTable - 0x403 - 5 - 0x403 - 4
683 self.send_set_extended_vlan_tagging_operation_vlan_configuration_data(0x202, 0x403, 0x403)
684 yield self.wait_for_response()
685
686 # Create AR - MacBridgePortConfigData - 513 - 513 - 1 - 11 - 1025
687 self.send_create_mac_bridge_port_configuration_data(0x201, 0x201, 1, 11, 0x401)
688 yield self.wait_for_response()
689