#!/usr/bin/env awk
#
# Returns true if the bitfields (hex numbers) 'val1' and 'val2' are equal
#
# Parameters:
#   - val1 : the first bitfield
#   - val2 : the second bitfield
#
# Dependencies:
#   - None
#
# See Also:
#   - bitsallset
#   - bitsanyset
#
# Examples:
#   - tawk 'bfeq($icmpStat, 1)' file.txt
#   - tawk 'bfeq($icmpStat, 0x1) { print }' file.txt

@include "hdr"

function bfeq(val1, val2) {
    if (hdr()) return __PRIHDR__
    return strtonum(val1) == strtonum(val2)
}
