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

@include "hdr"
@include "proto"

function esp(p) {
    if (hdr()) return __PRIHDR__
    if (p) return p == 50
    else return proto(50)
}
