#!/usr/bin/env awk
#
# Returns true if the flow contains DNS traffic
#
# Dependencies:
#   - dnsDecode
#
# Examples:
#   - tawk 'dns()' file.txt
#   - tawk 'dns() { print $srcIP4 }' file.txt

@include "hdr"
@include "_validate_col"

function dns(        _c) {
    _c = _validate_col("dnsStat")
    if (hdr()) return __PRIHDR__
    return (strtonum($_c) && !bitisset($_c, 0x2))  # Ignore nbns
    #return strtonum($_c)
}
