Did I find the right examples for you? yes no

All Samples(7)  |  Call(6)  |  Derive(0)  |  Import(1)

src/p/y/pystack-1.0.0/pystack/kernel_filter.py   pystack(Download)
'''
 
from netfilter.rule import Rule, Match
from netfilter.table import Table, IptablesError
 
    matches = []
    if portsrc:
        matches.append(Match('tcp', '--sport '+str(portsrc)))
    if portdst:
        matches.append(Match('tcp', '--dport '+str(portdst)))
    matches = []
    if portsrc:
        matches.append(Match('tcp', '--sport '+str(portsrc)))
    if portdst:
        matches.append(Match('tcp', '--dport '+str(portdst)))