(self,
pkt, # type: Optional[Packet]
v, # type: bytes
)
| 1875 | self.length_from = lambda x, length=length: length # type: ignore |
| 1876 | |
| 1877 | def i2repr(self, |
| 1878 | pkt, # type: Optional[Packet] |
| 1879 | v, # type: bytes |
| 1880 | ): |
| 1881 | # type: (...) -> str |
| 1882 | if isinstance(v, bytes) and not conf.debug_strfixedlenfield: |
| 1883 | v = v.rstrip(b"\0") |
| 1884 | return super(StrFixedLenField, self).i2repr(pkt, v) |
| 1885 | |
| 1886 | def getfield(self, pkt, s): |
| 1887 | # type: (Packet, bytes) -> Tuple[bytes, bytes] |