MCPcopy Create free account
hub / github.com/secdev/scapy / _is_ptr

Function _is_ptr

scapy/layers/dns.py:201–208  ·  view source on GitHub ↗

Heuristic to guess if bytes are an encoded DNS pointer.

(x)

Source from the content-addressed store, hash-verified

199
200
201def _is_ptr(x):
202 """
203 Heuristic to guess if bytes are an encoded DNS pointer.
204 """
205 return (
206 (x and x[-1] == 0) or
207 (len(x) >= 2 and (x[-2] & 0xc0) == 0xc0)
208 )
209
210
211def dns_encode(x, check_built=False):

Callers 2

dns_encodeFunction · 0.85
h2iMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…