/openthread-3.7.0/tests/scripts/thread-cert/ |
D | Cert_9_2_06_DatasetDissemination.py | 233 must_verify(lambda p: p.thread_meshcop.tlv.state == 1) 252 filter(lambda p: p.mle.tlv.active_tstamp == TIMESTAMP_INIT and \ 253 (p.mle.tlv.leader_data.data_version - 254 _pkt.mle.tlv.leader_data.data_version) % 256 <= 127 and \ 255 p.mle.tlv.leader_data.stable_data_version == 256 _pkt.mle.tlv.leader_data.stable_data_version and \ 257 p.thread_nwd.tlv.stable == [0] and \ 258 NWD_COMMISSIONING_DATA_TLV in p.thread_nwd.tlv.type and \ 259 NM_COMMISSIONER_SESSION_ID_TLV in p.thread_meshcop.tlv.type and \ 260 NM_STEERING_DATA_TLV in p.thread_meshcop.tlv.type and \ [all …]
|
D | Cert_9_2_09_PendingPartition.py | 248 must_verify(lambda p: p.thread_meshcop.tlv.state == 1) 272 filter(lambda p: p.mle.tlv.active_tstamp == TIMESTAMP_INIT and\ 273 p.mle.tlv.pending_tstamp == COMM_PENDING_TIMESTAMP and\ 274 (p.mle.tlv.leader_data.data_version - 275 _pkt.mle.tlv.leader_data.data_version) % 256 <= 127 and\ 276 (p.mle.tlv.leader_data.stable_data_version - 277 _pkt.mle.tlv.leader_data.stable_data_version) % 256 <= 127 and\ 278 p.thread_nwd.tlv.stable == [0] and\ 279 NWD_COMMISSIONING_DATA_TLV in p.thread_nwd.tlv.type and\ 280 NM_COMMISSIONER_SESSION_ID_TLV in p.thread_meshcop.tlv.type and\ [all …]
|
D | Cert_9_2_04_ActiveDataset.py | 210 … MGMT_ACTIVE_SET_URI).filter(lambda p: p.thread_meshcop.tlv.xpan_id == '000db70000000000' and p. 211 … thread_meshcop.tlv.net_name == ['GRL'] and p.thread_meshcop.tlv.chan_mask_mask 212 … == '001fffe0' and p.thread_meshcop.tlv.active_tstamp == 101).must_next() 216 lambda p: p.thread_meshcop.tlv.state == 1).must_next() 224 …T_ACTIVE_GET_URI).filter(lambda p: p.thread_meshcop.tlv.active_tstamp == 101 and p.thread_meshcop.… 225 … xpan_id == '000db70000000000' and p.thread_meshcop.tlv.net_name == ['GRL'] and 226 … p.thread_meshcop.tlv.chan_mask_mask == '001fffe0').must_next() 231 … lambda p: p.thread_meshcop.tlv.active_tstamp == 102 and p.thread_meshcop.tlv.xpan_id == 232 … '000db70000000001' and p.thread_meshcop.tlv.net_name == ['threadcert'] and p.thread_meshcop.tlv. 233 chan_mask_mask == '001fffe0' and p.thread_meshcop.tlv.channel == [18]).must_next() [all …]
|
D | Cert_7_1_06_BorderRouterAsLeader.py | 204 p.thread_nwd.tlv.prefix and\ 206 p.thread_nwd.tlv.border_router_16 232 } <= set(p.mle.tlv.type) and\ 233 p.thread_nwd.tlv.border_router.flag.p == [1] and\ 234 p.thread_nwd.tlv.border_router.flag.s == [1] and\ 235 p.thread_nwd.tlv.border_router.flag.r == [1] and\ 236 p.thread_nwd.tlv.border_router.flag.o == [1] and\ 238 p.thread_nwd.tlv.prefix 249 } <= set(p.mle.tlv.type) and\ 254 } <= set(p.thread_nwd.tlv.type) and\ [all …]
|
D | Cert_8_3_01_CommissionerPetition.py | 125 } == set(p.coap.tlv.type)\ 150 } <= set(p.coap.tlv.type) and\ 151 p.thread_meshcop.tlv.state == MESHCOP_ACCEPT 162 } == set(p.mle.tlv.type) and\ 165 } == set(p.thread_nwd.tlv.type) and\ 170 } == set(p.thread_meshcop.tlv.type) and\ 171 p.mle.tlv.leader_data.data_version == 172 (_pkt.mle.tlv.leader_data.data_version + 1) % 256 and\ 173 p.thread_nwd.tlv.stable == [0] 189 } == set(p.coap.tlv.type) and\ [all …]
|
D | Cert_7_1_07_BorderRouterAsLeader.py | 228 p.thread_nwd.tlv.prefix and\ 230 p.thread_nwd.tlv.border_router_16 261 } <= set(p.mle.tlv.type) and\ 263 p.thread_nwd.tlv.prefix and\ 264 p.mle.tlv.leader_data.data_version == 265 (_pkt.mle.tlv.leader_data.data_version + 1) % 256 and\ 266 p.mle.tlv.leader_data.stable_data_version == 267 (_pkt.mle.tlv.leader_data.stable_data_version + 1) % 256 278 } <= set(p.mle.tlv.type) and\ 282 } <= set(p.thread_nwd.tlv.type) and\ [all …]
|
D | Cert_9_2_11_NetworkKey.py | 238 must_verify(lambda p: p.thread_meshcop.tlv.state == 1) 242 filter(lambda p: p.mle.tlv.active_tstamp == 10 and\ 243 p.mle.tlv.pending_tstamp == 10 and\ 244 (p.mle.tlv.leader_data.data_version - 245 _pkt.mle.tlv.leader_data.data_version) % 256 <= 127 and\ 246 (p.mle.tlv.leader_data.stable_data_version - 247 _pkt.mle.tlv.leader_data.stable_data_version) % 256 <= 127 and\ 248 p.thread_nwd.tlv.stable == [0] and\ 249 NWD_COMMISSIONING_DATA_TLV in p.thread_nwd.tlv.type and\ 250 NM_COMMISSIONER_SESSION_ID_TLV in p.thread_meshcop.tlv.type and\ [all …]
|
D | Cert_5_8_04_SecurityPolicyTLV.py | 205 filter(lambda p: p.thread_meshcop.tlv.type is nullField).\ 217 filter(lambda p: (p.thread_meshcop.tlv.sec_policy_rot == 3600 and 218 p.thread_meshcop.tlv.sec_policy_o == 1 and 219 p.thread_meshcop.tlv.sec_policy_n == 1 and 220 p.thread_meshcop.tlv.sec_policy_r == 1 and 221 p.thread_meshcop.tlv.sec_policy_c == 1) or 222 (p.thread_meshcop.tlv.unknown == '0e10f7')).\ 239 } == set(p.thread_meshcop.tlv.type) and\ 240 p.thread_meshcop.tlv.active_tstamp == 15 and\ 241 (p.thread_meshcop.tlv.sec_policy_o == 0 or [all …]
|
D | Cert_9_2_05_ActiveDataset.py | 182 filter(lambda p: p.thread_meshcop.tlv.state == 1).\ 201 } <= set(p.mle.tlv.type) and\ 202 p.mle.tlv.active_tstamp == 100 and\ 203 (p.mle.tlv.leader_data.data_version - 204 _pkt.mle.tlv.leader_data.data_version) % 256 <= 127 and\ 205 (p.mle.tlv.leader_data.stable_data_version - 206 _pkt.mle.tlv.leader_data.stable_data_version) % 256 <= 127 234 } <= set(p.mle.tlv.type) and\ 245 } <= set(p.thread_meshcop.tlv.type) and\ 246 p.mle.tlv.active_tstamp == 100 and\ [all …]
|
D | Cert_7_1_01_BorderRouterAsLeader.py | 149 } < set(p.mle.tlv.type) and\ 150 p.mle.tlv.mode.network_data == 1 167 } == set(p.thread_nwd.tlv.prefix) and\ 168 p.thread_nwd.tlv.border_router.flag.p == [1, 1] and\ 169 p.thread_nwd.tlv.border_router.flag.s == [1, 1] and\ 170 p.thread_nwd.tlv.border_router.flag.r == [1, 1] and\ 171 p.thread_nwd.tlv.border_router.flag.o == [1, 1] and\ 172 p.thread_nwd.tlv.stable == [0, 1, 1, 1, 0, 0, 0] 191 } <= set(p.mle.tlv.type) and\ 192 p.mle.tlv.mode.network_data == 0 [all …]
|
D | v1_2_LowPower_7_2_01_ForwardTrackingSeries.py | 194 … .filter(lambda p: LinkMetricsSubTlvType.FORWARD_PROBING_REGISTRATION in p.mle.tlv.link_sub_tlv) \ 195 .filter(lambda p: 4 in p.mle.tlv.link_forward_series) \ 196 ….filter(lambda p: consts.LINK_METRICS_TYPE_AVERAGE_ENUM_COUNT in p.mle.tlv.metric_type_id_flags.ty… 197 ….filter(lambda p: consts.LINK_METRICS_METRIC_TYPE_ENUM_PDU_COUNT in p.mle.tlv.metric_type_id_flags… 198 .filter(lambda p: 1 in p.mle.tlv.metric_type_id_flags.l) \ 205 .filter(lambda p: p.mle.tlv.link_status_sub_tlv == consts.LINK_METRICS_STATUS_SUCCESS) \ 212 .filter(lambda p: TlvType.LINK_METRICS_REPORT in p.mle.tlv.type) \ 213 ….filter(lambda p: consts.LINK_METRICS_TYPE_AVERAGE_ENUM_COUNT in p.mle.tlv.metric_type_id_flags.ty… 214 ….filter(lambda p: consts.LINK_METRICS_METRIC_TYPE_ENUM_PDU_COUNT in p.mle.tlv.metric_type_id_flags… 224 … .filter(lambda p: LinkMetricsSubTlvType.FORWARD_PROBING_REGISTRATION in p.mle.tlv.link_sub_tlv) \ [all …]
|
D | Cert_9_2_02_MGMTCommissionerSet.py | 156 [NM_STEERING_DATA_TLV] == p.coap.tlv.type and\ 157 p.thread_meshcop.tlv.steering_data == Bytes('ff') 170 [NM_STATE_TLV] == p.coap.tlv.type and\ 171 p.thread_meshcop.tlv.state == MESHCOP_REJECT 188 } == set(p.thread_meshcop.tlv.type) and\ 189 p.thread_meshcop.tlv.steering_data == Bytes('ff') 202 [NM_STATE_TLV] == p.coap.tlv.type and\ 203 p.thread_meshcop.tlv.state == MESHCOP_ACCEPT 221 } == set(p.mle.tlv.type) and\ 224 } == set(p.thread_nwd.tlv.type) and\ [all …]
|
D | v1_2_LowPower_7_1_02_SingleProbeLinkMetricsWithoutEnhancedAck.py | 209 … .filter(lambda p: LinkMetricsSubTlvType.LINK_METRICS_QUERY_ID in p.mle.tlv.link_sub_tlv) \ 210 .filter(lambda p: p.mle.tlv.query_id == 0) \ 211 … .filter(lambda p: LinkMetricsSubTlvType.LINK_METRICS_QUERY_OPTIONS in p.mle.tlv.link_sub_tlv) \ 225 .filter(lambda p: LinkMetricsSubTlvType.LINK_METRICS_REPORT in p.mle.tlv.link_sub_tlv) \ 226 ….filter(lambda p: consts.LINK_METRICS_TYPE_AVERAGE_ENUM_EXPONENTIAL in p.mle.tlv.metric_type_id_fl… 227 ….filter(lambda p: consts.LINK_METRICS_METRIC_TYPE_ENUM_RSSI in p.mle.tlv.metric_type_id_flags.metr… 245 … .filter(lambda p: LinkMetricsSubTlvType.LINK_METRICS_QUERY_ID in p.mle.tlv.link_sub_tlv) \ 246 .filter(lambda p: p.mle.tlv.query_id == 0) \ 247 … .filter(lambda p: LinkMetricsSubTlvType.LINK_METRICS_QUERY_OPTIONS in p.mle.tlv.link_sub_tlv) \ 261 .filter(lambda p: LinkMetricsSubTlvType.LINK_METRICS_REPORT in p.mle.tlv.link_sub_tlv) \ [all …]
|
D | Cert_7_1_03_BorderRouterAsLeader.py | 149 } == set(p.thread_nwd.tlv.prefix) and\ 150 p.thread_nwd.tlv.border_router.flag.p == [1, 1] and\ 151 p.thread_nwd.tlv.border_router.flag.s == [1, 1] and\ 152 p.thread_nwd.tlv.border_router.flag.r == [1, 1] and\ 153 p.thread_nwd.tlv.border_router.flag.o == [1, 1] and\ 154 p.thread_nwd.tlv.stable == [0, 1, 1, 1, 0, 0, 0] 180 } < set(p.mle.tlv.type) and\ 181 p.mle.tlv.addr_reg_iid is not nullField and\ 182 set(_pkt.mle.tlv.addr_reg_iid) > set(p.mle.tlv.addr_reg_iid) 200 } == set(p.mle.tlv.type) and\ [all …]
|
D | Cert_9_2_08_PersistentDatasets.py | 201 filter(lambda p: p.thread_meshcop.tlv.active_tstamp == 203 p.thread_meshcop.tlv.pending_tstamp == 205 p.thread_meshcop.tlv.delay_timer == 207 p.thread_meshcop.tlv.channel == 209 p.thread_meshcop.tlv.pan_id == 211 NM_COMMISSIONER_SESSION_ID_TLV in p.thread_meshcop.tlv.type 224 must_verify(lambda p: p.thread_meshcop.tlv.state == 1) 242 filter(lambda p: p.mle.tlv.active_tstamp == 244 p.mle.tlv.pending_tstamp == 246 p.mle.tlv.leader_data.data_version != [all …]
|
D | Cert_9_2_07_DelayTimer.py | 162 …t_verify(lambda p: {ACTIVE_OPERATION_DATASET_TLV, ACTIVE_TIMESTAMP_TLV} < set(p.mle.tlv.type) and { 165 } <= set(p.thread_meshcop.tlv.type) and p.mle.tlv.active_tstamp == LEADER_ACTIVE_TIMESTAMP) 169 lambda p: p.coap.code == COAP_CODE_ACK and p.thread_meshcop.tlv.state == 1) 174 … p.mle.tlv.type) and {NM_BORDER_AGENT_LOCATOR_TLV, NM_COMMISSIONER_SESSION_ID_TLV} <= set( 175 … p.thread_meshcop.tlv.type) and p.thread_nwd.tlv.stable == [0] and p.mle.tlv.active_tstamp == 180 …t_verify(lambda p: {ACTIVE_OPERATION_DATASET_TLV, ACTIVE_TIMESTAMP_TLV} < set(p.mle.tlv.type) and { 183 } <= set(p.thread_meshcop.tlv.type) and p.mle.tlv.active_tstamp == ROUTER_ACTIVE_TIMESTAMP) 187 lambda p: p.coap.code == COAP_CODE_ACK and p.thread_meshcop.tlv.state == 1) 193 … } <= set(p.mle.tlv.type) and p.thread_nwd.tlv.stable == [0] and p.mle.tlv.active_tstamp == 194 ROUTER_ACTIVE_TIMESTAMP and p.mle.tlv.pending_tstamp == ROUTER_PENDING_TIMESTAMP) [all …]
|
D | Cert_5_1_05_RouterAddressTimeout.py | 120 } == set(p.coap.tlv.type) and\ 122 p.thread_address.tlv.status == 0 139 } <= set(p.mle.tlv.type)\ 170 } <= set(p.mle.tlv.type) 183 } <= set(p.mle.tlv.type) or\ 189 } <= set(p.mle.tlv.type)\ 199 } == set(p.coap.tlv.type) and\ 201 p.thread_address.tlv.rloc16 == 202 _pkt_as.thread_address.tlv.rloc16 212 } == set(p.coap.tlv.type) and\ [all …]
|
D | Cert_5_6_09_NetworkDataForwarding.py | 150 … p.thread_nwd.tlv.prefix) and p.thread_nwd.tlv.border_router.flag.p == [0] and p.thread_nwd.tlv. 151 … border_router.flag.s == [1] and p.thread_nwd.tlv.border_router.flag.r == [1] and p.thread_nwd.tlv 152 … .border_router.flag.o == [1] and p.thread_nwd.tlv.stable == [0, 1, 1, 1, 1, 1]) 158 p.mle.tlv.type 160 p.thread_nwd.tlv.type) and {Ipv6Addr('2001:2:0:1::'), Ipv6Addr('2001:2:0:2::')} == set( 161 … p.thread_nwd.tlv.prefix) and {0xFFFE, 0xFFFE} == set(p.thread_nwd.tlv.border_router_16)) 182 } == set(p.thread_nwd.tlv.type) and { 184 …} == set(p.thread_nwd.tlv.prefix) and p.thread_nwd.tlv.border_router.flag.p == [0, 1] and p.thread… 185 …tlv.border_router.flag.s == [1, 1] and p.thread_nwd.tlv.border_router.flag.r == [1, 1] and p.threa… 186 … .tlv.border_router.flag.o == [1, 1] and p.thread_nwd.tlv.stable == [0, 1, 1, 1, 1, 1]) [all …]
|
D | Cert_5_1_04_RouterAddressReallocation.py | 151 } <= set(p.mle.tlv.type) and\ 153 p.mle.tlv.scan_mask.r == 1 and\ 154 p.mle.tlv.scan_mask.e == 1 174 } <= set(p.mle.tlv.type) and\ 176 p.mle.tlv.scan_mask.r == 1 and\ 177 p.mle.tlv.scan_mask.e == 0 194 p.mle.tlv.leader_data.partition_id != 195 _pkt_pt.mle.tlv.leader_data.partition_id and\ 196 (p.mle.tlv.leader_data.data_version != 197 _pkt_pt.mle.tlv.leader_data.data_version or\ [all …]
|
D | Cert_5_6_02_NetworkDataRegisterBeforeAttachRouter.py | 124 lambda p: {LEADER_DATA_TLV, ROUTE64_TLV, SOURCE_ADDRESS_TLV} == set(p.mle.tlv.type)) 131 } < set(p.mle.tlv.type)) 138 … p.thread_nwd.tlv.prefix) and p.thread_nwd.tlv.border_router.flag.p == [1, 1] and p.thread_nwd.tlv. 139 …border_router.flag.s == [1, 1] and p.thread_nwd.tlv.border_router.flag.r == [1, 1] and p.thread_nw… 140 border_router.flag.o == [1, 1] and p.thread_nwd.tlv.stable == [0, 1, 1, 1, 0, 0, 0]) 147 …lambda p: {Ipv6Addr('2001:2:0:1::')} == set(p.thread_nwd.tlv.prefix) and p.thread_nwd.tlv.border_r… 148 …flag.p == [1] and p.thread_nwd.tlv.border_router.flag.s == [1] and p.thread_nwd.tlv.border_router.… 149 … [1] and p.thread_nwd.tlv.border_router.flag.o == [1] and p.thread_nwd.tlv.stable == [1, 1, 1]) 155 … p.thread_nwd.tlv.prefix) and p.thread_nwd.tlv.border_router.flag.p == [1, 1] and p.thread_nwd.tlv. 156 …border_router.flag.s == [1, 1] and p.thread_nwd.tlv.border_router.flag.r == [1, 1] and p.thread_nw… [all …]
|
D | Cert_5_6_06_NetworkDataExpiration.py | 166 } == set(p.thread_nwd.tlv.type) and { 169 … } == set(p.thread_nwd.tlv.prefix) and p.thread_nwd.tlv.stable == [0, 1, 1, 1, 0, 0, 0, 1, 1, 1]) 173 …p: {SOURCE_ADDRESS_TLV, MODE_TLV, LEADER_DATA_TLV, ADDRESS_REGISTRATION_TLV} < set(p.mle.tlv.type)) 178 p.mle.tlv.type) and { 181 } == set(p.thread_nwd.tlv.type) and { 183 … } == set(p.thread_nwd.tlv.prefix) and {0xFFFE, 0xFFFE} == set(p.thread_nwd.tlv.border_router_16)) 188 …p: {SOURCE_ADDRESS_TLV, MODE_TLV, LEADER_DATA_TLV, ADDRESS_REGISTRATION_TLV} < set(p.mle.tlv.type)) 200 } == set(p.thread_nwd.tlv.type) and 202 …Ipv6Addr('2001:2:0:3::')} == set(p.thread_nwd.tlv.prefix) and p.mle.tlv.leader_data.data_version == 203 … (_pkt.mle.tlv.leader_data.data_version + 1) % 256 and p.mle.tlv.leader_data.stable_data_version == [all …]
|
/openthread-3.7.0/src/core/thread/ |
D | network_data_tlvs.cpp | 44 const NetworkDataTlv *tlv; in Find() local 46 for (tlv = aStart; (tlv + 1 <= aEnd) && (tlv->GetNext() <= aEnd); tlv = tlv->GetNext()) in Find() 48 if (tlv->GetType() == aType) in Find() 54 tlv = nullptr; in Find() 57 return tlv; in Find() 65 const NetworkDataTlv *tlv; in Find() local 67 for (tlv = aStart; (tlv + 1 <= aEnd) && (tlv->GetNext() <= aEnd); tlv = tlv->GetNext()) in Find() 69 if ((tlv->GetType() == aType) && (tlv->IsStable() == aStable)) in Find() 75 tlv = nullptr; in Find() 78 return tlv; in Find() [all …]
|
/openthread-3.7.0/tools/tcat_ble_client/dataset/ |
D | dataset_entries.py | 22 from tlv.dataset_tlv import MeshcopTlvType 23 from tlv.tlv import TLV 49 def set_from_tlv(self, tlv: TLV): 71 def set_from_tlv(self, tlv: TLV): 72 (value,) = struct.unpack('>Q', tlv.value) 79 tlv = struct.pack('>BBQ', self.type.value, self.length, value) 80 return TLV.from_bytes(tlv) 97 def set_from_tlv(self, tlv: TLV): 98 (value,) = struct.unpack('>Q', tlv.value) 105 tlv = struct.pack('>BBQ', self.type.value, self.length, value) [all …]
|
/openthread-3.7.0/src/core/meshcop/ |
D | dataset.cpp | 119 for (const Tlv *tlv = GetTlvsStart(); tlv < end; tlv = tlv->GetNext()) in ValidateTlvs() local 121 VerifyOrExit(!tlv->IsExtended() && ((tlv + 1) <= end) && (tlv->GetNext() <= end)); in ValidateTlvs() 122 VerifyOrExit(IsTlvValid(*tlv)); in ValidateTlvs() 125 validatedLength = static_cast<uint16_t>(reinterpret_cast<const uint8_t *>(tlv) - mTlvs); in ValidateTlvs() 126 VerifyOrExit(Tlv::FindTlv(mTlvs, validatedLength, tlv->GetType()) == nullptr); in ValidateTlvs() 392 … for (const Tlv *tlv = aDataset.GetTlvsStart(); tlv < aDataset.GetTlvsEnd(); tlv = tlv->GetNext()) in WriteTlvsFrom() local 394 SuccessOrExit(error = WriteTlv(*tlv)); in WriteTlvsFrom() 488 SecurityPolicyTlv tlv; in WriteTlvsFrom() local 490 tlv.Init(); in WriteTlvsFrom() 491 tlv.SetSecurityPolicy(aDatasetInfo.Get<kSecurityPolicy>()); in WriteTlvsFrom() [all …]
|
/openthread-3.7.0/tests/scripts/thread-cert/pktverify/ |
D | test_layer_fields.py | 90 print(p.coap.tlv.type, p.coap.tlv) 91 assert isinstance(coap.tlv, LayerFieldsContainer), repr(coap.tlv) 92 self.assertIsInstanceOrNull(coap.tlv.type, list) 100 self.assertIsInstanceOrNull(mle.tlv.mode.receiver_on_idle, int) 101 self.assertIsInstanceOrNull(mle.tlv.mode.reserved1, int) 102 self.assertIsInstanceOrNull(mle.tlv.mode.reserved2, int) 103 self.assertIsInstanceOrNull(mle.tlv.mode.device_type_bit, int) 104 self.assertIsInstanceOrNull(mle.tlv.mode.network_data, int) 105 self.assertIsInstanceOrNull(mle.tlv.challenge, Bytes) 106 self.assertIsInstanceOrNull(mle.tlv.scan_mask.r, int) [all …]
|