#!/usr/bin/env awk
#
# Return true if source or destination IP is equal to 'ip' or
# belongs to 'ip', e.g., 1.2.3.4/24.
#
# If 'ip' is omitted, return the source and destination IP.
#
# Parameters:
#   - [ip] : the IP address to filter
#
# Dependencies:
#   - None
#
# See also:
#   - dnet
#   - snet
#   - host      : alias for net
#   - dhost     : alias for dnet
#   - shost     : alias for snet
#   - ipinnet
#   - ipinrange
#
# Examples:
#   - tawk 'net("1.2.3.4")' file.txt
#   - tawk 'net("1.2.3.4/24")' file.txt
#   - tawk 'net(0x01020304) { print net() }' file.txt
#   - tawk '{ print net() }' file.txt

@include "host"

function net(ip) {
    return host(ip)
}
