forked from oremanj/python-netfilterqueue
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathnetfilterqueue.c
6238 lines (5892 loc) · 279 KB
/
netfilterqueue.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Generated by Cython 0.18 on Mon Apr 15 11:27:09 2013 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
#error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PY_FORMAT_SIZE_T ""
#define CYTHON_FORMAT_SSIZE_T ""
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
#define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
(PyErr_Format(PyExc_TypeError, \
"expected index value, got %.200s", Py_TYPE(o)->tp_name), \
(PyObject*)0))
#define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
!PyComplex_Check(o))
#define PyIndex_Check __Pyx_PyIndex_Check
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#define __PYX_BUILD_PY_SSIZE_T "i"
#else
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
#define PyType_Modified(t)
typedef struct {
void *buf;
PyObject *obj;
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
#define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
#else
#define CYTHON_PEP393_ENABLED 0
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
#define PyBytesObject PyStringObject
#define PyBytes_Type PyString_Type
#define PyBytes_Check PyString_Check
#define PyBytes_CheckExact PyString_CheckExact
#define PyBytes_FromString PyString_FromString
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
#define PyBytes_FromFormat PyString_FromFormat
#define PyBytes_DecodeEscape PyString_DecodeEscape
#define PyBytes_AsString PyString_AsString
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
#define PyBytes_Size PyString_Size
#define PyBytes_AS_STRING PyString_AS_STRING
#define PyBytes_GET_SIZE PyString_GET_SIZE
#define PyBytes_Repr PyString_Repr
#define PyBytes_Concat PyString_Concat
#define PyBytes_ConcatAndDel PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
#define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
#define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
#define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
#define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
#define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
#else
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_NAMESTR(n) ((char *)(n))
#define __Pyx_DOCSTR(n) ((char *)(n))
#else
#define __Pyx_NAMESTR(n) (n)
#define __Pyx_DOCSTR(n) (n)
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__netfilterqueue
#define __PYX_HAVE_API__netfilterqueue
#include "sys/types.h"
#include "netinet/ip.h"
#include "sys/time.h"
#include "netinet/in.h"
#include "libnfnetlink/linux_nfnetlink.h"
#include "libnetfilter_queue/linux_nfnetlink_queue.h"
#include "libnetfilter_queue/libnetfilter_queue.h"
#include "sys/socket.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
#ifndef CYTHON_INLINE
#if defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char *__pyx_f[] = {
"netfilterqueue.pyx",
"netfilterqueue.pxd",
};
/*--- Type declarations ---*/
struct __pyx_obj_14netfilterqueue_Packet;
struct __pyx_obj_14netfilterqueue_NetfilterQueue;
/* "netfilterqueue.pxd":19
*
* # Dummy defines from netinet/in.h:
* cdef enum: # <<<<<<<<<<<<<<
* IPPROTO_IP = 0 # Dummy protocol for TCP.
* IPPROTO_HOPOPTS = 0 # IPv6 Hop-by-Hop options.
*/
enum {
__pyx_e_14netfilterqueue_IPPROTO_IP = 0,
__pyx_e_14netfilterqueue_IPPROTO_HOPOPTS = 0,
__pyx_e_14netfilterqueue_IPPROTO_ICMP = 1,
__pyx_e_14netfilterqueue_IPPROTO_IGMP = 2,
__pyx_e_14netfilterqueue_IPPROTO_IPIP = 4,
__pyx_e_14netfilterqueue_IPPROTO_TCP = 6,
__pyx_e_14netfilterqueue_IPPROTO_EGP = 8,
__pyx_e_14netfilterqueue_IPPROTO_PUP = 12,
__pyx_e_14netfilterqueue_IPPROTO_UDP = 17,
__pyx_e_14netfilterqueue_IPPROTO_IDP = 22,
__pyx_e_14netfilterqueue_IPPROTO_TP = 29,
__pyx_e_14netfilterqueue_IPPROTO_IPV6 = 41,
__pyx_e_14netfilterqueue_IPPROTO_ROUTING = 43,
__pyx_e_14netfilterqueue_IPPROTO_FRAGMENT = 44,
__pyx_e_14netfilterqueue_IPPROTO_RSVP = 46,
__pyx_e_14netfilterqueue_IPPROTO_GRE = 47,
__pyx_e_14netfilterqueue_IPPROTO_ESP = 50,
__pyx_e_14netfilterqueue_IPPROTO_AH = 51,
__pyx_e_14netfilterqueue_IPPROTO_ICMPV6 = 58,
__pyx_e_14netfilterqueue_IPPROTO_NONE = 59,
__pyx_e_14netfilterqueue_IPPROTO_DSTOPTS = 60,
__pyx_e_14netfilterqueue_IPPROTO_MTP = 92,
__pyx_e_14netfilterqueue_IPPROTO_ENCAP = 98,
__pyx_e_14netfilterqueue_IPPROTO_PIM = 103,
__pyx_e_14netfilterqueue_IPPROTO_COMP = 108,
__pyx_e_14netfilterqueue_IPPROTO_SCTP = 132,
__pyx_e_14netfilterqueue_IPPROTO_RAW = 255,
__pyx_e_14netfilterqueue_IPPROTO_MAX
};
/* "netfilterqueue.pxd":135
*
* # Dummy defines from linux/socket.h:
* cdef enum: # Protocol families, same as address families. # <<<<<<<<<<<<<<
* PF_INET = 2
* PF_INET6 = 10
*/
enum {
__pyx_e_14netfilterqueue_PF_INET = 2,
__pyx_e_14netfilterqueue_PF_INET6 = 10
};
/* "netfilterqueue.pxd":143
*
* # Dummy defines from linux/netfilter.h
* cdef enum: # <<<<<<<<<<<<<<
* NF_DROP
* NF_ACCEPT
*/
enum {
/* "netfilterqueue.pxd":150
* NF_REPEAT
* NF_STOP
* NF_MAX_VERDICT = NF_STOP # <<<<<<<<<<<<<<
*
* cdef class Packet:
*/
__pyx_e_14netfilterqueue_NF_DROP,
__pyx_e_14netfilterqueue_NF_ACCEPT,
__pyx_e_14netfilterqueue_NF_STOLEN,
__pyx_e_14netfilterqueue_NF_QUEUE,
__pyx_e_14netfilterqueue_NF_REPEAT,
__pyx_e_14netfilterqueue_NF_STOP,
__pyx_e_14netfilterqueue_NF_MAX_VERDICT = __pyx_e_14netfilterqueue_NF_STOP
};
/* "netfilterqueue.pxd":152
* NF_MAX_VERDICT = NF_STOP
*
* cdef class Packet: # <<<<<<<<<<<<<<
* cdef nfq_q_handle *_qh
* cdef nfq_data *_nfa
*/
struct __pyx_obj_14netfilterqueue_Packet {
PyObject_HEAD
struct __pyx_vtabstruct_14netfilterqueue_Packet *__pyx_vtab;
struct nfq_q_handle *_qh;
struct nfq_data *_nfa;
struct nfqnl_msg_packet_hdr *_hdr;
int _verdict_is_set;
int _mark_is_set;
u_int32_t _given_mark;
PyObject *_given_payload;
u_int32_t id;
u_int16_t hw_protocol;
u_int8_t hook;
u_int32_t mark;
Py_ssize_t payload_len;
char *payload;
struct timeval timestamp;
};
/* "netfilterqueue.pxd":191
* cpdef repeat(self)
*
* cdef class NetfilterQueue: # <<<<<<<<<<<<<<
* cdef object user_callback # User callback
* cdef nfq_handle *h # Handle to NFQueue library
*/
struct __pyx_obj_14netfilterqueue_NetfilterQueue {
PyObject_HEAD
PyObject *user_callback;
struct nfq_handle *h;
struct nfq_q_handle *qh;
u_int16_t af;
PyObject *packet_copy_size;
};
/* "netfilterqueue.pyx":34
* return 1
*
* cdef class Packet: # <<<<<<<<<<<<<<
* """A packet received from NetfilterQueue."""
* def __cinit__(self):
*/
struct __pyx_vtabstruct_14netfilterqueue_Packet {
PyObject *(*set_nfq_data)(struct __pyx_obj_14netfilterqueue_Packet *, struct nfq_q_handle *, struct nfq_data *);
void (*verdict)(struct __pyx_obj_14netfilterqueue_Packet *, u_int8_t);
Py_ssize_t (*get_payload_len)(struct __pyx_obj_14netfilterqueue_Packet *, int __pyx_skip_dispatch);
double (*get_timestamp)(struct __pyx_obj_14netfilterqueue_Packet *, int __pyx_skip_dispatch);
PyObject *(*set_payload)(struct __pyx_obj_14netfilterqueue_Packet *, PyObject *, int __pyx_skip_dispatch);
PyObject *(*set_mark)(struct __pyx_obj_14netfilterqueue_Packet *, u_int32_t, int __pyx_skip_dispatch);
PyObject *(*get_mark)(struct __pyx_obj_14netfilterqueue_Packet *, int __pyx_skip_dispatch);
PyObject *(*accept)(struct __pyx_obj_14netfilterqueue_Packet *, int __pyx_skip_dispatch);
PyObject *(*drop)(struct __pyx_obj_14netfilterqueue_Packet *, int __pyx_skip_dispatch);
PyObject *(*repeat)(struct __pyx_obj_14netfilterqueue_Packet *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_14netfilterqueue_Packet *__pyx_vtabptr_14netfilterqueue_Packet;
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
#define __Pyx_RefNannySetupContext(name, acquire_gil) \
if (acquire_gil) { \
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
PyGILState_Release(__pyx_gilstate_save); \
} else { \
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
}
#else
#define __Pyx_RefNannySetupContext(name, acquire_gil) \
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
#define __Pyx_RefNannyFinishContext() \
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XGOTREF(r)
#define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
#ifndef __PYX_FORCE_INIT_THREADS
#define __PYX_FORCE_INIT_THREADS 0
#endif
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact); /*proto*/
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
PyObject* value;
#if PY_MAJOR_VERSION >= 3
value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) {
if (unlikely(PyErr_Occurred()))
return NULL;
value = default_value;
}
Py_INCREF(value);
#else
if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
value = PyDict_GetItem(d, key);
if (unlikely(!value)) {
value = default_value;
}
Py_INCREF(value);
} else {
PyObject *m;
m = __Pyx_GetAttrString(d, "get");
if (!m) return NULL;
value = PyObject_CallFunctionObjArgs(m, key,
(default_value == Py_None) ? NULL : default_value, NULL);
Py_DECREF(m);
}
#endif
return value;
}
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
const char* function_name); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_u_int32_t(u_int32_t);
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_u_int16_t(u_int16_t);
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_u_int8_t(u_int8_t);
static CYTHON_INLINE u_int32_t __Pyx_PyInt_from_py_u_int32_t(PyObject *);
static CYTHON_INLINE u_int8_t __Pyx_PyInt_from_py_u_int8_t(PyObject *);
static CYTHON_INLINE u_int16_t __Pyx_PyInt_from_py_u_int16_t(PyObject *);
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename); /*proto*/
static int __Pyx_check_binary_version(void);
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
typedef struct {
int code_line;
PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from 'netfilterqueue' */
static PyTypeObject *__pyx_ptype_14netfilterqueue_Packet = 0;
static PyTypeObject *__pyx_ptype_14netfilterqueue_NetfilterQueue = 0;
static int __pyx_f_14netfilterqueue_global_callback(struct nfq_q_handle *, struct nfgenmsg *, struct nfq_data *, void *); /*proto*/
#define __Pyx_MODULE_NAME "netfilterqueue"
int __pyx_module_is_main_netfilterqueue = 0;
/* Implementation of 'netfilterqueue' */
static PyObject *__pyx_builtin_OSError;
static PyObject *__pyx_builtin_RuntimeWarning;
static int __pyx_pf_14netfilterqueue_6Packet___cinit__(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_2__str__(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_4get_payload(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_6get_payload_len(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_8get_timestamp(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_10set_payload(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self, PyObject *__pyx_v_payload); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_12set_mark(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self, u_int32_t __pyx_v_mark); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_14get_mark(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_16accept(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_18drop(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_20repeat(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_2id___get__(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_11hw_protocol___get__(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_4hook___get__(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_4mark___get__(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_6Packet_7payload___get__(struct __pyx_obj_14netfilterqueue_Packet *__pyx_v_self); /* proto */
static int __pyx_pf_14netfilterqueue_14NetfilterQueue___cinit__(struct __pyx_obj_14netfilterqueue_NetfilterQueue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static void __pyx_pf_14netfilterqueue_14NetfilterQueue_2__dealloc__(struct __pyx_obj_14netfilterqueue_NetfilterQueue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_4bind(struct __pyx_obj_14netfilterqueue_NetfilterQueue *__pyx_v_self, int __pyx_v_queue_num, PyObject *__pyx_v_user_callback, u_int32_t __pyx_v_max_len, u_int8_t __pyx_v_mode, u_int32_t __pyx_v_range); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_6unbind(struct __pyx_obj_14netfilterqueue_NetfilterQueue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14netfilterqueue_14NetfilterQueue_8run(struct __pyx_obj_14netfilterqueue_NetfilterQueue *__pyx_v_self); /* proto */
static char __pyx_k_1[] = "Unknown protocol";
static char __pyx_k_2[] = "%s packet, %s bytes";
static char __pyx_k_3[] = "Failed to get payload of packet.";
static char __pyx_k_5[] = "Verdict already given for this packet.";
static char __pyx_k_7[] = "Failed to open NFQueue.";
static char __pyx_k_9[] = "Failed to bind family %s. Are you root?";
static char __pyx_k_12[] = "Failed to create queue %s.";
static char __pyx_k_13[] = "Failed to set packet copy mode.";
static char __pyx_k_15[] = "\nBind to a Linux netfilter queue. Send packets to a user-specified callback \nfunction.\n\nCopyright: (c) 2011, Kerkhoff Technologies Inc.\nLicense: MIT; see LICENSE.txt\n";
static char __pyx_k_17[] = "DEFAULT_MAX_QUEUELEN";
static char __pyx_k_18[] = "BBN-RCC-MON";
static char __pyx_k_19[] = "NVP-II";
static char __pyx_k_20[] = "DCN-MEAS";
static char __pyx_k_21[] = "XNS-IDP";
static char __pyx_k_22[] = "TRUNK-1";
static char __pyx_k_23[] = "TRUNK-2";
static char __pyx_k_24[] = "LEAF-1";
static char __pyx_k_25[] = "LEAF-2";
static char __pyx_k_26[] = "ISO-TP4";
static char __pyx_k_27[] = "MFE-NSP";
static char __pyx_k_28[] = "MERIT-INP";
static char __pyx_k_29[] = "IDPR-CMTP";
static char __pyx_k_30[] = "TP++";
static char __pyx_k_31[] = "IPv6-Route";
static char __pyx_k_32[] = "IPv6-Frag";
static char __pyx_k_33[] = "I-NLSP";
static char __pyx_k_34[] = "IPv6-ICMP";
static char __pyx_k_35[] = "IPv6-NoNxt";
static char __pyx_k_36[] = "IPv6-Opts";
static char __pyx_k_37[] = "any host internal protocol";
static char __pyx_k_38[] = "any local network";
static char __pyx_k_39[] = "SAT-EXPAK";
static char __pyx_k_40[] = "any distributed file system";
static char __pyx_k_41[] = "SAT-MON";
static char __pyx_k_42[] = "BR-SAT-MON";
static char __pyx_k_43[] = "SUN-ND";
static char __pyx_k_44[] = "WB-MON";
static char __pyx_k_45[] = "WB-EXPAK";
static char __pyx_k_46[] = "ISO-IP";
static char __pyx_k_47[] = "SECURE-VMTP";
static char __pyx_k_48[] = "NSFNET-IGP";
static char __pyx_k_49[] = "Sprite-RPC";
static char __pyx_k_50[] = "AX.25";
static char __pyx_k_51[] = "SCC-SP";
static char __pyx_k_52[] = "any private encryption scheme";
static char __pyx_k_53[] = "A/N";
static char __pyx_k_54[] = "Compaq-Peer";
static char __pyx_k_55[] = "IPX-in-IP";
static char __pyx_k_56[] = "any 0-hop protocol";
static char __pyx_k_57[] = "RSVP-E2E-IGNORE";
static char __pyx_k_58[] = "MPLS-in-IP";
static char __pyx_k__AH[] = "AH";
static char __pyx_k__FC[] = "FC";
static char __pyx_k__IL[] = "IL";
static char __pyx_k__IP[] = "IP";
static char __pyx_k__SM[] = "SM";
static char __pyx_k__ST[] = "ST";
static char __pyx_k__af[] = "af";
static char __pyx_k__3PC[] = "3PC";
static char __pyx_k__BNA[] = "BNA";
static char __pyx_k__CBT[] = "CBT";
static char __pyx_k__DDP[] = "DDP";
static char __pyx_k__DDX[] = "DDX";
static char __pyx_k__DGP[] = "DGP";
static char __pyx_k__DSR[] = "DSR";
static char __pyx_k__EGP[] = "EGP";
static char __pyx_k__ESP[] = "ESP";
static char __pyx_k__GGP[] = "GGP";
static char __pyx_k__GRE[] = "GRE";
static char __pyx_k__HIP[] = "HIP";
static char __pyx_k__HMP[] = "HMP";
static char __pyx_k__IGP[] = "IGP";
static char __pyx_k__MTP[] = "MTP";
static char __pyx_k__MUX[] = "MUX";
static char __pyx_k__PGM[] = "PGM";
static char __pyx_k__PIM[] = "PIM";
static char __pyx_k__PRM[] = "PRM";
static char __pyx_k__PTP[] = "PTP";
static char __pyx_k__PUP[] = "PUP";
static char __pyx_k__PVP[] = "PVP";
static char __pyx_k__QNX[] = "QNX";
static char __pyx_k__RDP[] = "RDP";
static char __pyx_k__RVD[] = "RVD";
static char __pyx_k__SMP[] = "SMP";
static char __pyx_k__SNP[] = "SNP";
static char __pyx_k__SPS[] = "SPS";
static char __pyx_k__SRP[] = "SRP";
static char __pyx_k__STP[] = "STP";
static char __pyx_k__TCF[] = "TCF";
static char __pyx_k__TCP[] = "TCP";
static char __pyx_k__TTP[] = "TTP";
static char __pyx_k__UDP[] = "UDP";
static char __pyx_k__UTI[] = "UTI";
static char __pyx_k__WSN[] = "WSN";
static char __pyx_k__XTP[] = "XTP";
static char __pyx_k__get[] = "get";
static char __pyx_k__ARIS[] = "ARIS";
static char __pyx_k__CFTP[] = "CFTP";
static char __pyx_k__CPHB[] = "CPHB";
static char __pyx_k__CPNX[] = "CPNX";
static char __pyx_k__CRTP[] = "CRTP";
static char __pyx_k__DCCP[] = "DCCP";
static char __pyx_k__FIRE[] = "FIRE";
static char __pyx_k__GMTP[] = "GMTP";
static char __pyx_k__IATP[] = "IATP";
static char __pyx_k__ICMP[] = "ICMP";
static char __pyx_k__IDPR[] = "IDPR";
static char __pyx_k__IDRP[] = "IDRP";
static char __pyx_k__IFMP[] = "IFMP";
static char __pyx_k__IGMP[] = "IGMP";
static char __pyx_k__IPCV[] = "IPCV";
static char __pyx_k__IPIP[] = "IPIP";
static char __pyx_k__IPLT[] = "IPLT";
static char __pyx_k__IPPC[] = "IPPC";
static char __pyx_k__IPv6[] = "IPv6";
static char __pyx_k__IRTP[] = "IRTP";
static char __pyx_k__ISIS[] = "ISIS";
static char __pyx_k__L2TP[] = "L2TP";
static char __pyx_k__LARP[] = "LARP";
static char __pyx_k__MICP[] = "MICP";
static char __pyx_k__NARP[] = "NARP";
static char __pyx_k__PIPE[] = "PIPE";
static char __pyx_k__PNNI[] = "PNNI";
static char __pyx_k__RSVP[] = "RSVP";
static char __pyx_k__SCPS[] = "SCPS";
static char __pyx_k__SCTP[] = "SCTP";
static char __pyx_k__SDRP[] = "SDRP";
static char __pyx_k__SKIP[] = "SKIP";
static char __pyx_k__TLSP[] = "TLSP";
static char __pyx_k__VISA[] = "VISA";
static char __pyx_k__VMTP[] = "VMTP";
static char __pyx_k__VRRP[] = "VRRP";
static char __pyx_k__XNET[] = "XNET";
static char __pyx_k__drop[] = "drop";
static char __pyx_k__mode[] = "mode";
static char __pyx_k__ARGUS[] = "ARGUS";
static char __pyx_k__CHAOS[] = "CHAOS";
static char __pyx_k__CRUDP[] = "CRUDP";
static char __pyx_k__EIGRP[] = "EIGRP";
static char __pyx_k__EMCON[] = "EMCON";
static char __pyx_k__ENCAP[] = "ENCAP";
static char __pyx_k__SWIPE[] = "SWIPE";
static char __pyx_k__Shim6[] = "Shim6";
static char __pyx_k__VINES[] = "VINES";
static char __pyx_k__manet[] = "manet";
static char __pyx_k__range[] = "range";
static char __pyx_k__HOPOPT[] = "HOPOPT";
static char __pyx_k__IPComp[] = "IPComp";
static char __pyx_k__MOBILE[] = "MOBILE";
static char __pyx_k__NETBLT[] = "NETBLT";
static char __pyx_k__accept[] = "accept";
static char __pyx_k__repeat[] = "repeat";
static char __pyx_k__ETHERIP[] = "ETHERIP";
static char __pyx_k__OSError[] = "OSError";
static char __pyx_k__OSPFIGP[] = "OSPFIGP";
static char __pyx_k__UDPLite[] = "UDPLite";
static char __pyx_k__VERSION[] = "VERSION";
static char __pyx_k__max_len[] = "max_len";
static char __pyx_k__Mobility[] = "Mobility";
static char __pyx_k__Reserved[] = "Reserved";
static char __pyx_k__SSCOPMCE[] = "SSCOPMCE";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__get_mark[] = "get_mark";
static char __pyx_k__set_mark[] = "set_mark";
static char __pyx_k__COPY_META[] = "COPY_META";
static char __pyx_k__COPY_NONE[] = "COPY_NONE";
static char __pyx_k__KRYPTOLAN[] = "KRYPTOLAN";
static char __pyx_k__PROTOCOLS[] = "PROTOCOLS";
static char __pyx_k__queue_num[] = "queue_num";
static char __pyx_k__COPY_PACKET[] = "COPY_PACKET";
static char __pyx_k__set_payload[] = "set_payload";
static char __pyx_k__get_timestamp[] = "get_timestamp";
static char __pyx_k__user_callback[] = "user_callback";
static char __pyx_k__RuntimeWarning[] = "RuntimeWarning";
static char __pyx_k__get_payload_len[] = "get_payload_len";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_n_s_17;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_35;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_47;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_50;
static PyObject *__pyx_kp_s_51;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_kp_s_54;
static PyObject *__pyx_kp_s_55;
static PyObject *__pyx_kp_s_56;
static PyObject *__pyx_kp_s_57;
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_kp_s__3PC;
static PyObject *__pyx_n_s__AH;
static PyObject *__pyx_n_s__ARGUS;
static PyObject *__pyx_n_s__ARIS;
static PyObject *__pyx_n_s__BNA;
static PyObject *__pyx_n_s__CBT;
static PyObject *__pyx_n_s__CFTP;
static PyObject *__pyx_n_s__CHAOS;
static PyObject *__pyx_n_s__COPY_META;
static PyObject *__pyx_n_s__COPY_NONE;
static PyObject *__pyx_n_s__COPY_PACKET;
static PyObject *__pyx_n_s__CPHB;
static PyObject *__pyx_n_s__CPNX;
static PyObject *__pyx_n_s__CRTP;
static PyObject *__pyx_n_s__CRUDP;
static PyObject *__pyx_n_s__DCCP;
static PyObject *__pyx_n_s__DDP;
static PyObject *__pyx_n_s__DDX;
static PyObject *__pyx_n_s__DGP;
static PyObject *__pyx_n_s__DSR;
static PyObject *__pyx_n_s__EGP;
static PyObject *__pyx_n_s__EIGRP;
static PyObject *__pyx_n_s__EMCON;
static PyObject *__pyx_n_s__ENCAP;
static PyObject *__pyx_n_s__ESP;
static PyObject *__pyx_n_s__ETHERIP;
static PyObject *__pyx_n_s__FC;
static PyObject *__pyx_n_s__FIRE;
static PyObject *__pyx_n_s__GGP;
static PyObject *__pyx_n_s__GMTP;
static PyObject *__pyx_n_s__GRE;
static PyObject *__pyx_n_s__HIP;
static PyObject *__pyx_n_s__HMP;
static PyObject *__pyx_n_s__HOPOPT;
static PyObject *__pyx_n_s__IATP;
static PyObject *__pyx_n_s__ICMP;
static PyObject *__pyx_n_s__IDPR;
static PyObject *__pyx_n_s__IDRP;
static PyObject *__pyx_n_s__IFMP;
static PyObject *__pyx_n_s__IGMP;
static PyObject *__pyx_n_s__IGP;
static PyObject *__pyx_n_s__IL;
static PyObject *__pyx_n_s__IP;
static PyObject *__pyx_n_s__IPCV;
static PyObject *__pyx_n_s__IPComp;
static PyObject *__pyx_n_s__IPIP;
static PyObject *__pyx_n_s__IPLT;
static PyObject *__pyx_n_s__IPPC;
static PyObject *__pyx_n_s__IPv6;
static PyObject *__pyx_n_s__IRTP;
static PyObject *__pyx_n_s__ISIS;
static PyObject *__pyx_n_s__KRYPTOLAN;
static PyObject *__pyx_n_s__L2TP;
static PyObject *__pyx_n_s__LARP;
static PyObject *__pyx_n_s__MICP;
static PyObject *__pyx_n_s__MOBILE;
static PyObject *__pyx_n_s__MTP;
static PyObject *__pyx_n_s__MUX;
static PyObject *__pyx_n_s__Mobility;
static PyObject *__pyx_n_s__NARP;
static PyObject *__pyx_n_s__NETBLT;
static PyObject *__pyx_n_s__OSError;
static PyObject *__pyx_n_s__OSPFIGP;
static PyObject *__pyx_n_s__PGM;
static PyObject *__pyx_n_s__PIM;
static PyObject *__pyx_n_s__PIPE;
static PyObject *__pyx_n_s__PNNI;
static PyObject *__pyx_n_s__PRM;
static PyObject *__pyx_n_s__PROTOCOLS;
static PyObject *__pyx_n_s__PTP;
static PyObject *__pyx_n_s__PUP;
static PyObject *__pyx_n_s__PVP;
static PyObject *__pyx_n_s__QNX;
static PyObject *__pyx_n_s__RDP;
static PyObject *__pyx_n_s__RSVP;
static PyObject *__pyx_n_s__RVD;
static PyObject *__pyx_n_s__Reserved;
static PyObject *__pyx_n_s__RuntimeWarning;