| 1429 | |
| 1430 | |
| 1431 | class ZEP2(Packet): |
| 1432 | name = "Zigbee Encapsulation Protocol (V2)" |
| 1433 | fields_desc = [ |
| 1434 | StrFixedLenField("preamble", "EX", length=2), |
| 1435 | ByteField("ver", 0), |
| 1436 | ByteField("type", 0), |
| 1437 | ByteField("channel", 0), |
| 1438 | ShortField("device", 0), |
| 1439 | ByteField("lqi_mode", 1), |
| 1440 | ByteField("lqi_val", 0), |
| 1441 | TimeStampField("timestamp", 0), |
| 1442 | IntField("seq", 0), |
| 1443 | BitField("res", 0, 80), # 10 bytes reserved field |
| 1444 | ByteField("length", 0), |
| 1445 | ] |
| 1446 | |
| 1447 | @classmethod |
| 1448 | def dispatch_hook(cls, _pkt=b"", *args, **kargs): |
| 1449 | if _pkt and len(_pkt) >= 4: |
| 1450 | v = orb(_pkt[2]) |
| 1451 | if v == 1: |
| 1452 | return ZEP1 |
| 1453 | elif v == 2: |
| 1454 | return ZEP2 |
| 1455 | return cls |
| 1456 | |
| 1457 | def guess_payload_class(self, payload): |
| 1458 | if self.lqi_mode: |
| 1459 | return Dot15d4 |
| 1460 | else: |
| 1461 | return Dot15d4FCS |
| 1462 | |
| 1463 | |
| 1464 | class ZEP1(ZEP2): |
nothing calls this directly
no test coverage detected
searching dependent graphs…