It's an exception printing machine provided that the logic works as I would presume it does above. The logic for it is just a wrapper around Scapy's sniff/bpf function. Problematically, unless there's validation that traffic on that port does indeed have a DNSQR layer, it will raise an exception for any packets that do not abide this format on the port.
how does sniffing work tho?