#!/usr/bin/env awk
#
# Return true if one of the source or dest. MAC addresses is equal to 'mac'.
# If 'mac' is omitted, return the source and destination MAC addresses.
#
# Parameters:
#   - [m] : the MAC address to filter
#
# Dependencies:
#   - macRecorder
#
# See also:
#   - dether
#   - dmac
#   - ether: alias for mac
#   - sether
#   - smac
#
# Examples:
#   - tawk 'mac("00:11:22:33:44:55")' file.txt
#   - tawk 'mac("00:11:22:33:44:55") { print mac() }' file.txt
#   - tawk '{ print mac() }' file.txt

@include "dmac"
@include "smac"

function mac(m) {
    if (length(m) > 0) return smac(m) || dmac(m)
    else return smac() OFS dmac()
}
