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

@include "proto"

function udp(p) {
    if (p) return p == 17
    else return proto(17)
}
