A field designed to carry a OUI (3 bytes)
| 3748 | |
| 3749 | |
| 3750 | class OUIField(X3BytesField): |
| 3751 | """ |
| 3752 | A field designed to carry a OUI (3 bytes) |
| 3753 | """ |
| 3754 | |
| 3755 | def i2repr(self, pkt, val): |
| 3756 | # type: (Optional[Packet], int) -> str |
| 3757 | by_val = struct.pack("!I", val or 0)[1:] |
| 3758 | oui = str2mac(by_val + b"\0" * 3)[:8] |
| 3759 | if conf.manufdb: |
| 3760 | fancy = conf.manufdb._get_manuf(oui) |
| 3761 | if fancy != oui: |
| 3762 | return "%s (%s)" % (fancy, oui) |
| 3763 | return oui |
| 3764 | |
| 3765 | |
| 3766 | class UUIDField(Field[UUID, bytes]): |
no outgoing calls
no test coverage detected
searching dependent graphs…