--- pcap.c.orig	2011-01-25 12:41:01.000000000 -0800
+++ pcap.c	2011-01-25 12:41:20.000000000 -0800
@@ -1,233 +1,291 @@
-/* Generated by Pyrex 0.9.3 on Sun Oct 16 19:38:39 2005 */
+/* Generated by Pyrex 0.9.9 on Tue Jan 25 12:41:20 2011 */
 
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #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 PyInt_FromSsize_t(z) PyInt_FromLong(z)
+  #define PyInt_AsSsize_t(o)	PyInt_AsLong(o)
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+  #ifndef __stdcall
+    #define __stdcall
+  #endif
+  #ifndef __cdecl
+    #define __cdecl
+  #endif
+#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+#include <math.h>
 #include "pcap.h"
 #include "pcap_ex.h"
 
 
-typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
-typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
-static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
-static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
-static int __Pyx_PrintItem(PyObject *); /*proto*/
-static int __Pyx_PrintNewline(void); /*proto*/
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static void __Pyx_ReRaise(void); /*proto*/
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-static PyObject *__Pyx_GetExcValue(void); /*proto*/
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
-static void __Pyx_WriteUnraisable(char *name); /*proto*/
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
 
 static PyObject *__pyx_m;
 static PyObject *__pyx_b;
 static int __pyx_lineno;
 static char *__pyx_filename;
-staticforward char **__pyx_f;
+static char **__pyx_f;
 
 static char __pyx_mdoc[] = "packet capture library\n\nThis module provides a high level interface to packet capture systems.\nAll packets on the network, even those destined for other hosts, are\naccessible through this mechanism.\n";
 
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[],     Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+
+static void __Pyx_AddTraceback(char *funcname); /*proto*/
+
 /* Declarations from pcap */
 
+
+/* Declarations from implementation of pcap */
+
+typedef void (*__pyx_t_4pcap_pcap_handler)(void *,struct pcap_pkthdr *,char *);
+
 struct __pyx_t_4pcap_pcap_handler_ctx {
-  void (*callback);
-  void (*args);
+  void *callback;
+  void *args;
   int got_exc;
 };
 
-staticforward PyTypeObject __pyx_type_4pcap_bpf;
-
 struct __pyx_obj_4pcap_bpf {
   PyObject_HEAD
   struct bpf_program fcode;
 };
 
-staticforward PyTypeObject __pyx_type_4pcap_pcap;
-
 struct __pyx_obj_4pcap_pcap {
   PyObject_HEAD
-  pcap_t (*__pcap);
-  char (*__name);
-  char (*__filter);
-  char (__ebuf[256]);
+  pcap_t *__pcap;
+  char *__name;
+  char *__filter;
+  char __ebuf[256];
   int __dloff;
 };
 
+
+
 static PyTypeObject *__pyx_ptype_4pcap_bpf = 0;
 static PyTypeObject *__pyx_ptype_4pcap_pcap = 0;
-static PyObject *__pyx_k13;
-static PyObject *__pyx_k14;
-static PyObject *__pyx_k15;
-static PyObject *__pyx_k16;
-static PyObject *__pyx_k17;
-static PyObject *__pyx_k18;
-static PyObject *__pyx_k19;
-static PyObject *__pyx_k20;
-static void (__pyx_f_4pcap___pcap_handler(void (*),struct pcap_pkthdr (*),char (*))); /*proto*/
+static void __pyx_f_4pcap___pcap_handler(void *,struct pcap_pkthdr *,char *); /*proto*/
 
-/* Implementation of pcap */
-
-static char (__pyx_k1[]) = "Network interface or dumpfile name.";
-static char (__pyx_k2[]) = "Maximum number of bytes to capture for each packet.";
-static char (__pyx_k3[]) = "Datalink offset (length of layer-2 frame header).";
-static char (__pyx_k4[]) = "Current packet capture filter.";
-static char (__pyx_k5[]) = "File descriptor (or Win32 HANDLE) for capture handle.";
-static char (__pyx_k6[]) = "Dug Song <dugsong@monkey.org>";
-static char (__pyx_k7[]) = "Copyright (c) 2004 Dug Song";
-static char (__pyx_k8[]) = "BSD license";
-static char (__pyx_k9[]) = "http://monkey.org/~dugsong/pypcap/";
-static char (__pyx_k10[]) = "1.1";
+static char __pyx_k1[] = "bad filter";
+static char __pyx_k2[] = "";
+static char __pyx_k3[] = "dltoff";
+static char __pyx_k4[] = "couldn't set BPF immediate mode";
+static char __pyx_k5[] = "append";
+static char __pyx_k6[] = "dispatch";
+static char __pyx_k7[] = "__add_pkts";
+static char __pyx_k8[] = "sys";
+static char __pyx_k9[] = "exc_info";
+static char __pyx_k10[] = "Network interface or dumpfile name.";
+static char __pyx_k11[] = "Maximum number of bytes to capture for each packet.";
+static char __pyx_k12[] = "Datalink offset (length of layer-2 frame header).";
+static char __pyx_k13[] = "Current packet capture filter.";
+static char __pyx_k14[] = "File descriptor (or Win32 HANDLE) for capture handle.";
+static char __pyx_k15[] = "Dug Song <dugsong@monkey.org>";
+static char __pyx_k16[] = "__author__";
+static char __pyx_k17[] = "Copyright (c) 2004 Dug Song";
+static char __pyx_k18[] = "__copyright__";
+static char __pyx_k19[] = "BSD license";
+static char __pyx_k20[] = "__license__";
+static char __pyx_k21[] = "http://monkey.org/~dugsong/pypcap/";
+static char __pyx_k22[] = "__url__";
+static char __pyx_k23[] = "1.1";
+static char __pyx_k24[] = "__version__";
+static char __pyx_k25[] = "DLT_NULL";
+static char __pyx_k26[] = "DLT_EN10MB";
+static char __pyx_k27[] = "DLT_EN3MB";
+static char __pyx_k28[] = "DLT_AX25";
+static char __pyx_k29[] = "DLT_PRONET";
+static char __pyx_k30[] = "DLT_CHAOS";
+static char __pyx_k31[] = "DLT_IEEE802";
+static char __pyx_k32[] = "DLT_ARCNET";
+static char __pyx_k33[] = "DLT_SLIP";
+static char __pyx_k34[] = "DLT_PPP";
+static char __pyx_k35[] = "DLT_FDDI";
+static char __pyx_k36[] = "DLT_LINUX_SLL";
+static char __pyx_k37[] = "DLT_PFLOG";
+static char __pyx_k38[] = "DLT_PFSYNC";
+static char __pyx_k39[] = "platform";
+static char __pyx_k40[] = "find";
+static char __pyx_k41[] = "openbsd";
+static char __pyx_k42[] = "DLT_LOOP";
+static char __pyx_k43[] = "DLT_RAW";
 
-static PyObject *__pyx_n___author__;
-static PyObject *__pyx_n___copyright__;
-static PyObject *__pyx_n___license__;
-static PyObject *__pyx_n___url__;
-static PyObject *__pyx_n___version__;
-static PyObject *__pyx_n_sys;
-static PyObject *__pyx_n_DLT_NULL;
-static PyObject *__pyx_n_DLT_EN10MB;
-static PyObject *__pyx_n_DLT_EN3MB;
+static PyObject *__pyx_n_DLT_ARCNET;
 static PyObject *__pyx_n_DLT_AX25;
-static PyObject *__pyx_n_DLT_PRONET;
 static PyObject *__pyx_n_DLT_CHAOS;
-static PyObject *__pyx_n_DLT_IEEE802;
-static PyObject *__pyx_n_DLT_ARCNET;
-static PyObject *__pyx_n_DLT_SLIP;
-static PyObject *__pyx_n_DLT_PPP;
+static PyObject *__pyx_n_DLT_EN10MB;
+static PyObject *__pyx_n_DLT_EN3MB;
 static PyObject *__pyx_n_DLT_FDDI;
+static PyObject *__pyx_n_DLT_IEEE802;
 static PyObject *__pyx_n_DLT_LINUX_SLL;
+static PyObject *__pyx_n_DLT_LOOP;
+static PyObject *__pyx_n_DLT_NULL;
 static PyObject *__pyx_n_DLT_PFLOG;
 static PyObject *__pyx_n_DLT_PFSYNC;
-static PyObject *__pyx_n_DLT_LOOP;
+static PyObject *__pyx_n_DLT_PPP;
+static PyObject *__pyx_n_DLT_PRONET;
 static PyObject *__pyx_n_DLT_RAW;
+static PyObject *__pyx_n_DLT_SLIP;
+static PyObject *__pyx_n___add_pkts;
+static PyObject *__pyx_n___author__;
+static PyObject *__pyx_n___copyright__;
+static PyObject *__pyx_n___license__;
+static PyObject *__pyx_n___url__;
+static PyObject *__pyx_n___version__;
+static PyObject *__pyx_n_append;
+static PyObject *__pyx_n_dispatch;
 static PyObject *__pyx_n_dltoff;
-static PyObject *__pyx_n_ex_name;
-static PyObject *__pyx_n_lookupdev;
-static PyObject *__pyx_n_platform;
+static PyObject *__pyx_n_exc_info;
 static PyObject *__pyx_n_find;
 static PyObject *__pyx_n_openbsd;
-static PyObject *__pyx_n_True;
-static PyObject *__pyx_n_False;
+static PyObject *__pyx_n_platform;
+static PyObject *__pyx_n_sys;
 
-static PyObject *__pyx_k6p;
-static PyObject *__pyx_k7p;
-static PyObject *__pyx_k8p;
-static PyObject *__pyx_k9p;
-static PyObject *__pyx_k10p;
+static PyObject *__pyx_k1p;
+static PyObject *__pyx_k4p;
+static PyObject *__pyx_k15p;
+static PyObject *__pyx_k17p;
+static PyObject *__pyx_k19p;
+static PyObject *__pyx_k21p;
+static PyObject *__pyx_k23p;
 
