diff --git a/README.rst b/README.rst index 7e04b01..a8dc530 100644 --- a/README.rst +++ b/README.rst @@ -81,9 +81,8 @@ From source To install from source:: - wget https://pypi.python.org/packages/94/5b/83d10952c1312fe056f8f2f524a4a59fdc9d56b84a67cae1ed779e2da50b/NetfilterQueue-0.8.tar.gz#md5=8e78db992ad3a73dd86fef05293fff65 - tar -xvzf NetfilterQueue-0.8.tar.gz - cd NetfilterQueue-0.8 + git clone git@github.com:kti/python-netfilterqueue.git + cd python-netfilterqueue python setup.py install If Cython is installed, Distutils will use it to regenerate the .c source from the .pyx. It will then compile the .c into a .so. diff --git a/examples/print_and_accept.py b/examples/print_and_accept.py index 4182629..afad935 100755 --- a/examples/print_and_accept.py +++ b/examples/print_and_accept.py @@ -3,6 +3,9 @@ from netfilterqueue import NetfilterQueue def print_and_accept(pkt): print(pkt) + hw = pkt.get_hw() + if hw: + print(":".join("{:02x}".format(ord(c)) for c in hw[0:6])) pkt.accept() nfqueue = NetfilterQueue() diff --git a/netfilterqueue.c b/netfilterqueue.c index fa4219e..230d6dc 100644 --- a/netfilterqueue.c +++ b/netfilterqueue.c @@ -967,12 +967,12 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); -/* IncludeStringH.proto */ -#include - /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* IncludeStringH.proto */ +#include + /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); @@ -2081,9 +2081,8 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations u_int8_t __pyx_t_1; - u_int8_t *__pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("set_nfq_data", 0); /* "netfilterqueue.pyx":57 @@ -2100,7 +2099,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ * self._qh = qh * self._nfa = nfa # <<<<<<<<<<<<<< * self._hdr = nfq_get_msg_packet_hdr(nfa) - * self._hw = nfq_get_packet_hw(nfa) + * */ __pyx_v_self->_nfa = __pyx_v_nfa; @@ -2108,22 +2107,13 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ * self._qh = qh * self._nfa = nfa * self._hdr = nfq_get_msg_packet_hdr(nfa) # <<<<<<<<<<<<<< - * self._hw = nfq_get_packet_hw(nfa) - * - */ - __pyx_v_self->_hdr = nfq_get_msg_packet_hdr(__pyx_v_nfa); - - /* "netfilterqueue.pyx":60 - * self._nfa = nfa - * self._hdr = nfq_get_msg_packet_hdr(nfa) - * self._hw = nfq_get_packet_hw(nfa) # <<<<<<<<<<<<<< * * self.id = ntohl(self._hdr.packet_id) */ - __pyx_v_self->_hw = nfq_get_packet_hw(__pyx_v_nfa); + __pyx_v_self->_hdr = nfq_get_msg_packet_hdr(__pyx_v_nfa); - /* "netfilterqueue.pyx":62 - * self._hw = nfq_get_packet_hw(nfa) + /* "netfilterqueue.pyx":61 + * self._hdr = nfq_get_msg_packet_hdr(nfa) * * self.id = ntohl(self._hdr.packet_id) # <<<<<<<<<<<<<< * self.hw_protocol = ntohs(self._hdr.hw_protocol) @@ -2131,37 +2121,27 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ */ __pyx_v_self->id = ntohl(__pyx_v_self->_hdr->packet_id); - /* "netfilterqueue.pyx":63 + /* "netfilterqueue.pyx":62 * * self.id = ntohl(self._hdr.packet_id) * self.hw_protocol = ntohs(self._hdr.hw_protocol) # <<<<<<<<<<<<<< * self.hook = self._hdr.hook - * self.hw_addr = self._hw.hw_addr + * */ __pyx_v_self->hw_protocol = ntohs(__pyx_v_self->_hdr->hw_protocol); - /* "netfilterqueue.pyx":64 + /* "netfilterqueue.pyx":63 * self.id = ntohl(self._hdr.packet_id) * self.hw_protocol = ntohs(self._hdr.hw_protocol) * self.hook = self._hdr.hook # <<<<<<<<<<<<<< - * self.hw_addr = self._hw.hw_addr * + * self.payload_len = nfq_get_payload(self._nfa, &self.payload) */ __pyx_t_1 = __pyx_v_self->_hdr->hook; __pyx_v_self->hook = __pyx_t_1; /* "netfilterqueue.pyx":65 - * self.hw_protocol = ntohs(self._hdr.hw_protocol) * self.hook = self._hdr.hook - * self.hw_addr = self._hw.hw_addr # <<<<<<<<<<<<<< - * - * self.payload_len = nfq_get_payload(self._nfa, &self.payload) - */ - __pyx_t_2 = __pyx_v_self->_hw->hw_addr; - memcpy(&(__pyx_v_self->hw_addr[0]), __pyx_t_2, sizeof(__pyx_v_self->hw_addr[0]) * (8 - 0)); - - /* "netfilterqueue.pyx":67 - * self.hw_addr = self._hw.hw_addr * * self.payload_len = nfq_get_payload(self._nfa, &self.payload) # <<<<<<<<<<<<<< * if self.payload_len < 0: @@ -2169,30 +2149,30 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ */ __pyx_v_self->payload_len = nfq_get_payload(__pyx_v_self->_nfa, (&__pyx_v_self->payload)); - /* "netfilterqueue.pyx":68 + /* "netfilterqueue.pyx":66 * * self.payload_len = nfq_get_payload(self._nfa, &self.payload) * if self.payload_len < 0: # <<<<<<<<<<<<<< * raise OSError("Failed to get payload of packet.") * */ - __pyx_t_3 = ((__pyx_v_self->payload_len < 0) != 0); - if (__pyx_t_3) { + __pyx_t_2 = ((__pyx_v_self->payload_len < 0) != 0); + if (__pyx_t_2) { - /* "netfilterqueue.pyx":69 + /* "netfilterqueue.pyx":67 * self.payload_len = nfq_get_payload(self._nfa, &self.payload) * if self.payload_len < 0: * raise OSError("Failed to get payload of packet.") # <<<<<<<<<<<<<< * * nfq_get_timestamp(self._nfa, &self.timestamp) */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 67, __pyx_L1_error) - /* "netfilterqueue.pyx":68 + /* "netfilterqueue.pyx":66 * * self.payload_len = nfq_get_payload(self._nfa, &self.payload) * if self.payload_len < 0: # <<<<<<<<<<<<<< @@ -2201,7 +2181,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ */ } - /* "netfilterqueue.pyx":71 + /* "netfilterqueue.pyx":69 * raise OSError("Failed to get payload of packet.") * * nfq_get_timestamp(self._nfa, &self.timestamp) # <<<<<<<<<<<<<< @@ -2210,7 +2190,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ */ nfq_get_timestamp(__pyx_v_self->_nfa, (&__pyx_v_self->timestamp)); - /* "netfilterqueue.pyx":72 + /* "netfilterqueue.pyx":70 * * nfq_get_timestamp(self._nfa, &self.timestamp) * self.mark = nfq_get_nfmark(nfa) # <<<<<<<<<<<<<< @@ -2231,7 +2211,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netfilterqueue.Packet.set_nfq_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -2240,7 +2220,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_nfq_data(struct __pyx_obj_ return __pyx_r; } -/* "netfilterqueue.pyx":74 +/* "netfilterqueue.pyx":72 * self.mark = nfq_get_nfmark(nfa) * * cdef void verdict(self, u_int8_t verdict): # <<<<<<<<<<<<<< @@ -2258,7 +2238,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte unsigned char *__pyx_t_4; __Pyx_RefNannySetupContext("verdict", 0); - /* "netfilterqueue.pyx":76 + /* "netfilterqueue.pyx":74 * cdef void verdict(self, u_int8_t verdict): * """Call appropriate set_verdict... function on packet.""" * if self._verdict_is_set: # <<<<<<<<<<<<<< @@ -2268,20 +2248,20 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte __pyx_t_1 = (__pyx_v_self->_verdict_is_set != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":77 + /* "netfilterqueue.pyx":75 * """Call appropriate set_verdict... function on packet.""" * if self._verdict_is_set: * raise RuntimeWarning("Verdict already given for this packet.") # <<<<<<<<<<<<<< * * cdef u_int32_t modified_payload_len = 0 */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeWarning, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeWarning, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 77, __pyx_L1_error) + __PYX_ERR(0, 75, __pyx_L1_error) - /* "netfilterqueue.pyx":76 + /* "netfilterqueue.pyx":74 * cdef void verdict(self, u_int8_t verdict): * """Call appropriate set_verdict... function on packet.""" * if self._verdict_is_set: # <<<<<<<<<<<<<< @@ -2290,7 +2270,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte */ } - /* "netfilterqueue.pyx":79 + /* "netfilterqueue.pyx":77 * raise RuntimeWarning("Verdict already given for this packet.") * * cdef u_int32_t modified_payload_len = 0 # <<<<<<<<<<<<<< @@ -2299,7 +2279,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte */ __pyx_v_modified_payload_len = 0; - /* "netfilterqueue.pyx":80 + /* "netfilterqueue.pyx":78 * * cdef u_int32_t modified_payload_len = 0 * cdef unsigned char *modified_payload = NULL # <<<<<<<<<<<<<< @@ -2308,7 +2288,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte */ __pyx_v_modified_payload = NULL; - /* "netfilterqueue.pyx":81 + /* "netfilterqueue.pyx":79 * cdef u_int32_t modified_payload_len = 0 * cdef unsigned char *modified_payload = NULL * if self._given_payload: # <<<<<<<<<<<<<< @@ -2318,7 +2298,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte __pyx_t_1 = (__pyx_v_self->_given_payload != Py_None) && (PyBytes_GET_SIZE(__pyx_v_self->_given_payload) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":82 + /* "netfilterqueue.pyx":80 * cdef unsigned char *modified_payload = NULL * if self._given_payload: * modified_payload_len = len(self._given_payload) # <<<<<<<<<<<<<< @@ -2329,23 +2309,23 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 82, __pyx_L1_error) + __PYX_ERR(0, 80, __pyx_L1_error) } - __pyx_t_3 = PyBytes_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_3 = PyBytes_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_modified_payload_len = __pyx_t_3; - /* "netfilterqueue.pyx":83 + /* "netfilterqueue.pyx":81 * if self._given_payload: * modified_payload_len = len(self._given_payload) * modified_payload = self._given_payload # <<<<<<<<<<<<<< * if self._mark_is_set: * nfq_set_verdict2( */ - __pyx_t_4 = __Pyx_PyObject_AsUString(__pyx_v_self->_given_payload); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_AsUString(__pyx_v_self->_given_payload); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_v_modified_payload = __pyx_t_4; - /* "netfilterqueue.pyx":81 + /* "netfilterqueue.pyx":79 * cdef u_int32_t modified_payload_len = 0 * cdef unsigned char *modified_payload = NULL * if self._given_payload: # <<<<<<<<<<<<<< @@ -2354,7 +2334,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte */ } - /* "netfilterqueue.pyx":84 + /* "netfilterqueue.pyx":82 * modified_payload_len = len(self._given_payload) * modified_payload = self._given_payload * if self._mark_is_set: # <<<<<<<<<<<<<< @@ -2364,7 +2344,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte __pyx_t_1 = (__pyx_v_self->_mark_is_set != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":85 + /* "netfilterqueue.pyx":83 * modified_payload = self._given_payload * if self._mark_is_set: * nfq_set_verdict2( # <<<<<<<<<<<<<< @@ -2373,7 +2353,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte */ nfq_set_verdict2(__pyx_v_self->_qh, __pyx_v_self->id, __pyx_v_verdict, __pyx_v_self->_given_mark, __pyx_v_modified_payload_len, __pyx_v_modified_payload); - /* "netfilterqueue.pyx":84 + /* "netfilterqueue.pyx":82 * modified_payload_len = len(self._given_payload) * modified_payload = self._given_payload * if self._mark_is_set: # <<<<<<<<<<<<<< @@ -2383,7 +2363,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte goto __pyx_L5; } - /* "netfilterqueue.pyx":93 + /* "netfilterqueue.pyx":91 * modified_payload) * else: * nfq_set_verdict( # <<<<<<<<<<<<<< @@ -2392,7 +2372,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte */ /*else*/ { - /* "netfilterqueue.pyx":98 + /* "netfilterqueue.pyx":96 * verdict, * modified_payload_len, * modified_payload) # <<<<<<<<<<<<<< @@ -2403,7 +2383,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte } __pyx_L5:; - /* "netfilterqueue.pyx":100 + /* "netfilterqueue.pyx":98 * modified_payload) * * self._verdict_is_set = True # <<<<<<<<<<<<<< @@ -2412,7 +2392,7 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte */ __pyx_v_self->_verdict_is_set = 1; - /* "netfilterqueue.pyx":74 + /* "netfilterqueue.pyx":72 * self.mark = nfq_get_nfmark(nfa) * * cdef void verdict(self, u_int8_t verdict): # <<<<<<<<<<<<<< @@ -2429,12 +2409,12 @@ static void __pyx_f_14netfilterqueue_6Packet_verdict(struct __pyx_obj_14netfilte __Pyx_RefNannyFinishContext(); } -/* "netfilterqueue.pyx":102 +/* "netfilterqueue.pyx":100 * self._verdict_is_set = True * * def get_hw(self): # <<<<<<<<<<<<<< * """Return the hardware address as Python string.""" - * cdef object py_string + * self._hw = nfq_get_packet_hw(self._nfa) */ /* Python wrapper */ @@ -2456,11 +2436,62 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_4get_hw(struct __pyx_obj_14ne PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; + u_int8_t *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_hw", 0); - /* "netfilterqueue.pyx":105 + /* "netfilterqueue.pyx":102 + * def get_hw(self): * """Return the hardware address as Python string.""" + * self._hw = nfq_get_packet_hw(self._nfa) # <<<<<<<<<<<<<< + * if self._hw == NULL: + * # nfq_get_packet_hw doesn't work on OUTPUT and PREROUTING chains + */ + __pyx_v_self->_hw = nfq_get_packet_hw(__pyx_v_self->_nfa); + + /* "netfilterqueue.pyx":103 + * """Return the hardware address as Python string.""" + * self._hw = nfq_get_packet_hw(self._nfa) + * if self._hw == NULL: # <<<<<<<<<<<<<< + * # nfq_get_packet_hw doesn't work on OUTPUT and PREROUTING chains + * return None + */ + __pyx_t_1 = ((__pyx_v_self->_hw == NULL) != 0); + if (__pyx_t_1) { + + /* "netfilterqueue.pyx":105 + * if self._hw == NULL: + * # nfq_get_packet_hw doesn't work on OUTPUT and PREROUTING chains + * return None # <<<<<<<<<<<<<< + * self.hw_addr = self._hw.hw_addr + * cdef object py_string + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "netfilterqueue.pyx":103 + * """Return the hardware address as Python string.""" + * self._hw = nfq_get_packet_hw(self._nfa) + * if self._hw == NULL: # <<<<<<<<<<<<<< + * # nfq_get_packet_hw doesn't work on OUTPUT and PREROUTING chains + * return None + */ + } + + /* "netfilterqueue.pyx":106 + * # nfq_get_packet_hw doesn't work on OUTPUT and PREROUTING chains + * return None + * self.hw_addr = self._hw.hw_addr # <<<<<<<<<<<<<< + * cdef object py_string + * if cpython.version.PY_MAJOR_VERSION >= 3: + */ + __pyx_t_2 = __pyx_v_self->_hw->hw_addr; + memcpy(&(__pyx_v_self->hw_addr[0]), __pyx_t_2, sizeof(__pyx_v_self->hw_addr[0]) * (8 - 0)); + + /* "netfilterqueue.pyx":108 + * self.hw_addr = self._hw.hw_addr * cdef object py_string * if cpython.version.PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<< * py_string = PyBytes_FromStringAndSize(self.hw_addr, 8) @@ -2469,29 +2500,29 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_4get_hw(struct __pyx_obj_14ne __pyx_t_1 = ((PY_MAJOR_VERSION >= 3) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":106 + /* "netfilterqueue.pyx":109 * cdef object py_string * if cpython.version.PY_MAJOR_VERSION >= 3: * py_string = PyBytes_FromStringAndSize(self.hw_addr, 8) # <<<<<<<<<<<<<< * else: * py_string = PyString_FromStringAndSize(self.hw_addr, 8) */ - __pyx_t_2 = PyBytes_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_py_string = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = PyBytes_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_py_string = __pyx_t_3; + __pyx_t_3 = 0; - /* "netfilterqueue.pyx":105 - * """Return the hardware address as Python string.""" + /* "netfilterqueue.pyx":108 + * self.hw_addr = self._hw.hw_addr * cdef object py_string * if cpython.version.PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<< * py_string = PyBytes_FromStringAndSize(self.hw_addr, 8) * else: */ - goto __pyx_L3; + goto __pyx_L4; } - /* "netfilterqueue.pyx":108 + /* "netfilterqueue.pyx":111 * py_string = PyBytes_FromStringAndSize(self.hw_addr, 8) * else: * py_string = PyString_FromStringAndSize(self.hw_addr, 8) # <<<<<<<<<<<<<< @@ -2499,14 +2530,14 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_4get_hw(struct __pyx_obj_14ne * */ /*else*/ { - __pyx_t_2 = PyString_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_py_string = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = PyString_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_py_string = __pyx_t_3; + __pyx_t_3 = 0; } - __pyx_L3:; + __pyx_L4:; - /* "netfilterqueue.pyx":109 + /* "netfilterqueue.pyx":112 * else: * py_string = PyString_FromStringAndSize(self.hw_addr, 8) * return py_string # <<<<<<<<<<<<<< @@ -2518,17 +2549,17 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_4get_hw(struct __pyx_obj_14ne __pyx_r = __pyx_v_py_string; goto __pyx_L0; - /* "netfilterqueue.pyx":102 + /* "netfilterqueue.pyx":100 * self._verdict_is_set = True * * def get_hw(self): # <<<<<<<<<<<<<< * """Return the hardware address as Python string.""" - * cdef object py_string + * self._hw = nfq_get_packet_hw(self._nfa) */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netfilterqueue.Packet.get_hw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2538,7 +2569,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_4get_hw(struct __pyx_obj_14ne return __pyx_r; } -/* "netfilterqueue.pyx":111 +/* "netfilterqueue.pyx":114 * return py_string * * def get_payload(self): # <<<<<<<<<<<<<< @@ -2567,19 +2598,19 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_6get_payload(struct __pyx_obj PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_payload", 0); - /* "netfilterqueue.pyx":114 + /* "netfilterqueue.pyx":117 * """Return payload as Python string.""" * cdef object py_string * py_string = self.payload[:self.payload_len] # <<<<<<<<<<<<<< * return py_string * */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_self->payload + 0, __pyx_v_self->payload_len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_self->payload + 0, __pyx_v_self->payload_len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_py_string = __pyx_t_1; __pyx_t_1 = 0; - /* "netfilterqueue.pyx":115 + /* "netfilterqueue.pyx":118 * cdef object py_string * py_string = self.payload[:self.payload_len] * return py_string # <<<<<<<<<<<<<< @@ -2591,7 +2622,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_6get_payload(struct __pyx_obj __pyx_r = __pyx_v_py_string; goto __pyx_L0; - /* "netfilterqueue.pyx":111 + /* "netfilterqueue.pyx":114 * return py_string * * def get_payload(self): # <<<<<<<<<<<<<< @@ -2611,7 +2642,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_6get_payload(struct __pyx_obj return __pyx_r; } -/* "netfilterqueue.pyx":117 +/* "netfilterqueue.pyx":120 * return py_string * * cpdef Py_ssize_t get_payload_len(self): # <<<<<<<<<<<<<< @@ -2633,7 +2664,7 @@ static Py_ssize_t __pyx_f_14netfilterqueue_6Packet_get_payload_len(struct __pyx_ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_payload_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_payload_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_9get_payload_len)) { __Pyx_INCREF(__pyx_t_1); @@ -2648,14 +2679,14 @@ static Py_ssize_t __pyx_f_14netfilterqueue_6Packet_get_payload_len(struct __pyx_ } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2664,7 +2695,7 @@ static Py_ssize_t __pyx_f_14netfilterqueue_6Packet_get_payload_len(struct __pyx_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":118 + /* "netfilterqueue.pyx":121 * * cpdef Py_ssize_t get_payload_len(self): * return self.payload_len # <<<<<<<<<<<<<< @@ -2674,7 +2705,7 @@ static Py_ssize_t __pyx_f_14netfilterqueue_6Packet_get_payload_len(struct __pyx_ __pyx_r = __pyx_v_self->payload_len; goto __pyx_L0; - /* "netfilterqueue.pyx":117 + /* "netfilterqueue.pyx":120 * return py_string * * cpdef Py_ssize_t get_payload_len(self): # <<<<<<<<<<<<<< @@ -2714,7 +2745,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_8get_payload_len(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_payload_len", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_14netfilterqueue_6Packet_get_payload_len(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_14netfilterqueue_6Packet_get_payload_len(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2731,7 +2762,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_8get_payload_len(struct __pyx return __pyx_r; } -/* "netfilterqueue.pyx":120 +/* "netfilterqueue.pyx":123 * return self.payload_len * * cpdef double get_timestamp(self): # <<<<<<<<<<<<<< @@ -2753,7 +2784,7 @@ static double __pyx_f_14netfilterqueue_6Packet_get_timestamp(struct __pyx_obj_14 if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_11get_timestamp)) { __Pyx_INCREF(__pyx_t_1); @@ -2768,14 +2799,14 @@ static double __pyx_f_14netfilterqueue_6Packet_get_timestamp(struct __pyx_obj_14 } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2784,7 +2815,7 @@ static double __pyx_f_14netfilterqueue_6Packet_get_timestamp(struct __pyx_obj_14 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":121 + /* "netfilterqueue.pyx":124 * * cpdef double get_timestamp(self): * return self.timestamp.tv_sec + (self.timestamp.tv_usec/1000000.0) # <<<<<<<<<<<<<< @@ -2794,7 +2825,7 @@ static double __pyx_f_14netfilterqueue_6Packet_get_timestamp(struct __pyx_obj_14 __pyx_r = (__pyx_v_self->timestamp.tv_sec + (__pyx_v_self->timestamp.tv_usec / 1000000.0)); goto __pyx_L0; - /* "netfilterqueue.pyx":120 + /* "netfilterqueue.pyx":123 * return self.payload_len * * cpdef double get_timestamp(self): # <<<<<<<<<<<<<< @@ -2834,7 +2865,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_10get_timestamp(struct __pyx_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_timestamp", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_f_14netfilterqueue_6Packet_get_timestamp(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_f_14netfilterqueue_6Packet_get_timestamp(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2851,7 +2882,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_10get_timestamp(struct __pyx_ return __pyx_r; } -/* "netfilterqueue.pyx":123 +/* "netfilterqueue.pyx":126 * return self.timestamp.tv_sec + (self.timestamp.tv_usec/1000000.0) * * cpdef set_payload(self, bytes payload): # <<<<<<<<<<<<<< @@ -2873,7 +2904,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_payload(struct __pyx_obj_1 if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_payload); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_payload); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_13set_payload)) { __Pyx_XDECREF(__pyx_r); @@ -2889,13 +2920,13 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_payload(struct __pyx_obj_1 } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_payload); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_payload); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_payload}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -2903,19 +2934,19 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_payload(struct __pyx_obj_1 #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_payload}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_payload); __Pyx_GIVEREF(__pyx_v_payload); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_payload); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -2929,7 +2960,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_payload(struct __pyx_obj_1 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":125 + /* "netfilterqueue.pyx":128 * cpdef set_payload(self, bytes payload): * """Set the new payload of this packet.""" * self._given_payload = payload # <<<<<<<<<<<<<< @@ -2942,7 +2973,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_payload(struct __pyx_obj_1 __Pyx_DECREF(__pyx_v_self->_given_payload); __pyx_v_self->_given_payload = __pyx_v_payload; - /* "netfilterqueue.pyx":123 + /* "netfilterqueue.pyx":126 * return self.timestamp.tv_sec + (self.timestamp.tv_usec/1000000.0) * * cpdef set_payload(self, bytes payload): # <<<<<<<<<<<<<< @@ -2974,7 +3005,7 @@ static PyObject *__pyx_pw_14netfilterqueue_6Packet_13set_payload(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_payload (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload), (&PyBytes_Type), 1, "payload", 1))) __PYX_ERR(0, 123, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload), (&PyBytes_Type), 1, "payload", 1))) __PYX_ERR(0, 126, __pyx_L1_error) __pyx_r = __pyx_pf_14netfilterqueue_6Packet_12set_payload(((struct __pyx_obj_14netfilterqueue_Packet *)__pyx_v_self), ((PyObject*)__pyx_v_payload)); /* function exit code */ @@ -2992,7 +3023,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_12set_payload(struct __pyx_ob PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("set_payload", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_set_payload(__pyx_v_self, __pyx_v_payload, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_set_payload(__pyx_v_self, __pyx_v_payload, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3009,7 +3040,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_12set_payload(struct __pyx_ob return __pyx_r; } -/* "netfilterqueue.pyx":127 +/* "netfilterqueue.pyx":130 * self._given_payload = payload * * cpdef set_mark(self, u_int32_t mark): # <<<<<<<<<<<<<< @@ -3032,11 +3063,11 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_mark(struct __pyx_obj_14ne if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_15set_mark)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_u_int32_t(__pyx_v_mark); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_u_int32_t(__pyx_v_mark); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; @@ -3050,14 +3081,14 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_mark(struct __pyx_obj_14ne } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3066,20 +3097,20 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_mark(struct __pyx_obj_14ne #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -3093,7 +3124,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_mark(struct __pyx_obj_14ne __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":128 + /* "netfilterqueue.pyx":131 * * cpdef set_mark(self, u_int32_t mark): * self._given_mark = mark # <<<<<<<<<<<<<< @@ -3102,7 +3133,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_mark(struct __pyx_obj_14ne */ __pyx_v_self->_given_mark = __pyx_v_mark; - /* "netfilterqueue.pyx":129 + /* "netfilterqueue.pyx":132 * cpdef set_mark(self, u_int32_t mark): * self._given_mark = mark * self._mark_is_set = True # <<<<<<<<<<<<<< @@ -3111,7 +3142,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_set_mark(struct __pyx_obj_14ne */ __pyx_v_self->_mark_is_set = 1; - /* "netfilterqueue.pyx":127 + /* "netfilterqueue.pyx":130 * self._given_payload = payload * * cpdef set_mark(self, u_int32_t mark): # <<<<<<<<<<<<<< @@ -3145,7 +3176,7 @@ static PyObject *__pyx_pw_14netfilterqueue_6Packet_15set_mark(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mark (wrapper)", 0); assert(__pyx_arg_mark); { - __pyx_v_mark = __Pyx_PyInt_As_u_int32_t(__pyx_arg_mark); if (unlikely((__pyx_v_mark == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error) + __pyx_v_mark = __Pyx_PyInt_As_u_int32_t(__pyx_arg_mark); if (unlikely((__pyx_v_mark == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3166,7 +3197,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_14set_mark(struct __pyx_obj_1 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("set_mark", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_set_mark(__pyx_v_self, __pyx_v_mark, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_set_mark(__pyx_v_self, __pyx_v_mark, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3183,7 +3214,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_14set_mark(struct __pyx_obj_1 return __pyx_r; } -/* "netfilterqueue.pyx":131 +/* "netfilterqueue.pyx":134 * self._mark_is_set = True * * cpdef get_mark(self): # <<<<<<<<<<<<<< @@ -3205,7 +3236,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_get_mark(struct __pyx_obj_14ne if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_17get_mark)) { __Pyx_XDECREF(__pyx_r); @@ -3221,10 +3252,10 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_get_mark(struct __pyx_obj_14ne } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3236,7 +3267,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_get_mark(struct __pyx_obj_14ne __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":132 + /* "netfilterqueue.pyx":135 * * cpdef get_mark(self): * if self._mark_is_set: # <<<<<<<<<<<<<< @@ -3246,7 +3277,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_get_mark(struct __pyx_obj_14ne __pyx_t_5 = (__pyx_v_self->_mark_is_set != 0); if (__pyx_t_5) { - /* "netfilterqueue.pyx":133 + /* "netfilterqueue.pyx":136 * cpdef get_mark(self): * if self._mark_is_set: * return self._given_mark # <<<<<<<<<<<<<< @@ -3254,13 +3285,13 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_get_mark(struct __pyx_obj_14ne * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_u_int32_t(__pyx_v_self->_given_mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_u_int32_t(__pyx_v_self->_given_mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "netfilterqueue.pyx":132 + /* "netfilterqueue.pyx":135 * * cpdef get_mark(self): * if self._mark_is_set: # <<<<<<<<<<<<<< @@ -3269,7 +3300,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_get_mark(struct __pyx_obj_14ne */ } - /* "netfilterqueue.pyx":134 + /* "netfilterqueue.pyx":137 * if self._mark_is_set: * return self._given_mark * return self.mark # <<<<<<<<<<<<<< @@ -3277,13 +3308,13 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_get_mark(struct __pyx_obj_14ne * cpdef accept(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_u_int32_t(__pyx_v_self->mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_u_int32_t(__pyx_v_self->mark); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "netfilterqueue.pyx":131 + /* "netfilterqueue.pyx":134 * self._mark_is_set = True * * cpdef get_mark(self): # <<<<<<<<<<<<<< @@ -3324,7 +3355,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_16get_mark(struct __pyx_obj_1 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_mark", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_get_mark(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_get_mark(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3341,7 +3372,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_16get_mark(struct __pyx_obj_1 return __pyx_r; } -/* "netfilterqueue.pyx":136 +/* "netfilterqueue.pyx":139 * return self.mark * * cpdef accept(self): # <<<<<<<<<<<<<< @@ -3362,7 +3393,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_accept(struct __pyx_obj_14netf if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_accept); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_accept); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_19accept)) { __Pyx_XDECREF(__pyx_r); @@ -3378,10 +3409,10 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_accept(struct __pyx_obj_14netf } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3393,7 +3424,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_accept(struct __pyx_obj_14netf __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":138 + /* "netfilterqueue.pyx":141 * cpdef accept(self): * """Accept the packet.""" * self.verdict(NF_ACCEPT) # <<<<<<<<<<<<<< @@ -3402,7 +3433,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_accept(struct __pyx_obj_14netf */ ((struct __pyx_vtabstruct_14netfilterqueue_Packet *)__pyx_v_self->__pyx_vtab)->verdict(__pyx_v_self, __pyx_e_14netfilterqueue_NF_ACCEPT); - /* "netfilterqueue.pyx":136 + /* "netfilterqueue.pyx":139 * return self.mark * * cpdef accept(self): # <<<<<<<<<<<<<< @@ -3446,7 +3477,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_18accept(struct __pyx_obj_14n PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("accept", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_accept(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_accept(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3463,7 +3494,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_18accept(struct __pyx_obj_14n return __pyx_r; } -/* "netfilterqueue.pyx":140 +/* "netfilterqueue.pyx":143 * self.verdict(NF_ACCEPT) * * cpdef drop(self): # <<<<<<<<<<<<<< @@ -3484,7 +3515,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_drop(struct __pyx_obj_14netfil if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_drop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_drop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_21drop)) { __Pyx_XDECREF(__pyx_r); @@ -3500,10 +3531,10 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_drop(struct __pyx_obj_14netfil } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3515,7 +3546,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_drop(struct __pyx_obj_14netfil __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":142 + /* "netfilterqueue.pyx":145 * cpdef drop(self): * """Drop the packet.""" * self.verdict(NF_DROP) # <<<<<<<<<<<<<< @@ -3524,7 +3555,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_drop(struct __pyx_obj_14netfil */ ((struct __pyx_vtabstruct_14netfilterqueue_Packet *)__pyx_v_self->__pyx_vtab)->verdict(__pyx_v_self, __pyx_e_14netfilterqueue_NF_DROP); - /* "netfilterqueue.pyx":140 + /* "netfilterqueue.pyx":143 * self.verdict(NF_ACCEPT) * * cpdef drop(self): # <<<<<<<<<<<<<< @@ -3568,7 +3599,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_20drop(struct __pyx_obj_14net PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("drop", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_drop(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_drop(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3585,7 +3616,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_20drop(struct __pyx_obj_14net return __pyx_r; } -/* "netfilterqueue.pyx":144 +/* "netfilterqueue.pyx":147 * self.verdict(NF_DROP) * * cpdef repeat(self): # <<<<<<<<<<<<<< @@ -3606,7 +3637,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_repeat(struct __pyx_obj_14netf if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_repeat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_repeat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_14netfilterqueue_6Packet_23repeat)) { __Pyx_XDECREF(__pyx_r); @@ -3622,10 +3653,10 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_repeat(struct __pyx_obj_14netf } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3637,7 +3668,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_repeat(struct __pyx_obj_14netf __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "netfilterqueue.pyx":146 + /* "netfilterqueue.pyx":149 * cpdef repeat(self): * """Repeat the packet.""" * self.verdict(NF_REPEAT) # <<<<<<<<<<<<<< @@ -3646,7 +3677,7 @@ static PyObject *__pyx_f_14netfilterqueue_6Packet_repeat(struct __pyx_obj_14netf */ ((struct __pyx_vtabstruct_14netfilterqueue_Packet *)__pyx_v_self->__pyx_vtab)->verdict(__pyx_v_self, __pyx_e_14netfilterqueue_NF_REPEAT); - /* "netfilterqueue.pyx":144 + /* "netfilterqueue.pyx":147 * self.verdict(NF_DROP) * * cpdef repeat(self): # <<<<<<<<<<<<<< @@ -3690,7 +3721,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_22repeat(struct __pyx_obj_14n PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("repeat", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_repeat(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __pyx_f_14netfilterqueue_6Packet_repeat(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3927,7 +3958,7 @@ static PyObject *__pyx_pf_14netfilterqueue_6Packet_7payload___get__(struct __pyx return __pyx_r; } -/* "netfilterqueue.pyx":150 +/* "netfilterqueue.pyx":153 * cdef class NetfilterQueue: * """Handle a single numbered queue.""" * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -3966,23 +3997,23 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj int __pyx_t_4; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "netfilterqueue.pyx":151 + /* "netfilterqueue.pyx":154 * """Handle a single numbered queue.""" * def __cinit__(self, *args, **kwargs): * self.af = kwargs.get("af", PF_INET) # <<<<<<<<<<<<<< * * self.h = nfq_open() */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_PF_INET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_PF_INET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_af, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_af, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_u_int16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((u_int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_u_int16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((u_int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->af = __pyx_t_3; - /* "netfilterqueue.pyx":153 + /* "netfilterqueue.pyx":156 * self.af = kwargs.get("af", PF_INET) * * self.h = nfq_open() # <<<<<<<<<<<<<< @@ -3991,7 +4022,7 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj */ __pyx_v_self->h = nfq_open(); - /* "netfilterqueue.pyx":154 + /* "netfilterqueue.pyx":157 * * self.h = nfq_open() * if self.h == NULL: # <<<<<<<<<<<<<< @@ -4001,20 +4032,20 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj __pyx_t_4 = ((__pyx_v_self->h == NULL) != 0); if (__pyx_t_4) { - /* "netfilterqueue.pyx":155 + /* "netfilterqueue.pyx":158 * self.h = nfq_open() * if self.h == NULL: * raise OSError("Failed to open NFQueue.") # <<<<<<<<<<<<<< * nfq_unbind_pf(self.h, self.af) # This does NOT kick out previous * # running queues */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 155, __pyx_L1_error) + __PYX_ERR(0, 158, __pyx_L1_error) - /* "netfilterqueue.pyx":154 + /* "netfilterqueue.pyx":157 * * self.h = nfq_open() * if self.h == NULL: # <<<<<<<<<<<<<< @@ -4023,7 +4054,7 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj */ } - /* "netfilterqueue.pyx":156 + /* "netfilterqueue.pyx":159 * if self.h == NULL: * raise OSError("Failed to open NFQueue.") * nfq_unbind_pf(self.h, self.af) # This does NOT kick out previous # <<<<<<<<<<<<<< @@ -4032,7 +4063,7 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj */ nfq_unbind_pf(__pyx_v_self->h, __pyx_v_self->af); - /* "netfilterqueue.pyx":158 + /* "netfilterqueue.pyx":161 * nfq_unbind_pf(self.h, self.af) # This does NOT kick out previous * # running queues * if nfq_bind_pf(self.h, self.af) < 0: # <<<<<<<<<<<<<< @@ -4042,31 +4073,31 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj __pyx_t_4 = ((nfq_bind_pf(__pyx_v_self->h, __pyx_v_self->af) < 0) != 0); if (__pyx_t_4) { - /* "netfilterqueue.pyx":159 + /* "netfilterqueue.pyx":162 * # running queues * if nfq_bind_pf(self.h, self.af) < 0: * raise OSError("Failed to bind family %s. Are you root?" % self.af) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_t_2 = __Pyx_PyInt_From_u_int16_t(__pyx_v_self->af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_u_int16_t(__pyx_v_self->af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_bind_family_s_Are_you, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_bind_family_s_Are_you, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 159, __pyx_L1_error) + __PYX_ERR(0, 162, __pyx_L1_error) - /* "netfilterqueue.pyx":158 + /* "netfilterqueue.pyx":161 * nfq_unbind_pf(self.h, self.af) # This does NOT kick out previous * # running queues * if nfq_bind_pf(self.h, self.af) < 0: # <<<<<<<<<<<<<< @@ -4075,7 +4106,7 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj */ } - /* "netfilterqueue.pyx":150 + /* "netfilterqueue.pyx":153 * cdef class NetfilterQueue: * """Handle a single numbered queue.""" * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4096,7 +4127,7 @@ static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj return __pyx_r; } -/* "netfilterqueue.pyx":161 +/* "netfilterqueue.pyx":164 * raise OSError("Failed to bind family %s. Are you root?" % self.af) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -4120,7 +4151,7 @@ static void __pyx_pf_14netfilterqueue_14NetfilterQueue_2__dealloc__(struct __pyx int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "netfilterqueue.pyx":162 + /* "netfilterqueue.pyx":165 * * def __dealloc__(self): * if self.qh != NULL: # <<<<<<<<<<<<<< @@ -4130,7 +4161,7 @@ static void __pyx_pf_14netfilterqueue_14NetfilterQueue_2__dealloc__(struct __pyx __pyx_t_1 = ((__pyx_v_self->qh != NULL) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":163 + /* "netfilterqueue.pyx":166 * def __dealloc__(self): * if self.qh != NULL: * nfq_destroy_queue(self.qh) # <<<<<<<<<<<<<< @@ -4139,7 +4170,7 @@ static void __pyx_pf_14netfilterqueue_14NetfilterQueue_2__dealloc__(struct __pyx */ nfq_destroy_queue(__pyx_v_self->qh); - /* "netfilterqueue.pyx":162 + /* "netfilterqueue.pyx":165 * * def __dealloc__(self): * if self.qh != NULL: # <<<<<<<<<<<<<< @@ -4148,7 +4179,7 @@ static void __pyx_pf_14netfilterqueue_14NetfilterQueue_2__dealloc__(struct __pyx */ } - /* "netfilterqueue.pyx":166 + /* "netfilterqueue.pyx":169 * # Don't call nfq_unbind_pf unless you want to disconnect any other * # processes using this libnetfilter_queue on this protocol family! * nfq_close(self.h) # <<<<<<<<<<<<<< @@ -4157,7 +4188,7 @@ static void __pyx_pf_14netfilterqueue_14NetfilterQueue_2__dealloc__(struct __pyx */ nfq_close(__pyx_v_self->h); - /* "netfilterqueue.pyx":161 + /* "netfilterqueue.pyx":164 * raise OSError("Failed to bind family %s. Are you root?" % self.af) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -4169,7 +4200,7 @@ static void __pyx_pf_14netfilterqueue_14NetfilterQueue_2__dealloc__(struct __pyx __Pyx_RefNannyFinishContext(); } -/* "netfilterqueue.pyx":168 +/* "netfilterqueue.pyx":171 * nfq_close(self.h) * * def bind(self, int queue_num, object user_callback, # <<<<<<<<<<<<<< @@ -4214,7 +4245,7 @@ static PyObject *__pyx_pw_14netfilterqueue_14NetfilterQueue_5bind(PyObject *__py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_user_callback)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bind", 0, 2, 6, 1); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bind", 0, 2, 6, 1); __PYX_ERR(0, 171, __pyx_L3_error) } case 2: if (kw_args > 0) { @@ -4238,7 +4269,7 @@ static PyObject *__pyx_pw_14netfilterqueue_14NetfilterQueue_5bind(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bind") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bind") < 0)) __PYX_ERR(0, 171, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4252,32 +4283,32 @@ static PyObject *__pyx_pw_14netfilterqueue_14NetfilterQueue_5bind(PyObject *__py default: goto __pyx_L5_argtuple_error; } } - __pyx_v_queue_num = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_queue_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error) + __pyx_v_queue_num = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_queue_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L3_error) __pyx_v_user_callback = values[1]; if (values[2]) { - __pyx_v_max_len = __Pyx_PyInt_As_u_int32_t(values[2]); if (unlikely((__pyx_v_max_len == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L3_error) + __pyx_v_max_len = __Pyx_PyInt_As_u_int32_t(values[2]); if (unlikely((__pyx_v_max_len == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error) } else { __pyx_v_max_len = ((u_int32_t)0x400); } if (values[3]) { - __pyx_v_mode = __Pyx_PyInt_As_u_int8_t(values[3]); if (unlikely((__pyx_v_mode == ((u_int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_u_int8_t(values[3]); if (unlikely((__pyx_v_mode == ((u_int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) } else { __pyx_v_mode = __pyx_k__4; } if (values[4]) { - __pyx_v_range = __Pyx_PyInt_As_u_int32_t(values[4]); if (unlikely((__pyx_v_range == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L3_error) + __pyx_v_range = __Pyx_PyInt_As_u_int32_t(values[4]); if (unlikely((__pyx_v_range == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) } else { __pyx_v_range = ((u_int32_t)0xFFFF); } if (values[5]) { - __pyx_v_sock_len = __Pyx_PyInt_As_u_int32_t(values[5]); if (unlikely((__pyx_v_sock_len == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error) + __pyx_v_sock_len = __Pyx_PyInt_As_u_int32_t(values[5]); if (unlikely((__pyx_v_sock_len == ((u_int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) } else { __pyx_v_sock_len = ((u_int32_t)0x257800); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("bind", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bind", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("netfilterqueue.NetfilterQueue.bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4300,7 +4331,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("bind", 0); - /* "netfilterqueue.pyx":175 + /* "netfilterqueue.pyx":178 * """Create and bind to a new queue.""" * cdef unsigned int newsiz * self.user_callback = user_callback # <<<<<<<<<<<<<< @@ -4313,7 +4344,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o __Pyx_DECREF(__pyx_v_self->user_callback); __pyx_v_self->user_callback = __pyx_v_user_callback; - /* "netfilterqueue.pyx":176 + /* "netfilterqueue.pyx":179 * cdef unsigned int newsiz * self.user_callback = user_callback * self.qh = nfq_create_queue(self.h, queue_num, # <<<<<<<<<<<<<< @@ -4322,7 +4353,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ __pyx_v_self->qh = nfq_create_queue(__pyx_v_self->h, __pyx_v_queue_num, ((nfq_callback *)__pyx_f_14netfilterqueue_global_callback), ((void *)__pyx_v_self)); - /* "netfilterqueue.pyx":178 + /* "netfilterqueue.pyx":181 * self.qh = nfq_create_queue(self.h, queue_num, * global_callback, self) * if self.qh == NULL: # <<<<<<<<<<<<<< @@ -4332,31 +4363,31 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o __pyx_t_1 = ((__pyx_v_self->qh == NULL) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":179 + /* "netfilterqueue.pyx":182 * global_callback, self) * if self.qh == NULL: * raise OSError("Failed to create queue %s." % queue_num) # <<<<<<<<<<<<<< * * if range > MaxCopySize: */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_queue_num); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_queue_num); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_create_queue_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_create_queue_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 179, __pyx_L1_error) + __PYX_ERR(0, 182, __pyx_L1_error) - /* "netfilterqueue.pyx":178 + /* "netfilterqueue.pyx":181 * self.qh = nfq_create_queue(self.h, queue_num, * global_callback, self) * if self.qh == NULL: # <<<<<<<<<<<<<< @@ -4365,7 +4396,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ } - /* "netfilterqueue.pyx":181 + /* "netfilterqueue.pyx":184 * raise OSError("Failed to create queue %s." % queue_num) * * if range > MaxCopySize: # <<<<<<<<<<<<<< @@ -4375,7 +4406,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o __pyx_t_1 = ((__pyx_v_range > 0xFB0) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":182 + /* "netfilterqueue.pyx":185 * * if range > MaxCopySize: * range = MaxCopySize # <<<<<<<<<<<<<< @@ -4384,7 +4415,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ __pyx_v_range = 0xFB0; - /* "netfilterqueue.pyx":181 + /* "netfilterqueue.pyx":184 * raise OSError("Failed to create queue %s." % queue_num) * * if range > MaxCopySize: # <<<<<<<<<<<<<< @@ -4393,7 +4424,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ } - /* "netfilterqueue.pyx":183 + /* "netfilterqueue.pyx":186 * if range > MaxCopySize: * range = MaxCopySize * if nfq_set_mode(self.qh, mode, range) < 0: # <<<<<<<<<<<<<< @@ -4403,20 +4434,20 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o __pyx_t_1 = ((nfq_set_mode(__pyx_v_self->qh, __pyx_v_mode, __pyx_v_range) < 0) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":184 + /* "netfilterqueue.pyx":187 * range = MaxCopySize * if nfq_set_mode(self.qh, mode, range) < 0: * raise OSError("Failed to set packet copy mode.") # <<<<<<<<<<<<<< * * nfq_set_queue_maxlen(self.qh, max_len) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 184, __pyx_L1_error) + __PYX_ERR(0, 187, __pyx_L1_error) - /* "netfilterqueue.pyx":183 + /* "netfilterqueue.pyx":186 * if range > MaxCopySize: * range = MaxCopySize * if nfq_set_mode(self.qh, mode, range) < 0: # <<<<<<<<<<<<<< @@ -4425,7 +4456,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ } - /* "netfilterqueue.pyx":186 + /* "netfilterqueue.pyx":189 * raise OSError("Failed to set packet copy mode.") * * nfq_set_queue_maxlen(self.qh, max_len) # <<<<<<<<<<<<<< @@ -4434,7 +4465,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ nfq_set_queue_maxlen(__pyx_v_self->qh, __pyx_v_max_len); - /* "netfilterqueue.pyx":188 + /* "netfilterqueue.pyx":191 * nfq_set_queue_maxlen(self.qh, max_len) * * newsiz = nfnl_rcvbufsiz(nfq_nfnlh(self.h),sock_len) # <<<<<<<<<<<<<< @@ -4443,7 +4474,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ __pyx_v_newsiz = nfnl_rcvbufsiz(nfq_nfnlh(__pyx_v_self->h), __pyx_v_sock_len); - /* "netfilterqueue.pyx":189 + /* "netfilterqueue.pyx":192 * * newsiz = nfnl_rcvbufsiz(nfq_nfnlh(self.h),sock_len) * if newsiz != sock_len*2: # <<<<<<<<<<<<<< @@ -4453,18 +4484,18 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o __pyx_t_1 = ((__pyx_v_newsiz != (__pyx_v_sock_len * 2)) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":190 + /* "netfilterqueue.pyx":193 * newsiz = nfnl_rcvbufsiz(nfq_nfnlh(self.h),sock_len) * if newsiz != sock_len*2: * raise RuntimeWarning("Socket rcvbuf limit is now %d, requested %d." % (newsiz,sock_len)) # <<<<<<<<<<<<<< * * def unbind(self): */ - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_newsiz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_newsiz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_From_u_int32_t(__pyx_v_sock_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_u_int32_t(__pyx_v_sock_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); @@ -4472,22 +4503,22 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Socket_rcvbuf_limit_is_now_d_req, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Socket_rcvbuf_limit_is_now_d_req, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeWarning, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeWarning, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 190, __pyx_L1_error) + __PYX_ERR(0, 193, __pyx_L1_error) - /* "netfilterqueue.pyx":189 + /* "netfilterqueue.pyx":192 * * newsiz = nfnl_rcvbufsiz(nfq_nfnlh(self.h),sock_len) * if newsiz != sock_len*2: # <<<<<<<<<<<<<< @@ -4496,7 +4527,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o */ } - /* "netfilterqueue.pyx":168 + /* "netfilterqueue.pyx":171 * nfq_close(self.h) * * def bind(self, int queue_num, object user_callback, # <<<<<<<<<<<<<< @@ -4519,7 +4550,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_o return __pyx_r; } -/* "netfilterqueue.pyx":192 +/* "netfilterqueue.pyx":195 * raise RuntimeWarning("Socket rcvbuf limit is now %d, requested %d." % (newsiz,sock_len)) * * def unbind(self): # <<<<<<<<<<<<<< @@ -4547,7 +4578,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_6unbind(struct __pyx int __pyx_t_1; __Pyx_RefNannySetupContext("unbind", 0); - /* "netfilterqueue.pyx":194 + /* "netfilterqueue.pyx":197 * def unbind(self): * """Destroy the queue.""" * if self.qh != NULL: # <<<<<<<<<<<<<< @@ -4557,7 +4588,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_6unbind(struct __pyx __pyx_t_1 = ((__pyx_v_self->qh != NULL) != 0); if (__pyx_t_1) { - /* "netfilterqueue.pyx":195 + /* "netfilterqueue.pyx":198 * """Destroy the queue.""" * if self.qh != NULL: * nfq_destroy_queue(self.qh) # <<<<<<<<<<<<<< @@ -4566,7 +4597,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_6unbind(struct __pyx */ nfq_destroy_queue(__pyx_v_self->qh); - /* "netfilterqueue.pyx":194 + /* "netfilterqueue.pyx":197 * def unbind(self): * """Destroy the queue.""" * if self.qh != NULL: # <<<<<<<<<<<<<< @@ -4575,7 +4606,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_6unbind(struct __pyx */ } - /* "netfilterqueue.pyx":196 + /* "netfilterqueue.pyx":199 * if self.qh != NULL: * nfq_destroy_queue(self.qh) * self.qh = NULL # <<<<<<<<<<<<<< @@ -4584,7 +4615,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_6unbind(struct __pyx */ __pyx_v_self->qh = NULL; - /* "netfilterqueue.pyx":192 + /* "netfilterqueue.pyx":195 * raise RuntimeWarning("Socket rcvbuf limit is now %d, requested %d." % (newsiz,sock_len)) * * def unbind(self): # <<<<<<<<<<<<<< @@ -4599,7 +4630,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_6unbind(struct __pyx return __pyx_r; } -/* "netfilterqueue.pyx":199 +/* "netfilterqueue.pyx":202 * # See warning about nfq_unbind_pf in __dealloc__ above. * * def get_fd(self): # <<<<<<<<<<<<<< @@ -4627,7 +4658,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_8get_fd(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_fd", 0); - /* "netfilterqueue.pyx":201 + /* "netfilterqueue.pyx":204 * def get_fd(self): * """Get the file descriptor of the queue handler.""" * return nfq_fd(self.h) # <<<<<<<<<<<<<< @@ -4635,13 +4666,13 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_8get_fd(struct __pyx * def run(self, block=True): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(nfq_fd(__pyx_v_self->h)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(nfq_fd(__pyx_v_self->h)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "netfilterqueue.pyx":199 + /* "netfilterqueue.pyx":202 * # See warning about nfq_unbind_pf in __dealloc__ above. * * def get_fd(self): # <<<<<<<<<<<<<< @@ -4660,7 +4691,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_8get_fd(struct __pyx return __pyx_r; } -/* "netfilterqueue.pyx":203 +/* "netfilterqueue.pyx":206 * return nfq_fd(self.h) * * def run(self, block=True): # <<<<<<<<<<<<<< @@ -4697,7 +4728,7 @@ static PyObject *__pyx_pw_14netfilterqueue_14NetfilterQueue_11run(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 203, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 206, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4710,7 +4741,7 @@ static PyObject *__pyx_pw_14netfilterqueue_14NetfilterQueue_11run(PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("run", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 203, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("run", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 206, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("netfilterqueue.NetfilterQueue.run", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4737,14 +4768,14 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o int __pyx_t_5; __Pyx_RefNannySetupContext("run", 0); - /* "netfilterqueue.pyx":205 + /* "netfilterqueue.pyx":208 * def run(self, block=True): * """Accept packets using recv.""" * cdef int fd = self.get_fd() # <<<<<<<<<<<<<< * cdef char buf[BufferSize] * cdef int rv */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -4757,25 +4788,25 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_fd = __pyx_t_4; - /* "netfilterqueue.pyx":209 + /* "netfilterqueue.pyx":212 * cdef int rv * cdef int recv_flags * recv_flags = 0 if block else MSG_DONTWAIT # <<<<<<<<<<<<<< * * while True: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) if (__pyx_t_5) { __pyx_t_4 = 0; } else { @@ -4783,7 +4814,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o } __pyx_v_recv_flags = __pyx_t_4; - /* "netfilterqueue.pyx":211 + /* "netfilterqueue.pyx":214 * recv_flags = 0 if block else MSG_DONTWAIT * * while True: # <<<<<<<<<<<<<< @@ -4792,7 +4823,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o */ while (1) { - /* "netfilterqueue.pyx":212 + /* "netfilterqueue.pyx":215 * * while True: * with nogil: # <<<<<<<<<<<<<< @@ -4806,7 +4837,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o #endif /*try:*/ { - /* "netfilterqueue.pyx":213 + /* "netfilterqueue.pyx":216 * while True: * with nogil: * rv = recv(fd, buf, sizeof(buf), recv_flags) # <<<<<<<<<<<<<< @@ -4816,7 +4847,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o __pyx_v_rv = recv(__pyx_v_fd, __pyx_v_buf, (sizeof(__pyx_v_buf)), __pyx_v_recv_flags); } - /* "netfilterqueue.pyx":212 + /* "netfilterqueue.pyx":215 * * while True: * with nogil: # <<<<<<<<<<<<<< @@ -4834,7 +4865,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o } } - /* "netfilterqueue.pyx":214 + /* "netfilterqueue.pyx":217 * with nogil: * rv = recv(fd, buf, sizeof(buf), recv_flags) * if (rv >= 0): # <<<<<<<<<<<<<< @@ -4844,7 +4875,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o __pyx_t_5 = ((__pyx_v_rv >= 0) != 0); if (__pyx_t_5) { - /* "netfilterqueue.pyx":215 + /* "netfilterqueue.pyx":218 * rv = recv(fd, buf, sizeof(buf), recv_flags) * if (rv >= 0): * nfq_handle_packet(self.h, buf, rv) # <<<<<<<<<<<<<< @@ -4853,7 +4884,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o */ nfq_handle_packet(__pyx_v_self->h, __pyx_v_buf, __pyx_v_rv); - /* "netfilterqueue.pyx":214 + /* "netfilterqueue.pyx":217 * with nogil: * rv = recv(fd, buf, sizeof(buf), recv_flags) * if (rv >= 0): # <<<<<<<<<<<<<< @@ -4863,7 +4894,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o goto __pyx_L10; } - /* "netfilterqueue.pyx":217 + /* "netfilterqueue.pyx":220 * nfq_handle_packet(self.h, buf, rv) * else: * if errno != ENOBUFS: # <<<<<<<<<<<<<< @@ -4874,7 +4905,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o __pyx_t_5 = ((errno != __pyx_e_14netfilterqueue_ENOBUFS) != 0); if (__pyx_t_5) { - /* "netfilterqueue.pyx":218 + /* "netfilterqueue.pyx":221 * else: * if errno != ENOBUFS: * break # <<<<<<<<<<<<<< @@ -4883,7 +4914,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o */ goto __pyx_L4_break; - /* "netfilterqueue.pyx":217 + /* "netfilterqueue.pyx":220 * nfq_handle_packet(self.h, buf, rv) * else: * if errno != ENOBUFS: # <<<<<<<<<<<<<< @@ -4896,7 +4927,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o } __pyx_L4_break:; - /* "netfilterqueue.pyx":203 + /* "netfilterqueue.pyx":206 * return nfq_fd(self.h) * * def run(self, block=True): # <<<<<<<<<<<<<< @@ -4919,7 +4950,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_10run(struct __pyx_o return __pyx_r; } -/* "netfilterqueue.pyx":220 +/* "netfilterqueue.pyx":223 * break * * def run_socket(self, s): # <<<<<<<<<<<<<< @@ -4963,7 +4994,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct int __pyx_t_13; __Pyx_RefNannySetupContext("run_socket", 0); - /* "netfilterqueue.pyx":222 + /* "netfilterqueue.pyx":225 * def run_socket(self, s): * """Accept packets using socket.recv so that, for example, gevent can monkeypatch it.""" * while True: # <<<<<<<<<<<<<< @@ -4972,7 +5003,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct */ while (1) { - /* "netfilterqueue.pyx":223 + /* "netfilterqueue.pyx":226 * """Accept packets using socket.recv so that, for example, gevent can monkeypatch it.""" * while True: * try: # <<<<<<<<<<<<<< @@ -4988,32 +5019,32 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "netfilterqueue.pyx":224 + /* "netfilterqueue.pyx":227 * while True: * try: * buf = s.recv(BufferSize) # <<<<<<<<<<<<<< * rv = len(buf) * if rv >= 0: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_recv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_recv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_5); __pyx_t_5 = 0; - /* "netfilterqueue.pyx":225 + /* "netfilterqueue.pyx":228 * try: * buf = s.recv(BufferSize) * rv = len(buf) # <<<<<<<<<<<<<< * if rv >= 0: * nfq_handle_packet(self.h, buf, rv) */ - __pyx_t_6 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 225, __pyx_L5_error) + __pyx_t_6 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 228, __pyx_L5_error) __pyx_v_rv = __pyx_t_6; - /* "netfilterqueue.pyx":226 + /* "netfilterqueue.pyx":229 * buf = s.recv(BufferSize) * rv = len(buf) * if rv >= 0: # <<<<<<<<<<<<<< @@ -5023,17 +5054,17 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct __pyx_t_7 = ((__pyx_v_rv >= 0) != 0); if (__pyx_t_7) { - /* "netfilterqueue.pyx":227 + /* "netfilterqueue.pyx":230 * rv = len(buf) * if rv >= 0: * nfq_handle_packet(self.h, buf, rv) # <<<<<<<<<<<<<< * else: * break */ - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_buf); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L5_error) + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_buf); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L5_error) nfq_handle_packet(__pyx_v_self->h, __pyx_t_8, __pyx_v_rv); - /* "netfilterqueue.pyx":226 + /* "netfilterqueue.pyx":229 * buf = s.recv(BufferSize) * rv = len(buf) * if rv >= 0: # <<<<<<<<<<<<<< @@ -5043,7 +5074,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct goto __pyx_L13; } - /* "netfilterqueue.pyx":229 + /* "netfilterqueue.pyx":232 * nfq_handle_packet(self.h, buf, rv) * else: * break # <<<<<<<<<<<<<< @@ -5055,7 +5086,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct } __pyx_L13:; - /* "netfilterqueue.pyx":223 + /* "netfilterqueue.pyx":226 * """Accept packets using socket.recv so that, for example, gevent can monkeypatch it.""" * while True: * try: # <<<<<<<<<<<<<< @@ -5072,60 +5103,60 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "netfilterqueue.pyx":230 + /* "netfilterqueue.pyx":233 * else: * break * except socket.error as e: # <<<<<<<<<<<<<< * err = e.args[0] * if err == ENOBUFS: */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L7_except_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L7_except_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_9) { __Pyx_AddTraceback("netfilterqueue.NetfilterQueue.run_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 230, __pyx_L7_except_error) + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 233, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_5); - /* "netfilterqueue.pyx":231 + /* "netfilterqueue.pyx":234 * break * except socket.error as e: * err = e.args[0] # <<<<<<<<<<<<<< * if err == ENOBUFS: * continue */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L7_except_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 231, __pyx_L7_except_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_12); __pyx_t_12 = 0; - /* "netfilterqueue.pyx":232 + /* "netfilterqueue.pyx":235 * except socket.error as e: * err = e.args[0] * if err == ENOBUFS: # <<<<<<<<<<<<<< * continue * elif err == EAGAIN or err == EWOULDBLOCK: */ - __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_ENOBUFS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 232, __pyx_L7_except_error) + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_ENOBUFS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 235, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = PyObject_RichCompare(__pyx_v_err, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 232, __pyx_L7_except_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_v_err, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 232, __pyx_L7_except_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 235, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_7) { - /* "netfilterqueue.pyx":233 + /* "netfilterqueue.pyx":236 * err = e.args[0] * if err == ENOBUFS: * continue # <<<<<<<<<<<<<< @@ -5134,7 +5165,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct */ goto __pyx_L15_except_continue; - /* "netfilterqueue.pyx":232 + /* "netfilterqueue.pyx":235 * except socket.error as e: * err = e.args[0] * if err == ENOBUFS: # <<<<<<<<<<<<<< @@ -5143,35 +5174,35 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct */ } - /* "netfilterqueue.pyx":234 + /* "netfilterqueue.pyx":237 * if err == ENOBUFS: * continue * elif err == EAGAIN or err == EWOULDBLOCK: # <<<<<<<<<<<<<< * # This should only happen with a non-blocking socket, and the * # app should call run_socket again when more data is available. */ - __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_EAGAIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L7_except_error) + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_EAGAIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyObject_RichCompare(__pyx_v_err, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L7_except_error) + __pyx_t_12 = PyObject_RichCompare(__pyx_v_err, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 237, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 234, __pyx_L7_except_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 237, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (!__pyx_t_13) { } else { __pyx_t_7 = __pyx_t_13; goto __pyx_L17_bool_binop_done; } - __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_EWOULDBLOCK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L7_except_error) + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_e_14netfilterqueue_EWOULDBLOCK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 237, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = PyObject_RichCompare(__pyx_v_err, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L7_except_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_v_err, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 234, __pyx_L7_except_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 237, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = __pyx_t_13; __pyx_L17_bool_binop_done:; if (__pyx_t_7) { - /* "netfilterqueue.pyx":237 + /* "netfilterqueue.pyx":240 * # This should only happen with a non-blocking socket, and the * # app should call run_socket again when more data is available. * break # <<<<<<<<<<<<<< @@ -5180,7 +5211,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct */ goto __pyx_L14_except_break; - /* "netfilterqueue.pyx":234 + /* "netfilterqueue.pyx":237 * if err == ENOBUFS: * continue * elif err == EAGAIN or err == EWOULDBLOCK: # <<<<<<<<<<<<<< @@ -5189,7 +5220,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct */ } - /* "netfilterqueue.pyx":240 + /* "netfilterqueue.pyx":243 * else: * # This is bad. Let the caller handle it. * raise e # <<<<<<<<<<<<<< @@ -5198,7 +5229,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct */ /*else*/ { __Pyx_Raise(__pyx_v_e, 0, 0, 0); - __PYX_ERR(0, 240, __pyx_L7_except_error) + __PYX_ERR(0, 243, __pyx_L7_except_error) } __pyx_L14_except_break:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5214,7 +5245,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct goto __pyx_L7_except_error; __pyx_L7_except_error:; - /* "netfilterqueue.pyx":223 + /* "netfilterqueue.pyx":226 * """Accept packets using socket.recv so that, for example, gevent can monkeypatch it.""" * while True: * try: # <<<<<<<<<<<<<< @@ -5247,7 +5278,7 @@ static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_12run_socket(struct } __pyx_L4_break:; - /* "netfilterqueue.pyx":220 + /* "netfilterqueue.pyx":223 * break * * def run_socket(self, s): # <<<<<<<<<<<<<< @@ -5748,8 +5779,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 69, __pyx_L1_error) - __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 75, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -5759,69 +5790,69 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "netfilterqueue.pyx":69 + /* "netfilterqueue.pyx":67 * self.payload_len = nfq_get_payload(self._nfa, &self.payload) * if self.payload_len < 0: * raise OSError("Failed to get payload of packet.") # <<<<<<<<<<<<<< * * nfq_get_timestamp(self._nfa, &self.timestamp) */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_payload_of_packet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_payload_of_packet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "netfilterqueue.pyx":77 + /* "netfilterqueue.pyx":75 * """Call appropriate set_verdict... function on packet.""" * if self._verdict_is_set: * raise RuntimeWarning("Verdict already given for this packet.") # <<<<<<<<<<<<<< * * cdef u_int32_t modified_payload_len = 0 */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Verdict_already_given_for_this_p); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Verdict_already_given_for_this_p); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "netfilterqueue.pyx":155 + /* "netfilterqueue.pyx":158 * self.h = nfq_open() * if self.h == NULL: * raise OSError("Failed to open NFQueue.") # <<<<<<<<<<<<<< * nfq_unbind_pf(self.h, self.af) # This does NOT kick out previous * # running queues */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_open_NFQueue); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_open_NFQueue); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "netfilterqueue.pyx":184 + /* "netfilterqueue.pyx":187 * range = MaxCopySize * if nfq_set_mode(self.qh, mode, range) < 0: * raise OSError("Failed to set packet copy mode.") # <<<<<<<<<<<<<< * * nfq_set_queue_maxlen(self.qh, max_len) */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_packet_copy_mode); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_packet_copy_mode); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "netfilterqueue.pyx":224 + /* "netfilterqueue.pyx":227 * while True: * try: * buf = s.recv(BufferSize) # <<<<<<<<<<<<<< * rv = len(buf) * if rv >= 0: */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_4096); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_4096); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "netfilterqueue.pyx":8 * License: MIT; see LICENSE.txt * """ - * VERSION = (0, 8, 0) # <<<<<<<<<<<<<< + * VERSION = (0, 8, 1) # <<<<<<<<<<<<<< * * # Constants for module users */ - __pyx_tuple__7 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_8, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_8, __pyx_int_1); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __Pyx_RefNannyFinishContext(); @@ -6081,9 +6112,9 @@ PyMODINIT_FUNC PyInit_netfilterqueue(void) if (__Pyx_SetVtable(__pyx_type_14netfilterqueue_Packet.tp_dict, __pyx_vtabptr_14netfilterqueue_Packet) < 0) __PYX_ERR(0, 40, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Packet", (PyObject *)&__pyx_type_14netfilterqueue_Packet) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __pyx_ptype_14netfilterqueue_Packet = &__pyx_type_14netfilterqueue_Packet; - if (PyType_Ready(&__pyx_type_14netfilterqueue_NetfilterQueue) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_14netfilterqueue_NetfilterQueue) < 0) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_type_14netfilterqueue_NetfilterQueue.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "NetfilterQueue", (PyObject *)&__pyx_type_14netfilterqueue_NetfilterQueue) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NetfilterQueue", (PyObject *)&__pyx_type_14netfilterqueue_NetfilterQueue) < 0) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_ptype_14netfilterqueue_NetfilterQueue = &__pyx_type_14netfilterqueue_NetfilterQueue; /*--- Type import code ---*/ /*--- Variable import code ---*/ @@ -6096,7 +6127,7 @@ PyMODINIT_FUNC PyInit_netfilterqueue(void) /* "netfilterqueue.pyx":8 * License: MIT; see LICENSE.txt * """ - * VERSION = (0, 8, 0) # <<<<<<<<<<<<<< + * VERSION = (0, 8, 1) # <<<<<<<<<<<<<< * * # Constants for module users */ @@ -6141,7 +6172,7 @@ PyMODINIT_FUNC PyInit_netfilterqueue(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "netfilterqueue.pyx":170 + /* "netfilterqueue.pyx":173 * def bind(self, int queue_num, object user_callback, * u_int32_t max_len=DEFAULT_MAX_QUEUELEN, * u_int8_t mode=NFQNL_COPY_PACKET, # <<<<<<<<<<<<<< @@ -6150,158 +6181,158 @@ PyMODINIT_FUNC PyInit_netfilterqueue(void) */ __pyx_k__4 = NFQNL_COPY_PACKET; - /* "netfilterqueue.pyx":243 + /* "netfilterqueue.pyx":246 * * PROTOCOLS = { * 0: "HOPOPT", # <<<<<<<<<<<<<< * 1: "ICMP", * 2: "IGMP", */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_int_0, __pyx_n_s_HOPOPT) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, __pyx_n_s_ICMP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_2, __pyx_n_s_IGMP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_3, __pyx_n_s_GGP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, __pyx_n_s_IP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_5, __pyx_n_s_ST) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_6, __pyx_n_s_TCP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_7, __pyx_n_s_CBT) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_n_s_EGP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_9, __pyx_n_s_IGP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_10, __pyx_kp_s_BBN_RCC_MON) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_11, __pyx_kp_s_NVP_II) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_12, __pyx_n_s_PUP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_13, __pyx_n_s_ARGUS) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_14, __pyx_n_s_EMCON) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_15, __pyx_n_s_XNET) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_16, __pyx_n_s_CHAOS) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_17, __pyx_n_s_UDP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_18, __pyx_n_s_MUX) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_19, __pyx_kp_s_DCN_MEAS) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_20, __pyx_n_s_HMP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_21, __pyx_n_s_PRM) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_22, __pyx_kp_s_XNS_IDP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_23, __pyx_kp_s_TRUNK_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_24, __pyx_kp_s_TRUNK_2) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_25, __pyx_kp_s_LEAF_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_26, __pyx_kp_s_LEAF_2) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_27, __pyx_n_s_RDP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_28, __pyx_n_s_IRTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_29, __pyx_kp_s_ISO_TP4) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_30, __pyx_n_s_NETBLT) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_31, __pyx_kp_s_MFE_NSP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_32, __pyx_kp_s_MERIT_INP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_33, __pyx_n_s_DCCP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_34, __pyx_kp_s_3PC) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_35, __pyx_n_s_IDPR) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_36, __pyx_n_s_XTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_37, __pyx_n_s_DDP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_38, __pyx_kp_s_IDPR_CMTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_39, __pyx_kp_s_TP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_40, __pyx_n_s_IL) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_41, __pyx_n_s_IPv6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_42, __pyx_n_s_SDRP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_43, __pyx_kp_s_IPv6_Route) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_44, __pyx_kp_s_IPv6_Frag) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_45, __pyx_n_s_IDRP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_46, __pyx_n_s_RSVP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_47, __pyx_n_s_GRE) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_48, __pyx_n_s_DSR) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_49, __pyx_n_s_BNA) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_50, __pyx_n_s_ESP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_51, __pyx_n_s_AH) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_52, __pyx_kp_s_I_NLSP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_53, __pyx_n_s_SWIPE) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_54, __pyx_n_s_NARP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_55, __pyx_n_s_MOBILE) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_56, __pyx_n_s_TLSP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_57, __pyx_n_s_SKIP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_58, __pyx_kp_s_IPv6_ICMP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_59, __pyx_kp_s_IPv6_NoNxt) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_60, __pyx_kp_s_IPv6_Opts) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_61, __pyx_kp_s_any_host_internal_protocol) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_62, __pyx_n_s_CFTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_63, __pyx_kp_s_any_local_network) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_64, __pyx_kp_s_SAT_EXPAK) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_65, __pyx_n_s_KRYPTOLAN) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_66, __pyx_n_s_RVD) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_67, __pyx_n_s_IPPC) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_68, __pyx_kp_s_any_distributed_file_system) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_69, __pyx_kp_s_SAT_MON) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_70, __pyx_n_s_VISA) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_71, __pyx_n_s_IPCV) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_72, __pyx_n_s_CPNX) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_73, __pyx_n_s_CPHB) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_74, __pyx_n_s_WSN) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_75, __pyx_n_s_PVP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_76, __pyx_kp_s_BR_SAT_MON) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_77, __pyx_kp_s_SUN_ND) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_78, __pyx_kp_s_WB_MON) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_79, __pyx_kp_s_WB_EXPAK) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_80, __pyx_kp_s_ISO_IP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_81, __pyx_n_s_VMTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_82, __pyx_kp_s_SECURE_VMTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_83, __pyx_n_s_VINES) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_84, __pyx_n_s_TTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_85, __pyx_kp_s_NSFNET_IGP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_86, __pyx_n_s_DGP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_87, __pyx_n_s_TCF) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_88, __pyx_n_s_EIGRP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_89, __pyx_n_s_OSPFIGP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_90, __pyx_kp_s_Sprite_RPC) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_91, __pyx_n_s_LARP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_92, __pyx_n_s_MTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_93, __pyx_kp_s_AX_25) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_94, __pyx_n_s_IPIP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_95, __pyx_n_s_MICP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_96, __pyx_kp_s_SCC_SP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_97, __pyx_n_s_ETHERIP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_98, __pyx_n_s_ENCAP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_99, __pyx_kp_s_any_private_encryption_scheme) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_100, __pyx_n_s_GMTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_101, __pyx_n_s_IFMP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_102, __pyx_n_s_PNNI) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_103, __pyx_n_s_PIM) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_104, __pyx_n_s_ARIS) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_105, __pyx_n_s_SCPS) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_106, __pyx_n_s_QNX) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_107, __pyx_kp_s_A_N) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_108, __pyx_n_s_IPComp) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_109, __pyx_n_s_SNP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_110, __pyx_kp_s_Compaq_Peer) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_111, __pyx_kp_s_IPX_in_IP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_112, __pyx_n_s_VRRP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_113, __pyx_n_s_PGM) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_114, __pyx_kp_s_any_0_hop_protocol) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_115, __pyx_n_s_L2TP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_116, __pyx_n_s_DDX) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_117, __pyx_n_s_IATP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_118, __pyx_n_s_STP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_119, __pyx_n_s_SRP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_120, __pyx_n_s_UTI) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_121, __pyx_n_s_SMP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_122, __pyx_n_s_SM) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_123, __pyx_n_s_PTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_124, __pyx_n_s_ISIS) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_125, __pyx_n_s_FIRE) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_126, __pyx_n_s_CRTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_127, __pyx_n_s_CRUDP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_128, __pyx_n_s_SSCOPMCE) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_129, __pyx_n_s_IPLT) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_130, __pyx_n_s_SPS) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_131, __pyx_n_s_PIPE) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_132, __pyx_n_s_SCTP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_133, __pyx_n_s_FC) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_134, __pyx_kp_s_RSVP_E2E_IGNORE) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_135, __pyx_n_s_Mobility) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_136, __pyx_n_s_UDPLite) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_137, __pyx_kp_s_MPLS_in_IP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_138, __pyx_n_s_manet) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_139, __pyx_n_s_HIP) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_140, __pyx_n_s_Shim6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_int_255, __pyx_n_s_Reserved) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PROTOCOLS, __pyx_t_1) < 0) __PYX_ERR(0, 242, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_0, __pyx_n_s_HOPOPT) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, __pyx_n_s_ICMP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_2, __pyx_n_s_IGMP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_3, __pyx_n_s_GGP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, __pyx_n_s_IP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_5, __pyx_n_s_ST) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_6, __pyx_n_s_TCP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_7, __pyx_n_s_CBT) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_n_s_EGP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_9, __pyx_n_s_IGP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_10, __pyx_kp_s_BBN_RCC_MON) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_11, __pyx_kp_s_NVP_II) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_12, __pyx_n_s_PUP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_13, __pyx_n_s_ARGUS) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_14, __pyx_n_s_EMCON) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_15, __pyx_n_s_XNET) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_16, __pyx_n_s_CHAOS) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_17, __pyx_n_s_UDP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_18, __pyx_n_s_MUX) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_19, __pyx_kp_s_DCN_MEAS) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_20, __pyx_n_s_HMP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_21, __pyx_n_s_PRM) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_22, __pyx_kp_s_XNS_IDP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_23, __pyx_kp_s_TRUNK_1) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_24, __pyx_kp_s_TRUNK_2) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_25, __pyx_kp_s_LEAF_1) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_26, __pyx_kp_s_LEAF_2) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_27, __pyx_n_s_RDP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_28, __pyx_n_s_IRTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_29, __pyx_kp_s_ISO_TP4) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_30, __pyx_n_s_NETBLT) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_31, __pyx_kp_s_MFE_NSP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_32, __pyx_kp_s_MERIT_INP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_33, __pyx_n_s_DCCP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_34, __pyx_kp_s_3PC) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_35, __pyx_n_s_IDPR) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_36, __pyx_n_s_XTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_37, __pyx_n_s_DDP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_38, __pyx_kp_s_IDPR_CMTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_39, __pyx_kp_s_TP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_40, __pyx_n_s_IL) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_41, __pyx_n_s_IPv6) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_42, __pyx_n_s_SDRP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_43, __pyx_kp_s_IPv6_Route) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_44, __pyx_kp_s_IPv6_Frag) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_45, __pyx_n_s_IDRP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_46, __pyx_n_s_RSVP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_47, __pyx_n_s_GRE) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_48, __pyx_n_s_DSR) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_49, __pyx_n_s_BNA) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_50, __pyx_n_s_ESP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_51, __pyx_n_s_AH) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_52, __pyx_kp_s_I_NLSP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_53, __pyx_n_s_SWIPE) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_54, __pyx_n_s_NARP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_55, __pyx_n_s_MOBILE) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_56, __pyx_n_s_TLSP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_57, __pyx_n_s_SKIP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_58, __pyx_kp_s_IPv6_ICMP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_59, __pyx_kp_s_IPv6_NoNxt) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_60, __pyx_kp_s_IPv6_Opts) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_61, __pyx_kp_s_any_host_internal_protocol) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_62, __pyx_n_s_CFTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_63, __pyx_kp_s_any_local_network) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_64, __pyx_kp_s_SAT_EXPAK) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_65, __pyx_n_s_KRYPTOLAN) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_66, __pyx_n_s_RVD) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_67, __pyx_n_s_IPPC) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_68, __pyx_kp_s_any_distributed_file_system) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_69, __pyx_kp_s_SAT_MON) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_70, __pyx_n_s_VISA) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_71, __pyx_n_s_IPCV) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_72, __pyx_n_s_CPNX) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_73, __pyx_n_s_CPHB) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_74, __pyx_n_s_WSN) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_75, __pyx_n_s_PVP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_76, __pyx_kp_s_BR_SAT_MON) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_77, __pyx_kp_s_SUN_ND) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_78, __pyx_kp_s_WB_MON) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_79, __pyx_kp_s_WB_EXPAK) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_80, __pyx_kp_s_ISO_IP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_81, __pyx_n_s_VMTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_82, __pyx_kp_s_SECURE_VMTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_83, __pyx_n_s_VINES) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_84, __pyx_n_s_TTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_85, __pyx_kp_s_NSFNET_IGP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_86, __pyx_n_s_DGP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_87, __pyx_n_s_TCF) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_88, __pyx_n_s_EIGRP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_89, __pyx_n_s_OSPFIGP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_90, __pyx_kp_s_Sprite_RPC) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_91, __pyx_n_s_LARP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_92, __pyx_n_s_MTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_93, __pyx_kp_s_AX_25) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_94, __pyx_n_s_IPIP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_95, __pyx_n_s_MICP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_96, __pyx_kp_s_SCC_SP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_97, __pyx_n_s_ETHERIP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_98, __pyx_n_s_ENCAP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_99, __pyx_kp_s_any_private_encryption_scheme) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_100, __pyx_n_s_GMTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_101, __pyx_n_s_IFMP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_102, __pyx_n_s_PNNI) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_103, __pyx_n_s_PIM) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_104, __pyx_n_s_ARIS) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_105, __pyx_n_s_SCPS) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_106, __pyx_n_s_QNX) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_107, __pyx_kp_s_A_N) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_108, __pyx_n_s_IPComp) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_109, __pyx_n_s_SNP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_110, __pyx_kp_s_Compaq_Peer) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_111, __pyx_kp_s_IPX_in_IP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_112, __pyx_n_s_VRRP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_113, __pyx_n_s_PGM) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_114, __pyx_kp_s_any_0_hop_protocol) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_115, __pyx_n_s_L2TP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_116, __pyx_n_s_DDX) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_117, __pyx_n_s_IATP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_118, __pyx_n_s_STP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_119, __pyx_n_s_SRP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_120, __pyx_n_s_UTI) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_121, __pyx_n_s_SMP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_122, __pyx_n_s_SM) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_123, __pyx_n_s_PTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_124, __pyx_n_s_ISIS) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_125, __pyx_n_s_FIRE) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_126, __pyx_n_s_CRTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_127, __pyx_n_s_CRUDP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_128, __pyx_n_s_SSCOPMCE) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_129, __pyx_n_s_IPLT) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_130, __pyx_n_s_SPS) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_131, __pyx_n_s_PIPE) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_132, __pyx_n_s_SCTP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_133, __pyx_n_s_FC) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_134, __pyx_kp_s_RSVP_E2E_IGNORE) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_135, __pyx_n_s_Mobility) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_136, __pyx_n_s_UDPLite) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_137, __pyx_kp_s_MPLS_in_IP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_138, __pyx_n_s_manet) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_139, __pyx_n_s_HIP) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_140, __pyx_n_s_Shim6) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_int_255, __pyx_n_s_Reserved) < 0) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PROTOCOLS, __pyx_t_1) < 0) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netfilterqueue.pyx":1 diff --git a/netfilterqueue.pyx b/netfilterqueue.pyx index 5a9ef1d..889326e 100644 --- a/netfilterqueue.pyx +++ b/netfilterqueue.pyx @@ -5,7 +5,7 @@ function. Copyright: (c) 2011, Kerkhoff Technologies Inc. License: MIT; see LICENSE.txt """ -VERSION = (0, 8, 0) +VERSION = (0, 8, 1) # Constants for module users COPY_NONE = 0 @@ -57,12 +57,10 @@ cdef class Packet: self._qh = qh self._nfa = nfa self._hdr = nfq_get_msg_packet_hdr(nfa) - self._hw = nfq_get_packet_hw(nfa) self.id = ntohl(self._hdr.packet_id) self.hw_protocol = ntohs(self._hdr.hw_protocol) self.hook = self._hdr.hook - self.hw_addr = self._hw.hw_addr self.payload_len = nfq_get_payload(self._nfa, &self.payload) if self.payload_len < 0: @@ -101,6 +99,11 @@ cdef class Packet: def get_hw(self): """Return the hardware address as Python string.""" + self._hw = nfq_get_packet_hw(self._nfa) + if self._hw == NULL: + # nfq_get_packet_hw doesn't work on OUTPUT and PREROUTING chains + return None + self.hw_addr = self._hw.hw_addr cdef object py_string if cpython.version.PY_MAJOR_VERSION >= 3: py_string = PyBytes_FromStringAndSize(self.hw_addr, 8) diff --git a/setup.py b/setup.py index ffc50f8..5762621 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from distutils.core import setup, Extension -VERSION = "0.8" # Remember to change README.rst and netfilterqueue.pyx when version changes. +VERSION = "0.8.1" # Remember to change netfilterqueue.pyx when version changes. try: # Use Cython