MCPcopy Index your code
hub / github.com/secdev/scapy / MayEnd

Class MayEnd

scapy/fields.py:340–363  ·  view source on GitHub ↗

Allow packet dissection to end after the dissection of this field if no bytes are left. A good example would be a length field that can be 0 or a set value, and where it would be too annoying to use multiple ConditionalFields Important note: any field below this one MUST defau

Source from the content-addressed store, hash-verified

338
339
340class MayEnd(_FieldContainer):
341 """
342 Allow packet dissection to end after the dissection of this field
343 if no bytes are left.
344
345 A good example would be a length field that can be 0 or a set value,
346 and where it would be too annoying to use multiple ConditionalFields
347
348 Important note: any field below this one MUST default
349 to an empty value, else the behavior will be unexpected.
350 """
351 __slots__ = ["fld"]
352
353 def __init__(self, fld):
354 # type: (Any) -> None
355 self.fld = fld
356
357 def __eq__(self, other):
358 # type: (Any) -> bool
359 return bool(self.fld == other)
360
361 def __hash__(self):
362 # type: () -> int
363 return hash(self.fld)
364
365
366class ActionField(_FieldContainer):

Callers 15

nlmsgerrClass · 0.90
PHYPayloadClass · 0.90
AltBeaconClass · 0.90
LDPLabelMMClass · 0.90
LDPLabelWMClass · 0.90
DoIPClass · 0.90
KWP_ROEClass · 0.90
KWP_ROEPRClass · 0.90
KWP_NRClass · 0.90
GMLAN_NRClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected