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
| 338 | |
| 339 | |
| 340 | class 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 | |
| 366 | class ActionField(_FieldContainer): |
no outgoing calls
no test coverage detected