MCPcopy Create free account
hub / github.com/secdev/scapy / DFS_REFERRAL

Class DFS_REFERRAL

scapy/layers/smb2.py:4475–4499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4473
4474
4475class 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
4502class DFS_REFERRAL_V3(DFS_REFERRAL):

Callers

nothing calls this directly

Calls 4

LEShortFieldClass · 0.90
FieldLenFieldClass · 0.90
LEShortEnumFieldClass · 0.90
StrNullFieldUtf16Class · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…