#!/usr/bin/env awk
#
# Returns true if the protocol number is equal to 51 (AH)
#
# Parameters:
#   - [p] : the protocol to test [default: $l4Proto]
#
# Dependencies:
#   - basicFlow
#
# See Also:
#   - proto
#
# Examples:
#   - tawk 'ah()' file.txt
#   - tawk 'ah() { print $srcIP4 }' file.txt
#   - tawk 'ah($l4Proto)' file.txt
#   - tawk 'ah($l4Proto) { print $srcIP4 }' file.txt

@include "hdr"
@include "proto"

function ah(p) {
    if (hdr()) return __PRIHDR__
    if (p) return p == 51
    else return proto(51)
}
