Lines Matching refs:command_msg
55 def check_address_query(command_msg, source_node, destination_address): argument
58 command_msg.assertCoapMessageContainsTlv(network_layer.TargetEid)
61 assert (ipv6.ip_address(source_rloc) == command_msg.ipv6_packet.ipv6_header.source_address), (
64 str(command_msg.ipv6_packet.ipv6_header.source_address))
69 …assert (ipv6.ip_address(destination_address) == command_msg.ipv6_packet.ipv6_header.destination_ad…
73 def check_address_notification(command_msg, source_node, destination_node): argument
76 command_msg.assertCoapMessageRequestUriPath('/a/an')
77 command_msg.assertCoapMessageContainsTlv(network_layer.TargetEid)
78 command_msg.assertCoapMessageContainsTlv(network_layer.Rloc16)
79 command_msg.assertCoapMessageContainsTlv(network_layer.MlEid)
82 assert (ipv6.ip_address(source_rloc) == command_msg.ipv6_packet.ipv6_header.source_address
86 …assert (ipv6.ip_address(destination_rloc) == command_msg.ipv6_packet.ipv6_header.destination_addre…
90 def check_address_error_notification(command_msg, source_node, destination_address): argument
93 command_msg.assertCoapMessageRequestUriPath('/a/ae')
94 command_msg.assertCoapMessageContainsTlv(network_layer.TargetEid)
95 command_msg.assertCoapMessageContainsTlv(network_layer.MlEid)
98 assert (ipv6.ip_address(source_rloc) == command_msg.ipv6_packet.ipv6_header.source_address), (
101 str(command_msg.ipv6_packet.ipv6_header.source_address))
106 …assert (ipv6.ip_address(destination_address) == command_msg.ipv6_packet.ipv6_header.destination_ad…
109 str(command_msg.ipv6_packet.ipv6_header.destination_address))
112 def check_address_solicit(command_msg, was_router): argument
113 command_msg.assertCoapMessageRequestUriPath('/a/as')
114 command_msg.assertCoapMessageContainsTlv(network_layer.MacExtendedAddress)
115 command_msg.assertCoapMessageContainsTlv(network_layer.Status)
117 command_msg.assertCoapMessageContainsTlv(network_layer.Rloc16)
119 command_msg.assertMleMessageDoesNotContainTlv(network_layer.Rloc16)
122 def check_address_release(command_msg, destination_node): argument
125 command_msg.assertCoapMessageRequestUriPath('/a/ar')
126 command_msg.assertCoapMessageContainsTlv(network_layer.Rloc16)
127 command_msg.assertCoapMessageContainsTlv(network_layer.MacExtendedAddress)
130 …assert (ipv6.ip_address(destination_rloc) == command_msg.ipv6_packet.ipv6_header.destination_addre…
134 def check_tlv_request_tlv(command_msg, check_type, tlv_id): argument
137 tlv_request_tlv = command_msg.get_mle_message_tlv(mle.TlvRequest)
164 command_msg, argument
173 command_msg.assertMleMessageContainsTlv(mle.Challenge)
174 command_msg.assertMleMessageContainsTlv(mle.Version)
176 check_mle_optional_tlv(command_msg, source_address, mle.SourceAddress)
177 check_mle_optional_tlv(command_msg, leader_data, mle.LeaderData)
179 check_tlv_request_tlv(command_msg, tlv_request_address16, mle.TlvType.ADDRESS16)
180 check_tlv_request_tlv(command_msg, tlv_request_route64, mle.TlvType.ROUTE64)
181 check_tlv_request_tlv(command_msg, tlv_request_link_margin, mle.TlvType.LINK_MARGIN)
185 command_msg, argument
197 command_msg.assertMleMessageContainsTlv(mle.LinkLayerFrameCounter)
198 command_msg.assertMleMessageContainsTlv(mle.SourceAddress)
199 command_msg.assertMleMessageContainsTlv(mle.Response)
200 command_msg.assertMleMessageContainsTlv(mle.Version)
202 check_mle_optional_tlv(command_msg, leader_data, mle.LeaderData)
203 check_mle_optional_tlv(command_msg, link_margin, mle.LinkMargin)
204 check_mle_optional_tlv(command_msg, mle_frame_counter, mle.MleFrameCounter)
205 check_mle_optional_tlv(command_msg, challenge, mle.Challenge)
206 check_mle_optional_tlv(command_msg, address16, mle.Address16)
207 check_mle_optional_tlv(command_msg, route64, mle.Route64)
209 check_tlv_request_tlv(command_msg, tlv_request_link_margin, mle.TlvType.LINK_MARGIN)
212 …assert (ipv6.ip_address(destination_link_local) == command_msg.ipv6_packet.ipv6_header.destination…
236 def check_id_set(command_msg, router_id): argument
239 tlv = command_msg.assertMleMessageContainsTlv(mle.Route64)
243 def get_routing_cost(command_msg, router_id): argument
246 tlv = command_msg.assertMleMessageContainsTlv(mle.Route64)
267 def check_mle_optional_tlv(command_msg, type, tlv): argument
269 command_msg.assertMleMessageContainsTlv(tlv)
271 command_msg.assertMleMessageDoesNotContainTlv(tlv)
273 command_msg.assertMleMessageContainsOptionalTlv(tlv)
278 def check_mle_advertisement(command_msg): argument
279 command_msg.assertSentWithHopLimit(255)
280 command_msg.assertSentToDestinationAddress(config.LINK_LOCAL_ALL_NODES_ADDRESS)
281 command_msg.assertMleMessageContainsTlv(mle.SourceAddress)
282 command_msg.assertMleMessageContainsTlv(mle.LeaderData)
283 command_msg.assertMleMessageContainsTlv(mle.Route64)
286 def check_parent_request(command_msg, is_first_request): argument
289 if command_msg.mle.aux_sec_hdr.key_id_mode != 0x2:
292 command_msg.assertSentWithHopLimit(255)
293 command_msg.assertSentToDestinationAddress(config.LINK_LOCAL_ALL_ROUTERS_ADDRESS)
294 command_msg.assertMleMessageContainsTlv(mle.Mode)
295 command_msg.assertMleMessageContainsTlv(mle.Challenge)
296 command_msg.assertMleMessageContainsTlv(mle.Version)
297 scan_mask = command_msg.assertMleMessageContainsTlv(mle.ScanMask)
307 def check_parent_response(command_msg, mle_frame_counter=CheckType.OPTIONAL): argument
310 command_msg.assertMleMessageContainsTlv(mle.Challenge)
311 command_msg.assertMleMessageContainsTlv(mle.Connectivity)
312 command_msg.assertMleMessageContainsTlv(mle.LeaderData)
313 command_msg.assertMleMessageContainsTlv(mle.LinkLayerFrameCounter)
314 command_msg.assertMleMessageContainsTlv(mle.LinkMargin)
315 command_msg.assertMleMessageContainsTlv(mle.Response)
316 command_msg.assertMleMessageContainsTlv(mle.SourceAddress)
317 command_msg.assertMleMessageContainsTlv(mle.Version)
319 check_mle_optional_tlv(command_msg, mle_frame_counter, mle.MleFrameCounter)
323 command_msg, argument
333 if command_msg.mle.aux_sec_hdr.key_id_mode != 0x2:
336 command_msg.assertMleMessageContainsTlv(mle.LinkLayerFrameCounter)
337 command_msg.assertMleMessageContainsTlv(mle.Mode)
338 command_msg.assertMleMessageContainsTlv(mle.Response)
339 command_msg.assertMleMessageContainsTlv(mle.Timeout)
340 command_msg.assertMleMessageContainsTlv(mle.Version)
342 check_mle_optional_tlv(command_msg, tlv_request, mle.TlvRequest)
343 check_mle_optional_tlv(command_msg, mle_frame_counter, mle.MleFrameCounter)
344 check_mle_optional_tlv(command_msg, address_registration, mle.AddressRegistration)
345 check_mle_optional_tlv(command_msg, active_timestamp, mle.ActiveTimestamp)
346 check_mle_optional_tlv(command_msg, pending_timestamp, mle.PendingTimestamp)
347 check_mle_optional_tlv(command_msg, route64, mle.Route64)
349 check_tlv_request_tlv(command_msg, CheckType.CONTAIN, mle.TlvType.ADDRESS16)
350 check_tlv_request_tlv(command_msg, CheckType.CONTAIN, mle.TlvType.NETWORK_DATA)
354 command_msg, argument
366 command_msg.assertMleMessageContainsTlv(mle.SourceAddress)
367 command_msg.assertMleMessageContainsTlv(mle.LeaderData)
368 command_msg.assertMleMessageContainsTlv(mle.Address16)
370 check_mle_optional_tlv(command_msg, route64, mle.Route64)
371 check_mle_optional_tlv(command_msg, network_data, mle.NetworkData)
372 check_mle_optional_tlv(command_msg, address_registration, mle.AddressRegistration)
373 check_mle_optional_tlv(command_msg, active_timestamp, mle.ActiveTimestamp)
374 check_mle_optional_tlv(command_msg, pending_timestamp, mle.PendingTimestamp)
375 check_mle_optional_tlv(command_msg, active_operational_dataset, mle.ActiveOperationalDataset)
376 check_mle_optional_tlv(command_msg, pending_operational_dataset, mle.PendingOperationalDataset)
379 network_data_tlv = command_msg.assertMleMessageContainsTlv(mle.NetworkData)
391 command_msg, argument
402 command_msg.assertMleMessageContainsTlv(mle.Mode)
403 check_mle_optional_tlv(command_msg, source_address, mle.SourceAddress)
404 check_mle_optional_tlv(command_msg, leader_data, mle.LeaderData)
405 check_mle_optional_tlv(command_msg, challenge, mle.Challenge)
406 check_mle_optional_tlv(command_msg, time_out, mle.Timeout)
407 check_mle_optional_tlv(command_msg, address_registration, mle.AddressRegistration)
408 check_mle_optional_tlv(command_msg, tlv_request_tlv, mle.TlvRequest)
409 check_mle_optional_tlv(command_msg, active_timestamp, mle.ActiveTimestamp)
412 _check_address_registration(command_msg, CIDs)
448 def check_secure_mle_key_id_mode(command_msg, key_id_mode): argument
451 assert isinstance(command_msg.mle, mle.MleMessageSecured)
452 assert command_msg.mle.aux_sec_hdr.key_id_mode == key_id_mode
455 def check_data_response(command_msg, network_data_check=None, active_timestamp=CheckType.OPTIONAL): argument
458 check_secure_mle_key_id_mode(command_msg, 0x02)
459 command_msg.assertMleMessageContainsTlv(mle.SourceAddress)
460 command_msg.assertMleMessageContainsTlv(mle.LeaderData)
461 check_mle_optional_tlv(command_msg, active_timestamp, mle.ActiveTimestamp)
463 network_data_tlv = command_msg.assertMleMessageContainsTlv(mle.NetworkData)
468 command_msg, argument
477 check_secure_mle_key_id_mode(command_msg, 0x02)
479 command_msg.assertMleMessageContainsTlv(mle.SourceAddress)
480 check_mle_optional_tlv(command_msg, leader_data, mle.LeaderData)
481 check_mle_optional_tlv(command_msg, network_data, mle.NetworkData)
482 check_mle_optional_tlv(command_msg, challenge, mle.Challenge)
483 check_mle_optional_tlv(command_msg, tlv_request, mle.TlvRequest)
484 check_mle_optional_tlv(command_msg, active_timestamp, mle.ActiveTimestamp)
488 command_msg, argument
501 check_secure_mle_key_id_mode(command_msg, 0x02)
503 command_msg.assertMleMessageContainsTlv(mle.SourceAddress)
504 command_msg.assertMleMessageContainsTlv(mle.Mode)
505 check_mle_optional_tlv(command_msg, timeout, mle.Timeout)
506 check_mle_optional_tlv(command_msg, address_registration, mle.AddressRegistration)
507 check_mle_optional_tlv(command_msg, address16, mle.Address16)
508 check_mle_optional_tlv(command_msg, leader_data, mle.LeaderData)
509 check_mle_optional_tlv(command_msg, network_data, mle.NetworkData)
510 check_mle_optional_tlv(command_msg, response, mle.Response)
511 check_mle_optional_tlv(command_msg, link_layer_frame_counter, mle.LinkLayerFrameCounter)
512 check_mle_optional_tlv(command_msg, mle_frame_counter, mle.MleFrameCounter)
515 _check_address_registration(command_msg, CIDs)
518 def _check_address_registration(command_msg, CIDs=()): argument
519 addresses = command_msg.assertMleMessageContainsTlv(mle.AddressRegistration).addresses
537 command_msg, argument
544 addresses = command_msg.assertMleMessageContainsTlv(mle.AddressRegistration).addresses
554 def check_compressed_address_registration_tlv(command_msg, cid, iid, cid_present_once=False): argument
568 addresses = command_msg.assertMleMessageContainsTlv(mle.AddressRegistration).addresses
599 def check_discovery_request(command_msg, thread_version: str = None): argument
602 assert not isinstance(command_msg.mle, mle.MleMessageSecured)
603 tlvs = command_msg.assertMleMessageContainsTlv(mle.ThreadDiscovery).tlvs
612 def check_discovery_response(command_msg, argument
618 assert not isinstance(command_msg.mle, mle.MleMessageSecured)
619 assert (command_msg.mac_header.src_address.type == common.MacAddressType.LONG)
620 assert command_msg.mac_header.dest_address == request_src_addr
622 tlvs = command_msg.assertMleMessageContainsTlv(mle.ThreadDiscovery).tlvs
638 def get_joiner_udp_port_in_discovery_response(command_msg): argument
641 tlvs = command_msg.assertMleMessageContainsTlv(mle.ThreadDiscovery).tlvs