| 2484 | |
| 2485 | |
| 2486 | class BitFieldLenField(BitField): |
| 2487 | __slots__ = ["length_of", "count_of", "adjust", "tot_size", "end_tot_size"] |
| 2488 | |
| 2489 | def __init__(self, |
| 2490 | name, # type: str |
| 2491 | default, # type: Optional[int] |
| 2492 | size, # type: int |
| 2493 | length_of=None, # type: Optional[Union[Callable[[Optional[Packet]], int], str]] # noqa: E501 |
| 2494 | count_of=None, # type: Optional[str] |
| 2495 | adjust=lambda pkt, x: x, # type: Callable[[Optional[Packet], int], int] # noqa: E501 |
| 2496 | tot_size=0, # type: int |
| 2497 | end_tot_size=0, # type: int |
| 2498 | ): |
| 2499 | # type: (...) -> None |
| 2500 | super(BitFieldLenField, self).__init__(name, default, size, |
| 2501 | tot_size, end_tot_size) |
| 2502 | self.length_of = length_of |
| 2503 | self.count_of = count_of |
| 2504 | self.adjust = adjust |
| 2505 | |
| 2506 | def i2m(self, pkt, x): |
| 2507 | # type: (Optional[Packet], Optional[Any]) -> int |
| 2508 | return FieldLenField.i2m(self, pkt, x) # type: ignore |
| 2509 | |
| 2510 | |
| 2511 | class XBitField(BitField): |
no outgoing calls
no test coverage detected