| 4473 | |
| 4474 | |
| 4475 | class DFS_REFERRAL(Packet): |
| 4476 | fields_desc = [ |
| 4477 | LEShortField("Version", 1), |
| 4478 | FieldLenField( |
| 4479 | "Size", None, fmt="<H", length_of="ShareName", adjust=lambda pkt, x: x + 9 |
| 4480 | ), |
| 4481 | LEShortEnumField("ServerType", 0, {0: "non-root", 1: "root"}), |
| 4482 | LEShortField("ReferralEntryFlags", 0), |
| 4483 | StrNullFieldUtf16("ShareName", ""), |
| 4484 | ] |
| 4485 | |
| 4486 | @classmethod |
| 4487 | def dispatch_hook(cls, _pkt=None, *args, **kargs): |
| 4488 | if _pkt and len(_pkt) >= 2: |
| 4489 | version = struct.unpack("<H", _pkt[:2])[0] |
| 4490 | if version == 1: |
| 4491 | return DFS_REFERRAL |
| 4492 | elif version == 3: |
| 4493 | return DFS_REFERRAL_V3 |
| 4494 | elif version == 4: |
| 4495 | return DFS_REFERRAL_V4 |
| 4496 | return cls |
| 4497 | |
| 4498 | def default_payload_class(self, s): |
| 4499 | return conf.padding_layer |
| 4500 | |
| 4501 | |
| 4502 | class DFS_REFERRAL_V3(DFS_REFERRAL): |
nothing calls this directly
no test coverage detected
searching dependent graphs…