Skip to content

Commit 8510039

Browse files
committed
Update examples.rst
Fixed TABLE_*
1 parent 4ee5b89 commit 8510039

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/examples.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Parameters are always strings.
5757
When you are ready constructing your rule, add them to the chain you want it
5858
to show up in:
5959

60-
>>> chain = iptc.Chain(iptc.Table(iptc.Table.TABLE_FILTER), "INPUT")
60+
>>> chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), "INPUT")
6161
>>> chain.insert_rule(rule)
6262

6363
This will put your rule into the INPUT chain in the filter table.
@@ -69,7 +69,7 @@ Reject packets with source address ``127.0.0.1/255.0.0.0`` coming in on any of
6969
the eth interfaces:
7070

7171
>>> import iptc
72-
>>> chain = iptc.Chain(iptc.Table(iptc.Table.TABLE_FILTER), "INPUT")
72+
>>> chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), "INPUT")
7373
>>> rule = iptc.Rule()
7474
>>> rule.in_interface = "eth+"
7575
>>> rule.src = "127.0.0.1/255.0.0.0"
@@ -83,7 +83,7 @@ Simple rule not using any match extensions
8383
Inserting a rule to NAT TCP packets going out via ``eth0``:
8484

8585
>>> import iptc
86-
>>> chain = iptc.Chain(iptc.Table(iptc.Table.TABLE_NAT), "POSTROUTING")
86+
>>> chain = iptc.Chain(iptc.Table(iptc.Table.NAT), "POSTROUTING")
8787
>>> rule = iptc.Rule()
8888
>>> rule.protocol = "tcp"
8989
>>> rule.out_interface = "eth0"
@@ -98,7 +98,7 @@ Rule using the udp match extension
9898
Mark packets going to ``192.168.1.2`` UDP port ``1234`` with ``0xffff``:
9999

100100
>>> import iptc
101-
>>> chain = iptc.Chain(iptc.Table(iptc.Table.TABLE_MANGLE), "PREROUTING")
101+
>>> chain = iptc.Chain(iptc.Table(iptc.Table.MANGLE), "PREROUTING")
102102
>>> rule = iptc.Rule()
103103
>>> rule.dst = "192.168.1.2"
104104
>>> rule.protocol = "udp"
@@ -129,5 +129,5 @@ Now we will add multiple matches to a rule. This one is the
129129
>>> match.dst_range = "172.22.33.106"
130130
>>> rule.add_match(match)
131131
>>> rule.target = iptc.Target(rule, "DROP")
132-
>>> chain = iptc.Chain(iptc.Table.(iptc.Table.TABLE_FILTER), "INPUT")
132+
>>> chain = iptc.Chain(iptc.Table.(iptc.Table.FILTER), "INPUT")
133133
>>> chain.insert_rule(rule)

0 commit comments

Comments
 (0)