Skip to content

Commit

Permalink
Use xt functions instead of ipt_entry_{match,target}.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldx committed Feb 6, 2013
1 parent b10fcb4 commit a18504a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions iptc/ip4tc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ class ipt_entry(ct.Structure):
("counters", xt_counters), # Packet and byte counters
("elems", ct.c_ubyte * 0)] # The matches (if any) then the target

class ipt_entry_target(xt_entry_target):
pass

class ipt_entry_match(xt_entry_match):
pass

_libiptc_file = ctypes.util.find_library("ip4tc")

if not _libiptc_file:
Expand Down Expand Up @@ -1005,13 +999,13 @@ def _set_rule(self, entry):
off = 0
while entrysz + off < entry.target_offset:
match = ct.cast(ct.byref(entry.elems, off),
ct.POINTER(ipt_entry_match))[0]
ct.POINTER(xt_entry_match))[0]
m = Match(self, match=match)
self.add_match(m)
off += m.size

target = ct.cast(ct.byref(entry, entry.target_offset),
ct.POINTER(ipt_entry_target))[0]
ct.POINTER(xt_entry_target))[0]
self.target = Target(self, target=target)
jump = self.chain.table.get_target(entry) # standard target is special
if jump:
Expand Down

0 comments on commit a18504a

Please sign in to comment.