add repeat to packet; release 0.5

This commit is contained in:
Fen Qin 2013-04-03 19:55:51 +08:00
parent 3b62cd55ad
commit 26ff0e7844
5 changed files with 1286 additions and 787 deletions

View File

@ -1,3 +1,6 @@
v0.5, 3 Apr 2013
Add repeat.
v0.4, 24 Dec 2012
Add set_payload.

File diff suppressed because it is too large Load Diff

View File

@ -183,6 +183,7 @@ cdef class Packet:
cpdef set_mark(self, u_int32_t mark)
cpdef accept(self)
cpdef drop(self)
cpdef repeat(self)
cdef class NetfilterQueue:
cdef object user_callback # User callback

View File

@ -5,7 +5,7 @@ function.
Copyright: (c) 2011, Kerkhoff Technologies Inc.
License: MIT; see LICENSE.txt
"""
VERSION = (0, 4, 0)
VERSION = (0, 5, 0)
# Constants for module users
COPY_NONE = 1
@ -73,8 +73,7 @@ cdef class Packet:
modified_payload_len = len(self._given_payload)
modified_payload = self._given_payload
if self._mark_is_set:
nfq_set_verdict_mark( # TODO: make this use nfq_set_verdict2 if
# available on system
nfq_set_verdict_mark(
self._qh,
self.id,
verdict,
@ -119,6 +118,10 @@ cdef class Packet:
"""Drop the packet."""
self.verdict(NF_DROP)
cpdef repeat(self):
"""Repeat the packet."""
self.verdict(NF_REPEAT)
cdef class NetfilterQueue:
"""Handle a single numbered queue."""
def __cinit__(self, *args, **kwargs):

View File

@ -1,6 +1,6 @@
from distutils.core import setup, Extension
VERSION = "0.4" # Remember to change README.rst when version changes.
VERSION = "0.5" # Remember to change README.rst when version changes.
try:
# Use Cython