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

@include "proto"

function icmp(p) {
    if (p) return p == 1
    else return proto(1)
}
