(self, pkt, x)
| 344 | return super(DNSStrField, self).any2i(pkt, x) |
| 345 | |
| 346 | def h2i(self, pkt, x): |
| 347 | # Setting a DNSStrField manually (h2i) means any current compression will break |
| 348 | if ( |
| 349 | pkt and |
| 350 | isinstance(pkt.parent, DNSCompressedPacket) and |
| 351 | pkt.parent.raw_packet_cache |
| 352 | ): |
| 353 | pkt.parent.clear_cache() |
| 354 | if not x: |
| 355 | return b"." |
| 356 | x = bytes_encode(x) |
| 357 | if x[-1:] != b"." and not _is_ptr(x): |
| 358 | return x + b"." |
| 359 | return x |
| 360 | |
| 361 | def i2m(self, pkt, x): |
| 362 | return dns_encode(x, check_built=True) |
no test coverage detected