Did I find the right examples for you? yes no

All Samples(5)  |  Call(4)  |  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
 
    rule = Rule(
                #in_interface=interface,
                protocol=proto,
                source = ipsrc,
                destination = ipdst,
    rule = Rule(
                #in_interface=interface,
                protocol=proto,
                source = ipsrc,
                destination = ipdst,
    """
    match =  Match('icmp', '--icmp-type port-unreachable')
    rule = Rule(protocol="icmp", matches=[match], jump='DROP')
    Table('filter').append_rule('OUTPUT', rule)
 
 
    match =  Match('icmp', '--icmp-type port-unreachable')
    rule = Rule(protocol="icmp", matches=[match], jump='DROP')
    try:
        Table('filter').delete_rule('OUTPUT', rule)