-static void __pyx_f_4pcap___pcap_handler(void (*__pyx_v_arg),struct pcap_pkthdr (*__pyx_v_hdr),char (*__pyx_v_pkt)) {
-  struct __pyx_t_4pcap_pcap_handler_ctx (*__pyx_v_ctx);
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+  {&__pyx_n_DLT_ARCNET, 1, __pyx_k32, sizeof(__pyx_k32)},
+  {&__pyx_n_DLT_AX25, 1, __pyx_k28, sizeof(__pyx_k28)},
+  {&__pyx_n_DLT_CHAOS, 1, __pyx_k30, sizeof(__pyx_k30)},
+  {&__pyx_n_DLT_EN10MB, 1, __pyx_k26, sizeof(__pyx_k26)},
+  {&__pyx_n_DLT_EN3MB, 1, __pyx_k27, sizeof(__pyx_k27)},
+  {&__pyx_n_DLT_FDDI, 1, __pyx_k35, sizeof(__pyx_k35)},
+  {&__pyx_n_DLT_IEEE802, 1, __pyx_k31, sizeof(__pyx_k31)},
+  {&__pyx_n_DLT_LINUX_SLL, 1, __pyx_k36, sizeof(__pyx_k36)},
+  {&__pyx_n_DLT_LOOP, 1, __pyx_k42, sizeof(__pyx_k42)},
+  {&__pyx_n_DLT_NULL, 1, __pyx_k25, sizeof(__pyx_k25)},
+  {&__pyx_n_DLT_PFLOG, 1, __pyx_k37, sizeof(__pyx_k37)},
+  {&__pyx_n_DLT_PFSYNC, 1, __pyx_k38, sizeof(__pyx_k38)},
+  {&__pyx_n_DLT_PPP, 1, __pyx_k34, sizeof(__pyx_k34)},
+  {&__pyx_n_DLT_PRONET, 1, __pyx_k29, sizeof(__pyx_k29)},
+  {&__pyx_n_DLT_RAW, 1, __pyx_k43, sizeof(__pyx_k43)},
+  {&__pyx_n_DLT_SLIP, 1, __pyx_k33, sizeof(__pyx_k33)},
+  {&__pyx_n___add_pkts, 1, __pyx_k7, sizeof(__pyx_k7)},
+  {&__pyx_n___author__, 1, __pyx_k16, sizeof(__pyx_k16)},
+  {&__pyx_n___copyright__, 1, __pyx_k18, sizeof(__pyx_k18)},
+  {&__pyx_n___license__, 1, __pyx_k20, sizeof(__pyx_k20)},
+  {&__pyx_n___url__, 1, __pyx_k22, sizeof(__pyx_k22)},
+  {&__pyx_n___version__, 1, __pyx_k24, sizeof(__pyx_k24)},
+  {&__pyx_n_append, 1, __pyx_k5, sizeof(__pyx_k5)},
+  {&__pyx_n_dispatch, 1, __pyx_k6, sizeof(__pyx_k6)},
+  {&__pyx_n_dltoff, 1, __pyx_k3, sizeof(__pyx_k3)},
+  {&__pyx_n_exc_info, 1, __pyx_k9, sizeof(__pyx_k9)},
+  {&__pyx_n_find, 1, __pyx_k40, sizeof(__pyx_k40)},
+  {&__pyx_n_openbsd, 1, __pyx_k41, sizeof(__pyx_k41)},
+  {&__pyx_n_platform, 1, __pyx_k39, sizeof(__pyx_k39)},
+  {&__pyx_n_sys, 1, __pyx_k8, sizeof(__pyx_k8)},
+  {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)},
+  {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)},
+  {&__pyx_k15p, 0, __pyx_k15, sizeof(__pyx_k15)},
+  {&__pyx_k17p, 0, __pyx_k17, sizeof(__pyx_k17)},
+  {&__pyx_k19p, 0, __pyx_k19, sizeof(__pyx_k19)},
+  {&__pyx_k21p, 0, __pyx_k21, sizeof(__pyx_k21)},
+  {&__pyx_k23p, 0, __pyx_k23, sizeof(__pyx_k23)},
+  {0, 0, 0, 0}
+};
+
+static PyObject *__pyx_d1;
+static PyObject *__pyx_d2;
+static PyObject *__pyx_d3;
+static PyObject *__pyx_d4;
+static PyObject *__pyx_d5;
+static PyObject *__pyx_d6;
+static PyObject *__pyx_d7;
+static PyObject *__pyx_d8;
+
+
+/* Implementation of pcap */
+
+static void __pyx_f_4pcap___pcap_handler(void *__pyx_v_arg,struct pcap_pkthdr *__pyx_v_hdr,char *__pyx_v_pkt) {
+  struct __pyx_t_4pcap_pcap_handler_ctx *__pyx_v_ctx;
   int __pyx_v_gil;
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
-  PyObject *__pyx_4 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":92 */
-  __pyx_v_ctx = ((struct __pyx_t_4pcap_pcap_handler_ctx (*))__pyx_v_arg);
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":92 */
+  __pyx_v_ctx = ((struct __pyx_t_4pcap_pcap_handler_ctx *)__pyx_v_arg);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":93 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":93 */
   __pyx_v_gil = PyGILState_Ensure();
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":94 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":94 */
   /*try:*/ {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":95 */
-    __pyx_1 = (PyObject *)__pyx_v_ctx->callback;
-    Py_INCREF(__pyx_1);
-    __pyx_2 = PyFloat_FromDouble((__pyx_v_hdr->ts.tv_sec + (__pyx_v_hdr->ts.tv_usec / 1000000.0))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
-    __pyx_3 = PyBuffer_FromMemory(__pyx_v_pkt,__pyx_v_hdr->caplen); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L2;}
-    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
-    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
-    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+    __pyx_1 = PyFloat_FromDouble((__pyx_v_hdr->ts.tv_sec + (__pyx_v_hdr->ts.tv_usec / 1000000.0))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
+    __pyx_2 = PyBuffer_FromMemory(__pyx_v_pkt,__pyx_v_hdr->caplen); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L2;}
+    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
+    __pyx_1 = 0;
     __pyx_2 = 0;
-    __pyx_3 = 0;
-    __pyx_2 = (PyObject *)__pyx_v_ctx->args;
-    Py_INCREF(__pyx_2);
-    __pyx_3 = PySequence_Tuple(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
-    Py_DECREF(__pyx_2); __pyx_2 = 0;
-    __pyx_2 = PyNumber_Add(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    __pyx_1 = PySequence_Tuple(((PyObject *)__pyx_v_ctx->args)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
+    __pyx_2 = PyNumber_Add(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
-    __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
     Py_DECREF(__pyx_1); __pyx_1 = 0;
+    __pyx_3 = PyObject_CallObject(((PyObject *)__pyx_v_ctx->callback), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L2;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
   }
   goto __pyx_L3;
   __pyx_L2:;
-  Py_XDECREF(__pyx_3); __pyx_3 = 0;
   Py_XDECREF(__pyx_1); __pyx_1 = 0;
   Py_XDECREF(__pyx_2); __pyx_2 = 0;
-  Py_XDECREF(__pyx_4); __pyx_4 = 0;
+  Py_XDECREF(__pyx_3); __pyx_3 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":98 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":98 */
   /*except:*/ {
-    __Pyx_AddTraceback("pcap.__pcap_handler");
-    __pyx_3 = __Pyx_GetExcValue(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":99 */
     __pyx_v_ctx->got_exc = 1;
     goto __pyx_L3;
   }
   __pyx_L3:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":100 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":100 */
   PyGILState_Release(__pyx_v_gil);
 
-  goto __pyx_L0;
-  __pyx_L1:;
-  Py_XDECREF(__pyx_1);
-  Py_XDECREF(__pyx_2);
-  Py_XDECREF(__pyx_3);
-  Py_XDECREF(__pyx_4);
-  __Pyx_WriteUnraisable("pcap.__pcap_handler");
-  __pyx_L0:;
 }
 
-static PyObject *__pyx_n_IOError;
-
-static PyObject *__pyx_k21p;
-
-static char (__pyx_k21[]) = "bad filter";
-
 static int __pyx_f_4pcap_3bpf___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_f_4pcap_3bpf___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  char (*__pyx_v_filter);
+  char *__pyx_v_filter;
   PyObject *__pyx_v_dlt = 0;
   int __pyx_r;
   int __pyx_1;
   int __pyx_2;
-  PyObject *__pyx_3 = 0;
   static char *__pyx_argnames[] = {"filter","dlt",0};
-  __pyx_v_dlt = __pyx_k13;
+  __pyx_v_dlt = __pyx_d1;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s|O", __pyx_argnames, &__pyx_v_filter, &__pyx_v_dlt)) return -1;
   Py_INCREF(__pyx_v_self);
   Py_INCREF(__pyx_v_dlt);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":133 */
   __pyx_1 = PyInt_AsLong(__pyx_v_dlt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
   __pyx_2 = (pcap_ex_compile_nopcap(65535,__pyx_1,(&((struct __pyx_obj_4pcap_bpf *)__pyx_v_self)->fcode),__pyx_v_filter,1,0) < 0);
   if (__pyx_2) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":134 */
-    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_IOError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_3, __pyx_k21p, 0);
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __Pyx_Raise(PyExc_IOError, __pyx_k1p, 0);
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
     goto __pyx_L2;
   }
@@ -236,7 +294,6 @@
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1:;
-  Py_XDECREF(__pyx_3);
   __Pyx_AddTraceback("pcap.bpf.__init__");
   __pyx_r = -1;
   __pyx_L0:;
@@ -245,62 +302,43 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_len;
-
 static PyObject *__pyx_f_4pcap_3bpf_filter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_4pcap_3bpf_filter[] = "Return boolean match for buf against our filter.";
 static PyObject *__pyx_f_4pcap_3bpf_filter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_buf = 0;
   int __pyx_v_n;
   PyObject *__pyx_r;
-  PyObject *__pyx_1 = 0;
-  PyObject *__pyx_2 = 0;
-  PyObject *__pyx_3 = 0;
-  int __pyx_4;
-  char (*__pyx_5);
+  Py_ssize_t __pyx_1;
+  char *__pyx_2;
+  int __pyx_3;
   static char *__pyx_argnames[] = {"buf",0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0;
   Py_INCREF(__pyx_v_self);
   Py_INCREF(__pyx_v_buf);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":138 */
-  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
-  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
-  Py_INCREF(__pyx_v_buf);
-  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_buf);
-  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
-  Py_DECREF(__pyx_1); __pyx_1 = 0;
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
-  __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_v_n = __pyx_4;
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":139 */
-  __pyx_5 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
-  __pyx_4 = (bpf_filter(((struct __pyx_obj_4pcap_bpf *)__pyx_v_self)->fcode.bf_insns,__pyx_5,__pyx_v_n,__pyx_v_n) == 0);
-  if (__pyx_4) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":140 */
-    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
-    __pyx_r = __pyx_1;
-    __pyx_1 = 0;
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":138 */
+  __pyx_1 = PyObject_Length(__pyx_v_buf); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
+  __pyx_v_n = __pyx_1;
+
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":139 */
+  __pyx_2 = PyString_AsString(__pyx_v_buf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
+  __pyx_3 = (bpf_filter(((struct __pyx_obj_4pcap_bpf *)__pyx_v_self)->fcode.bf_insns,__pyx_2,__pyx_v_n,__pyx_v_n) == 0);
+  if (__pyx_3) {
+    Py_INCREF(Py_False);
+    __pyx_r = Py_False;
     goto __pyx_L0;
     goto __pyx_L2;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":141 */
-  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
-  __pyx_r = __pyx_2;
-  __pyx_2 = 0;
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":141 */
+  Py_INCREF(Py_True);
+  __pyx_r = Py_True;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
-  Py_XDECREF(__pyx_1);
-  Py_XDECREF(__pyx_2);
-  Py_XDECREF(__pyx_3);
   __Pyx_AddTraceback("pcap.bpf.filter");
   __pyx_r = 0;
   __pyx_L0:;
@@ -312,25 +350,11 @@
 static void __pyx_f_4pcap_3bpf___dealloc__(PyObject *__pyx_v_self); /*proto*/
 static void __pyx_f_4pcap_3bpf___dealloc__(PyObject *__pyx_v_self) {
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":143 */
   pcap_freecode((&((struct __pyx_obj_4pcap_bpf *)__pyx_v_self)->fcode));
 
-  goto __pyx_L0;
-  __pyx_L1:;
-  __Pyx_AddTraceback("pcap.bpf.__dealloc__");
-  __pyx_L0:;
   Py_DECREF(__pyx_v_self);
 }
 
-static PyObject *__pyx_n_OSError;
-static PyObject *__pyx_n_KeyError;
-
-static PyObject *__pyx_k23p;
-
-static char (__pyx_k22[]) = "";
-static char (__pyx_k23[]) = "couldn't set BPF immediate mode";
-
 static int __pyx_f_4pcap_4pcap___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_f_4pcap_4pcap___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_name = 0;
@@ -338,21 +362,21 @@
   PyObject *__pyx_v_promisc = 0;
   PyObject *__pyx_v_timeout_ms = 0;
   PyObject *__pyx_v_immediate = 0;
-  char (*__pyx_v_p);
+  char *__pyx_v_p;
   int __pyx_r;
   int __pyx_1;
   int __pyx_2;
   PyObject *__pyx_3 = 0;
-  PyObject *__pyx_4 = 0;
-  char (*__pyx_5);
-  int __pyx_6;
+  char *__pyx_4;
+  int __pyx_5;
+  PyObject *__pyx_6 = 0;
   PyObject *__pyx_7 = 0;
   static char *__pyx_argnames[] = {"name","snaplen","promisc","timeout_ms","immediate",0};
-  __pyx_v_name = __pyx_k14;
-  __pyx_v_snaplen = __pyx_k15;
-  __pyx_v_promisc = __pyx_k16;
-  __pyx_v_timeout_ms = __pyx_k17;
-  __pyx_v_immediate = __pyx_k18;
+  __pyx_v_name = __pyx_d2;
+  __pyx_v_snaplen = __pyx_d3;
+  __pyx_v_promisc = __pyx_d4;
+  __pyx_v_timeout_ms = __pyx_d5;
+  __pyx_v_immediate = __pyx_d6;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOO", __pyx_argnames, &__pyx_v_name, &__pyx_v_snaplen, &__pyx_v_promisc, &__pyx_v_timeout_ms, &__pyx_v_immediate)) return -1;
   Py_INCREF(__pyx_v_self);
   Py_INCREF(__pyx_v_name);
@@ -361,24 +385,20 @@
   Py_INCREF(__pyx_v_timeout_ms);
   Py_INCREF(__pyx_v_immediate);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":168 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":168 */
   __pyx_1 = PyObject_IsTrue(__pyx_v_name); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;}
   __pyx_2 = (!__pyx_1);
   if (__pyx_2) {
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":169 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":169 */
     __pyx_v_p = pcap_ex_lookupdev(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf);
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":170 */
-    __pyx_1 = (__pyx_v_p == 0);
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":170 */
+    __pyx_1 = (__pyx_v_p == NULL);
     if (__pyx_1) {
-
-      /* "/Users/dugsong/projects/pypcap/pcap.pyx":171 */
-      __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
-      __pyx_4 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
-      __Pyx_Raise(__pyx_3, __pyx_4, 0);
+      __pyx_3 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
+      __Pyx_Raise(PyExc_OSError, __pyx_3, 0);
       Py_DECREF(__pyx_3); __pyx_3 = 0;
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
       goto __pyx_L3;
     }
@@ -386,57 +406,49 @@
     goto __pyx_L2;
   }
   /*else*/ {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":173 */
-    __pyx_5 = PyString_AsString(__pyx_v_name); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;}
-    __pyx_v_p = __pyx_5;
+    __pyx_4 = PyString_AsString(__pyx_v_name); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;}
+    __pyx_v_p = __pyx_4;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":175 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":175 */
   ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap = pcap_open_offline(__pyx_v_p,((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":176 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":176 */
   __pyx_2 = (!(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap != 0));
   if (__pyx_2) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":177 */
     __pyx_1 = PyInt_AsLong(__pyx_v_snaplen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
     __pyx_2 = PyInt_AsLong(__pyx_v_promisc); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
-    __pyx_6 = PyInt_AsLong(__pyx_v_timeout_ms); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
-    ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap = pcap_open_live(pcap_ex_name(__pyx_v_p),__pyx_1,__pyx_2,__pyx_6,((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf);
+    __pyx_5 = PyInt_AsLong(__pyx_v_timeout_ms); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
+    ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap = pcap_open_live(pcap_ex_name(__pyx_v_p),__pyx_1,__pyx_2,__pyx_5,((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf);
     goto __pyx_L4;
   }
   __pyx_L4:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":179 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":179 */
   __pyx_1 = (!(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap != 0));
   if (__pyx_1) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":180 */
-    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
-    __pyx_4 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_3, __pyx_4, 0);
+    __pyx_3 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
+    __Pyx_Raise(PyExc_OSError, __pyx_3, 0);
     Py_DECREF(__pyx_3); __pyx_3 = 0;
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
     goto __pyx_L5;
   }
   __pyx_L5:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":182 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":182 */
   ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__name = strdup(__pyx_v_p);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":183 */
-  ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter = strdup(__pyx_k22);
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":183 */
+  ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter = strdup(__pyx_k2);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":184 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":184 */
   /*try:*/ {
     __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_dltoff); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L6;}
-    __pyx_4 = PyInt_FromLong(pcap_datalink(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L6;}
-    __pyx_7 = PyObject_GetItem(__pyx_3, __pyx_4); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L6;}
+    __pyx_6 = PyInt_FromLong(pcap_datalink(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L6;}
+    __pyx_7 = PyObject_GetItem(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L6;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    Py_DECREF(__pyx_6); __pyx_6 = 0;
     __pyx_2 = PyInt_AsLong(__pyx_7); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L6;}
     Py_DECREF(__pyx_7); __pyx_7 = 0;
     ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__dloff = __pyx_2;
@@ -444,38 +456,29 @@
   goto __pyx_L7;
   __pyx_L6:;
   Py_XDECREF(__pyx_3); __pyx_3 = 0;
-  Py_XDECREF(__pyx_4); __pyx_4 = 0;
+  Py_XDECREF(__pyx_6); __pyx_6 = 0;
   Py_XDECREF(__pyx_7); __pyx_7 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":185 */
-  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
-  __pyx_6 = PyErr_ExceptionMatches(__pyx_3);
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
-  if (__pyx_6) {
-    __Pyx_AddTraceback("pcap.__init__");
-    __pyx_4 = __Pyx_GetExcValue(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":185 */
+  __pyx_5 = PyErr_ExceptionMatches(PyExc_KeyError);
+  if (__pyx_5) {
     goto __pyx_L7;
   }
   goto __pyx_L1;
   __pyx_L7:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":186 */
-  __pyx_7 = __pyx_v_immediate;
-  Py_INCREF(__pyx_7);
-  __pyx_1 = PyObject_IsTrue(__pyx_7); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":186 */
+  __pyx_3 = __pyx_v_immediate;
+  Py_INCREF(__pyx_3);
+  __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
   if (__pyx_1) {
-    Py_DECREF(__pyx_7); __pyx_7 = 0;
-    __pyx_7 = PyInt_FromLong((pcap_ex_immediate(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap) < 0)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __pyx_3 = PyInt_FromLong((pcap_ex_immediate(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap) < 0)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
   }
-  __pyx_2 = PyObject_IsTrue(__pyx_7); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  Py_DECREF(__pyx_7); __pyx_7 = 0;
+  __pyx_2 = PyObject_IsTrue(__pyx_3); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
   if (__pyx_2) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":187 */
-    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_3, __pyx_k23p, 0);
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __Pyx_Raise(PyExc_OSError, __pyx_k4p, 0);
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
     goto __pyx_L8;
   }
@@ -485,7 +488,7 @@
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_3);
-  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_6);
   Py_XDECREF(__pyx_7);
   __Pyx_AddTraceback("pcap.pcap.__init__");
   __pyx_r = -1;
@@ -504,14 +507,12 @@
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":192 */
   __pyx_1 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -527,14 +528,12 @@
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":197 */
   __pyx_1 = PyInt_FromLong(pcap_snapshot(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -550,14 +549,12 @@
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":202 */
   __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__dloff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -573,14 +570,12 @@
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":207 */
   __pyx_1 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -596,14 +591,12 @@
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":212 */
   __pyx_1 = PyInt_FromLong(pcap_ex_fileno(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -622,14 +615,12 @@
   static char *__pyx_argnames[] = {0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":216 */
   __pyx_1 = PyInt_FromLong(pcap_ex_fileno(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -647,64 +638,54 @@
   PyObject *__pyx_v_optimize = 0;
   struct bpf_program __pyx_v_fcode;
   PyObject *__pyx_r;
-  char (*__pyx_1);
+  char *__pyx_1;
   int __pyx_2;
   int __pyx_3;
   PyObject *__pyx_4 = 0;
-  PyObject *__pyx_5 = 0;
   static char *__pyx_argnames[] = {"value","optimize",0};
-  __pyx_v_optimize = __pyx_k19;
+  __pyx_v_optimize = __pyx_d7;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_value, &__pyx_v_optimize)) return 0;
   Py_INCREF(__pyx_v_self);
   Py_INCREF(__pyx_v_value);
   Py_INCREF(__pyx_v_optimize);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":221 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":221 */
   free(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":222 */
-  __pyx_1 = PyString_AsString(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":222 */
+  __pyx_1 = PyString_AsString(__pyx_v_value); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;}
   ((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter = strdup(__pyx_1);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":223 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":223 */
   __pyx_2 = PyInt_AsLong(__pyx_v_optimize); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;}
   __pyx_3 = (pcap_compile(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,(&__pyx_v_fcode),((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter,__pyx_2,0) < 0);
   if (__pyx_3) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":224 */
-    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
-    __pyx_5 = PyString_FromString(pcap_geterr(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_4, __pyx_5, 0);
+    __pyx_4 = PyString_FromString(pcap_geterr(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
+    __Pyx_Raise(PyExc_OSError, __pyx_4, 0);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
-    Py_DECREF(__pyx_5); __pyx_5 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
     goto __pyx_L2;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":225 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":225 */
   __pyx_2 = (pcap_setfilter(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,(&__pyx_v_fcode)) < 0);
   if (__pyx_2) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":226 */
-    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
-    __pyx_5 = PyString_FromString(pcap_geterr(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_4, __pyx_5, 0);
+    __pyx_4 = PyString_FromString(pcap_geterr(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
+    __Pyx_Raise(PyExc_OSError, __pyx_4, 0);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
-    Py_DECREF(__pyx_5); __pyx_5 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
     goto __pyx_L3;
   }
   __pyx_L3:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":227 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":227 */
   pcap_freecode((&__pyx_v_fcode));
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_4);
-  Py_XDECREF(__pyx_5);
   __Pyx_AddTraceback("pcap.pcap.setfilter");
   __pyx_r = 0;
   __pyx_L0:;
@@ -721,16 +702,14 @@
   PyObject *__pyx_r;
   int __pyx_1;
   static char *__pyx_argnames[] = {"nonblock",0};
-  __pyx_v_nonblock = __pyx_k20;
+  __pyx_v_nonblock = __pyx_d8;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_nonblock)) return 0;
   Py_INCREF(__pyx_v_self);
   Py_INCREF(__pyx_v_nonblock);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":231 */
   __pyx_1 = PyInt_AsLong(__pyx_v_nonblock); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
   pcap_ex_setnonblock(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,__pyx_1,((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf);
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   __Pyx_AddTraceback("pcap.pcap.setnonblock");
@@ -748,57 +727,47 @@
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   int __pyx_2;
-  PyObject *__pyx_3 = 0;
   static char *__pyx_argnames[] = {0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
   Py_INCREF(__pyx_v_self);
-  __pyx_v_ret = Py_None; Py_INCREF(__pyx_v_ret);
+  __pyx_v_ret = Py_None; Py_INCREF(Py_None);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":235 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":235 */
   __pyx_1 = PyInt_FromLong(pcap_ex_getnonblock(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
   Py_DECREF(__pyx_v_ret);
   __pyx_v_ret = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":236 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":236 */
   __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;}
   if (PyObject_Cmp(__pyx_v_ret, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;}
   __pyx_2 = __pyx_2 < 0;
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   if (__pyx_2) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":237 */
-    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
-    __pyx_3 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_1, __pyx_3, 0);
+    __pyx_1 = PyString_FromString(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__ebuf); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
+    __Pyx_Raise(PyExc_OSError, __pyx_1, 0);
     Py_DECREF(__pyx_1); __pyx_1 = 0;
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
     goto __pyx_L2;
   }
   __pyx_2 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;}
   if (__pyx_2) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":239 */
-    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;}
-    __pyx_r = __pyx_1;
-    __pyx_1 = 0;
+    Py_INCREF(Py_True);
+    __pyx_r = Py_True;
     goto __pyx_L0;
     goto __pyx_L2;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":240 */
-  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;}
-  __pyx_r = __pyx_3;
-  __pyx_3 = 0;
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":240 */
+  Py_INCREF(Py_False);
+  __pyx_r = Py_False;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
-  Py_XDECREF(__pyx_3);
   __Pyx_AddTraceback("pcap.pcap.getnonblock");
   __pyx_r = 0;
   __pyx_L0:;
@@ -815,14 +784,12 @@
   static char *__pyx_argnames[] = {0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":244 */
   __pyx_1 = PyInt_FromLong(pcap_datalink(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -837,7 +804,7 @@
 static char __pyx_doc_4pcap_4pcap_next[] = "Return the next (timestamp, packet) tuple, or None on error.";
 static PyObject *__pyx_f_4pcap_4pcap_next(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   struct pcap_pkthdr __pyx_v_hdr;
-  char (*__pyx_v_pkt);
+  char *__pyx_v_pkt;
   PyObject *__pyx_r;
   int __pyx_1;
   PyObject *__pyx_2 = 0;
@@ -847,14 +814,12 @@
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
   Py_INCREF(__pyx_v_self);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":250 */
-  __pyx_v_pkt = ((char (*))pcap_next(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,(&__pyx_v_hdr)));
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":250 */
+  __pyx_v_pkt = ((char *)pcap_next(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,(&__pyx_v_hdr)));
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":251 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":251 */
   __pyx_1 = (!(__pyx_v_pkt != 0));
   if (__pyx_1) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":252 */
     Py_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
@@ -862,7 +827,7 @@
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":253 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":253 */
   __pyx_2 = PyFloat_FromDouble((__pyx_v_hdr.ts.tv_sec + (__pyx_v_hdr.ts.tv_usec / 1000000.0))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}
   __pyx_3 = PyBuffer_FromMemory(__pyx_v_pkt,__pyx_v_hdr.caplen); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
   __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}
@@ -874,7 +839,7 @@
   __pyx_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_2);
@@ -887,8 +852,6 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_append;
-
 static PyObject *__pyx_f_4pcap_4pcap___add_pkts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static PyObject *__pyx_f_4pcap_4pcap___add_pkts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_ts = 0;
@@ -904,8 +867,6 @@
   Py_INCREF(__pyx_v_ts);
   Py_INCREF(__pyx_v_pkt);
   Py_INCREF(__pyx_v_pkts);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":257 */
   __pyx_1 = PyObject_GetAttr(__pyx_v_pkts, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;}
   __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;}
   Py_INCREF(__pyx_v_ts);
@@ -920,7 +881,7 @@
   Py_DECREF(__pyx_3); __pyx_3 = 0;
   Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -936,9 +897,6 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_dispatch;
-static PyObject *__pyx_n___add_pkts;
-
 static PyObject *__pyx_f_4pcap_4pcap_readpkts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_4pcap_4pcap_readpkts[] = "Return a list of (timestamp, packet) tuples received in one buffer.";
 static PyObject *__pyx_f_4pcap_4pcap_readpkts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -951,15 +909,15 @@
   static char *__pyx_argnames[] = {0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
   Py_INCREF(__pyx_v_self);
-  __pyx_v_pkts = Py_None; Py_INCREF(__pyx_v_pkts);
+  __pyx_v_pkts = Py_None; Py_INCREF(Py_None);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":261 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":261 */
   __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;}
   Py_DECREF(__pyx_v_pkts);
   __pyx_v_pkts = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":262 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":262 */
   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_dispatch); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
   __pyx_2 = PyInt_FromLong((-1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
   __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n___add_pkts); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
@@ -975,12 +933,12 @@
   Py_DECREF(__pyx_4); __pyx_4 = 0;
   Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":263 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":263 */
   Py_INCREF(__pyx_v_pkts);
   __pyx_r = __pyx_v_pkts;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -995,8 +953,6 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_exc_info;
-
 static PyObject *__pyx_f_4pcap_4pcap_dispatch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_4pcap_4pcap_dispatch[] = "Collect and process packets with a user callback,\n        return the number of packets processed, or 0 for a savefile.\n        \n        Arguments:\n        \n        cnt      -- number of packets to process;\n                    or 0 to process all packets until an error occurs,\n                    EOF is reached, or the read times out;\n                    or -1 to process all packets received in one buffer\n        callback -- function with (timestamp, pkt, *args) prototype\n        *args    -- optional arguments passed to callback on execution\n        ";
 static PyObject *__pyx_f_4pcap_4pcap_dispatch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -1013,7 +969,7 @@
   PyObject *__pyx_4 = 0;
   PyObject *__pyx_5 = 0;
   static char *__pyx_argnames[] = {"cnt","callback",0};
-  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0) < 0) return 0;
+  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0, 0) < 0) return 0;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_cnt, &__pyx_v_callback)) {
     Py_XDECREF(__pyx_args);
     Py_XDECREF(__pyx_kwds);
@@ -1023,63 +979,61 @@
   Py_INCREF(__pyx_v_self);
   Py_INCREF(__pyx_v_cnt);
   Py_INCREF(__pyx_v_callback);
-  __pyx_v_exc = Py_None; Py_INCREF(__pyx_v_exc);
+  __pyx_v_exc = Py_None; Py_INCREF(Py_None);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":281 */
-  __pyx_v_ctx.callback = ((void (*))__pyx_v_callback);
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":281 */
+  __pyx_v_ctx.callback = ((void *)__pyx_v_callback);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":282 */
-  __pyx_v_ctx.args = ((void (*))__pyx_v_args);
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":282 */
+  __pyx_v_ctx.args = ((void *)__pyx_v_args);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":283 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":283 */
   __pyx_v_ctx.got_exc = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":284 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":284 */
   __pyx_1 = PyInt_AsLong(__pyx_v_cnt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
-  __pyx_v_n = pcap_dispatch(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,__pyx_1,__pyx_f_4pcap___pcap_handler,((unsigned char (*))(&__pyx_v_ctx)));
+  __pyx_v_n = pcap_dispatch(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,__pyx_1,__pyx_f_4pcap___pcap_handler,((unsigned char *)(&__pyx_v_ctx)));
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":286 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":286 */
   __pyx_1 = __pyx_v_ctx.got_exc;
   if (__pyx_1) {
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":287 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":287 */
     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_exc_info); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
-    __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
-    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
+    __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
-    Py_DECREF(__pyx_2); __pyx_2 = 0;
     Py_DECREF(__pyx_v_exc);
-    __pyx_v_exc = __pyx_4;
-    __pyx_4 = 0;
+    __pyx_v_exc = __pyx_2;
+    __pyx_2 = 0;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":288 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":288 */
     __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
     __pyx_2 = PyObject_GetItem(__pyx_v_exc, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
-    __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
-    __pyx_3 = PyObject_GetItem(__pyx_v_exc, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
-    __pyx_4 = PyInt_FromLong(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
-    __pyx_5 = PyObject_GetItem(__pyx_v_exc, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
-    __Pyx_Raise(__pyx_2, __pyx_3, __pyx_5);
-    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
+    __pyx_4 = PyObject_GetItem(__pyx_v_exc, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
+    __pyx_5 = PyObject_GetItem(__pyx_v_exc, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __Pyx_Raise(__pyx_2, __pyx_4, __pyx_5);
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
     Py_DECREF(__pyx_5); __pyx_5 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;}
     goto __pyx_L2;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":289 */
-  __pyx_4 = PyInt_FromLong(__pyx_v_n); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}
-  __pyx_r = __pyx_4;
-  __pyx_4 = 0;
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":289 */
+  __pyx_3 = PyInt_FromLong(__pyx_v_n); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}
+  __pyx_r = __pyx_3;
+  __pyx_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_2);
@@ -1099,15 +1053,13 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_KeyboardInterrupt;
-
 static PyObject *__pyx_f_4pcap_4pcap_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_4pcap_4pcap_loop[] = "Loop forever, processing packets with a user callback.\n        The loop can be exited with an exception, including KeyboardInterrupt.\n        \n        Arguments:\n\n        callback -- function with (timestamp, pkt, *args) prototype\n        *args    -- optional arguments passed to callback on execution\n        ";
 static PyObject *__pyx_f_4pcap_4pcap_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_callback = 0;
   PyObject *__pyx_v_args = 0;
-  struct pcap_pkthdr (*__pyx_v_hdr);
-  char (*__pyx_v_pkt);
+  struct pcap_pkthdr *__pyx_v_hdr;
+  char *__pyx_v_pkt;
   int __pyx_v_n;
   PyObject *__pyx_r;
   long __pyx_1;
@@ -1116,7 +1068,7 @@
   PyObject *__pyx_4 = 0;
   PyObject *__pyx_5 = 0;
   static char *__pyx_argnames[] = {"callback",0};
-  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_args, 0) < 0) return 0;
+  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_args, 0, 0) < 0) return 0;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_callback)) {
     Py_XDECREF(__pyx_args);
     Py_XDECREF(__pyx_kwds);
@@ -1126,29 +1078,26 @@
   Py_INCREF(__pyx_v_self);
   Py_INCREF(__pyx_v_callback);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":303 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":303 */
   pcap_ex_setup(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":304 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":304 */
   while (1) {
-    __pyx_L2:;
     __pyx_1 = 1;
     if (!__pyx_1) break;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":305 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":305 */
     Py_BEGIN_ALLOW_THREADS;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":306 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":306 */
     __pyx_v_n = pcap_ex_next(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,(&__pyx_v_hdr),(&__pyx_v_pkt));
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":307 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":307 */
     Py_END_ALLOW_THREADS;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":308 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":308 */
     __pyx_2 = (__pyx_v_n == 1);
     if (__pyx_2) {
-
-      /* "/Users/dugsong/projects/pypcap/pcap.pyx":309 */
       __pyx_3 = PyFloat_FromDouble((__pyx_v_hdr->ts.tv_sec + (__pyx_v_hdr->ts.tv_usec / 1000000.0))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}
       __pyx_4 = PyBuffer_FromMemory(__pyx_v_pkt,__pyx_v_hdr->caplen); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}
       __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}
@@ -1167,18 +1116,12 @@
     }
     __pyx_2 = (__pyx_v_n == (-1));
     if (__pyx_2) {
-
-      /* "/Users/dugsong/projects/pypcap/pcap.pyx":312 */
-      __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_KeyboardInterrupt); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}
-      __Pyx_Raise(__pyx_3, 0, 0);
-      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __Pyx_Raise(PyExc_KeyboardInterrupt, 0, 0);
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}
       goto __pyx_L4;
     }
     __pyx_2 = (__pyx_v_n == (-2));
     if (__pyx_2) {
-
-      /* "/Users/dugsong/projects/pypcap/pcap.pyx":314 */
       goto __pyx_L3;
       goto __pyx_L4;
     }
@@ -1186,7 +1129,7 @@
   }
   __pyx_L3:;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_3);
@@ -1211,14 +1154,12 @@
   static char *__pyx_argnames[] = {0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
   Py_INCREF(__pyx_v_self);
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":318 */
   __pyx_1 = PyString_FromString(pcap_geterr(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -1243,25 +1184,21 @@
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
   Py_INCREF(__pyx_v_self);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":324 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":324 */
   __pyx_1 = (pcap_stats(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,(&__pyx_v_pstat)) < 0);
   if (__pyx_1) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":325 */
-    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
-    __pyx_3 = PyString_FromString(pcap_geterr(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_2, __pyx_3, 0);
+    __pyx_2 = PyString_FromString(pcap_geterr(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
+    __Pyx_Raise(PyExc_OSError, __pyx_2, 0);
     Py_DECREF(__pyx_2); __pyx_2 = 0;
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
     goto __pyx_L2;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":326 */
-  __pyx_2 = PyInt_FromLong(__pyx_v_pstat.ps_recv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
-  __pyx_3 = PyInt_FromLong(__pyx_v_pstat.ps_drop); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
-  __pyx_4 = PyInt_FromLong(__pyx_v_pstat.ps_ifdrop); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":326 */
+  __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_pstat.ps_recv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
+  __pyx_3 = PyLong_FromUnsignedLong(__pyx_v_pstat.ps_drop); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
+  __pyx_4 = PyLong_FromUnsignedLong(__pyx_v_pstat.ps_ifdrop); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
   __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
   PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
   PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
@@ -1273,7 +1210,7 @@
   __pyx_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_2);
@@ -1292,30 +1229,24 @@
   PyObject *__pyx_r;
   Py_INCREF(__pyx_v_self);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":329 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":329 */
   pcap_ex_setup(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":330 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":330 */
   Py_INCREF(__pyx_v_self);
   __pyx_r = __pyx_v_self;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
-  goto __pyx_L0;
-  __pyx_L1:;
-  __Pyx_AddTraceback("pcap.pcap.__iter__");
-  __pyx_r = 0;
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   __pyx_L0:;
   Py_DECREF(__pyx_v_self);
   return __pyx_r;
 }
 
-static PyObject *__pyx_n_StopIteration;
-
 static PyObject *__pyx_f_4pcap_4pcap___next__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_f_4pcap_4pcap___next__(PyObject *__pyx_v_self) {
-  struct pcap_pkthdr (*__pyx_v_hdr);
-  char (*__pyx_v_pkt);
+  struct pcap_pkthdr *__pyx_v_hdr;
+  char *__pyx_v_pkt;
   int __pyx_v_n;
   PyObject *__pyx_r;
   long __pyx_1;
@@ -1325,26 +1256,23 @@
   PyObject *__pyx_5 = 0;
   Py_INCREF(__pyx_v_self);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":336 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":336 */
   while (1) {
-    __pyx_L2:;
     __pyx_1 = 1;
     if (!__pyx_1) break;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":337 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":337 */
     Py_BEGIN_ALLOW_THREADS;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":338 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":338 */
     __pyx_v_n = pcap_ex_next(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap,(&__pyx_v_hdr),(&__pyx_v_pkt));
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":339 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":339 */
     Py_END_ALLOW_THREADS;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":340 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":340 */
     __pyx_2 = (__pyx_v_n == 1);
     if (__pyx_2) {
-
-      /* "/Users/dugsong/projects/pypcap/pcap.pyx":341 */
       __pyx_3 = PyFloat_FromDouble((__pyx_v_hdr->ts.tv_sec + (__pyx_v_hdr->ts.tv_usec / 1000000.0))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
       __pyx_4 = PyBuffer_FromMemory(__pyx_v_pkt,__pyx_v_hdr->caplen); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; goto __pyx_L1;}
       __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
@@ -1359,29 +1287,20 @@
     }
     __pyx_2 = (__pyx_v_n == (-1));
     if (__pyx_2) {
-
-      /* "/Users/dugsong/projects/pypcap/pcap.pyx":344 */
-      __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_KeyboardInterrupt); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
-      __Pyx_Raise(__pyx_3, 0, 0);
-      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __Pyx_Raise(PyExc_KeyboardInterrupt, 0, 0);
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
       goto __pyx_L4;
     }
     __pyx_2 = (__pyx_v_n == (-2));
     if (__pyx_2) {
-
-      /* "/Users/dugsong/projects/pypcap/pcap.pyx":346 */
-      __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}
-      __Pyx_Raise(__pyx_4, 0, 0);
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      __Pyx_Raise(PyExc_StopIteration, 0, 0);
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}
       goto __pyx_L4;
     }
     __pyx_L4:;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_3);
@@ -1399,58 +1318,46 @@
   int __pyx_1;
   Py_INCREF(__pyx_v_self);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":349 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":349 */
   __pyx_1 = (((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__name != 0);
   if (__pyx_1) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":350 */
     free(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__name);
     goto __pyx_L2;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":351 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":351 */
   __pyx_1 = (((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter != 0);
   if (__pyx_1) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":352 */
     free(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__filter);
     goto __pyx_L3;
   }
   __pyx_L3:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":353 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":353 */
   __pyx_1 = (((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap != 0);
   if (__pyx_1) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":354 */
     pcap_close(((struct __pyx_obj_4pcap_pcap *)__pyx_v_self)->__pcap);
     goto __pyx_L4;
   }
   __pyx_L4:;
 
-  goto __pyx_L0;
-  __pyx_L1:;
-  __Pyx_AddTraceback("pcap.pcap.__dealloc__");
-  __pyx_L0:;
   Py_DECREF(__pyx_v_self);
 }
 
 static PyObject *__pyx_f_4pcap_ex_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static PyObject *__pyx_f_4pcap_ex_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  char (*__pyx_v_foo);
+  char *__pyx_v_foo;
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
   static char *__pyx_argnames[] = {"foo",0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s", __pyx_argnames, &__pyx_v_foo)) return 0;
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":357 */
   __pyx_1 = PyString_FromString(pcap_ex_name(__pyx_v_foo)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
@@ -1463,113 +1370,51 @@
 static PyObject *__pyx_f_4pcap_lookupdev(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_4pcap_lookupdev[] = "Return the name of a network device suitable for sniffing.";
 static PyObject *__pyx_f_4pcap_lookupdev(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  char (*__pyx_v_p);
-  char (__pyx_v_ebuf[256]);
+  char *__pyx_v_p;
+  char __pyx_v_ebuf[256];
   PyObject *__pyx_r;
   int __pyx_1;
   PyObject *__pyx_2 = 0;
-  PyObject *__pyx_3 = 0;
   static char *__pyx_argnames[] = {0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":362 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":362 */
   __pyx_v_p = pcap_ex_lookupdev(__pyx_v_ebuf);
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":363 */
-  __pyx_1 = (__pyx_v_p == 0);
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":363 */
+  __pyx_1 = (__pyx_v_p == NULL);
   if (__pyx_1) {
-
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":364 */
-    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
-    __pyx_3 = PyString_FromString(__pyx_v_ebuf); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
-    __Pyx_Raise(__pyx_2, __pyx_3, 0);
+    __pyx_2 = PyString_FromString(__pyx_v_ebuf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
+    __Pyx_Raise(PyExc_OSError, __pyx_2, 0);
     Py_DECREF(__pyx_2); __pyx_2 = 0;
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
     goto __pyx_L2;
   }
   __pyx_L2:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":365 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":365 */
   __pyx_2 = PyString_FromString(__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
   __pyx_r = __pyx_2;
   __pyx_2 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(__pyx_r);
+  __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1:;
   Py_XDECREF(__pyx_2);
-  Py_XDECREF(__pyx_3);
   __Pyx_AddTraceback("pcap.lookupdev");
   __pyx_r = 0;
   __pyx_L0:;
   return __pyx_r;
 }
 
-static __Pyx_InternTabEntry __pyx_intern_tab[] = {
-  {&__pyx_n_DLT_ARCNET, "DLT_ARCNET"},
-  {&__pyx_n_DLT_AX25, "DLT_AX25"},
-  {&__pyx_n_DLT_CHAOS, "DLT_CHAOS"},
-  {&__pyx_n_DLT_EN10MB, "DLT_EN10MB"},
-  {&__pyx_n_DLT_EN3MB, "DLT_EN3MB"},
-  {&__pyx_n_DLT_FDDI, "DLT_FDDI"},
-  {&__pyx_n_DLT_IEEE802, "DLT_IEEE802"},
-  {&__pyx_n_DLT_LINUX_SLL, "DLT_LINUX_SLL"},
-  {&__pyx_n_DLT_LOOP, "DLT_LOOP"},
-  {&__pyx_n_DLT_NULL, "DLT_NULL"},
-  {&__pyx_n_DLT_PFLOG, "DLT_PFLOG"},
-  {&__pyx_n_DLT_PFSYNC, "DLT_PFSYNC"},
-  {&__pyx_n_DLT_PPP, "DLT_PPP"},
-  {&__pyx_n_DLT_PRONET, "DLT_PRONET"},
-  {&__pyx_n_DLT_RAW, "DLT_RAW"},
-  {&__pyx_n_DLT_SLIP, "DLT_SLIP"},
-  {&__pyx_n_False, "False"},
-  {&__pyx_n_IOError, "IOError"},
-  {&__pyx_n_KeyError, "KeyError"},
-  {&__pyx_n_KeyboardInterrupt, "KeyboardInterrupt"},
-  {&__pyx_n_OSError, "OSError"},
-  {&__pyx_n_StopIteration, "StopIteration"},
-  {&__pyx_n_True, "True"},
-  {&__pyx_n___add_pkts, "__add_pkts"},
-  {&__pyx_n___author__, "__author__"},
-  {&__pyx_n___copyright__, "__copyright__"},
-  {&__pyx_n___license__, "__license__"},
-  {&__pyx_n___url__, "__url__"},
-  {&__pyx_n___version__, "__version__"},
-  {&__pyx_n_append, "append"},
-  {&__pyx_n_dispatch, "dispatch"},
-  {&__pyx_n_dltoff, "dltoff"},
-  {&__pyx_n_ex_name, "ex_name"},
-  {&__pyx_n_exc_info, "exc_info"},
-  {&__pyx_n_find, "find"},
-  {&__pyx_n_len, "len"},
-  {&__pyx_n_lookupdev, "lookupdev"},
-  {&__pyx_n_openbsd, "openbsd"},
-  {&__pyx_n_platform, "platform"},
-  {&__pyx_n_sys, "sys"},
-  {0, 0}
-};
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_k6p, __pyx_k6, sizeof(__pyx_k6)},
-  {&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7)},
-  {&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8)},
-  {&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)},
-  {&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)},
-  {&__pyx_k21p, __pyx_k21, sizeof(__pyx_k21)},
-  {&__pyx_k23p, __pyx_k23, sizeof(__pyx_k23)},
-  {0, 0, 0}
-};
-
 static PyObject *__pyx_tp_new_4pcap_bpf(PyTypeObject *t, PyObject *a, PyObject *k) {
   PyObject *o = (*t->tp_alloc)(t, 0);
-  struct __pyx_obj_4pcap_bpf *p = (struct __pyx_obj_4pcap_bpf *)o;
+  if (!o) return 0;
   return o;
 }
 
 static void __pyx_tp_dealloc_4pcap_bpf(PyObject *o) {
-  struct __pyx_obj_4pcap_bpf *p = (struct __pyx_obj_4pcap_bpf *)o;
   {
     PyObject *etype, *eval, *etb;
     PyErr_Fetch(&etype, &eval, &etb);
@@ -1582,17 +1427,6 @@
   (*o->ob_type->tp_free)(o);
 }
 
-static int __pyx_tp_traverse_4pcap_bpf(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_4pcap_bpf *p = (struct __pyx_obj_4pcap_bpf *)o;
-  return 0;
-}
-
-static int __pyx_tp_clear_4pcap_bpf(PyObject *o) {
-  struct __pyx_obj_4pcap_bpf *p = (struct __pyx_obj_4pcap_bpf *)o;
-  return 0;
-}
-
 static struct PyMethodDef __pyx_methods_4pcap_bpf[] = {
   {"filter", (PyCFunction)__pyx_f_4pcap_3bpf_filter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4pcap_3bpf_filter},
   {0, 0, 0, 0}
@@ -1637,6 +1471,9 @@
   0, /*nb_true_divide*/
   0, /*nb_inplace_floor_divide*/
   0, /*nb_inplace_true_divide*/
+  #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
+  0, /*nb_index*/
+  #endif
 };
 
 static PySequenceMethods __pyx_tp_as_sequence_bpf = {
@@ -1665,7 +1502,7 @@
   0, /*bf_getcharbuffer*/
 };
 
-statichere PyTypeObject __pyx_type_4pcap_bpf = {
+PyTypeObject __pyx_type_4pcap_bpf = {
   PyObject_HEAD_INIT(0)
   0, /*ob_size*/
   "pcap.bpf", /*tp_name*/
@@ -1688,8 +1525,8 @@
   &__pyx_tp_as_buffer_bpf, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
   "bpf(filter, dlt=DLT_RAW) -> BPF filter object", /*tp_doc*/
-  __pyx_tp_traverse_4pcap_bpf, /*tp_traverse*/
-  __pyx_tp_clear_4pcap_bpf, /*tp_clear*/
+  0, /*tp_traverse*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -1716,12 +1553,11 @@
 
 static PyObject *__pyx_tp_new_4pcap_pcap(PyTypeObject *t, PyObject *a, PyObject *k) {
   PyObject *o = (*t->tp_alloc)(t, 0);
-  struct __pyx_obj_4pcap_pcap *p = (struct __pyx_obj_4pcap_pcap *)o;
+  if (!o) return 0;
   return o;
 }
 
 static void __pyx_tp_dealloc_4pcap_pcap(PyObject *o) {
-  struct __pyx_obj_4pcap_pcap *p = (struct __pyx_obj_4pcap_pcap *)o;
   {
     PyObject *etype, *eval, *etb;
     PyErr_Fetch(&etype, &eval, &etb);
@@ -1734,17 +1570,6 @@
   (*o->ob_type->tp_free)(o);
 }
 
-static int __pyx_tp_traverse_4pcap_pcap(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_4pcap_pcap *p = (struct __pyx_obj_4pcap_pcap *)o;
-  return 0;
-}
-
-static int __pyx_tp_clear_4pcap_pcap(PyObject *o) {
-  struct __pyx_obj_4pcap_pcap *p = (struct __pyx_obj_4pcap_pcap *)o;
-  return 0;
-}
-
 static PyObject *__pyx_getprop_4pcap_4pcap_name(PyObject *o, void *x) {
   return __pyx_f_4pcap_4pcap_4name___get__(o);
 }
@@ -1782,11 +1607,11 @@
 };
 
 static struct PyGetSetDef __pyx_getsets_4pcap_pcap[] = {
-  {"name", __pyx_getprop_4pcap_4pcap_name, 0, __pyx_k1, 0},
-  {"snaplen", __pyx_getprop_4pcap_4pcap_snaplen, 0, __pyx_k2, 0},
-  {"dloff", __pyx_getprop_4pcap_4pcap_dloff, 0, __pyx_k3, 0},
-  {"filter", __pyx_getprop_4pcap_4pcap_filter, 0, __pyx_k4, 0},
-  {"fd", __pyx_getprop_4pcap_4pcap_fd, 0, __pyx_k5, 0},
+  {"name", __pyx_getprop_4pcap_4pcap_name, 0, __pyx_k10, 0},
+  {"snaplen", __pyx_getprop_4pcap_4pcap_snaplen, 0, __pyx_k11, 0},
+  {"dloff", __pyx_getprop_4pcap_4pcap_dloff, 0, __pyx_k12, 0},
+  {"filter", __pyx_getprop_4pcap_4pcap_filter, 0, __pyx_k13, 0},
+  {"fd", __pyx_getprop_4pcap_4pcap_fd, 0, __pyx_k14, 0},
   {0, 0, 0, 0, 0}
 };
 
@@ -1829,6 +1654,9 @@
   0, /*nb_true_divide*/
   0, /*nb_inplace_floor_divide*/
   0, /*nb_inplace_true_divide*/
+  #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
+  0, /*nb_index*/
+  #endif
 };
 
 static PySequenceMethods __pyx_tp_as_sequence_pcap = {
@@ -1857,7 +1685,7 @@
   0, /*bf_getcharbuffer*/
 };
 
-statichere PyTypeObject __pyx_type_4pcap_pcap = {
+PyTypeObject __pyx_type_4pcap_pcap = {
   PyObject_HEAD_INIT(0)
   0, /*ob_size*/
   "pcap.pcap", /*tp_name*/
@@ -1880,8 +1708,8 @@
   &__pyx_tp_as_buffer_pcap, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
   "pcap(name=None, snaplen=65535, promisc=True, immediate=False) -> packet capture object\n    \n    Open a handle to a packet capture descriptor.\n    \n    Keyword arguments:\n    name      -- name of a network interface or dumpfile to open,\n                 or None to open the first available up interface\n    snaplen   -- maximum number of bytes to capture for each packet\n    promisc   -- boolean to specify promiscuous mode sniffing\n    immediate -- disable buffering, if possible\n    ", /*tp_doc*/
-  __pyx_tp_traverse_4pcap_pcap, /*tp_traverse*/
-  __pyx_tp_clear_4pcap_pcap, /*tp_clear*/
+  0, /*tp_traverse*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   __pyx_f_4pcap_4pcap___iter__, /*tp_iter*/
@@ -1912,22 +1740,22 @@
   {0, 0, 0, 0}
 };
 
-DL_EXPORT(void) initpcap(void); /*proto*/
-DL_EXPORT(void) initpcap(void) {
+static void __pyx_init_filenames(void); /*proto*/
+
+PyMODINIT_FUNC initpcap(void); /*proto*/
+PyMODINIT_FUNC initpcap(void) {
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
   int __pyx_4;
   PyObject *__pyx_5 = 0;
-  PyObject *__pyx_6 = 0;
-  PyObject *__pyx_7 = 0;
-  PyObject *__pyx_8 = 0;
+  __pyx_init_filenames();
   __pyx_m = Py_InitModule4("pcap", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
   if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;};
+  Py_INCREF(__pyx_m);
   __pyx_b = PyImport_AddModule("__builtin__");
   if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;};
   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;};
-  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;};
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;};
   if (PyType_Ready(&__pyx_type_4pcap_bpf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}
   if (PyObject_SetAttrString(__pyx_m, "bpf", (PyObject *)&__pyx_type_4pcap_bpf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}
@@ -1936,97 +1764,97 @@
   if (PyObject_SetAttrString(__pyx_m, "pcap", (PyObject *)&__pyx_type_4pcap_pcap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
   __pyx_ptype_4pcap_pcap = &__pyx_type_4pcap_pcap;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":13 */
-  if (PyObject_SetAttr(__pyx_m, __pyx_n___author__, __pyx_k6p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":13 */
+  if (PyObject_SetAttr(__pyx_m, __pyx_n___author__, __pyx_k15p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":14 */
-  if (PyObject_SetAttr(__pyx_m, __pyx_n___copyright__, __pyx_k7p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":14 */
+  if (PyObject_SetAttr(__pyx_m, __pyx_n___copyright__, __pyx_k17p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":15 */
-  if (PyObject_SetAttr(__pyx_m, __pyx_n___license__, __pyx_k8p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":15 */
+  if (PyObject_SetAttr(__pyx_m, __pyx_n___license__, __pyx_k19p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":16 */
-  if (PyObject_SetAttr(__pyx_m, __pyx_n___url__, __pyx_k9p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":16 */
+  if (PyObject_SetAttr(__pyx_m, __pyx_n___url__, __pyx_k21p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":17 */
-  if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k10p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":17 */
+  if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k23p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":19 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":19 */
   __pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":102 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":102 */
   __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_NULL, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":103 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":103 */
   __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_EN10MB, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":104 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":104 */
   __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_EN3MB, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":105 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":105 */
   __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_AX25, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":106 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":106 */
   __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_PRONET, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":107 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":107 */
   __pyx_1 = PyInt_FromLong(5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_CHAOS, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":108 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":108 */
   __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_IEEE802, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":109 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":109 */
   __pyx_1 = PyInt_FromLong(7); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_ARCNET, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":110 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":110 */
   __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_SLIP, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":111 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":111 */
   __pyx_1 = PyInt_FromLong(9); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_PPP, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":112 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":112 */
   __pyx_1 = PyInt_FromLong(10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_FDDI, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":114 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":114 */
   __pyx_1 = PyInt_FromLong(113); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_LINUX_SLL, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":116 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":116 */
   __pyx_1 = PyInt_FromLong(117); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_PFLOG, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":117 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":117 */
   __pyx_1 = PyInt_FromLong(18); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
   if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_PFSYNC, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":118 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":118 */
   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_platform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
@@ -2045,12 +1873,12 @@
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   if (__pyx_4) {
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":119 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":119 */
     __pyx_2 = PyInt_FromLong(12); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
     if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_LOOP, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":120 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":120 */
     __pyx_3 = PyInt_FromLong(14); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
     if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_RAW, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
@@ -2058,19 +1886,19 @@
   }
   /*else*/ {
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":122 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":122 */
     __pyx_1 = PyInt_FromLong(108); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
     if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_LOOP, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
     Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-    /* "/Users/dugsong/projects/pypcap/pcap.pyx":123 */
+    /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":123 */
     __pyx_2 = PyInt_FromLong(12); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
     if (PyObject_SetAttr(__pyx_m, __pyx_n_DLT_RAW, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
   }
   __pyx_L3:;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":125 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":125 */
   __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DLT_NULL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
   __pyx_2 = PyInt_FromLong(4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
@@ -2135,66 +1963,130 @@
   if (PyObject_SetAttr(__pyx_m, __pyx_n_dltoff, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
   Py_DECREF(__pyx_3); __pyx_3 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":132 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":132 */
   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DLT_RAW); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
-  __pyx_k13 = __pyx_1;
+  __pyx_d1 = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":163 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":163 */
   Py_INCREF(Py_None);
-  __pyx_k14 = Py_None;
+  __pyx_d2 = Py_None;
   __pyx_2 = PyInt_FromLong(65535); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
-  __pyx_k15 = __pyx_2;
+  __pyx_d3 = __pyx_2;
   __pyx_2 = 0;
-  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
-  __pyx_k16 = __pyx_3;
+  Py_INCREF(Py_True);
+  __pyx_d4 = Py_True;
+  __pyx_3 = PyInt_FromLong(500); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
+  __pyx_d5 = __pyx_3;
   __pyx_3 = 0;
-  __pyx_5 = PyInt_FromLong(500); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
-  __pyx_k17 = __pyx_5;
+  Py_INCREF(Py_False);
+  __pyx_d6 = Py_False;
+
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":218 */
+  __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;}
+  __pyx_d7 = __pyx_5;
   __pyx_5 = 0;
-  __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
-  __pyx_k18 = __pyx_6;
-  __pyx_6 = 0;
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":218 */
-  __pyx_7 = PyInt_FromLong(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;}
-  __pyx_k19 = __pyx_7;
-  __pyx_7 = 0;
-
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":229 */
-  __pyx_8 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
-  __pyx_k20 = __pyx_8;
-  __pyx_8 = 0;
 
-  /* "/Users/dugsong/projects/pypcap/pcap.pyx":359 */
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":229 */
+  Py_INCREF(Py_True);
+  __pyx_d8 = Py_True;
+
+  /* "/Users/areusch/Build/pypcap-1.1/pcap.pyx":359 */
   return;
   __pyx_L1:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
   Py_XDECREF(__pyx_5);
-  Py_XDECREF(__pyx_6);
-  Py_XDECREF(__pyx_7);
-  Py_XDECREF(__pyx_8);
   __Pyx_AddTraceback("pcap");
 }
 
 static char *__pyx_filenames[] = {
   "pcap.pyx",
 };
-statichere char **__pyx_f = __pyx_filenames;
 
 /* Runtime support code */
 
+static void __pyx_init_filenames(void) {
+  __pyx_f = __pyx_filenames;
+}
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
+    if (value == Py_None)
+        value = NULL;
+    if (tb == Py_None)
+        tb = NULL;
+    Py_XINCREF(type);
+    Py_XINCREF(value);
+    Py_XINCREF(tb);
+    if (tb && !PyTraceBack_Check(tb)) {
+        PyErr_SetString(PyExc_TypeError,
+            "raise: arg 3 must be a traceback or None");
+        goto raise_error;
+    }
+    #if PY_VERSION_HEX < 0x02050000
+    if (!PyClass_Check(type))
+    #else
+    if (!PyType_Check(type))
+    #endif
+    {
+        /* Raising an instance.  The value should be a dummy. */
+        if (value) {
+            PyErr_SetString(PyExc_TypeError,
+                "instance exception may not have a separate value");
+            goto raise_error;
+        }
+        /* Normalize to raise <class>, <instance> */
+        value = type;
+        #if PY_VERSION_HEX < 0x02050000
+            if (PyInstance_Check(type)) {
+                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
+                Py_INCREF(type);
+            }
+            else {
+                PyErr_SetString(PyExc_TypeError,
+                    "raise: exception must be an old-style class or instance");
+                goto raise_error;
+            }
+        #else
+            type = (PyObject*) type->ob_type;
+            Py_INCREF(type);
+            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+                PyErr_SetString(PyExc_TypeError,
+                    "raise: exception class must be a subclass of BaseException");
+                goto raise_error;
+            }
+        #endif
+    }
+    PyErr_Restore(type, value, tb);
+    return;
+raise_error:
+    Py_XDECREF(value);
+    Py_XDECREF(type);
+    Py_XDECREF(tb);
+    return;
+}
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
+    PyObject *result;
+    result = PyObject_GetAttr(dict, name);
+    if (!result)
+        PyErr_SetObject(PyExc_NameError, name);
+    return result;
+}
+
 static int __Pyx_GetStarArgs(
     PyObject **args, 
     PyObject **kwds,
     char *kwd_list[], 
-    int nargs,
+    Py_ssize_t nargs,
     PyObject **args2, 
-    PyObject **kwds2)
+    PyObject **kwds2,
+    char rqd_kwds[])
 {
     PyObject *x = 0, *args1 = 0, *kwds1 = 0;
+    int i;
+    char **p;
     
     if (args2)
         *args2 = 0;
@@ -2205,25 +2097,37 @@
         args1 = PyTuple_GetSlice(*args, 0, nargs);
         if (!args1)
             goto bad;
-        *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));
+        *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args));
         if (!*args2)
             goto bad;
     }
+    else if (PyTuple_GET_SIZE(*args) > nargs) {
+        int m = nargs;
+        int n = PyTuple_GET_SIZE(*args);
+        PyErr_Format(PyExc_TypeError,
+            "function takes at most %d positional arguments (%d given)",
+                m, n);
+        goto bad;
+    }
     else {
         args1 = *args;
         Py_INCREF(args1);
     }
     
+    if (rqd_kwds && !*kwds)
+            for (i = 0, p = kwd_list; *p; i++, p++)
+                if (rqd_kwds[i])
+                    goto missing_kwarg;
+    
     if (kwds2) {
         if (*kwds) {
-            char **p;
             kwds1 = PyDict_New();
-            if (!kwds)
+            if (!kwds1)
                 goto bad;
             *kwds2 = PyDict_Copy(*kwds);
             if (!*kwds2)
                 goto bad;
-            for (p = kwd_list; *p; p++) {
+            for (i = 0, p = kwd_list; *p; i++, p++) {
                 x = PyDict_GetItemString(*kwds, *p);
                 if (x) {
                     if (PyDict_SetItemString(kwds1, *p, x) < 0)
@@ -2231,6 +2135,8 @@
                     if (PyDict_DelItemString(*kwds2, *p) < 0)
                         goto bad;
                 }
+                else if (rqd_kwds && rqd_kwds[i])
+                    goto missing_kwarg;
             }
         }
         else {
@@ -2242,21 +2148,42 @@
     else {
         kwds1 = *kwds;
         Py_XINCREF(kwds1);
+        if (rqd_kwds && *kwds)
+            for (i = 0, p = kwd_list; *p; i++, p++)
+                if (rqd_kwds[i] && !PyDict_GetItemString(*kwds, *p))
+                        goto missing_kwarg;
     }
     
     *args = args1;
     *kwds = kwds1;
     return 0;
+missing_kwarg:
+    PyErr_Format(PyExc_TypeError,
+        "required keyword argument '%s' is missing", *p);
 bad:
     Py_XDECREF(args1);
     Py_XDECREF(kwds1);
-    if (*args2)
+    if (args2) {
         Py_XDECREF(*args2);
-    if (*kwds2)
+    }
+    if (kwds2) {
         Py_XDECREF(*kwds2);
+    }
     return -1;
 }
 
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+    while (t->p) {
+        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+        if (!*t->p)
+            return -1;
+        if (t->i)
+            PyString_InternInPlace(t->p);
+        ++t;
+    }
+    return 0;
+}
+
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
     PyObject *__import__ = 0;
     PyObject *empty_list = 0;
@@ -2290,137 +2217,6 @@
     return module;
 }
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result)
-        PyErr_SetObject(PyExc_NameError, name);
-    return result;
-}
-
-static PyObject *__Pyx_GetExcValue(void) {
-    PyObject *type = 0, *value = 0, *tb = 0;
-    PyObject *result = 0;
-    PyThreadState *tstate = PyThreadState_Get();
-    PyErr_Fetch(&type, &value, &tb);
-    PyErr_NormalizeException(&type, &value, &tb);
-    if (PyErr_Occurred())
-        goto bad;
-    if (!value) {
-        value = Py_None;
-        Py_INCREF(value);
-    }
-    Py_XDECREF(tstate->exc_type);
-    Py_XDECREF(tstate->exc_value);
-    Py_XDECREF(tstate->exc_traceback);
-    tstate->exc_type = type;
-    tstate->exc_value = value;
-    tstate->exc_traceback = tb;
-    result = value;
-    Py_XINCREF(result);
-    type = 0;
-    value = 0;
-    tb = 0;
-bad:
-    Py_XDECREF(type);
-    Py_XDECREF(value);
-    Py_XDECREF(tb);
-    return result;
-}
-
-static void __Pyx_WriteUnraisable(char *name) {
-    PyObject *old_exc, *old_val, *old_tb;
-    PyObject *ctx;
-    PyErr_Fetch(&old_exc, &old_val, &old_tb);
-    ctx = PyString_FromString(name);
-    PyErr_Restore(old_exc, old_val, old_tb);
-    if (!ctx)
-        ctx = Py_None;
-    PyErr_WriteUnraisable(ctx);
-}
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
-    Py_XINCREF(type);
-    Py_XINCREF(value);
-    Py_XINCREF(tb);
-    /* First, check the traceback argument, replacing None with NULL. */
-    if (tb == Py_None) {
-        Py_DECREF(tb);
-        tb = 0;
-    }
-    else if (tb != NULL && !PyTraceBack_Check(tb)) {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: arg 3 must be a traceback or None");
-        goto raise_error;
-    }
-    /* Next, replace a missing value with None */
-    if (value == NULL) {
-        value = Py_None;
-        Py_INCREF(value);
-    }
-    /* Next, repeatedly, replace a tuple exception with its first item */
-    while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
-        PyObject *tmp = type;
-        type = PyTuple_GET_ITEM(type, 0);
-        Py_INCREF(type);
-        Py_DECREF(tmp);
-    }
-    if (PyString_Check(type))
-        ;
-    else if (PyClass_Check(type))
-        ; /*PyErr_NormalizeException(&type, &value, &tb);*/
-    else if (PyInstance_Check(type)) {
-        /* Raising an instance.  The value should be a dummy. */
-        if (value != Py_None) {
-            PyErr_SetString(PyExc_TypeError,
-              "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        else {
-            /* Normalize to raise <class>, <instance> */
-            Py_DECREF(value);
-            value = type;
-            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-            Py_INCREF(type);
-        }
-    }
-    else {
-        /* Not something you can raise.  You get an exception
-           anyway, just not what you specified :-) */
-        PyErr_Format(PyExc_TypeError,
-                 "exceptions must be strings, classes, or "
-                 "instances, not %s", type->ob_type->tp_name);
-        goto raise_error;
-    }
-    PyErr_Restore(type, value, tb);
-    return;
-raise_error:
-    Py_XDECREF(value);
-    Py_XDECREF(type);
-    Py_XDECREF(tb);
-    return;
-}
-
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
-    while (t->p) {
-        *t->p = PyString_InternFromString(t->s);
-        if (!*t->p)
-            return -1;
-        ++t;
-    }
-    return 0;
-}
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
-    while (t->p) {
-        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
-        if (!*t->p)
-            return -1;
-        ++t;
-    }
-    return 0;
-}
-
 #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
