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

@include "hdr"
@include "proto"

function tcp(p) {
    if (hdr()) return __PRIHDR__
    if (p) return p == 6
    else return proto(6)
}
