'Filters (if `neg` == True, filters out) records with
specified protocol/port at required state. Be aware that when
a host has a lot of ports filtered or closed, it will not
report all of them, but only a summary, and thus the filter
might not work as expected. This filter will always work to
find open ports.'

@staticmethod
def searchport(port, protocol='tcp', state='open', neg=False):

    if (port == 'host'):
        return NmapFilter(port=[(True, ((Port.port >= 0) if neg else (Port.port == (-1))))])
    return NmapFilter(port=[((not neg), and_((Port.port == port), (Port.protocol == protocol), (Port.state == state)))])
