blob: afcbba3f9192a810dac1589f233b4f94c31471e6 [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 Crooksf248e182017-02-07 10:50:24 -050029import voltha.core.flow_decomposer as fd
Steve Crooks3c2c7582017-01-10 15:02:26 -060030from voltha.protos import third_party
31from voltha.protos.adapter_pb2 import Adapter
32from voltha.protos.adapter_pb2 import AdapterConfig
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080033from voltha.protos.common_pb2 import LogLevel, OperStatus, ConnectStatus, \
34 AdminState
Steve Crooks3c2c7582017-01-10 15:02:26 -060035from voltha.protos.device_pb2 import DeviceType, DeviceTypes, Port
36from voltha.protos.health_pb2 import HealthStatus
37from voltha.protos.logical_device_pb2 import LogicalPort
38from voltha.protos.openflow_13_pb2 import OFPPS_LIVE, OFPPF_FIBER, OFPPF_1GB_FD
Steve Crooksf248e182017-02-07 10:50:24 -050039from voltha.protos.openflow_13_pb2 import OFPXMC_OPENFLOW_BASIC, ofp_port
Steve Crooks3c2c7582017-01-10 15:02:26 -060040from common.frameio.frameio import hexify
41from voltha.extensions.omci.omci import *
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080042
Steve Crooks3c2c7582017-01-10 15:02:26 -060043_ = third_party
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080044log = structlog.get_logger()
45
46
47@implementer(IAdapterInterface)
48class BroadcomOnuAdapter(object):
49
50 name = 'broadcom_onu'
51
52 supported_device_types = [
53 DeviceType(
Steve Crooks3c2c7582017-01-10 15:02:26 -060054 id=name,
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080055 adapter=name,
56 accepts_bulk_flow_update=True
57 )
58 ]
59
60 def __init__(self, adapter_agent, config):
61 self.adapter_agent = adapter_agent
62 self.config = config
63 self.descriptor = Adapter(
64 id=self.name,
65 vendor='Voltha project',
Steve Crooks3c2c7582017-01-10 15:02:26 -060066 version='0.4',
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080067 config=AdapterConfig(log_level=LogLevel.INFO)
68 )
Steve Crooks3c2c7582017-01-10 15:02:26 -060069 self.devices_handlers = dict() # device_id -> BroadcomOnuHandler()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080070
71 def start(self):
72 log.debug('starting')
73 log.info('started')
74
75 def stop(self):
76 log.debug('stopping')
77 log.info('stopped')
78
79 def adapter_descriptor(self):
80 return self.descriptor
81
82 def device_types(self):
83 return DeviceTypes(items=self.supported_device_types)
84
85 def health(self):
86 return HealthStatus(state=HealthStatus.HealthState.HEALTHY)
87
88 def change_master_state(self, master):
89 raise NotImplementedError()
90
91 def adopt_device(self, device):
Steve Crooks3c2c7582017-01-10 15:02:26 -060092 log.info('adopt_device', device_id=device.id)
93 self.devices_handlers[device.proxy_address.channel_id] = BroadcomOnuHandler(self, device.id)
94 reactor.callLater(0, self.devices_handlers[device.proxy_address.channel_id].activate, device)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -080095 return device
96
97 def abandon_device(self, device):
98 raise NotImplementedError()
99
Khen Nursimulud068d812017-03-06 11:44:18 -0500100 def disable_device(self, device):
101 raise NotImplementedError()
102
103 def reenable_device(self, device):
104 raise NotImplementedError()
105
106 def reboot_device(self, device):
107 raise NotImplementedError()
108
109 def delete_device(self, device):
110 raise NotImplementedError()
111
112 def get_device_details(self, device):
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800113 raise NotImplementedError()
114
Sergio Slobodrianec864c62017-03-09 11:41:43 -0500115 def update_pm_config(self, device, pm_configs):
116 raise NotImplementedError()
117
Steve Crooks3c2c7582017-01-10 15:02:26 -0600118 def update_flows_bulk(self, device, flows, groups):
119 log.info('bulk-flow-update', device_id=device.id,
120 flows=flows, groups=groups)
121 assert len(groups.items) == 0
122 handler = self.devices_handlers[device.proxy_address.channel_id]
Steve Crooksf248e182017-02-07 10:50:24 -0500123 return handler.update_flow_table(device, flows.items)
Steve Crooks3c2c7582017-01-10 15:02:26 -0600124
125 def update_flows_incrementally(self, device, flow_changes, group_changes):
126 raise NotImplementedError()
127
128 def send_proxied_message(self, proxy_address, msg):
129 log.info('send-proxied-message', proxy_address=proxy_address, msg=msg)
130
131 def receive_proxied_message(self, proxy_address, msg):
132 log.info('receive-proxied-message', proxy_address=proxy_address,
133 device_id=proxy_address.device_id, msg=hexify(msg))
134 handler = self.devices_handlers[proxy_address.channel_id]
135 handler.receive_message(msg)
136
137 def receive_packet_out(self, logical_device_id, egress_port_no, msg):
138 log.info('packet-out', logical_device_id=logical_device_id,
139 egress_port_no=egress_port_no, msg_len=len(msg))
140
141
142class BroadcomOnuHandler(object):
143
144 def __init__(self, adapter, device_id):
145 self.adapter = adapter
146 self.adapter_agent = adapter.adapter_agent
147 self.device_id = device_id
148 self.log = structlog.get_logger(device_id=device_id)
149 self.incoming_messages = DeferredQueue()
150 self.proxy_address = None
151 self.tx_id = 0
152
153 def receive_message(self, msg):
154 self.incoming_messages.put(msg)
155
156 def activate(self, device):
157 self.log.info('activating')
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800158
159 # first we verify that we got parent reference and proxy info
160 assert device.parent_id
161 assert device.proxy_address.device_id
162 assert device.proxy_address.channel_id
163
Steve Crooks3c2c7582017-01-10 15:02:26 -0600164 # register for proxied messages right away
165 self.proxy_address = device.proxy_address
166 self.adapter_agent.register_for_proxied_messages(device.proxy_address)
167
168 # populate device info
169 device.root = True
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800170 device.vendor = 'Broadcom'
Steve Crooks9e85ce82017-03-20 12:00:53 -0400171 device.model = 'n/a'
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800172 device.hardware_version = 'to be filled'
173 device.firmware_version = 'to be filled'
174 device.software_version = 'to be filled'
175 device.serial_number = uuid4().hex
176 device.connect_status = ConnectStatus.REACHABLE
177 self.adapter_agent.update_device(device)
178
Steve Crooks3c2c7582017-01-10 15:02:26 -0600179 # register physical ports
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800180 uni_port = Port(
Steve Crooks3c2c7582017-01-10 15:02:26 -0600181 port_no=2,
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800182 label='UNI facing Ethernet port',
183 type=Port.ETHERNET_UNI,
184 admin_state=AdminState.ENABLED,
185 oper_status=OperStatus.ACTIVE
186 )
187 self.adapter_agent.add_port(device.id, uni_port)
188 self.adapter_agent.add_port(device.id, Port(
189 port_no=1,
190 label='PON port',
191 type=Port.PON_ONU,
192 admin_state=AdminState.ENABLED,
193 oper_status=OperStatus.ACTIVE,
194 peers=[
195 Port.PeerPort(
196 device_id=device.parent_id,
197 port_no=device.parent_port_no
198 )
199 ]
200 ))
201
Steve Crooks3c2c7582017-01-10 15:02:26 -0600202 # add uni port to logical device
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800203 parent_device = self.adapter_agent.get_device(device.parent_id)
204 logical_device_id = parent_device.parent_id
205 assert logical_device_id
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800206 port_no = device.proxy_address.channel_id
207 cap = OFPPF_1GB_FD | OFPPF_FIBER
208 self.adapter_agent.add_logical_port(logical_device_id, LogicalPort(
Steve Crooks3c2c7582017-01-10 15:02:26 -0600209 id='uni-{}'.format(port_no),
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800210 ofp_port=ofp_port(
211 port_no=port_no,
Steve Crooks77334a72017-01-25 20:29:37 -0500212 hw_addr=mac_str_to_tuple('00:00:00:00:%02x:%02x' % ((port_no >> 8) & 0xff, port_no & 0xff)),
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800213 name='uni-{}'.format(port_no),
214 config=0,
215 state=OFPPS_LIVE,
216 curr=cap,
217 advertised=cap,
218 peer=cap,
219 curr_speed=OFPPF_1GB_FD,
220 max_speed=OFPPF_1GB_FD
221 ),
222 device_id=device.id,
223 device_port_no=uni_port.port_no
224 ))
225
Steve Crooks77334a72017-01-25 20:29:37 -0500226 reactor.callLater(10, self.message_exchange)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800227
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800228 device = self.adapter_agent.get_device(device.id)
229 device.oper_status = OperStatus.ACTIVE
230 self.adapter_agent.update_device(device)
231
Steve Crooks3c2c7582017-01-10 15:02:26 -0600232 @inlineCallbacks
Steve Crooksf248e182017-02-07 10:50:24 -0500233 def update_flow_table(self, device, flows):
234 #
235 # We need to proxy through the OLT to get to the ONU
236 # Configuration from here should be using OMCI
237 #
238 self.log.info('bulk-flow-update', device_id=device.id, flows=flows)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800239
Steve Crooksf248e182017-02-07 10:50:24 -0500240 def is_downstream(port):
241 return port == 2 # Need a better way
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800242
Steve Crooksf248e182017-02-07 10:50:24 -0500243 def is_upstream(port):
244 return not is_downstream(port)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800245
Steve Crooksf248e182017-02-07 10:50:24 -0500246 for flow in flows:
247 try:
248 _in_port = fd.get_in_port(flow)
249 assert _in_port is not None
Steve Crooks3c2c7582017-01-10 15:02:26 -0600250
Steve Crooksf248e182017-02-07 10:50:24 -0500251 if is_downstream(_in_port):
252 self.log.info('downstream-flow')
253 elif is_upstream(_in_port):
254 self.log.info('upstream-flow')
255 else:
256 raise Exception('port should be 1 or 2 by our convention')
257
258 _out_port = fd.get_out_port(flow) # may be None
259 self.log.info('out-port', out_port=_out_port)
260
261 for field in fd.get_ofb_fields(flow):
262 if field.type == fd.ETH_TYPE:
263 _type = field.eth_type
264 self.log.info('field-type-eth-type',
265 eth_type=_type)
266
267 elif field.type == fd.IP_PROTO:
268 _proto = field.ip_proto
269 self.log.info('field-type-ip-proto',
270 ip_proto=_proto)
271
272 elif field.type == fd.IN_PORT:
273 _port = field.port
274 self.log.info('field-type-in-port',
275 in_port=_port)
276
277 elif field.type == fd.VLAN_VID:
278 _vlan_vid = field.vlan_vid & 0xfff
279 self.log.info('field-type-vlan-vid',
280 vlan=_vlan_vid)
281
282 elif field.type == fd.VLAN_PCP:
283 _vlan_pcp = field.vlan_pcp
284 self.log.info('field-type-vlan-pcp',
285 pcp=_vlan_pcp)
286
287 elif field.type == fd.UDP_DST:
288 _udp_dst = field.udp_dst
289 self.log.info('field-type-udp-dst',
290 udp_dst=_udp_dst)
291
292 elif field.type == fd.UDP_SRC:
293 _udp_src = field.udp_src
294 self.log.info('field-type-udp-src',
295 udp_src=_udp_src)
296
297 elif field.type == fd.IPV4_DST:
298 _ipv4_dst = field.ipv4_dst
299 self.log.info('field-type-ipv4-dst',
300 ipv4_dst=_ipv4_dst)
301
302 elif field.type == fd.IPV4_SRC:
303 _ipv4_src = field.ipv4_src
304 self.log.info('field-type-ipv4-src',
305 ipv4_dst=_ipv4_src)
306
307 elif field.type == fd.METADATA:
308 _metadata = field.metadata
309 self.log.info('field-type-metadata',
310 metadata=_metadata)
311
312 else:
313 raise NotImplementedError('field.type={}'.format(
314 field.type))
315
316 for action in fd.get_actions(flow):
317
318 if action.type == fd.OUTPUT:
319 _output = action.output.port
320 self.log.info('action-type-output',
321 output=_output, in_port=_in_port)
322
323 elif action.type == fd.POP_VLAN:
324 self.log.info('action-type-pop-vlan',
325 in_port=_in_port)
326
327 elif action.type == fd.PUSH_VLAN:
328 _push_tpid = action.push.ethertype
329 log.info('action-type-push-vlan',
330 push_tpid=_push_tpid, in_port=_in_port)
331 if action.push.ethertype != 0x8100:
332 self.log.error('unhandled-tpid',
333 ethertype=action.push.ethertype)
334
335 elif action.type == fd.SET_FIELD:
336 _field = action.set_field.field.ofb_field
337 assert (action.set_field.field.oxm_class ==
338 OFPXMC_OPENFLOW_BASIC)
339 self.log.info('action-type-set-field',
340 field=_field, in_port=_in_port)
341 if _field.type == fd.VLAN_VID:
342 self.log.info('set-field-type-valn-vid',
343 vlan_vid=_field.vlan_vid & 0xfff)
344 else:
345 self.log.error('unsupported-action-set-field-type',
346 field_type=_field.type)
347 else:
348 log.error('unsupported-action-type',
349 action_type=action.type, in_port=_in_port)
350
351 #
352 # All flows created from ONU adapter should be OMCI based
353 #
354
355 except Exception as e:
356 log.exception('failed-to-install-flow', e=e, flow=flow)
357
Steve Crooks3c2c7582017-01-10 15:02:26 -0600358 def get_tx_id(self):
359 self.tx_id += 1
360 return self.tx_id
361
362 def send_omci_message(self, frame):
363 _frame = hexify(str(frame))
364 self.log.info('send-omci-message-%s' % _frame)
365 device = self.adapter_agent.get_device(self.device_id)
366 try:
367 self.adapter_agent.send_proxied_message(device.proxy_address, _frame)
368 except Exception as e:
369 self.log.info('send-omci-message-exception', exc=str(e))
370
371 def send_get_circuit_pack(self, entity_id=0):
372 frame = OmciFrame(
373 transaction_id=self.get_tx_id(),
374 message_type=OmciGet.message_id,
375 omci_message=OmciGet(
376 entity_class=CircuitPack.class_id,
377 entity_id=entity_id,
378 attributes_mask=CircuitPack.mask_for('vendor_id')
379 )
380 )
381 self.send_omci_message(frame)
382
383 def send_mib_reset(self, entity_id=0):
384 frame = OmciFrame(
385 transaction_id=self.get_tx_id(),
386 message_type=OmciMibReset.message_id,
387 omci_message=OmciMibReset(
388 entity_class=OntData.class_id,
389 entity_id=entity_id
390 )
391 )
392 self.send_omci_message(frame)
393
Steve Crooks9e85ce82017-03-20 12:00:53 -0400394 def send_create_gal_ethernet_profile(self,
395 entity_id,
396 max_gem_payload_size):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600397 frame = OmciFrame(
398 transaction_id=self.get_tx_id(),
399 message_type=OmciCreate.message_id,
400 omci_message=OmciCreate(
401 entity_class=GalEthernetProfile.class_id,
402 entity_id=entity_id,
403 data=dict(
404 max_gem_payload_size=max_gem_payload_size
405 )
406 )
407 )
408 self.send_omci_message(frame)
409
Steve Crooks9e85ce82017-03-20 12:00:53 -0400410 def send_set_tcont(self,
411 entity_id,
412 alloc_id):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600413 data = dict(
414 alloc_id=alloc_id
415 )
416 frame = OmciFrame(
417 transaction_id=self.get_tx_id(),
418 message_type=OmciSet.message_id,
419 omci_message=OmciSet(
420 entity_class=Tcont.class_id,
Steve Crooks9e85ce82017-03-20 12:00:53 -0400421 entity_id=entity_id,
Steve Crooks3c2c7582017-01-10 15:02:26 -0600422 attributes_mask=Tcont.mask_for(*data.keys()),
423 data=data
424 )
425 )
426 self.send_omci_message(frame)
427
Steve Crooks9e85ce82017-03-20 12:00:53 -0400428 def send_create_8021p_mapper_service_profile(self,
429 entity_id):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600430 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400431 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600432 message_type=OmciCreate.message_id,
433 omci_message=OmciCreate(
434 entity_class=Ieee8021pMapperServiceProfile.class_id,
435 entity_id=entity_id,
436 data=dict(
437 tp_pointer=OmciNullPointer,
438 interwork_tp_pointer_for_p_bit_priority_0=OmciNullPointer,
439 )
440 )
441 )
442 self.send_omci_message(frame)
443
Steve Crooks9e85ce82017-03-20 12:00:53 -0400444 def send_create_mac_bridge_service_profile(self,
445 entity_id):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600446 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400447 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600448 message_type=OmciCreate.message_id,
449 omci_message=OmciCreate(
450 entity_class=MacBridgeServiceProfile.class_id,
451 entity_id=entity_id,
452 data=dict(
453 spanning_tree_ind=False,
454 learning_ind=True,
455 priority=0x8000,
456 max_age=20 * 256,
457 hello_time=2 * 256,
458 forward_delay=15 * 256,
459 unknown_mac_address_discard=True
460 )
461 )
462 )
463 self.send_omci_message(frame)
464
Steve Crooks9e85ce82017-03-20 12:00:53 -0400465 def send_create_gem_port_network_ctp(self,
466 entity_id,
467 port_id,
468 tcont_id,
469 direction,
470 tm):
471 _directions = {"upstream": 1, "downstream": 2, "bi-directional": 3}
472 if _directions.has_key(direction):
473 _direction = _directions[direction]
474 else:
475 self.log.error('invalid-gem-port-direction', direction=direction)
476 raise ValueError('Invalid GEM port direction: {_dir}'.format(_dir=direction))
477
Steve Crooks3c2c7582017-01-10 15:02:26 -0600478 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400479 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600480 message_type=OmciCreate.message_id,
481 omci_message=OmciCreate(
482 entity_class=GemPortNetworkCtp.class_id,
483 entity_id=entity_id,
484 data=dict(
485 port_id=port_id,
486 tcont_pointer=tcont_id,
Steve Crooks9e85ce82017-03-20 12:00:53 -0400487 direction=_direction,
488 traffic_management_pointer_upstream=tm
Steve Crooks3c2c7582017-01-10 15:02:26 -0600489 )
490 )
491 )
492 self.send_omci_message(frame)
493
Steve Crooks9e85ce82017-03-20 12:00:53 -0400494 def send_create_multicast_gem_interworking_tp(self,
495 entity_id,
496 gem_port_net_ctp_id):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600497 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400498 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600499 message_type=OmciCreate.message_id,
500 omci_message=OmciCreate(
501 entity_class=MulticastGemInterworkingTp.class_id,
502 entity_id=entity_id,
503 data=dict(
504 gem_port_network_ctp_pointer=gem_port_net_ctp_id,
505 interworking_option=0,
Steve Crooks9e85ce82017-03-20 12:00:53 -0400506 service_profile_pointer=0x1
Steve Crooks3c2c7582017-01-10 15:02:26 -0600507 )
508 )
509 )
510 self.send_omci_message(frame)
511
Steve Crooks9e85ce82017-03-20 12:00:53 -0400512 def send_create_gem_inteworking_tp(self,
513 entity_id,
514 gem_port_net_ctp_id,
515 service_profile_id):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600516 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400517 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600518 message_type=OmciCreate.message_id,
519 omci_message=OmciCreate(
520 entity_class=GemInterworkingTp.class_id,
521 entity_id=entity_id,
522 data=dict(
523 gem_port_network_ctp_pointer=gem_port_net_ctp_id,
524 interworking_option=5,
525 service_profile_pointer=service_profile_id,
526 interworking_tp_pointer=0x0,
527 gal_profile_pointer=0x1
528 )
529 )
530 )
531 self.send_omci_message(frame)
532
Steve Crooks9e85ce82017-03-20 12:00:53 -0400533 def send_set_8021p_mapper_service_profile(self,
534 entity_id,
535 interwork_tp_id):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600536 data = dict(
537 interwork_tp_pointer_for_p_bit_priority_0 = interwork_tp_id
538 )
539 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400540 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600541 message_type=OmciSet.message_id,
542 omci_message=OmciSet(
543 entity_class=Ieee8021pMapperServiceProfile.class_id,
544 entity_id=entity_id,
545 attributes_mask=Ieee8021pMapperServiceProfile.mask_for(
546 *data.keys()),
547 data=data
548 )
549 )
550 self.send_omci_message(frame)
551
552 def send_create_mac_bridge_port_configuration_data(self,
553 entity_id,
554 bridge_id,
555 port_id,
556 tp_type,
557 tp_id):
558 frame = OmciFrame(
559 transaction_id=self.get_tx_id(),
560 message_type=OmciCreate.message_id,
561 omci_message=OmciCreate(
562 entity_class=MacBridgePortConfigurationData.class_id,
563 entity_id=entity_id,
564 data=dict(
565 bridge_id_pointer = bridge_id,
566 port_num=port_id,
567 tp_type=tp_type,
Steve Crooks9e85ce82017-03-20 12:00:53 -0400568 tp_pointer=tp_id
Steve Crooks3c2c7582017-01-10 15:02:26 -0600569 )
570 )
571 )
572 self.send_omci_message(frame)
573
Steve Crooks9e85ce82017-03-20 12:00:53 -0400574 def send_create_vlan_tagging_filter_data(self,
575 entity_id,
576 vlan_id):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600577 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400578 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600579 message_type=OmciCreate.message_id,
580 omci_message=OmciCreate(
581 entity_class=VlanTaggingFilterData.class_id,
582 entity_id=entity_id,
583 data=dict(
584 vlan_filter_0=vlan_id,
585 forward_operation=0x10,
586 number_of_entries=1
587 )
588 )
589 )
590 self.send_omci_message(frame)
591
Steve Crooks46d64302017-03-10 15:11:06 -0500592 def send_create_extended_vlan_tagging_operation_configuration_data(self,
593 entity_id,
594 assoc_type,
595 assoc_me):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600596 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400597 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600598 message_type=OmciCreate.message_id,
599 omci_message=OmciCreate(
600 entity_class=
601 ExtendedVlanTaggingOperationConfigurationData.class_id,
602 entity_id=entity_id,
603 data=dict(
Steve Crooks46d64302017-03-10 15:11:06 -0500604 association_type=assoc_type,
605 associated_me_pointer=assoc_me
Steve Crooks3c2c7582017-01-10 15:02:26 -0600606 )
607 )
608 )
609 self.send_omci_message(frame)
610
Steve Crooks9e85ce82017-03-20 12:00:53 -0400611 def send_set_extended_vlan_tagging_operation_tpid_configuration_data(self,
612 entity_id,
613 input_tpid,
614 output_tpid):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600615 data = dict(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400616 input_tpid=input_tpid,
617 output_tpid=output_tpid,
Steve Crooks3c2c7582017-01-10 15:02:26 -0600618 downstream_mode=0, # inverse of upstream
619 )
620 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400621 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600622 message_type=OmciSet.message_id,
623 omci_message=OmciSet(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400624 entity_class=
Steve Crooks3c2c7582017-01-10 15:02:26 -0600625 ExtendedVlanTaggingOperationConfigurationData.class_id,
626 entity_id=entity_id,
Steve Crooks9e85ce82017-03-20 12:00:53 -0400627 attributes_mask=
Steve Crooks3c2c7582017-01-10 15:02:26 -0600628 ExtendedVlanTaggingOperationConfigurationData.mask_for(
629 *data.keys()),
630 data=data
631 )
632 )
633 self.send_omci_message(frame)
634
Steve Crooksa9d0a7c2017-03-28 22:40:01 -0400635 def send_set_extended_vlan_tagging_operation_vlan_configuration_data_untagged(self,
636 entity_id,
637 filter_inner_vid,
638 treatment_inner_vid):
Steve Crooks3c2c7582017-01-10 15:02:26 -0600639 data = dict(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400640 received_frame_vlan_tagging_operation_table=
Steve Crooks3c2c7582017-01-10 15:02:26 -0600641 VlanTaggingOperation(
642 filter_outer_priority=15,
Steve Crooks46d64302017-03-10 15:11:06 -0500643 filter_outer_vid=4096,
644 filter_outer_tpid_de=0,
645
646 filter_inner_priority=15,
647 filter_inner_vid=filter_inner_vid,
648 filter_inner_tpid_de=0,
Steve Crooks3c2c7582017-01-10 15:02:26 -0600649 filter_ether_type=0,
Steve Crooks46d64302017-03-10 15:11:06 -0500650
651 treatment_tags_to_remove=0,
Steve Crooks3c2c7582017-01-10 15:02:26 -0600652 treatment_outer_priority=15,
Steve Crooks46d64302017-03-10 15:11:06 -0500653 treatment_outer_vid=0,
654 treatment_outer_tpid_de=0,
655
656 treatment_inner_priority=0,
657 treatment_inner_vid=treatment_inner_vid,
Steve Crooks3c2c7582017-01-10 15:02:26 -0600658 treatment_inner_tpid_de=4
659 )
660 )
661 frame = OmciFrame(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400662 transaction_id=self.get_tx_id(),
Steve Crooks3c2c7582017-01-10 15:02:26 -0600663 message_type=OmciSet.message_id,
664 omci_message=OmciSet(
Steve Crooks9e85ce82017-03-20 12:00:53 -0400665 entity_class=
Steve Crooks3c2c7582017-01-10 15:02:26 -0600666 ExtendedVlanTaggingOperationConfigurationData.class_id,
Steve Crooks9e85ce82017-03-20 12:00:53 -0400667 entity_id=entity_id,
668 attributes_mask=
Steve Crooks3c2c7582017-01-10 15:02:26 -0600669 ExtendedVlanTaggingOperationConfigurationData.mask_for(
670 *data.keys()),
671 data=data
672 )
673 )
674 self.send_omci_message(frame)
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800675
Steve Crooksa9d0a7c2017-03-28 22:40:01 -0400676 def send_set_extended_vlan_tagging_operation_vlan_configuration_data_single_tag(self,
677 entity_id,
678 filter_inner_priority,
679 filter_inner_vid,
680 filter_inner_tpid_de,
681 treatment_tags_to_remove,
682 treatment_inner_priority,
683 treatment_inner_vid):
684 data = dict(
685 received_frame_vlan_tagging_operation_table=
686 VlanTaggingOperation(
687 filter_outer_priority=15,
688 filter_outer_vid=4096,
689 filter_outer_tpid_de=0,
690
691 filter_inner_priority=filter_inner_priority,
692 filter_inner_vid=filter_inner_vid,
693 filter_inner_tpid_de=filter_inner_tpid_de,
694 filter_ether_type=0,
695
696 treatment_tags_to_remove=treatment_tags_to_remove,
697 treatment_outer_priority=15,
698 treatment_outer_vid=0,
699 treatment_outer_tpid_de=0,
700
701 treatment_inner_priority=treatment_inner_priority,
702 treatment_inner_vid=treatment_inner_vid,
703 treatment_inner_tpid_de=4
704 )
705 )
706 frame = OmciFrame(
707 transaction_id=self.get_tx_id(),
708 message_type=OmciSet.message_id,
709 omci_message=OmciSet(
710 entity_class=
711 ExtendedVlanTaggingOperationConfigurationData.class_id,
712 entity_id=entity_id,
713 attributes_mask=
714 ExtendedVlanTaggingOperationConfigurationData.mask_for(
715 *data.keys()),
716 data=data
717 )
718 )
719 self.send_omci_message(frame)
720
Steve Crooks9e85ce82017-03-20 12:00:53 -0400721 def send_create_multicast_operations_profile(self,
722 entity_id,
723 igmp_ver):
724 frame = OmciFrame(
725 transaction_id=self.get_tx_id(),
726 message_type=OmciCreate.message_id,
727 omci_message=OmciCreate(
728 entity_class=
729 MulticastOperationsProfile.class_id,
730 entity_id=entity_id,
731 data=dict(
732 igmp_version=igmp_ver,
733 igmp_function=0,
734 immediate_leave=0
735 )
736 )
737 )
738 self.send_omci_message(frame)
739
740 def send_set_multicast_operations_profile_acl_row0(self,
741 entity_id,
742 acl_table,
743 row_key,
744 gem_port,
745 vlan,
746 src_ip,
747 dst_ip_start,
748 dst_ip_end):
749 row0 = AccessControlRow0(
750 set_ctrl=1,
751 row_part_id=0,
752 test=0,
753 row_key=row_key,
754 gem_port_id=gem_port,
755 vlan_id=vlan,
756 src_ip=src_ip,
757 dst_ip_start=dst_ip_start,
758 dst_ip_end=dst_ip_end,
759 ipm_group_bw=0
760 )
761
762 if acl_table == 'dynamic':
763 data = dict(
764 dynamic_access_control_list_table=row0
765 )
766 else:
767 data = dict(
768 static_access_control_list_table=row0
769 )
770
771 frame = OmciFrame(
772 transaction_id=self.get_tx_id(),
773 message_type=OmciSet.message_id,
774 omci_message=OmciSet(
775 entity_class=MulticastOperationsProfile.class_id,
776 entity_id=entity_id,
777 attributes_mask=MulticastOperationsProfile.mask_for(
778 *data.keys()),
779 data=data
780 )
781 )
782 self.send_omci_message(frame)
783
784 def send_set_multicast_operations_profile_ds_igmp_mcast_tci(self,
785 entity_id,
786 ctrl_type,
787 tci):
788 data = dict(
789 ds_igmp_mcast_tci=
790 DownstreamIgmpMulticastTci(
791 ctrl_type=ctrl_type,
792 tci=tci
793 )
794 )
795 frame = OmciFrame(
796 transaction_id=self.get_tx_id(),
797 message_type=OmciSet.message_id,
798 omci_message=OmciSet(
799 entity_class=MulticastOperationsProfile.class_id,
800 entity_id=entity_id,
801 attributes_mask=MulticastOperationsProfile.mask_for(
802 *data.keys()),
803 data=data
804 )
805 )
806 self.send_omci_message(frame)
807
808 def send_create_multicast_subscriber_config_info(self,
809 entity_id,
810 me_type,
811 mcast_oper_profile):
812 frame = OmciFrame(
813 transaction_id=self.get_tx_id(),
814 message_type=OmciCreate.message_id,
815 omci_message=OmciCreate(
816 entity_class=
817 MulticastSubscriberConfigInfo.class_id,
818 entity_id=entity_id,
819 data=dict(
820 me_type=me_type,
821 mcast_operations_profile_pointer=mcast_oper_profile
822 )
823 )
824 )
825 self.send_omci_message(frame)
826
827 def send_set_multicast_subscriber_config_info(self,
828 entity_id,
829 max_groups=0,
830 max_mcast_bw=0,
831 bw_enforcement=0):
832 data = dict(
833 max_simultaneous_groups=max_groups,
834 max_multicast_bandwidth=max_mcast_bw,
835 bandwidth_enforcement=bw_enforcement
836 )
837 frame = OmciFrame(
838 transaction_id=self.get_tx_id(),
839 message_type=OmciSet.message_id,
840 omci_message=OmciSet(
841 entity_class=MulticastSubscriberConfigInfo.class_id,
842 entity_id=entity_id,
843 attributes_mask=MulticastSubscriberConfigInfo.mask_for(
844 *data.keys()),
845 data=data
846 )
847 )
848 self.send_omci_message(frame)
849
850 def send_set_multicast_service_package(self,
851 entity_id,
852 row_key,
853 vid_uni,
854 max_groups,
855 max_mcast_bw,
856 mcast_oper_profile):
857 data = dict(
858 multicast_service_package_table=
859 MulticastServicePackage(
860 set_ctrl=1,
861 row_key=row_key,
862
863 vid_uni=vid_uni,
864 max_simultaneous_groups=max_groups,
865 max_multicast_bw=max_mcast_bw,
866 mcast_operations_profile_pointer=mcast_oper_profile
867 )
868 )
869 frame = OmciFrame(
870 transaction_id=self.get_tx_id(),
871 message_type=OmciSet.message_id,
872 omci_message=OmciSet(
873 entity_class=MulticastSubscriberConfigInfo.class_id,
874 entity_id=entity_id,
875 attributes_mask=MulticastSubscriberConfigInfo.mask_for(
876 *data.keys()),
877 data=data
878 )
879 )
880 self.send_omci_message(frame)
881
882 def send_set_multicast_allowed_preview_groups_row0(self,
883 entity_id,
884 row_key,
885 src_ip,
886 vlan_id_ani,
887 vlan_id_uni):
888 data = dict(
889 allowed_preview_groups_table=
890 AllowedPreviewGroupsRow0(
891 set_ctrl=1,
892 row_part_id=0,
893 row_key=row_key,
894
895 src_ip=src_ip,
896 vlan_id_ani=vlan_id_ani,
897 vlan_id_uni=vlan_id_uni
898 )
899 )
900 frame = OmciFrame(
901 transaction_id=self.get_tx_id(),
902 message_type=OmciSet.message_id,
903 omci_message=OmciSet(
904 entity_class=MulticastSubscriberConfigInfo.class_id,
905 entity_id=entity_id,
906 attributes_mask=MulticastSubscriberConfigInfo.mask_for(
907 *data.keys()),
908 data=data
909 )
910 )
911 self.send_omci_message(frame)
912
913 def send_set_multicast_allowed_preview_groups_row1(self,
914 entity_id,
915 row_key,
916 dst_ip,
917 duration,
918 time_left):
919 data = dict(
920 allowed_preview_groups_table=
921 AllowedPreviewGroupsRow1(
922 set_ctrl=1,
923 row_part_id=1,
924 row_key=row_key,
925
926 dst_ip=dst_ip,
927 duration=duration,
928 time_left=time_left
929 )
930 )
931 frame = OmciFrame(
932 transaction_id=self.get_tx_id(),
933 message_type=OmciSet.message_id,
934 omci_message=OmciSet(
935 entity_class=MulticastSubscriberConfigInfo.class_id,
936 entity_id=entity_id,
937 attributes_mask=MulticastSubscriberConfigInfo.mask_for(
938 *data.keys()),
939 data=data
940 )
941 )
942 self.send_omci_message(frame)
943
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800944 @inlineCallbacks
Steve Crooks3c2c7582017-01-10 15:02:26 -0600945 def wait_for_response(self):
946 log.info('wait-for-response')
947 try:
948 response = yield self.incoming_messages.get()
Steve Crooks9e85ce82017-03-20 12:00:53 -0400949 log.info('got-response')
950 # resp = OmciFrame(response)
951 # resp.show()
Steve Crooks3c2c7582017-01-10 15:02:26 -0600952 except Exception as e:
953 self.log.info('wait-for-response-exception', exc=str(e))
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800954
Steve Crooks3c2c7582017-01-10 15:02:26 -0600955 @inlineCallbacks
956 def message_exchange(self):
957 log.info('message_exchange')
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800958 # reset incoming message queue
959 while self.incoming_messages.pending:
960 _ = yield self.incoming_messages.get()
961
962 # construct message
Steve Crooks3c2c7582017-01-10 15:02:26 -0600963 # MIB Reset - OntData - 0
964 self.send_mib_reset()
965 yield self.wait_for_response()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800966
Steve Crooks3c2c7582017-01-10 15:02:26 -0600967 # Create AR - GalEthernetProfile - 1
968 self.send_create_gal_ethernet_profile(1, 48)
969 yield self.wait_for_response()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800970
Steve Crooks3c2c7582017-01-10 15:02:26 -0600971 # Set AR - TCont - 32768 - 1024
972 self.send_set_tcont(0x8000, 0x400)
973 yield self.wait_for_response()
Zsolt Haraszticc153aa2016-12-14 02:28:59 -0800974
Steve Crooks3c2c7582017-01-10 15:02:26 -0600975 # Set AR - TCont - 32769 - 1025
976 self.send_set_tcont(0x8001, 0x401)
977 yield self.wait_for_response()
Zsolt Haraszti656ecc62016-12-28 15:08:23 -0800978
Steve Crooks3c2c7582017-01-10 15:02:26 -0600979 # Set AR - TCont - 32770 - 1026
980 self.send_set_tcont(0x8002, 0x402)
981 yield self.wait_for_response()
982
983 # Set AR - TCont - 32771 - 1027
984 self.send_set_tcont(0x8003, 0x403)
985 yield self.wait_for_response()
986
987 # Create AR - 802.1pMapperServiceProfile - 32768
988 self.send_create_8021p_mapper_service_profile(0x8000)
989 yield self.wait_for_response()
990
991 # Create AR - 802.1pMapperServiceProfile - 32769
992 self.send_create_8021p_mapper_service_profile(0x8001)
993 yield self.wait_for_response()
994
995 # Create AR - 802.1pMapperServiceProfile - 32770
996 self.send_create_8021p_mapper_service_profile(0x8002)
997 yield self.wait_for_response()
998
999 # Create AR - 802.1pMapperServiceProfile - 32771
1000 self.send_create_8021p_mapper_service_profile(0x8003)
1001 yield self.wait_for_response()
1002
1003 # Create AR - MacBridgeServiceProfile - 513
1004 self.send_create_mac_bridge_service_profile(0x201)
1005 yield self.wait_for_response()
1006
1007 # Create AR - GemPortNetworkCtp - 256 - 1024 - 32768
Steve Crooks9e85ce82017-03-20 12:00:53 -04001008 self.send_create_gem_port_network_ctp(0x100, 0x400, 0x8000, "bi-directional", 0x100)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001009 yield self.wait_for_response()
1010
1011 # Create AR - GemPortNetworkCtp - 257 - 1025 - 32769
Steve Crooks9e85ce82017-03-20 12:00:53 -04001012 self.send_create_gem_port_network_ctp(0x101, 0x401, 0x8001, "bi-directional", 0x100)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001013 yield self.wait_for_response()
1014
1015 # Create AR - GemPortNetworkCtp - 258 - 1026 - 32770
Steve Crooks9e85ce82017-03-20 12:00:53 -04001016 self.send_create_gem_port_network_ctp(0x102, 0x402, 0x8002, "bi-directional", 0x100)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001017 yield self.wait_for_response()
1018
1019 # Create AR - GemPortNetworkCtp - 259 - 1027 - 32771
Steve Crooks9e85ce82017-03-20 12:00:53 -04001020 self.send_create_gem_port_network_ctp(0x103, 0x403, 0x8003, "bi-directional", 0x100)
1021 yield self.wait_for_response()
1022
1023 # Create AR - GemPortNetworkCtp - 260 - 4000 - 0
1024 self.send_create_gem_port_network_ctp(0x104, 0x0FA0, 0, "downstream", 0)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001025 yield self.wait_for_response()
1026
1027 # Create AR - MulticastGemInterworkingTp - 6 - 260
1028 self.send_create_multicast_gem_interworking_tp(0x6, 0x104)
1029 yield self.wait_for_response()
1030
1031 # Create AR - GemInterworkingTp - 32769 - 256 -32768 - 1
1032 self.send_create_gem_inteworking_tp(0x8001, 0x100, 0x8000)
1033 yield self.wait_for_response()
1034
1035 # Create AR - GemInterworkingTp - 32770 - 257 -32769 - 1
1036 self.send_create_gem_inteworking_tp(0x8002, 0x101, 0x8001)
1037 yield self.wait_for_response()
1038
1039 # Create AR - GemInterworkingTp - 32771 - 258 -32770 - 1
1040 self.send_create_gem_inteworking_tp(0x8003, 0x102, 0x8002)
1041 yield self.wait_for_response()
1042
1043 # Create AR - GemInterworkingTp - 32772 - 259 -32771 - 1
1044 self.send_create_gem_inteworking_tp(0x8004, 0x103, 0x8003)
1045 yield self.wait_for_response()
1046
1047 # Set AR - 802.1pMapperServiceProfile - 32768 - 32769
1048 self.send_set_8021p_mapper_service_profile(0x8000, 0x8001)
1049 yield self.wait_for_response()
1050
1051 # Set AR - 802.1pMapperServiceProfile - 32769 - 32770
1052 self.send_set_8021p_mapper_service_profile(0x8001, 0x8002)
1053 yield self.wait_for_response()
1054
1055 # Set AR - 802.1pMapperServiceProfile - 32770 - 32771
1056 self.send_set_8021p_mapper_service_profile(0x8002, 0x8003)
1057 yield self.wait_for_response()
1058
1059 # Set AR - 802.1pMapperServiceProfile - 32771 - 32772
1060 self.send_set_8021p_mapper_service_profile(0x8003, 0x8004)
1061 yield self.wait_for_response()
1062
1063 # Create AR - MacBridgePortConfigData - 8449 - 513 - 2 - 3 - 32768
1064 self.send_create_mac_bridge_port_configuration_data(0x2101, 0x201, 2, 3, 0x8000)
1065 yield self.wait_for_response()
1066
1067 # Create AR - MacBridgePortConfigData - 8450 - 513 - 3 - 3 - 32769
1068 self.send_create_mac_bridge_port_configuration_data(0x2102, 0x201, 3, 3, 0x8001)
1069 yield self.wait_for_response()
1070
1071 # Create AR - MacBridgePortConfigData - 8451 - 513 - 4 - 3 - 32770
1072 self.send_create_mac_bridge_port_configuration_data(0x2103, 0x201, 4, 3, 0x8002)
1073 yield self.wait_for_response()
1074
1075 # Create AR - MacBridgePortConfigData - 8452 - 513 - 5 - 3 - 32771
1076 self.send_create_mac_bridge_port_configuration_data(0x2104, 0x201, 5, 3, 0x8003)
1077 yield self.wait_for_response()
1078
1079 # Create AR - MacBridgePortConfigData - 9000 - 513 - 6 - 6 - 6
1080 self.send_create_mac_bridge_port_configuration_data(0x2328, 0x201, 6, 6, 6)
1081 yield self.wait_for_response()
1082
1083 # Create AR - VlanTaggingFilterData - 8449 - 040000000000000000000000000000000000000000000000
1084 self.send_create_vlan_tagging_filter_data(0x2101, 0x0400)
1085 yield self.wait_for_response()
1086
1087 # Create AR - VlanTaggingFilterData - 8450 - 040100000000000000000000000000000000000000000000
1088 self.send_create_vlan_tagging_filter_data(0x2102, 0x0401)
1089 yield self.wait_for_response()
1090
1091 # Create AR - VlanTaggingFilterData - 8451 - 040200000000000000000000000000000000000000000000
1092 self.send_create_vlan_tagging_filter_data(0x2103, 0x0402)
1093 yield self.wait_for_response()
1094
1095 # Create AR - VlanTaggingFilterData - 8452 - 040300000000000000000000000000000000000000000000
1096 self.send_create_vlan_tagging_filter_data(0x2104, 0x0403)
1097 yield self.wait_for_response()
1098
Steve Crooks9e85ce82017-03-20 12:00:53 -04001099 # Create AR - MulticastOperationsProfile
1100 self.send_create_multicast_operations_profile(0x201, 3)
1101 yield self.wait_for_response()
1102
1103 # Set AR - MulticastOperationsProfile - Dynamic Access Control List table
1104 self.send_set_multicast_operations_profile_acl_row0(0x201,
1105 'dynamic',
1106 0,
1107 0x0fa0,
1108 0x0fa0,
1109 '0.0.0.0',
1110 '224.0.0.0',
1111 '239.255.255.255')
1112 yield self.wait_for_response()
1113
1114 # Create AR - MulticastSubscriberConfigInfo
1115 self.send_create_multicast_subscriber_config_info(0x201, 0, 0x201)
1116 yield self.wait_for_response()
1117
1118 # Set AR - MulticastOperationsProfile - Downstream IGMP Multicast TCI
1119 self.send_set_multicast_operations_profile_ds_igmp_mcast_tci(0x201, 3, 0x401)
1120 yield self.wait_for_response()
1121
Steve Crooks46d64302017-03-10 15:11:06 -05001122 # Create AR - ExtendedVlanTaggingOperationConfigData - 514 - 2 - 0x105
Steve Crooks9e85ce82017-03-20 12:00:53 -04001123 self.send_create_extended_vlan_tagging_operation_configuration_data(0x202, 2, 0x102)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001124 yield self.wait_for_response()
1125
1126 # Set AR - ExtendedVlanTaggingOperationConfigData - 514 - 8100 - 8100
Steve Crooks46d64302017-03-10 15:11:06 -05001127 self.send_set_extended_vlan_tagging_operation_tpid_configuration_data(0x202, 0x8100, 0x8100)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001128 yield self.wait_for_response()
1129
Steve Crooks46d64302017-03-10 15:11:06 -05001130 # Set AR - ExtendedVlanTaggingOperationConfigData
1131 # 514 - RxVlanTaggingOperationTable - add VLAN 1025 to untagged pkts
Steve Crooksa9d0a7c2017-03-28 22:40:01 -04001132 #self.send_set_extended_vlan_tagging_operation_vlan_configuration_data_untagged(0x202, 0x1000, 0x401)
1133 #yield self.wait_for_response()
1134
1135 # Set AR - ExtendedVlanTaggingOperationConfigData
1136 # 514 - RxVlanTaggingOperationTable - add VLAN 1025 to priority tagged pkts
1137 self.send_set_extended_vlan_tagging_operation_vlan_configuration_data_single_tag(0x202, 0, 0, 0, 1, 8, 0x401)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001138 yield self.wait_for_response()
1139
Steve Crooks46d64302017-03-10 15:11:06 -05001140 # Create AR - MacBridgePortConfigData - 513 - 513 - 1 - 1 - 0x105
Steve Crooks9e85ce82017-03-20 12:00:53 -04001141 self.send_create_mac_bridge_port_configuration_data(0x201, 0x201, 1, 1, 0x102)
Steve Crooks3c2c7582017-01-10 15:02:26 -06001142 yield self.wait_for_response()